
//***************************************************************
// code gestion affichage Planete Gourmande
// Auteur : Société Abiotik
// tous droits réservés
// contact : 04 67 57 03 72
//***************************************************************
// ----------------------------------------copyright abiotik 2006



	function espace(largeur,hauteur){					 
		document.write('<table width="100%" border="0" cellspacing="0" cellpadding="0"><tr>'
			+'<td><img src="../site/graph/commun/images/espaceur.gif" width="'+largeur+'" height="'+hauteur+'"></td>'
			+'</tr></table>');
	}
	
	function tabSimple(contenu){
		document.write('<table width="100%" border="0" cellspacing="0" cellpadding="0" class="rose10"><tr>'
			+'<td>'+contenu+'</td>'
			+'</tr></table>');
	}


	function tabFinBlocLien(contenu){
		document.write('<table width="100%" border="0" cellspacing="0" cellpadding="0"><tr>'
			+'<td width="100%" background="../site/graph/commun/images/fondBoutMenu.gif" class="blanc10" align="center"><b>'+contenu+'</b></td>'
			+'<td><img src="../site/graph/commun/images/flecheBoutMenu.gif"></td>'
			+'</tr></table>');
	}
	
	function supportBlocHaut(){	
		document.write('<table width="100%" style="background-image: url(../site/graph/commun/images/fondBlocmenu.gif);  background-repeat: no-repeat;  background-position: bottom;" border="0" cellspacing="0" cellpadding="0">'
			+'<tr><td height="31">');
	}


	function supportBlocHautBlanc(){	
		document.write('<table width="100%"  border="0" cellspacing="0" cellpadding="0">'
			+'<tr><td  class="rose10">');
	}
                            
	function supportBlocBas(){
		document.write('</td></tr></table>');
	}
  
	function ligneInfo(contenu){
		document.write('<table width="100%" border="0" cellspacing="0" cellpadding="0"><tr>'
			+'<td width="18" align="center" valign="top"><img src="../site/graph/commun/images/flecheLigneMenu.gif" width="10" height="11"></td>'
			+'<td class="rose10"><b>'+contenu+'</b></td>'
			+'</tr></table>');
	}


//MONTAGE PAGE
//****************************************************

// avant Selection
//------------------
	function montageMenugauchehaut(){


// bloc recherche		
		tabSimple('<img src="../site/graph/commun/images/titreRechercher.gif">');
		supportBlocHaut();

		document.write('<table width="100%" border="0" cellspacing="0" cellpadding="0" height="31">'
			+'<form action="recherche_resultats.cfm?code_lg=lg_fr" method="post" name="form_search" target="_self">'		
			+'<tr><td width="100%" align="right"><input type="text" name="mot" size="20"></td>'
			+'<td valign="top"><a onClick="verification();" href="#"><img src="../site/graph/commun/images/boutOk.gif" border="0"></a></td></tr>'
			+'</form>'
			+'</table>');

		supportBlocBas();
		tabFinBlocLien('<a href="recherche_resultats.cfm?code_lg=lg_fr">Recherche Avancée</a>')
		
		espace(1,15);


// bloc Selection		
		tabSimple('<img src="../site/graph/commun/images/titreSelection.gif">');
		supportBlocHautBlanc();
	}


// aprés selection / avant login	
//------------------
	
	function montageMenugauchehaut2(){

		supportBlocBas();
		tabSimple('<img src="../site/graph/commun/images/finBlocMenu2.gif">');

		espace(1,15);



// bloc compte				
		tabSimple('<img src="../site/graph/commun/images/titreCompte.gif">');
		supportBlocHaut();		
	}




