var url = "http://www.faiences-rouen.com/uk/";
// JavaScript Document
function vnews()
	{
		myform = document.newsletter;
		if(myform.n_email.value != "")
			{
			adresse   = myform.n_email.value;
			var place = adresse.indexOf("@",1);
			var point = adresse.indexOf(".",place+1);
			if ((place > -1)&&(adresse.length >2)&&(point > 1))
				{
					document.newsletter.submit();						
				}
			else
				{
					alert("Wrong email adress");
					document.newsletter.n_email.focus();
				}
			}
		else{ alert('Wrong email adress'); }	
	}
function vsearch()
	{
		if(document.recherche.motcle.value != ""){if(document.recherche.motcle.value.length >=3){document.recherche.submit();}
		else{alert("Merci de compléter votre recherche");}}
		else{alert("Merci de précisez votre recherche");}
	}
function sendData(data, page)
	{
		if(document.all){var XhrObj = new ActiveXObject("Microsoft.XMLHTTP");}else{var XhrObj = new XMLHttpRequest();}
		var content = document.getElementById("action");
		if(data == 'null'){XhrObj.open("GET", page);}
		else{XhrObj.open("GET", page+"?"+data);}
		XhrObj.onreadystatechange = function(){if(XhrObj.readyState == 4 && XhrObj.status == 200){content.innerHTML = XhrObj.responseText; document.location.href=url+"panier.php";}}    
		XhrObj.send(null);
	}
function add(id)
	{
		if(document.myform.qty.value > 0){sendData("id="+id+"&nb="+document.myform.qty.value,url+"_add.php");}else{alert("Wring quantity");}
	}
function Zoom(id){window.open(url+"viewer.php?pic="+id,"view","width=10px, height=10px");}
function pass(){window.open(url+"pass.php","","width=300px, height=180px");}
