




//************************************************************************
//						GESTION PRINCIPALE - PLATINE V3
//************************************************************************
// Auteur : Abiotik / jean luc COSTAGLIOLA
// contact : 04 67 57 03 72
//************************************************************************
// ------------------------------------- tous droits réservés abiotik 2010


//**************************************************
// gestion pub img/html >> pub accueil survol  (PAS)
//**************************************************

	var memoPAS, timeOutPAS, timeAlfaPAS, nbOpac, timeOpac, timeAttentePAS;
	var memoPAS=1;
	var memoSupPAS=5;
	var changePAS_OK=1;
	var defilManuPAS=0;
	
// init defil auto
//--------------------------------------------------
	function initPAS(){

		// init img
		with (document.getElementById("imgPAS1").style)
		if (document.all) 
			filter="alpha(opacity=100)";
		else 
			opacity=1;

		for(i=2; i<6; i++)
			with (document.getElementById("imgPAS"+i).style) visibility="hidden";
		
		// init bloc html
		with (document.getElementById("htmlPAS1").style)
			if (document.all)filter="alpha(opacity=100)";
			else opacity=1;

		for(i=2; i<6; i++)
			with (document.getElementById("htmlPAS"+i).style) visibility="hidden";		

		// lancement défile
		tempsPAS()
	}

// affich manuel
//--------------------------------------------------

	function afficheManuPAS(numAffichPAS){
		if(numAffichPAS != memoPAS){
			// arret defile + var de déblocage Manuel
			clearTimeout(timeOutPAS);
			defilManuPAS=numAffichPAS;
			
			clearTimeout(timeOpac);
			timeAttentePAS = setTimeout('affichPAS()',150);
		}
	}

	function stopTempsAttente(){
		clearTimeout(timeAttentePAS);
	}

// Fonction affiche
//--------------------------
	function affichPAS(){
		// passage auto/defil
		if (defilManuPAS>0)
			memoPAS=defilManuPAS;
		
		// affich bout
		document.imgSurvol.src="../site/gestionClient/pubDefil/images/pubImgSurvol"+memoPAS+".gif"
		//gestion img
		for(i=1; i<6; i++){		
			with (document.getElementById("imgPAS"+i).style) {
				visibility="hidden";
				if (document.all)
					filter="alpha(opacity=0)";
				else
					opacity=0;
			}
		}
		with (document.getElementById("imgPAS"+memoPAS).style) visibility="visible";		
		
		//gestion bloc html
		for(i=1; i<6; i++){		
			with (document.getElementById("htmlPAS"+i).style) {
				visibility="hidden";
				if (document.all)
					filter="alpha(opacity=0)";
				else
					opacity=0;
			}
		}
		with (document.getElementById("htmlPAS"+memoPAS).style) visibility="visible";
		
		
		// lancement alfa img/html haute
		nbOpac=1;
		clearTimeout(timeOpac)
		alfaChangePAS(); 		
	}

// Fonctions tourne calque
//--------------------------
	function tournePAS(){
		memoSupPAS=memoPAS;
		memoPAS++;
	
		if (memoPAS==6) {
			memoPAS=1;
			memoSupPAS=5;
		}
		affichPAS();	
		tempsPAS();
	}



// Fonctions gestion temps
//--------------------------
	function tempsPAS(){
		timeOutPAS = setTimeout('tournePAS()',4000);
	}



// Fonction affich img haute >> effet alfa
//------------------------------------------
	function alfaChangePAS(){
		timeOpac= setTimeout('affichImgPAS()',50);	
	}

	
	function affichImgPAS(){
		// img
		with (document.getElementById("imgPAS"+memoPAS).style) {
			if (document.all)
				filter=eval('"alpha(opacity='+nbOpac+')"');
			else
				opacity=(nbOpac/100);
		}
	
		// bloc html
		with (document.getElementById("htmlPAS"+memoPAS).style) {
			if (document.all)
				filter=eval('"alpha(opacity='+nbOpac+')"');
			else
				opacity=(nbOpac/100);
		}

		nbOpac=nbOpac+20;
		
		if(nbOpac > 120){
		}
		else{
			alfaChangePAS();
		}
	
	}