// apres login
//------------------
	function montageMenugaucheBas(){
		supportBlocBas();
		tabFinBlocLien('<a href="javascript:suiviDeCommande();">Suivi de commande</a>');

		espace(1,15);

// bloc infos		
		tabSimple('<img src="../site/graph/commun/images/titreInfos.gif">');
		supportBlocHaut();
		ligneInfo('<a href="page_actus_page.cfm?num_actus=2&code_lg=lg_fr">Qui sommes-nous ?</a>');
		ligneInfo('<a href="page_actus_page.cfm?num_actus=3&code_lg=lg_fr">Livraisons & délais</a>');
		ligneInfo('<a href="page_actus_page.cfm?num_actus=4&code_lg=lg_fr">Paiement sécurisé</a>');
		ligneInfo('<a href="page_actus_page.cfm?num_actus=5&code_lg=lg_fr">Modes de paiement</a>');
		ligneInfo('<a href="infos_cgv.cfm?code_lg=lg_fr">Conditions générales <br>de vente</a>');
		supportBlocBas();
		tabSimple('<img src="../site/graph/commun/images/finBlocMenu.gif">');

		espace(1,15);

/*
// bloc Catalogue		
		tabSimple('<img src="../site/graph/commun/images/titreCatalogue.gif">');
		supportBlocHaut();
		ligneInfo('<a href="../site/PDF/CATALOGUE.pdf" target="blank">Catalogue PDF (2,7 Mo)</a>');
		ligneInfo('<a href="../site/PDF/BDC.pdf" target="blank">Bon de commande PDF <br>(125 Ko)</a>');
		supportBlocBas();
		tabSimple('<img src="../site/graph/commun/images/finBlocMenu.gif">');

		espace(1,15);
*/


//emailing
		tabSimple('<img src="../site/graph/commun/images/titreEmailing.gif">');
		supportBlocHaut();		

		document.write('<table width="100%" border="0" cellspacing="0" cellpadding="0">'
		+'<form name="form_mailing" action="trait_mailinglist.cfm?code_lg=lg_fr" method="post"><tr><td>');		
		
		document.write('<table width="100%" border="0" cellspacing="0" cellpadding="0">'
			+'<tr><td><input type="radio" name="abonne" value="1" checked ></td>'		
			+'<td width="100%" class="rose10"><b>Je m\'abonne</b></td></tr>'
			+'<tr><td><input type="radio" name="abonne" value="0" ></td>'		
			+'<td width="100%" class="rose10"><b>Je me désabonne</b></td></tr>'			
			+'</table>');
			
					
		tabSimple('&nbsp;&nbsp;<b><i>Entrez votre E-mail</i></b>');		
		document.write('<table width="100%" border="0" cellspacing="0" cellpadding="0" height="31"><tr>'
			+'<td width="100%" align="right"><input type="text" name="mail" value="Votre E-mail" size="20"></td>'
			+'<td  valign="top"><a href="#" onClick="verif();"><img src="../site/graph/commun/images/boutOk.gif" border="0"></a></td>'
			+'</tr></table>'
			
			+'</td></tr></form></table>');
			
			
					
		
		supportBlocBas();
		tabSimple('<img src="../site/graph/commun/images/finBlocMenu.gif">');

		espace(1,15);


// ban Catalogue		
		tabSimple('<a href="../site/PDF/CATALOGUE.pdf" target="blank"><img src="../site/graph/commun/images/banCatalogue_Menu.gif" border="0" alt="Téléchargez notre catalogue 2007/2008"></a>');
		espace(1,15);



// favoris et partenaires		
//------------------------
	// Bloc AJOUT FAVORIS
		if(document.all){
			tabSimple('<a href="#" onClick="window.external.addfavorite(\'http://www.planetegourmande.fr/\',\'PLANETE GOURMANDE, gourmandises et confiserie\')"><img src="../site/graph/commun/images/boutFavoris.gif" border="0"></a>');
			espace(1,3);		
		}
	
		tabSimple('<a href="infos_partenaires.cfm?code_lg=lg_fr"><img src="../site/graph/commun/images/boutPartenaire.gif" border="0"></a>');
		espace(1,20);				
	}






// FONCTIONS ABK Divers ------------------- SuiviCDE
function suiviDeCommande(){

	var recup= document.cookie;

	recup=unescape(recup);
//verif  cookies
	if (recup == "")
		self.location = "suiviCDE.cfm";
		//alert ("Pour suivre vos commandes,\nvotre navigateur doit accepter les cookies \net vous devez vous identifier");
	// cookie présent	
	else{
		recup=recup.indexOf("CL");
		if (recup<0)
			self.location = "suiviCDE.cfm";
			//alert ("Pour suivre vos commandes,\nvous devez vous identifier dans le cadre \"COMPTE\"");
		else
			self.location = "sommaire_compte_client.cfm?code_lg=lg_fr";
	}

}


//-------------------------------------------------------------------------------
// BLOC RECHERCHE PWB

	// Fonction verif PB
	function verification(){
		if (document.form_search.mot.value == '')
		alert ('Veuillez entrer au moins un mot a rechercher. ');
		else document.form_search.submit();
	}



// FONCTIONS POWER BOUTIQUE ------------------- EMAILING

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 == '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.submit();
	else if (str != '') alert('Veuillez saisir : '+str);
}



