
function Openhw(path,nom,h,w)
{
	var topm = (screen.height - h) / 2;
	var leftm = (screen.width - w) / 2;
	
	
	switch(nom){
		case 'site':
			var pathnew = ""; 
			
			var webbox = "../webbox";
			pos = (path.indexOf(webbox)) 
			
			if (pos == -1) {
  	  		  pathnew = path.substr(6,path.length);
  	  		}
  	  		else
  	  		{
  	  		  pathnew = path.substr(9,path.length);
  	  		}
	  		win = window.open(pathnew,nom,"width="+w+",height="+h+",top="+topm+",left="+leftm+",scrollbars=yes,toolbar=1,location=1,directories=1,status=1,menubar=1,resizable=yes");
	  		if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
		break;
																
		case 'pop_site':	
			var pathnew = ""; 
  	  		
  	  		var webbox = "../webbox";
			pos = (path.indexOf(webbox)) 
			
			if (pos == -1) {
  	  		  pathnew = path.substr(6,path.length);
  	  		}
  	  		else
  	  		{
  	  		  pathnew = path.substr(9,path.length);
  	  		}
  	  		
  	  		win = window.open(pathnew,nom,"width="+w+",height="+h+",top="+topm+",left="+leftm+",scrollbars=no");
	  		if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
		break;
		
		case 'site_navright':
			var pathnew = ""; 
			
			var webbox = "../../webbox";
			pos = (path.indexOf(webbox)) 
			
			if (pos == -1) {
  	  		  pathnew = path.substr(9,path.length);
  	  		}
  	  		else
  	  		{
  	  		  pathnew = path.substr(12,path.length);
  	  		}
	  		win = window.open(pathnew,nom,"width="+w+",height="+h+",top="+topm+",left="+leftm+",scrollbars=yes,toolbar=1,location=1,directories=1,status=1,menubar=1,resizable=yes");
	  		if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
		break;
		
		case 'pop_site_navright':	
			var pathnew = ""; 
  	  		
  	  		var webbox = "../../webbox";
			pos = (path.indexOf(webbox)) 
			
			if (pos == -1) {
  	  		  pathnew = path.substr(9,path.length);
  	  		}
  	  		else
  	  		{
  	  		  pathnew = path.substr(12,path.length);
  	  		}
  	  		win = window.open(pathnew,nom,"width="+w+",height="+h+",top="+topm+",left="+leftm+",scrollbars=no");
	  		if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
		break;
		
		case 'nolink':	
			//alert("test");
		break;
																				
		default:
			win = window.open(path,nom,"width="+w+",height="+h+",top="+topm+",left="+leftm+",scrollbars=no");
	  		if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
		break;
	}
}

function Openhwscroll(path,nom,h,w)
{
	var topm = (screen.height - h) / 2;
	var leftm = (screen.width - w) / 2;
	win = window.open(path,nom,"width="+w+",height="+h+",top="+topm+",left="+leftm+",scrollbars=yes,toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=no");
	if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
}

function OpenImphw(path,h,w,sb)
{
	var topm = (screen.height - h) / 2;
	var leftm = (screen.width - w) / 2;
	win = window.open(path,"Imp","width="+w+",height="+h+",top="+topm+",left="+leftm+",scrollbars=yes,toolbar=yes");
	if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
}

function Open(path)
{
	if (top.window.opener != null)
	{
		top.window.opener.window.location.href = path;
				
		if (parseInt(navigator.appVersion) >= 4)
		{
			top.window.opener.window.focus();
		}
	}
	else
	{
		window.location = path;
	}
}

function OpenProduct(path)
{
	window.open("http://frfre.garnier.com/index.asp?location=" + path, "_blank");
}

function openDown(chemin,targett)
{
	if (parent.window.opener != null){
		top.window.opener.window.location.href=chemin;
		if (parseInt(navigator.appVersion) >= 4) 
		{ 
			top.window.opener.window.focus(); 
		}
	}else{
		switch(targett){
			case 'self':	
				var cheminpath = chemin;
				var cheminpathnew = "";
				//cheminpath = chemin.substr(3,chemin.length);
				//alert(cheminpath);
				
				for (var i=0; i < cheminpath.length; i++) 
				{ 
				var c = cheminpath.charAt(i); 
				if (c == '&') cheminpathnew+="%26"; 
				else cheminpathnew += c; 
				} 
				//alert(cheminpathnew);
				window.location = cheminpathnew;
			break;
			
			default:
				var cheminpath = "";
				var cheminpathnew = "";
				cheminpath = chemin.substr(3,chemin.length);
				//alert(cheminpath);
				
				for (var i=0; i < cheminpath.length; i++) 
				{ 
				var c = cheminpath.charAt(i); 
				if (c == '&') cheminpathnew+="%26"; 
				else cheminpathnew += c; 
				} 
				//alert(cheminpathnew);
				window.open("http://www.garnierbeautybar.mx/_es/_mx/index.aspx?location=" + cheminpathnew, "_blank");
			break;
		}
	}
}

function openDown2(chemin,targett)
{
	if (parent.window.opener.parent.window.opener != null){
		//alert("parent2");
		top.window.opener.top.window.opener.window.location.href=chemin;
		if (parseInt(navigator.appVersion) >= 4) 
		{ 
			top.window.opener.top.window.opener.window.focus(); 
		}
		
	}else{
	if (parent.window.opener != null){
		//alert("parent");
		top.window.opener.window.location.href="http://fr.garnier.com/_fr/_fr/index.aspx?location="+targett+chemin;
		if (parseInt(navigator.appVersion) >= 4) 
		{ 
			top.window.opener.window.focus(); 
		}
	}
	}
}

