$(document).ready(function() {

mail();
$('meta[name=author]').attr('content', 'New Author Name');

 function validateForm(oForm)
 {
 	//oForm refers to the form which you want to validate
 	oForm.onsubmit = function() // attach the function to onsubmit event
 	{
 		var regex = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
 		if(oForm.elements['Name'].value.length<1)
 		{
 			alert("Kérjük add meg a neved!");
			oForm.Name.focus();			
 			return false;
 		}			
 		else if(oForm.elements['Email'].value.length<1)
 		{
 			alert("Kérjük add meg az e-mail címedet!");
			oForm.Email.focus();			
 			return false;
 		}
 		else if(!regex.test(oForm.elements['Email'].value))
 		{
 			alert("Érvénytelen az e-mail címed. Kérjük adj meg egy érvényeset!");
			oForm.Email.focus();			
 			return false;
 		}
 		else if(oForm.elements['Address'].value.length<1)
 		{
 			alert("Kérjük add meg a címed!");
			oForm.Address.focus();			
 			return false;
 		}		
 		return true;
 	}
 }
function mail() {

	$('a.shop').click(function(e) {
		var sex=document.getElementById('polo_nem').value;
		var color=document.getElementById('polo_szin').value;		
		var size=document.getElementById('polo_meret').value;		
		//var sender='nadaspeti@gmail.com';
		 $('input#rendeles_nem').val(sex);		
		 $('input#rendeles_szin').val(color);
		 $('input#rendeles_meret').val(size);	
			var url = $(this).attr('href');
			//var rad_val='';
			//get_radio_value();	
//alert(rad_val);		
		chosen = ""
		e.preventDefault();
		
		//Get the A tag
		//var id = $(this).attr('href');
		var id='dialog';
		//Get the screen height and width
		var maskHeight = $(document).height();
		var maskWidth = $(window).width();
	
		//Set heigth and width to mask to fill up the whole screen
		$('#mask').css({'width':maskWidth,'height':maskHeight});
		
		//transition effect		
		$('#mask').fadeIn(1000);	
		$('#mask').fadeTo("slow",0.8);	
	
		//Get the window height and width
		var winH = $(window).height();

		//var winH=800;
		var winW = $(window).width();
              
		//Set the popup window to center
		$('#dialog').css('top',  winH/2);
		$('#dialog').css('left', winW/2-$('#dialog').width()/2);
	
		//transition effect
		$('#dialog').fadeIn(2000); 
	
	});

	//if close button is clicked
	$('.window .close').click(function (e) {
		//Cancel the link behavior
		e.preventDefault();
		
		$('#mask').fadeOut(1000);
		$('.window').fadeOut(1000);
	});		
	
	//if mask is clicked
	$('#mask').click(function () {
		$(this).fadeOut(1000);
		$('.window').fadeOut(1000);
	});	
//	
} 


});


