
/*   FONCTION DU MENU TOP   */
function newImage(arg) {
	if (document.images) {
		rslt = new Image();
		rslt.src = arg;
		return rslt;
	}
}

function changeImages() {
	if (document.images && (preloadFlag == true)) {
		for (var i=0; i<changeImages.arguments.length; i+=2) {
			document[changeImages.arguments[i]].src = changeImages.arguments[i+1];
		}
	}
}

var preloadFlag = false;
function preloadImages() {
	if (document.images) {
		btn_accueil_Accueil_over = newImage("images/btn_accueil-Accueil_over.gif");
		btn_sujet_Sujet_over = newImage("images/btn_sujet-Sujet_over.gif");
		btn_produits_Produits_over = newImage("images/btn_produits-Produits_over.gif");
		btn_faq_FAQ_over = newImage("images/btn_faq-FAQ_over.gif");
		btn_nous_joindre_Nousi_Joindre_over = newImage("images/btn_nous_joindre-Nousi_Join.gif");
		preloadFlag = true;
	}
}


/*    fonction bouton google   */
function OpenPopup(pURL, pWidth, pHeight){
	vWidth = pWidth;
	vHeight = pHeight;
	vleft=screen.width/2-(vWidth/2);
	vtop=screen.height/2-(vHeight/2)-27;
		
	vPopup = window.open(pURL, "popup", "toolbar=no,location=0,directories=no,status=yes,menubar=0,scrollbars=yes,resizable=0,width="+vWidth+",height="+vHeight+",top="+vtop+",left="+vleft);
	vPopup.focus();
}

function f_open_window_max( aURL, aWinName )
{
   var wOpen;
   var sOptions;

   sOptions = 'status=yes,menubar=yes,scrollbars=yes,resizable=yes,toolbar=yes';
   sOptions = sOptions + ',width=' + (screen.availWidth - 10).toString();
   sOptions = sOptions + ',height=' + (screen.availHeight - 122).toString();
   sOptions = sOptions + ',screenX=0,screenY=0,left=0,top=0';

   wOpen = window.open( '', aWinName, sOptions );
   wOpen.location = aURL;
   wOpen.focus();
   //wOpen.moveTo( 0, 0 );
   wOpen.resizeTo( screen.availWidth, screen.availHeight );
   //return wOpen;
}


/*   FONCTION DE DREAMWEAVER POUR LE MENU PRODUITS   */

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

/*   FONCTION JAVASCRIPT POUR FERMER LES MENUS    */


/* FRANCAIS */
function SwitchMenu(obj){
	if(document.getElementById){
	var el = document.getElementById(obj);
	var ar = document.getElementById("cont").getElementsByTagName("DIV");
		if(el.style.display == "none"){
			for (var i=0; i<ar.length; i++){
				ar[i].style.display = "none";
			}
			el.style.display = "block";
					document.getElementById("cont").style.height="422px";
					document.getElementById("cont").style.backgroundImage="url(images/menu_gauche_open.gif)";
			}else{
			el.style.display = "none";
					document.getElementById("cont").style.height="265px";
					document.getElementById("cont").style.backgroundImage="url(images/menu_gauche.gif)";
		}
	}
}

/* ENGLAIS */
function SwitchMenuEn(obj){
	if(document.getElementById){
	var el = document.getElementById(obj);
	var ar = document.getElementById("cont_en").getElementsByTagName("DIV");
		if(el.style.display == "none"){
			for (var i=0; i<ar.length; i++){
				ar[i].style.display = "none";
			}
			el.style.display = "block";
					document.getElementById("cont_en").style.height="380px";
					document.getElementById("cont_en").style.backgroundImage="url(images/menu_gauche_open_en.gif)";
			}else{
			el.style.display = "none";
					document.getElementById("cont_en").style.height="238px";
					document.getElementById("cont_en").style.backgroundImage="url(images/menu_gauche_en.gif)";
		}
	}
}

function ChangeClass(menu, newClass) { 
	 if (document.getElementById) { 
	 	document.getElementById(menu).className = newClass;
	 } 
} 
document.onselectstart = new Function("return true");

