//***************************************************************
// code gestion affichage SISTER SHOPPING
// Auteur : Société Abiotik
// contact : 04 67 57 03 72
//***************************************************************
//----------------------------------------copyright abiotik 2005



	// var designation "num" par nom rubrique
	var designRub;
	var numRubPub=0;
// correspondance 
// rub0 : accueil/annexe >> --
// rub1 : sac >> 21
// rub2 : chaussures >> 22
// rub3 : bijoux >> 27
// rub4 : ceintures/breloques >> 17
// rub5 : montres >> 19
// rub6 : hommes >> 28
// rub7 : enfants >> 29
// rub8 : soldes >> 30
// rub9 : soldes >> 31

// extract URL et pointage
//--------------------------

	var recup = window.document.location;
	//alert(recup);
	var chaine = recup.toString();
	var longueur = chaine.length;
	var resultat = chaine.indexOf('num=');
	var extract;
	

	// Accueil / annexe / entree rub
	if (boutique == 0){
		// on prend la valeur de designRub sur la page		 
	}
	// page boutique
	else{
		var extract1 = chaine.substring(resultat+4,resultat+5);
		if (longueur >= (resultat+5)){
			var extract2 = chaine.substring(resultat+5,resultat+6);
			if (extract2 == "&"){
				extract=extract1;
				}
			else{
				extract=extract1.toString()+extract2.toString();
			}
		}
		else{
			extract=extract1.toString();
		}

	// memo rub PwB pour appel pub
	numRubPub = extract;
		
	// deisgnation rub site / rub PwB
		if (extract == 21)
			designRub = 1;
		else if(extract == 22)
			designRub = 2;	
		else if(extract == 27)
			designRub = 3;	
		else if(extract == 17)
			designRub = 4;	
		else if(extract == 19)
			designRub = 5;	
		else if(extract == 28)
			designRub = 6;	
		else if(extract == 29)	
			designRub = 7;	
		else if(extract == 30)	
			designRub = 8;
		else if(extract == 31)	
			designRub = 9;					
		else
			designRub = 0;	
	}





//***************************************************************
// montage éléments commun
//***************************************************************

function espaceur(largeur,hauteur){
	document.write('<table width="100%" border="0" cellspacing="0" cellpadding="0"><tr>'
		+'<td><img src="../site/graphCommun/communNew/images/espaceur.gif" width="'+largeur+'" height="'+hauteur+'"></td>'
		+'</tr></table>');
}


//***************************************************************
// montage anciens éléments
//***************************************************************


function tabSimple(parametres,insertion){
	document.write('<table width="100%" border="0" cellspacing="0" cellpadding="0" '+parametres+'><tr>'
		+'<td>'+insertion+'</td>'
		+'</tr></table>');
}

function tabEspaceur(fond,largeur,hauteur){
	document.write('<table width="100%" border="0" cellspacing="0" cellpadding="0"><tr>'
		+'<td '+fond+'><img src="../site/graphCommun/commun/images/espaceur.gif" width="'+largeur+'" height="'+hauteur+'"></td>'
		+'</tr></table>');
}

function tabTitre(titre){
	document.write('<table width="100%" border="0" cellspacing="0" cellpadding="0" bgcolor="#B699C7"><tr>'
		+'<td><img src="../site/graphCommun/commun/images/fleche1.gif" width="12" height="17"></td>'
		+'<td class="Bc12" width="100%"><b>'+titre+'</b></td>'
		+'</tr></table>');
}


function tabListe(parametres,texte){
	document.write('<table width="100%" border="0" cellspacing="0" cellpadding="0" '+parametres+'><tr>'
		+'<td valign="top"><img src="../site/graphCommun/commun/images/fleche2.gif" width="22" height="11"></td>'
		+'<td class="Bl11" width="100%">'+texte+'</td>'
		+'</tr></table>');
}

	function ligneDecoCommune(largeur){
		document.write('<table width="'+largeur+'" border="0" cellspacing="0" cellpadding="0" align="center"><tr>'
			+'<td background="../site/graphCommun/produit/images/ligneProduit.gif">'
			+'<img src="../site/graphCommun/produit/images/espaceur.gif" width="1" height="3"></td>'
			+'</tr></table>');		
	}




//***************************************************************
// montage éléments divers
//***************************************************************

