// base
function rollOverOrg(ImgNme)
{
        obj=document.images[ImgNme];
        obj.src=(obj.src.lastIndexOf('_on')!=-1)? obj.src.replace(/_on/gi,"_off"):obj.src.replace(/_off/gi,"_on");
}

// layers
function rollOver(ImgNme)
{
        obj=(document.images)? document.images[ImgNme]:0; ClicNme=(document.clicImg)? document.clicImg.name:""; 
        if (!obj && document.layers) {
                for (i=0; i<document.layers.length; i++) { ObjLyr=document.layers[i].document;
                        if (ObjLyr.images && ObjLyr.images[ImgNme]) obj=ObjLyr.images[ImgNme];}}                
        if (ClicNme!=ImgNme) obj.src=(obj.src.lastIndexOf('_on')!=-1)? obj.src.replace(/_on/gi,"_off"):obj.src.replace(/_off/gi,"_on");
        document.OnImg=obj;
}

// clic
function Clic(ImgNme)
{
  obj=(document.images)? document.images[ImgNme]:0; 
  ClicNme=(document.clicImg) ? document.clicImg.name:"";
  if (ClicNme!=ImgNme && ClicNme!="") {document.clicImg.src=document.clicImg.src.replace(/_on/gi,"_off");}
  if (!obj && document.layers) {
                for (i=0; i<document.layers.length; i++) { ObjLyr=document.layers[i].document;
                        if (ObjLyr.images && ObjLyr.images[ImgNme]) obj=ObjLyr.images[ImgNme];}}        
        
  
  if (obj.src.lastIndexOf('off')!=-1)  {
  obj.src=obj.src.replace(/_off/gi,"_on");
  }
  else {
  obj.src=obj.src.replace(/_on/gi,"_off");
  }
  
  document.clicImg=obj;
}

/*Add To Favorites-RA 
 	
function setProductDisplay(uniqueID,VarListID)

{

      // Get the IDs for each of the controls that runs on the server.

      //varlist = uniqueID + '_' + 'ProductCode';

    varlist = uniqueID+'$ProductCode';
    var mf = GetMainFormName();
    //document.write (varlist); 
      if (mf!=null) 

         {

            // To get run at server controls

            var AVarList = document.forms[mf].elements[varlist];        

            }
 
      return AVarList.value;
 
}    

*/

//Add To Favorites


function AddToFavorites(prd){
		//var prd = setProductDisplay();
		openWindow("/_en/_us/conso/EspaceK/addTo_favorites_login.aspx?successurl=%2F_en%2F_us%2Fconso%2FESpaceK%2FaddTo_favorites_login.aspx%3Fproductcode=" + prd + "&productcode=" + prd, 350, 260);
		//window.location = "../club/add_favorite_from_popup.aspx?prdcode=" + prd;
	}



// FONCTION DES POP UP
n = (document.layers)? true:false;
ie = (document.all)? true:false;


function Sesame(page,target,larg,haut,scraul){
	var posXpop = (screen.availWidth-larg)/2;
	var posYpop = (screen.availHeight-haut)/2;
	param = "width="+larg+",height="+haut+",left="+posXpop+",top="+posYpop+",scrollbars="+scraul;
	popup = window.open(page,target,param);
}

function fermeNavAuto() {
	//alert(document.naviguation);
	parent.navi.document.naviguation.TGotoLabel ("_root", "fermeNav");
}

// IMPRESSION DES RITUELS
 
if (!window.print){
  document.write('<OBJECT ID="WebBrowser1" WIDTH=0 HEIGHT=0 CLASSID="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2">');
    document.write('<PARAM NAME="ExtentX" VALUE="0">');
    document.write('<PARAM NAME="ExtentY" VALUE="0">');
    document.write('<PARAM NAME="ViewMode" VALUE="1">');
    document.write('<PARAM NAME="Offline" VALUE="0">');
    document.write('<PARAM NAME="Silent" VALUE="0">');
    document.write('<PARAM NAME="RegisterAsBrowser" VALUE="1">');
    document.write('<PARAM NAME="RegisterAsDropTarget" VALUE="1">');
    document.write('<PARAM NAME="AutoArrange" VALUE="1">');
    document.write('<PARAM NAME="NoClientEdge" VALUE="1">');
    document.write('<PARAM NAME="AlignLeft" VALUE="0">');
    document.write('<PARAM NAME="ViewID" VALUE="{0057D0E0-3573-11CF-AE69-08002B2E1262}">');
  document.write('</OBJECT> ');
 }

function printRituels(){	
	if (window.print){
		window.print()
	}
	else{
		if(navigator.appVersion.indexOf("Mac")<0){
		WebBrowser1.focus()
		PrintFaPage()
		}
		else{
			alert('votre navigateur n\'incorpore pas cette fonction.\nutilisez le menu "fichier/imprimer"\nmerci')
		}
	}
}


	
	
	
function backRituels(){
		history.go(-1)
	}
function rollOverRituels(ImgNme)
{
        obj=(document.images)? document.images[ImgNme]:0; ClicNme=(document.clicImg)? document.clicImg.name:""; 
        if (!obj && document.layers) {
                for (i=0; i<document.layers.length; i++) { ObjLyr=document.layers[i].document;
                        if (ObjLyr.images && ObjLyr.images[ImgNme]) obj=ObjLyr.images[ImgNme];}}                
        if (ClicNme!=ImgNme) obj.src=(obj.src.lastIndexOf('_on')!=-1)? obj.src.replace(/_on/gi,"_off"):obj.src.replace(/_off/gi,"_on");
        document.OnImg=obj;
}	

var newWindow
function openPopup(url, popupWidth, popupHeight) {
	if (newWindow && !newWindow.closed)	{
		newWindow.close()
	}	
		
	var winl = (screen.width - popupWidth) / 2;
	var wint = (screen.height - popupHeight) / 2;
		
	newWindow = open(url, 'Kerastase', ("toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no,top=" + wint + ",left=" + winl + ",width=" + popupWidth + ",height=" + popupHeight + "\""));
	newWindow.focus();
}

function openWindow(url, popupWidth, popupHeight) {
	if (newWindow && !newWindow.closed)	{
		newWindow.close()
	}	
		
	var winl = (screen.width - popupWidth) / 2;
	var wint = (screen.height - popupHeight) / 2;
		
	newWindow = open(url, 'Kerastase', ("toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,copyhistory=no,top=" + wint + ",left=" + winl + ",width=" + popupWidth + ",height=" + popupHeight + "\""));
	newWindow.focus();
}

function openPopupandDispose(url) {
   
     window.opener.location=url;
	 window.close(); 
}
/*Script for style collection bio rollovers*/
function toggleDiv(id,flagit) {
if (flagit=="1"){
if (document.layers) document.layers[''+id+''].visibility = "show"
else if (document.all) document.all[''+id+''].style.visibility = "visible"
else if (document.getElementById) document.getElementById(''+id+'').style.visibility = "visible"
}
else
if (flagit=="0"){
if (document.layers) document.layers[''+id+''].visibility = "hide"
else if (document.all) document.all[''+id+''].style.visibility = "hidden"
else if (document.getElementById) document.getElementById(''+id+'').style.visibility = "hidden"
}
}