var rw;
var plan;

rw_contact="60px";
plan="paris";

function checkFormContact() {
	var error=false;
	if(document.box_contact_form.societe.value==""){error=true;}
	if(document.box_contact_form.nom.value==""){error=true;}
	if(document.box_contact_form.prenom.value==""){error=true;}
	if(document.box_contact_form.fonction.value==""){error=true;}
	if(document.box_contact_form.tel.value==""){error=true;}
	if(document.box_contact_form.mail.value==""){error=true;}
  if(document.box_contact_form.mail.value.indexOf("@",0)==-1){error=true;}
  if(document.box_contact_form.mail.value.indexOf(".",0)==-1){error=true;}
  if(document.box_contact_form.mail.value.indexOf(" ",0)!=-1){error=true;}
	if(error==true){
		alert("Vous n'avez pas complété le formulaire correctement.");
		return false;
	}else{
		return true;
	}
}

function startReseau (id, img, w) {
	MM_swapImage(id,'',img,1);
	$("#reseau2").stop().queue(function(){
		$(this).animate({width: w}, 500);
		$(this).dequeue();
	});
}
function restoreReseau(rw2) {
	
	$("#reseau2").stop().queue(function(){
		$(this).animate({width: rw2}, 500);
		$(this).dequeue();
	});
	MM_swapImgRestore()
}
//runcontact('laval');

function showMap(ville){
	if (ville == "paris") {
	
		//runcontact('paris');
		document.getElementById("paris_on").style.color = "#000";
		document.getElementById("paris_on").style.fontWeight = "bolder";		

		
		document.getElementById("laval_on").style.fontWeight = "normal";		
		document.getElementById("laval_on").style.color = "#707F87";
		
		document.getElementById("nantes_on").style.fontWeight = "normal";
		document.getElementById("nantes_on").style.color = "#707F87";

		
		$("#plans").animate({left: "0px"}, 500).queue(function(){
			$("#poignee_open1_contact").hide();
			$("#poignee_open2_contact").show();
			$(this).dequeue();
		});	
		plan="paris";
	} else if (ville == "nantes") {
	
		//runcontact('nantes');
		document.getElementById("nantes_on").style.color = "#000";
		document.getElementById("nantes_on").style.fontWeight = "bolder";		

		
		document.getElementById("laval_on").style.fontWeight = "normal";		
		document.getElementById("laval_on").style.color = "#707F87";
		
		document.getElementById("paris_on").style.fontWeight = "normal";
		document.getElementById("paris_on").style.color = "#707F87";


		$("#plans").animate({left: "-277px"}, 500).queue(function(){
			$("#poignee_open1_contact").show();
			$("#poignee_open2_contact").show();
			$(this).dequeue();
		});	

		plan="nantes";
	} else if (ville == "laval") {
	
		document.getElementById("laval_on").style.color = "#000";
		document.getElementById("laval_on").style.fontWeight = "bolder";		

		
		document.getElementById("paris_on").style.fontWeight = "normal";		
		document.getElementById("paris_on").style.color = "#707F87";
		
		document.getElementById("nantes_on").style.fontWeight = "normal";
		document.getElementById("nantes_on").style.color = "#707F87";


		$("#plans").animate({left: "-550px"}, 500).queue(function(){
			$("#poignee_open1_contact").show();
			$("#poignee_open2_contact").hide();
			$(this).dequeue();
		});		

		plan="laval";
	}
}

function p_open1(){
		if (plan == "paris") { 
			showMap("nantes");
		} else if (plan == "nantes") {
		  showMap("laval");
		}
}
function p_open2()
{
		if (plan == "nantes") { 
			showMap("paris");
		} else if (plan == "laval") {
		  showMap("nantes");
		}
}