// haut
//------------------------------
function divHautDroit(){
	document.write('<td width="108" valign="top">'
		//+'<div style="position:absolute; width: 108; height:50"  align="center"><a href="../boutique/collection_ete.cfm"><img src="../site/graphCommun/communNew/images/banncollectionETE.gif" border="0" alt="Collection ETE 2007"></a></div>'
		//<a href="../boutique/sacs.cfm" onMouseOver="survolMenu(1,1);" onMouseOut="survolMenu(1,0);"><img id="rub1" src="../site/graphCommun/communNew/images/rub1Titre1.gif" width="135" height="27" border="0" alt="Rayon &quot;Sac &agrave; main&quot;"></a>
		+'<div style="position:absolute; width: 108; height:50"  align="center"><a href="http://www.sistershopping.com/boutique/liste_produits.cfm?num=21&code_lg=lg_fr&type=169"  onMouseOver="survolMenu(9,1);" onMouseOut="survolMenu(9,0);"><img id="rub9" src="../site/graphCommun/communNew/images/rub9Titre1.gif" border="0" alt="Offrez un chèque cadeau"></a></div>'
		+'</td>');
		
	if(designRub == 9)
		document.getElementById("rub9").src = "../site/graphCommun/communNew/images/rub9Titre2.gif"		
}



// pied
//------------------------------
function texteHautCentre(){
	document.write('<table width="100%" border="0" cellspacing="0" cellpadding="0"><tr>'
		+'<td class="violet14" align="center">&nbsp;'
		//+'<b><a href="#">Accédez à notre BLOG</a></b></td>'
		+'</tr></table>');
}

function texteBasCentre(){
	document.write('<span class="gris8"><br>Copyright &copy; Sistershopping 2006 - 2009</span>');

}

function imgDroite(){
	document.write('<table width="100%" border="0" cellspacing="0" cellpadding="0"><tr>'
		+'<td><a href="http://www.sistershopping.com/boutique/infos_securite.cfm?code_lg=lg_fr"><img src="../site/graphCommun/communNew/images/bannierePiedPageDte.gif" border="0" alt="Pour la sécurité de vos paiements nous utilisons « Cybermut », cliquez pour en savoir plus"></a></td>'
		+'</tr></table>');
}






//***************************************************************
// gestion des survol et actif
//***************************************************************


//Menu principal
//-------------------------------
function survolMenu(num,action){
//document.getElementById("menuHaut"+ num).src = "../graph/commun/images/"+nomBoutMenu[num]+"1.gif"
	if(num != designRub){
		if(action == 1){
			document.getElementById("rub"+ num).src = "../site/graphCommun/Newsite/rub"+num+"Titre2.gif"
		}
		else{
			document.getElementById("rub"+ num).src = "../site/graphCommun/Newsite/rub"+num+"Titre1.gif"
		}
	}
}

function designMenuActif(){
	if(designRub > 0 && designRub < 9)
		document.getElementById("rub"+ designRub).src = "../site/graphCommun/Newsite/rub"+designRub+"Titre2.gif"
}



//Menu annexe
//-------------------------------		
//survolAnnexe('Accueil',1);
function survolAnnexe(num,action){
//document.getElementById("menuHaut"+ num).src = "../graph/commun/images/"+nomBoutMenu[num]+"1.gif"
	if(num != designRub){
		if(action == 1){
			document.getElementById(num).src = "../site/graphCommun/Newsite/bout"+num+"2.gif"
		}
		else{
			document.getElementById(num).src = "../site/graphCommun/Newsite/bout"+num+"1.gif"
		}
	}	
}


//***************************************************************
// montage centrale
//***************************************************************