var mute = 0;
	
function muteIt() {
    mute=1-mute;
    document.GSounds.setVariable("mute", mute);
    top.MScript.document.location.href = "mute.html?mute=" + mute;
    if (mute==0) {
    	changeImages('imageSon', 'imageSonOff');
    }
    else {
    	changeImages('imageSon', 'imageSonOn');
   }
}

function payslist(Vadresse) {
	if (Vadresse.substr(0,4).toLowerCase()=="java") {
		eval (Vadresse);
	}
	else if (Vadresse!="") {
		newbb = window.open(Vadresse,"newbb","");
	}
}

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_reloadPage(init) {  //reloads the window if Nav4 resized
	if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
		document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
	else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
	}
	MM_reloadPage(true);
	
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_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];}
	}

function changeImages() {
	if (document.images) {
		for (var i=0; i<changeImages.arguments.length; i+=2) {
		document[changeImages.arguments[i]].src = eval(changeImages.arguments[i+1] + ".src");
		}
	}
}

function MM_findObj(n, d) { //v4.0
	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 && document.getElementById) x=document.getElementById(n); return x;
	}

function MM_showHideLayers() { //v3.0
	var i,p,v,obj,args=MM_showHideLayers.arguments;
	for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
		if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v='hide')?'hidden':v; }
		obj.visibility=v; }
	}

function init()                 // Initialisation des variables d'environnement
	{
	var le_contexte = new CONTEXTE();
	if (le_contexte.ns4)
	{
		debut="document";
			fin="";
			inclu=".document";
			}
	else
			if (le_contexte.ie4)
					{
					debut="document.all";
					fin=".style";
					inclu="";
					}
	}

function CONTEXTE()             // Reconnaissance de la configuration du browser client
	{
	var agent = navigator.userAgent.toLowerCase();
	this.major = parseInt(navigator.appVersion);
	this.minor = parseFloat(navigator.appVersion);
	this.ns = ((agent.indexOf('mozilla')!=-1) && ((agent.indexOf('spoofer')==-1) && (agent.indexOf('compatible')==-1)));
	this.ns4 = (this.ns && (this.major>=4));
	this.ie = (agent.indexOf("msie")!=-1);
	this.ie4 = (this.ie && (this.major>=4));
	this.win = (agent.indexOf("win")!=-1);
	this.mac = (agent.indexOf("mac")!=-1);
	}


function Show(layer1,layer2)
	{
	if (layer1!=cur1)
		{
		if (cur1!=null)
			MM_showHideLayers(layer1,'','show',cur1,'','hide',layer2,'','show',cur2,'','hide');
		else
			MM_showHideLayers(layer1,'','show',layer2,'','show');
		cur1=layer1;
		cur2=layer2;
		}
	}
	
//fonction d'affichage des layers    
ns4 = (document.layers)? true:false
ie4 = (document.all)? true:false

function showObject(obj1) {
       
        if (ns4){eval("document."+obj1+".visibility = 'show'");
		}
        else if(ie4) {eval(obj1+".style.visibility = 'visible'");
		}
       tmp_layer = obj1;
}

function hideObject(obj1) {
       
        if (ns4){eval("document."+obj1+".visibility = 'hide'");
		}
        else if(ie4) {eval(obj1+".style.visibility = 'hidden'");
		}
       tmp_layer = obj1;
}


function searchEngine(pageurl)
	{
	var mf = GetMainFormName();
	if (mf==null) return;
	var search = GetElementName("search",mf)
	if (search!= null)
	searchtext = document.forms[mf].elements[search].value
	parent.window.location=pageurl+'?search='+searchtext;
	}
	
function AddEncodedParameter(pageUrl, parameterName, parameterValue)
{
	var parameterEncodedValue = new String();
	var character;
			
	if ((pageUrl) && (parameterValue) && (parameterName))
	{
		for (var index=0; index < parameterValue.length; index++) 
		{ 
			character = parameterValue.charAt(index); 
			if (character == '?' ) parameterEncodedValue += "%3F"; 
			else if (character == '&') parameterEncodedValue += "%26"; 
			else if (character == '/') parameterEncodedValue += "%2F"; 
			else parameterEncodedValue += character; 
		}
	
		return pageUrl + parameterName + '=' + parameterEncodedValue;
	}
	else
	{
		return '';
	}
}

function flashson() {
	if ("@@@@swfzone@@@@"!="") {
	document.write ("<OBJECT classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0' ID='GSounds' WIDTH='1' HEIGHT='1' ALIGN=''>");
	document.write ("<PARAM NAME=movie VALUE='@@WebBoxRelativePath@@/../swf/@@@@swfzone@@@@?mute="+mute+"'>");
	document.write ("<PARAM NAME=quality VALUE=high> <PARAM NAME=bgcolor VALUE=#FFFFFF>");
	document.write ("<EMBED src='@@WebBoxRelativePath@@/../swf/@@@@swfzone@@@@?mute="+mute+"' quality=high bgcolor=#FFFFFF  WIDTH='1' HEIGHT='1' swLiveConnect=true ID='GSounds' NAME='GSounds' ALIGN='' TYPE='application/x-shockwave-flash' PLUGINSPAGE='http://www.macromedia.com/go/getflashplayer'></EMBED>");
	document.write ("</OBJECT>");
	alert("son");
	}
}
function OpenhwNoToolbar (path,nom,h,w){
		win = window.open(path,nom,"width="+w+",height="+h+",toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=no");
}