//***************************************************************************
// GESTION MENU HAUT + SURVOL IMG
//***************************************************************************
// var communes
	var timeout;	
	var memo=1;
	var timeAttente;
	var img_MenuH1={
		img20:"catalogue",
		img21:"avantages",
		img22:"nosClients",
		img23:"paiementLivraison",
		img24:"service",
		img30:""
	};
	var coul_MenuH2={
		coul1:"#97ADC5",
		coul2:"#799DC5",
		coul3:"#18BFB1",
		coul4:"#1AB688",
		coul5:"#1AB660"
	};



// fonction de modif ouv/ferm menu  haut
//---------------------------------------
	function ouvFerm(numCalque){
		if(memo==numCalque){
			supCalque(numCalque);
			memo=1;
		}
		else{
			lanceCalque(numCalque);
		}
			
	}



	function initMenuH(){
		
	}

	function affCalque(nbCalque){
		c=nbCalque;
		timeAttente = setTimeout('lanceCalque(c)',300);
		stopTemps();		
	}
	

function lanceCalque(nbCalque){
		
		// suppression calque et img ou couleur
		with (document.getElementById("claque" + memo).style) visibility="hidden";
		if(memo > 20)
			document.getElementById("imgInfo"+memo).src='../site/graph/bandeauH/images/MH_'+eval("img_MenuH1.img"+memo)+'_1.gif';
		if(memo < 20)
			with (document.getElementById("boutMenuH2_" + memo).style) backgroundColor = "";

		//correction bug IE/select
		if(nbCalque == 24)
			document.getElementById("claque24").style.display="none";
		
		
		// gestion img bouton info >> MENU 1
		if(nbCalque > 20){
			document.getElementById("imgInfo"+nbCalque).src='../site/graph/bandeauH/images/MH_'+eval("img_MenuH1.img"+nbCalque)+'_2.gif';
			document.getElementById("imgInfo20").src='../site/graph/bandeauH/images/MH_'+img_MenuH1.img20+'_1.gif';
		}

		// gestion couleur bout MenuH2		
		if(nbCalque < 20){
			with (document.getElementById("boutMenuH2_" + nbCalque).style) backgroundColor = eval("coul_MenuH2.coul" + nbCalque);
			document.getElementById("imgInfo20").src='../site/graph/bandeauH/images/MH_'+img_MenuH1.img20+'_2.gif';
		}
		// affichage des calques
			document.getElementById("claque" + nbCalque).style.visibility="visible";
		
		//correction bug IE/select
			if(nbCalque == 24)
					document.getElementById("claque24").style.display="block";
		
		memo=nbCalque;
}

function supCalque(nbCalque){


		// suppression calque et img ou couleur
		if(memo > 20)
			document.getElementById("imgInfo"+memo).src='../site/graph/bandeauH/images/MH_'+eval("img_MenuH1.img"+memo)+'_1.gif';
			
		//correction bug IE/select
		if(nbCalque == 24)
			document.getElementById("claque24").style.display="none";			
		
		with (document.getElementById("claque" + memo).style) visibility="hidden";
		
		if(memo < 20)
			with (document.getElementById("boutMenuH2_" + memo).style) backgroundColor = "";		
		
		document.getElementById("imgInfo20").src='../site/graph/bandeauH/images/MH_'+img_MenuH1.img20+'_2.gif';		


}	


	function temps(){
		timeout = setTimeout('supCalque(memo)',300);
		clearTimeout(timeAttente);			
	}
	
	function stopTemps(){
		clearTimeout(timeout);
		//clearTimeout(timeAttente);
	}





//***************************************************************************
// MONTAGE BANDEAU DROIT
//***************************************************************************	

	function montageBandeauDroit(){

		// gestion des MV par bloc
		//-----------------------------		
		var designMV=designUnivers;
		//alert(designMV);
		
		//top ventes
		//-----------------------------
			if (eval('rub'+designMV+'MV').image != ""){
				var designImage, designLien;
				document.write('<div style="margin-top: 20px;"><img src="../site/graph/images/titre_topVente.gif"></div>');
				
				for(i=0; i<eval('rub'+designMV+'MV').image.length; i++){
					designImage = eval(eval('rub'+designMV+'MV').image[i]).image;
					designLien = eval(eval('rub'+designMV+'MV').image[i]).lien;
					//alert(designImage);
					document.write('<div><a href="'+designLien+'"><IMG src="../site/gestionClient/MV/images/'+designImage+'" border="0"></a></div>');
				}
			}		

		
		// Encarts Bas
		//-----------------------------	
		document.write('<a href="http://www.platine-center.com/boutique/page_3.cfm"><div style="margin-top: 21px;"><img src="../site/graph/images/bloc_modesPaiement.gif" border="0"></a></div>');
				
	}


