/***************************************
* Logins
***************************************/
function valider_login(frm)
	{
		if((frm.elements['login'].value != "") & (frm.elements['password'].value !="")) 
			{
				return true;
		}
		else 
			{
				if(frm.elements['pays'].value == "fr")
					{
						alert("ERREUR : Renseignez correctement les champs SVP");
				}
				else if(frm.elements['pays'].value == "en")
					{
						alert("ERROR : Complete the fields correctly please");
				}
				else
					{
						alert("ERROR : Debe cumplimentar por favor");
						
				}
				return false;
		}
}

/***************************************
* Envoi msg
***************************************/
function confirmation_dde_prospect(frm)
	{
		var pays = document.dde_prospect.p_pays.value;
		var nom = document.dde_prospect.p_nom.value;
		var tel = document.dde_prospect.p_tel.value;
		var email = document.dde_prospect.p_email.value;
		var place = email.indexOf("@",1);
		var point = email.indexOf(".", place+1);
		var mess = "";
		if(pays == "fr")
			{
				if (nom == "") mess += "ERREUR : Renseignez correctement le nom svp. \n";
				if (tel == "") mess += "ERREUR : Renseignez correctement votre telephone svp. \n";
				if (email == "") mess += "ERREUR : Renseignez correctement votre email svp. \n";
				if (!((place > -1) && (email.length > 2) && (point > 1) && (email != ""))) 
					{
						mess += "ERREUR : Entrez une adresse email valide svp. \n";
				}
		}
		else if(pays == "en")
			{
				if (nom == "") mess += "ERROR : Inform your name please. \n";
				if (tel == "") mess += "ERROR : Inform your phone please. \n";
				if (email == "") mess += "ERROR : Inform your mail please. \n";
				if (!((place > -1) && (email.length > 2) && (point > 1) && (email != ""))) 
					{
						mess += "ERROR : Inform your mail correctly please. \n";
				}
		}
		else if(pays == "es")
			{
				if (nom == "") mess += "ERROR : Debe cumplimentar su nombre por favor. \n";
				if (tel == "") mess += "ERROR : Debe cumplimentar su telefono por favor. \n";
				if (email == "") mess += "ERROR : Debe cumplimentar su correo electronico por favor. \n";
				if (!((place > -1) && (email.length > 2) && (point > 1) && (email != ""))) 
					{
						mess += "ERROR : Debe cumplimentar su correo electronico correctamente por favor. \n";
				}
		}
		else
			{
				if (nom == "") mess += "ERROR : Inform your name please. \n";
				if (tel == "") mess += "ERROR : Inform your phone please. \n";
				if (email == "") mess += "ERROR : Inform your mail please. \n";
				if (!((place > -1) && (email.length > 2) && (point > 1) && (email != ""))) 
					{
						mess += "ERROR : Inform your mail correctly please. \n";
				}
		}
		if (mess != "") 
			{
				alert (mess);
				return false;
		}	
		else
			{
				return true;	
		}
}

function actualiser(p_cat) 
	{
		var pays = document.dde_prospect.p_pays.value;
		if(pays == "fr")
			{
				window.location.href="nouscontacter.php?p_cat="+p_cat+"";
				return false;
		}
		else if(pays == "en")
			{
				window.location.href="contactus.php?p_cat="+p_cat+"";
				return false;
		}
		else if(pays == "es")
			{
				window.location.href="contactarnos.php?p_cat="+p_cat+"";
				return false;
		}
		else
			{
				window.location.href="contactus.php?p_cat="+p_cat+"";
				return false;
		}
}

/***************************************
* Gestion des flashs
***************************************/
function banniere_fr()
	{
		document.write('<object type="application/x-shockwave-flash" data="/header.swf" width="760" height="175">\n');
		document.write('<param name="wmode" value="Transparent">\n');
		document.write('<param name="movie" value="/header.swf">\n');
		document.write('<param name="quality" value="high">\n');
		document.write('<img src="/_img/header.jpg" alt="Doumerc Pneus SA"/>\n');
		document.write('</object>\n');
}

function banniere_en()
	{
		document.write('<object type="application/x-shockwave-flash" data="/en/header.swf" width="760" height="175">\n');
		document.write('<param name="wmode" value="Transparent">\n');
		document.write('<param name="movie" value="/en/header.swf">\n');
		document.write('<param name="quality" value="high">\n');
		document.write('<img src="/_img/header.jpg" alt="Doumerc Pneus SA"/>\n');
		document.write('</object>\n');
}

function banniere_es()
	{
		document.write('<object type="application/x-shockwave-flash" data="/es/header.swf" width="760" height="175">\n');
		document.write('<param name="wmode" value="Transparent">\n');
		document.write('<param name="movie" value="/es/header.swf">\n');
		document.write('<param name="quality" value="high">\n');
		document.write('<img src="/_img/header.jpg" alt="Doumerc Pneus SA"/>\n');
		document.write('</object>\n');
}
