function kotelezoEllenorzes(){
rendben=true;
if(document.megrendeles.nev.value=="") rendben=false;
if(document.megrendeles.email.value=="") rendben=false;
if(document.megrendeles.telefon.value=="") rendben=false;
if(document.megrendeles.bolti_atvetel.checked==false){
if(document.megrendeles.honap1.value=="") rendben=false;
if(document.megrendeles.nap1.value=="") rendben=false;
if(document.megrendeles.telepules1.value=="") rendben=false;
if(document.megrendeles.utca1.value=="") rendben=false;
}
if(rendben==false) {alert("Kérjük töltse ki az összes szükséges mezőt!");location.replace("#mainform");}
alert(rendben);
return rendben;
}

function monthname(curmonth){
switch(curmonth){
case 1:return 'január';break;case 2:return 'február';break;case 3:return 'március';break;case 4:return 'április';break;case 5:return 'május';break;case 6:return 'június';break;case 7:return 'július';break;case 8:return 'augusztus';break;case 9:return 'szeptember';break;case 10:return 'október';break;case 11:return 'november';break;case 12:return 'december';break;}
}


 if (navigator.userAgent.indexOf("Opera")!=-1
    && document.getElementById) type="OP";
if (document.all) type="IE";
if (document.layers) type="NN";
if (!document.all && document.getElementById) type="MO"; 


 function ShowLayer(id, action){
  if (type=="IE") eval("document.all." + id + ".style.display='" + action + "'");
  if (type=="NN") eval("document." + id + ".display='" + action + "'");
  if (type=="MO" || type=="OP")
    eval("document.getElementById('" + id + "').style.display='" + action + "'");
}


function whichButton(event)
{
if (event.button==2)//RIGHT CLICK
{
alert("Kérjük ÍRJA BE ISMÉT e-mail címét!");
}

}
function noCTRL(e)
{
document.title=event.keyCode;
var code = (document.all) ? event.keyCode:e.which;

var msg = "Kérjük ÍRJA BE ISMÉT e-mail címét!";
if (parseInt(code)==17 || parseInt(code)==91) //CTRL
{
//alert(code+' s');
window.event.returnValue = false;
}
} 

var xmlHttp=false;

if (!xmlHttp && typeof XMLHttpRequest != 'undefined') {
  xmlHttp = new XMLHttpRequest();
}
else if (window.ActiveXObject)
  {// code for IE5 and IE6
  xmlHttp=new ActiveXObject("Microsoft.xmlHtTP");
  }

function updatePage() {
  if (xmlHttp.readyState == 4) {
   if(xmlHttp.responseText=='0')
   {alert('A megadott e-mail cím nem létezik! Kérjük adjon meg másikat!');
   document.getElementById('email').value='';
   document.getElementById('email').focus();}
  }
}


function checkMailAddress(a){
	var url = "verifyemail.php?email="+a;
  xmlHttp.open("GET", url, true);
  xmlHttp.onreadystatechange = updatePage;
  xmlHttp.send(null);
}

function checkIfEqual(){
	if(document.getElementById('email').value!=document.getElementById('emailverify').value) {
		alert('A két e-mail cím nem egyezik, valószínűleg elgépelte!');
		//document.getElementById('emailverify').value='';
		document.getElementById('emailverify').focus();
		}
}