/*=======================================================
==============   Section du formulaire qui switch  ======
=========================================================
*/
function SwitchFormulaire(obj){
	if(document.getElementById){
	var el = document.getElementById(obj);
	var ar = document.getElementById("choix").getElementsByTagName("DIV");
		if(el.style.display == "none"){
			for (var i=0; i<ar.length; i++){
				ar[i].style.display = "none";
			}
			el.style.display = "block";
			document.getElementById("choix3").style.display = "block";
			document.modContactForm.FormToDisplay.value = obj;
			clearForm(obj);
			}
	}
}
function SwitchFormulaire2(obj){
	if(document.getElementById){
	var el = document.getElementById(obj);
	var ar = document.getElementById("choix").getElementsByTagName("DIV");
		if(el.style.display == "block"){
				document.getElementById("choix3").style.display="block"
				document.getElementById("choix1").style.display="none"
				document.getElementById("choix2").style.display="none"
				document.modContactForm.FormToDisplay.value = obj;
				clearForm(obj);
				
			}else{
			document.getElementById("choix3").style.display="block"
			document.modContactForm.FormToDisplay.value = obj;
			clearForm(obj);			
			}
	}
}
function clearForm(obj){
	switch (obj)
	{
	case 'choix1':
	  document.modContactForm.ckbCeramique2.checked=false;
	  document.modContactForm.ckbbois2.checked=false;
	  document.modContactForm.ckbTapis2.checked=false;
	  document.modContactForm.ckbflottant2.checked=false;
	  document.modContactForm.ckbchauffant2.checked=false;
	  document.modContactForm.ckbVinyle2.checked=false;
	  document.modContactForm.ckbTuiles2.checked=false;
	  document.modContactForm.ckbPeinture2.checked=false;
	  document.modContactForm.ckbAccessoires2.checked=false;
	  document.modContactForm.ckbStores2.checked=false;
	  document.modContactForm.ckbPapier2.checked=false;
	  document.modContactForm.ckbConsultation2.checked=false;
	  document.modContactForm.ckbProduits2.checked=false;
	  document.modContactForm.ckbentretien2.checked=false;
	  document.modContactForm.ckbInstallation2.checked=false;
	  document.modContactForm.ckbDecoration2.checked=false;
	  document.modContactForm.ckbCuisine.checked=false;
	  document.modContactForm.ckbmanger.checked=false;
	  document.modContactForm.ckbSalon.checked=false;
	  document.modContactForm.ckbfamiliale.checked=false;
	  document.modContactForm.ckbcoucher.checked=false;
	  document.modContactForm.ckbmaitres.checked=false;
	  document.modContactForm.ckbbain.checked=false;
	  document.modContactForm.ckbSousSol.checked=false;
	  document.modContactForm.ckbCommerce.checked=false;
	  document.modContactForm.ckbAutres.checked=false;
	  document.modContactForm.txtAutresDesc.value='';
	  break
	case 'choix2':
	  document.modContactForm.ckbCeramique.checked=false;
	  document.modContactForm.ckbbois.checked=false;
	  document.modContactForm.ckbTapis.checked=false;
	  document.modContactForm.ckbflottant.checked=false;
	  document.modContactForm.ckbchauffant.checked=false;
	  document.modContactForm.ckbVinyle.checked=false;
	  document.modContactForm.ckbTuiles.checked=false;
	  document.modContactForm.ckbPeinture.checked=false;
	  document.modContactForm.ckbAccessoires.checked=false;
	  document.modContactForm.ckbStores.checked=false;
	  document.modContactForm.ckbPapier.checked=false;
	  document.modContactForm.ckbConsultation.checked=false;
	  document.modContactForm.ckbProduits.checked=false;
	  document.modContactForm.ckbentretien.checked=false;
	  document.modContactForm.ckbInstallation.checked=false;
	  document.modContactForm.ckbDecoration.checked=false;
	  break
	case 'choix3':
	  document.modContactForm.ckbCeramique2.checked=false;
	  document.modContactForm.ckbbois2.checked=false;
	  document.modContactForm.ckbTapis2.checked=false;
	  document.modContactForm.ckbflottant2.checked=false;
	  document.modContactForm.ckbchauffant2.checked=false;
	  document.modContactForm.ckbVinyle2.checked=false;
	  document.modContactForm.ckbTuiles2.checked=false;
	  document.modContactForm.ckbPeinture2.checked=false;
	  document.modContactForm.ckbAccessoires2.checked=false;
	  document.modContactForm.ckbStores2.checked=false;
	  document.modContactForm.ckbPapier2.checked=false;
	  document.modContactForm.ckbConsultation2.checked=false;
	  document.modContactForm.ckbProduits2.checked=false;
	  document.modContactForm.ckbentretien2.checked=false;
	  document.modContactForm.ckbInstallation2.checked=false;
	  document.modContactForm.ckbDecoration2.checked=false;
	  document.modContactForm.ckbCuisine.checked=false;
	  document.modContactForm.ckbmanger.checked=false;
	  document.modContactForm.ckbSalon.checked=false;
	  document.modContactForm.ckbfamiliale.checked=false;
	  document.modContactForm.ckbcoucher.checked=false;
	  document.modContactForm.ckbmaitres.checked=false;
	  document.modContactForm.ckbbain.checked=false;
	  document.modContactForm.ckbSousSol.checked=false;
	  document.modContactForm.ckbCommerce.checked=false;
	  document.modContactForm.ckbAutres.checked=false;
	  document.modContactForm.txtAutresDesc.value='';
	  document.modContactForm.ckbCeramique.checked=false;
	  document.modContactForm.ckbbois.checked=false;
	  document.modContactForm.ckbTapis.checked=false;
	  document.modContactForm.ckbflottant.checked=false;
	  document.modContactForm.ckbchauffant.checked=false;
	  document.modContactForm.ckbVinyle.checked=false;
	  document.modContactForm.ckbTuiles.checked=false;
	  document.modContactForm.ckbPeinture.checked=false;
	  document.modContactForm.ckbAccessoires.checked=false;
	  document.modContactForm.ckbStores.checked=false;
	  document.modContactForm.ckbPapier.checked=false;
	  document.modContactForm.ckbConsultation.checked=false;
	  document.modContactForm.ckbProduits.checked=false;
	  document.modContactForm.ckbentretien.checked=false;
	  document.modContactForm.ckbInstallation.checked=false;
	  document.modContactForm.ckbDecoration.checked=false;
	  document.modContactForm.txtAutresDesc.value='';
	  break 
	}
}
