function checkform() {
	
	var hiba = '';
	
	nev = document.forms.myForm.nev.value;
	if (nev=='') {
		alert('Töltse ki a név mezőt!');
		return false;
	}
	
	tel = document.forms.myForm.tel.value;
	if (tel=='') {
		alert('Töltse ki a telefonszám mezőt!');
		return false;
	}
	
	email = document.forms.myForm.email.value;
	if (email=='') {
		alert('Töltse ki az e-mail mezőt!');
		return false;
	}
	
	validmail = isValidEmail();
	if (validmail != 1) {
			
				strEmail = document.forms.myForm.email.value;
				var content;
				content = "Az e-mail cím formátuma nem megfelelő: " + strEmail;
				alert(content);
				return false;
				
	}
	
	musor = document.forms.myForm.selectedmusor.value;
	if (musor=='') {
		alert('Válasszon legalább egy műsort!');
		return false;
	}
	
	if (hiba=='') {
		return true;
	} else {
		return false;
	}
	
}

function isValidEmail(email){
  validRegExp = /^[^@]+@[^@]+.[a-z]{2,}$/i;
  strEmail = document.forms.myForm.email.value;

				var content;
				content = strEmail;
				
			//	alert(content);

   // search email text for regular exp matches
    if (strEmail.search(validRegExp) == -1) 
   {
     	blnResult = 0;
      return blnResult;
    } else {
	    blnResult = 1
	    return blnResult;  
  	}
}

function reloadgirls(mivel) {
	$.get("_lanyok.php?musor="+mivel, function(data) {
    $("#lanyok").html(data);
  });
  document.forms.myForm.selectedmusor.value=mivel;
  reloadar()
}

function reloadar() {
	
					dataString = $("#myForm").serialize();
	 
	        $.ajax({
	        type: "POST",
	        url: "_ar.php",
	        data: dataString,
	        dataType: "json",
	        success: function(data) {
	 
	            
	            adat = data+' Ft';
	            
	            $("#vegar").html(adat);
	 
	        }
	 
	        });
	        
	        var lanyar
					
					if (lanyar) {
						changecss('.musorar','text-decoration','line-through')
					}else{
						changecss('.musorar','text-decoration','none')
					}
}



function changecss(theClass,element,value) {
	//Last Updated on October 10, 1020
	//documentation for this script at
	//http://www.shawnolson.net/a/503/altering-css-class-attributes-with-javascript.html
	 var cssRules;

	 var added = false;
	 for (var S = 0; S < document.styleSheets.length; S++){

    if (document.styleSheets[S]['rules']) {
	  cssRules = 'rules';
	 } else if (document.styleSheets[S]['cssRules']) {
	  cssRules = 'cssRules';
	 } else {
	  //no rules found... browser unknown
	 }

	  for (var R = 0; R < document.styleSheets[S][cssRules].length; R++) {
	   if (document.styleSheets[S][cssRules][R].selectorText == theClass) {
	    if(document.styleSheets[S][cssRules][R].style[element]){
	    document.styleSheets[S][cssRules][R].style[element] = value;
	    added=true;
		break;
	    }
	   }
	  }
	  if(!added){
	  try{
	  	document.styleSheets[S].insertRule(theClass+' { '+element+': '+value+'; }',document.styleSheets[S][cssRules].length);

	  } catch(err){
	  		try{document.styleSheets[S].addRule(theClass,element+': '+value+';');}catch(err){}

	  }

	  //if(document.styleSheets[S].insertRule){
			  //document.styleSheets[S].insertRule(theClass+' { '+element+': '+value+'; }',document.styleSheets[S][cssRules].length);
			//} else if (document.styleSheets[S].addRule) {
				//document.styleSheets[S].addRule(theClass,element+': '+value+';');
			//}
	  }
	 }
	}




function img(imgs) {
			if (((navigator.appName!='Microsoft Internet Explorer') && (navigator.appName!='Netscape')) || (parseInt(navigator.appVersion)<4)) {
			}
			console=window.open('/img.php?img=' + imgs,'a','fullscreen=no,margin=0,border=0,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,titlebar=no,width=100,height=100');
			console.focus();
}

		function popp(ehhez) {
			if (((navigator.appName!='Microsoft Internet Explorer') && (navigator.appName!='Netscape')) || (parseInt(navigator.appVersion)<4)) {
			}
			console=window.open('pop_kep.php?ehhez=' + ehhez,'a','fullscreen=no,margin=0,border=0,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,titlebar=no,width=400,height=400');
			console.focus();
		}




function printit(q) {
			if (((navigator.appName!='Microsoft Internet Explorer') && (navigator.appName!='Netscape')) || (parseInt(navigator.appVersion)<4)) {
			}
			console=window.open('/print.php?q=' + q,'print','fullscreen=no,margin=0,border=0,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,titlebar=no,width=780,height=550');
			console.focus();
}

function pdfit(q) {
			if (((navigator.appName!='Microsoft Internet Explorer') && (navigator.appName!='Netscape')) || (parseInt(navigator.appVersion)<4)) {
			}
			console=window.open('/pdf.php?q=' + q,'pdf','fullscreen=no,margin=0,border=0,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,titlebar=no,width=780,height=550');
			console.focus();
}