//***************************************************************************
// MONTAGE BANDEAU GAUCHE
//***************************************************************************	

// ACCUEIL
//----------------------------------

	function montageBandeauGaucheAccueil(){
	
			document.write('<div style="margin-top: 20px;"><a href="http://www.platine-center.com/boutique/les-avantages-de-platine-c.cfm"><img src="../site/graph/images/blocChoisirPC2.gif" border="0"></a></div>');	
	
	}


//***************************************************************************
// GESTION MENU GAUCHE
//***************************************************************************	

/*	
	var coul_MenuH2={
		coul1:"#97ADC5",
		coul2:"#799DC5",
		coul3:"#18BFB1",
		coul4:"#1AB688",
		coul5:"#1AB660"
	};
*/	



	function init_menuG(){
		if(designUnivers > 0){
			document.getElementById("bloc_univers" + designUnivers).style.display="block";
			document.getElementById("bloc_univers" + designUnivers).style.backgroundImage='url(../site/graph/menuG/images/fond_rub'+designUnivers+'.gif)';
			with (document.getElementById("univers" + designUnivers).style){
				backgroundColor = eval("coul_MenuH2.coul"+designUnivers);
				backgroundImage='url(../site/graph/menuG/images/menuV_ouv.gif)'; 		
			}
		}
		for(i=1; i<=5; i++){
			if(i != designUnivers){
				with (document.getElementById("bloc_univers" + i).style) display="none";
				with (document.getElementById("univers" + i).style)	backgroundImage='url(../site/graph/menuG/images/menuV_ferm.gif)';
				document.getElementById("bloc_univers" + i).style.backgroundImage='url(../site/graph/menuG/images/fond_rub0.gif)'; 				
			}
		}		
	}


	function gestion_MenuG(universMG){
		for(i=1; i<=5; i++){
			if(i != universMG){
				with (document.getElementById("bloc_univers" + i).style) display="none";
				with (document.getElementById("univers" + i).style)	backgroundImage='url(../site/graph/menuG/images/menuV_ferm.gif)';				
			}
		}
		with (document.getElementById("bloc_univers" + universMG).style) display="block";
		with (document.getElementById("univers" + universMG).style)	backgroundImage='url(../site/graph/menuG/images/menuV_ouv.gif)'; 
	}



//***************************************************************************
// MONTAGE PRODUIT
//***************************************************************************

	function insertProd(){

		// bloc haut
		//-----------------------------------
		var Destination = document.getElementById('insertProdHaut'); 
		
		var blocProdHaut='';
		//stock
		if( delaiApproTexteArray["0$4"]=="Disponibilité : cet article est en stock.")
			blocProdHaut=blocProdHaut+'<img src="../site/graph/produit/images/pictoStock.gif">';
		// livraison
		if(document.formulaire.prix.value >= 359)
			blocProdHaut=blocProdHaut+'<a href="page_10.cfm"><img src="../site/graph/produit/images/pictoLivraison.gif" border="0"></a>';
		//3x sans frais
		if(document.formulaire.prix.value >= 299)
			blocProdHaut=blocProdHaut+'<a href="page_3.cfm"><img src="../site/graph/produit/images/picto3xSF.gif" border="0"></a>';
			

			
			blocProdHaut=blocProdHaut+'<a href="les-avantages-de-platine-c.cfm"><img src="../site/graph/produit/images/pictoAlignePrix.gif" border="0"></a><img src="../site/graph/produit/images/pictoProdQualite.gif" border="0">';

						
				
		blocProdHaut=blocProdHaut+'<div style="background-color: #222222; width: 450px; margin-top: 5px;"><img src="../site/graph/images/espaceur.gif" width="1" height="1"></div>'
			+'<a href="les-avantages-de-platine-c.cfm"><img src="../site/graph/produit/images/pictoSatisfait.gif" border="0"></a>'
			+'<a href="formulaire_perso.cfm?code_lg=lg_fr&num_formulaire=5&visualisation=1"><img src="../site/graph/produit/images/pictoDevis.gif" border="0"></a>'
			+'<a href="http://www.platine-center.com/site/Mandat/Mandat-Platine-Center.doc"><img src="../site/graph/produit/images/pictoMandatAdmin.gif" border="0"></a>'
			+'<div style="background-color: #222222; width: 450px; margin-bottom: 15px;"><img src="../site/graph/images/espaceur.gif" width="1" height="1"></div>';		
		
		// Insert bouton CDE haut fiche
		if(document.formulaire.choix_1){
		}
		else{
			blocProdHaut=blocProdHaut+'<div style="margin-bottom: 25px;"><a href="#" onclick="IsNumeric();return false;"><img src="../site/graph/produit/images/boutPanier_3.gif" border="0"></a></div>';
		}		
	
		Destination.innerHTML =	 blocProdHaut;
	
		// bloc bas
		//-----------------------------------	
		var Destination = document.getElementById('insertProdBas'); 
		if(document.formulaire.choix_1){
			blocProdBas='<div style="background-color: #222222; width: 450px; margin-top: 25px;"><img src="../site/graph/images/espaceur.gif" width="1" height="3"></div>'
				+'<img src="../site/graph/produit/images/banTel.gif">'
				+'<div style="background-color: #222222; width: 450px; margin-bottom: 20px;"><img src="../site/graph/images/espaceur.gif" width="1" height="1"></div>';
		}		
		Destination.innerHTML =	 blocProdBas;		


	
	
	}
