function openPage(page, id){
	
	w = window.screen.width;
	h = window.screen.height;
	
	if(page == "catalogue"){
		if(id == "eat"){
			window.open('../popup_catalog.php?start=eat','nom_popup','menubar=no, location=no, status=no, scrollbars=no, menubar=no, toolbar=no, width='+w+', height='+h+', resize=yes');
		}else if(id == "drink"){
			window.open('../popup_catalog.php?start=drink','nom_popup','menubar=no, location=no, status=no, scrollbars=no, menubar=no, toolbar=no, width='+w+', height='+h+', resize=yes');
		}
	}else if(page == "recipe"){
		if(id == "eat"){
			window.open('../popup_eat.php','nom_popup','menubar=no, location=no, status=no, scrollbars=no, menubar=no, toolbar=no, width='+w+', height='+h+', resize=yes');
		}else if(id == "drink"){
			window.open('../popup_drink.php','nom_popup','menubar=no, location=no, status=no, scrollbars=no, menubar=no, toolbar=no, width='+w+', height='+h+', resize=yes');
		}
	}
}


function submitNewsletter(baseurl)
{
	form = document.forms.newsletter;
	if(form.email.value.indexOf('@') == -1 || form.email.value.indexOf('.') == -1 ){
		alert("Incorrect email adress");
	}else{
		$.ajax({
		   type: "GET",
		   url: baseurl+"/pages/newsletter_ajax.php",
		   data: "email="+form.email.value,
		   success: function(msg){
		     $('#ajaxLoad').empty().html('Thank you for your registration');
		   }
		 });
	}
	
}

function sendContact(form)
{
	success = true;
	message = "";
	if(form.nom.value == "" || form.company.value == "" || form.sujet.value == "" || form.email.value == "" || form.message.value == ""){
		success = false;
		message += "Please fill all fields";
	}else{
	if(form.email.value.indexOf('@') == -1 || form.email.value.indexOf('.') == -1 ){
		success = false;
		message += "Incorrect email adress";
	}
	}
	if(success) form.submit();
	else alert(message);
}



$(document).ready(function(){
	
	$('li.menu-item').each(function(){
		
		$(this).hover(
		function(){
			$(this).addClass('active');
		},
		function(){
			$(this).removeClass('active');
		});
		
	});
	
});