//page entrée rubrique
//-------------------------
function appelCentreEntreeRub(){
	
	// Appel fond
	
// var rub1Edito = {titre: "TITRE MARQUE1", texte:"Texte marque1<br>texte marque<br>texte marque",lien: "http://www.sistershopping.com"};	

	document.write('<table width="100%" height="460" border="0" cellspacing="0" cellpadding="0" style="background-image:url(../site/graphCommun/fondRub/images/fondRub'+designRub+'.jpg);  background-repeat: no-repeat;  background-position: left,top;"><tr>'
		+'<td valign="bottom">'

		// bloc pub marques bas
		+'<table width="100%" border="0" cellspacing="5" cellpadding="0">'
				
		// titre marques (image)
		+'<tr><td class="gris18"><b>'+eval('rub'+designRub+'Edito').titre+'</b></td></tr>'
		// texte marques
		+'<tr><td class="gris11"><b>'+eval('rub'+designRub+'Edito').texte+'</b><a href="'+eval('rub'+designRub+'Edito').lien+'"><b>&gt;&gt; En savoir plus</b></a></td></tr>'
		// lien
		//+'<tr><td class="violet11"><a href="'+eval('rub'+designRub+'Edito').lien+'"><b>&gt;&gt; En savoir plus</b></a></td></tr>'								
		+'</table>'
		
		+'</td>'
		+'</tr></table>');

}


// Menu dyn. Présent partout sauf annexes et page accueil
//--------------------------------------------------------
// >> pages différentes externes + gestion page et pubs

function appelMenuDyn(){
	if(designRub==0){
		appelBanPagesAnnexes();
	}
	else{
	document.write('<table width="100%" border="0" cellspacing="0" cellpadding="0">'
		+'<tr><td><img src="../site/graphCommun/menuDyn/images2/menuDynDbt.gif" width="176" height="13"></td></tr>'
		+'<tr><td height="300" valign="top"  background="../site/graphCommun/menuDyn/images2/menuDynFond.gif">' 

		+'<table width="100%" border="0" cellspacing="0" cellpadding="0"><tr><td valign="top">');
            
		// appel menu dyn.
		//-----------------------------
		affMenu();
			                  
	document.write('</td></tr></table> ' 
		+'</td></tr></table>'

		+'<table width="100%" border="0" cellspacing="0" cellpadding="0">'
		+'<tr><td><img src="../site/graphCommun/menuDyn/images2/menuDynFin.gif" width="176" height="18"></td></tr>'
		+'</table>');
	}
}


// Fonction Zoom calque sur listing
//*****************************************************************************************
	
var compteurZoomCalque = 1;	

	function posZoomCalque(ref){
		espaceur(1,10);
		
		document.write('<table border="0" cellspacing="0" cellpadding="0"><tr>'
    		+'<td><a onMouseOver="visibleZoomCalque(1,'+compteurZoomCalque+',\''+ref+'\');" onMouseOut="visibleZoomCalque(0,'+compteurZoomCalque+',\'espaceur\');"><img src="../site/graphCommun/produit/images/pictoLoupeGM.gif" border="0"></a></td>'
    		+'<td><div id="zoomCalque'+compteurZoomCalque+'" style="position:absolute; visibility: hidden; overflow: auto; ">'
    		+'<table border="0" cellspacing="1" cellpadding="1" bgcolor="#8A7498"><tr>'
    		+'<td bgcolor="#FFFFFF"><img id="imgZoomCalque'+compteurZoomCalque+'" src="../site/zoomGammes/espaceur.gif"></td>'
    		+'</tr></table>'
    		+'</div><br></td>'
    		+'</tr></table>');

		compteurZoomCalque++;

	}
	
	function visibleZoomCalque(action,calque,ref){
		with (document.getElementById("zoomCalque" + calque).style){
			if(action==1){
				document.getElementById("imgZoomCalque"+calque).src="../site/zoomGammes/"+ref+".jpg";
				visibility="visible";
			}
			else
				visibility="hidden";
		}
	}			

// Divers bannières
//*****************************************************************************************	

// banHautePanier 
var banHautePanier = {image: new Array("banMaximilesMoyenne2.gif"), lien: new Array(""), page:"1"};

// banBassePaiement 
var banBassePaiement = {image: new Array("banMaximilesMoyenne3.gif"), lien: new Array(""), page:"1"};





// Fonctions PwB
//*****************************************************************************************
//-------------------------------------------------------------------------------
	// RECHERCHE
	function verification(){
		if (document.form_search.mot.value == '')
		alert ('Veuillez entrer au moins un mot a rechercher. ');
		else document.form_search.submit();
	}


	// 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) {
			//alert(document.form_mailing.action);
			document.form_mailing.action="http://www.sistershopping.com/boutique/trait_mailinglist.cfm?code_lg=lg_fr";
			//alert(document.form_mailing.action);
			document.form_mailing.submit();
		}
		else if (str != '') {
			alert('Veuillez saisir : '+str);
		}
	}



