//insertProdHaut
//insertProdBas


	

//***************************************************************************
// MONTAGE INFOS PIED
//***************************************************************************        
	function montageInfosPied(){		
		document.write('<div><a href="http://www.platine-center.com/boutique/page_3.cfm"><img src="../site/graph/images/pied_banPaiement.gif" border="0"></a></div>'
			+'<div><a href="http://www.platine-center.com/boutique/page_10.cfm"><img src="../site/graph/images/pied_banLivraison.gif" border="0"></a></div>');
	}





		
//****************************************************************
// FONCTIONS DIVERSES
//****************************************************************
	
// FAVORIS IE et FF
//-----------------------------		  
	function favoris() { 
		if ( navigator.appName != 'Microsoft Internet Explorer' ) { 
			window.sidebar.addPanel("PlatineCenter.com - Matériel de sono et de sonorisation","http://www.platine-center.com/",""); 
		} 
		else { 
			window.external.AddFavorite("http://www.platine-center.com/","PlatineCenter.com - Matériel de sono et de sonorisation"); 
		} 
	} 

		


//****************************************************************
// FONCTIONS PWB
//****************************************************************

	// RECHERCHE
	//-------------------------------------------------------------------------------

	
	function focusMotValue()
	{
		if (document.form_search.mot.value == 'Recherchez un article')
			document.form_search.mot.value='';
	}
	function blurMotValue()
	{
		if (document.form_search.mot.value == '')
			document.form_search.mot.value='Recherchez un article';
	}	
	
	


	function verification(){
		if (document.form_search.mot.value == '')
			alert ('Veuillez entrer au moins un mot a rechercher. ');
		else document.form_search.submit();
	}


	// EMAILING
	//-------------------------------------------------------------------------------
	

	function focusMotValueNL()
	{
		if (document.form_mailing.mail.value == 'Entrez votre E-mail')
			document.form_mailing.mail.value='';
	}
	function blurMotValueNL()
	{
		if (document.form_mailing.mail.value == '')
			document.form_mailing.mail.value='Entrez votre E-mail';
	}
	
	
	
	function verif()
	{ 	var stop=0;
		var str='';
		var adresse = document.form_mailing.mail.value;
		var place = adresse.indexOf("@",1);
		var point = adresse.indexOf(".",place+1);
	
		if ((document.form_mailing.mail.value == '') || (document.form_mailing.mail.value == 'Entrez votre E-mail'))
		{	str=str+'\n - Votre E-mail';
			stop=1;
		}
		else
		{	if ((place > -1)&&(adresse.length >2)&&(point > 1)&&(adresse.length > point+2))
			{
			}
			else
			{	if (stop == 0)
				{	stop=1;
					alert('Veuillez saisir une adresse E-mail valide.');
					document.form_mailing.mail.focus();
				}
			}
		}
		
		if (stop==0) {
			document.form_mailing.action="trait_mailinglist.cfm?code_lg=lg_fr";
			document.form_mailing.submit();
		}
		else if (str != '') {
			alert('Veuillez saisir : '+str);
		}
	}


















