var domain = lg_domain(location.hostname);
tmp = location.hostname.split('.');
if (tmp[0] != 'www') {
	document.write('<script language="JAVASCRIPT" src="/js/commun/lggo.1.1.js"></script>');
} else {
	document.write('<script language="JAVASCRIPT" src="http://img.' + domain + '/js/commun/lggo.1.1.js"></script>');
}

function b(i,l) {document.images[i].src="http://img." + domain + "/" + l + "/nondispo.gif";}
function ucfirst(w) {if (w.length >= 1) { var m=w.charAt(0).toUpperCase() + w.substring(1).toLowerCase();} else m = w.toUpperCase();return m;}
function setfocus(){document.f.mot.focus();}
function lg_domain(server_name) {	var domain = ""; 	var tmp = server_name.split("\."); 	var taille = tmp.length; 	if (taille > 1) { 		if (tmp[taille-1] == 'uk' && tmp[taille-2] == 'co') { 			domain = tmp[taille-3] + '.co.uk';	 		} else { 			domain = tmp[taille-2] + '.' + tmp[taille-1];	 		} 	} 	return domain;}

//function urlEncode(sStr) {encodedHtml = escape(sStr.replace(/ /g,"_"));encodedHtml = encodedHtml.replace(/\//g,"_");encodedHtml = encodedHtml.replace(/\?/g,"%3F");encodedHtml = encodedHtml.replace(/=/g,"%3D");encodedHtml = encodedHtml.replace(/&/g,"%26");encodedHtml = encodedHtml.replace(/@/g,"%40");return encodedHtml;}
function urlEncode(sStr,lang) 	
{
	sStr = sStr.replace(/ /g,"_");sStr = sStr.replace(/\//g,"_");sStr = sStr.replace(/\?/g,"%3F");sStr = sStr.replace(/=/g,"%3D");sStr = sStr.replace(/&/g,"%26");sStr = sStr.replace(/@/g,"%40");sStr = sStr.replace(/%u20AC/g,"%80");
	//sStr = encodeURIComponent(sStr);

	if (lang == "pl")
	{
		sStr = sStr.replace(/\¿/g,"%BF"); // z
		sStr = sStr.replace(/\¯/g,"%AF");
		sStr = sStr.replace(/\ñ/g,"%F1"); // n
		sStr = sStr.replace(/\Ñ/g,"%D1");
		sStr = sStr.replace(/\¶/g,"%B6"); // s
		sStr = sStr.replace(/\¦/g,"%A6");
		sStr = sStr.replace(/\æ/g,"%E6"); // c
		sStr = sStr.replace(/\Æ/g,"%C6");
		sStr = sStr.replace(/\±/g,"%B1"); // a
		sStr = sStr.replace(/\Ñ/g,"%A1");
		sStr = sStr.replace(/\ê/g,"%EA"); // e
		sStr = sStr.replace(/\Ê/g,"%CA");
		sStr = sStr.replace(/\ó/g,"%F3"); // o
		sStr = sStr.replace(/\Ó/g,"%D3");
		sStr = sStr.replace(/\¼/g,"%BC"); // z
		sStr = sStr.replace(/\¬/g,"%AC");
		sStr = sStr.replace(/\³/g,"%B3"); // l
		sStr = sStr.replace(/\£/g,"%A3");
	}	
	else	
		sStr = escape(sStr);
return sStr;
}

function MM_goToURL() {  var i, args=MM_goToURL.arguments; document.MM_returnValue = false;  for (i=0; i<(args.length-1); i+=2) eval(args[i]+".location=\'"+args[i+1]+"\'");}
function redirect(CP,url) {	if (CP != "")		location.href = url;}
function afficheonerror(lang) { for(i=0;i<document.images.length;i++) { if(!document.images[i].complete) { if (document.images[i].src.substr(document.images[i].src.lastIndexOf('/'),2)=="i") document.images[i].src="http://www.webmarchand.com/img/" + lang + "/nondispo.gif"; } } }
function addEngine(name, ext, cat){  if ((typeof window.sidebar == "object") && (typeof  window.sidebar.addSearchEngine == "function"))  {window.sidebar.addSearchEngine("http://www.webmarchand.com/firefox/"+name+".src","http://www.webmarchand.com/firefox/"+name+"."+ext,name,cat);} else {alert("Vous devez avoir Firefox pour installer ce plugin.");}}
function addEngineS(name, ext, cat){ if ((typeof window.sidebar == "object") && (typeof window.sidebar.addSearchEngine == "function")) {window.sidebar.addSearchEngine("http://www.shopwahl.de/firefox/"+name+".src","http://www.shopwahl.de/firefox/"+name+"."+ext,name,cat);} else {alert("Vous devez avoir Firefox pour installer ce plugin.");}}
function MM_popup(theURL,winName,features) {window.open(theURL,winName,features);}
function addEngineM(name, ext, cat){if ((typeof window.sidebar == "object") && (typeof window.sidebar.addSearchEngine == "function")) {window.sidebar.addSearchEngine("http://www.mercamania.com/firefox/"+name+".src","http://www.mercamania.com/firefox/"+name+"."+ext,name,cat);} else {alert("Necesitas tener instalado el navegador Firefox para poder bajarte el plugin.");}}
function lg_open(u){l = (document.all ? screen.width : screen.width) * 0.9;h = (document.all ? screen.height : screen.height-100) * 0.9;conf = 'scrollbars=yes,toolbar=yes,location=yes,directories=yes,menubar=yes,resizable=yes,status=yes,width=' + l + ',height=' + h + ',screenX=0,screenY=0,top=0,left=0';open(u,'',conf);}	
/*
function goan(d,ext,s,id_mag,idx,lang,tag,vars) {u = "http://go." + d + "." + ext + "/nav/" + s + ".php?idmag_ann=" + id_mag + "&idx=" + idx + "&lang=" + lang + tag;if (vars) u += "&vars=" + vars;lg_open(u);}
function gopt(d,ext,s,id_mag,idx,idlg,id_rech,org,ms,lang,tag,idbp,vars) {u = "http://go." + d + "." + ext + "/nav/" + s + ".php?M=" + id_mag + "&idx=" + idx + "&idlg=" + idlg +"&ID_RECH=" + id_rech + "&org=" + org + "&MS=" + ms + "&lang=" + lang + tag; if (idbp>0) u += "&idbp=" + idbp;if (vars) u += "&vars=" + vars; lg_open(u);}
function gopn(d,ext,s,id_mag,idx,id_promo,lang,tag,vars) {u = "http://go." + d + "." + ext + "/nav/" + s + ".php?M=" + id_mag + "&P=" + id_promo + "&idx=" + idx + "&lang=" + lang + tag;if (vars) u += "&vars=" + vars;lg_open(u);}
*/
function goan(d,ext,s,id_mag,idx,lang,tag,vars) {lggo_goan(id_mag,idx,lang,tag,vars,"","");}
function gopt(d,ext,s,id_mag,idx,idlg,id_rech,org,ms,lang,tag,idbp,vars) {lggo_gopt(id_mag,idx,idlg,id_rech,org,ms,lang,tag,idbp,vars,"","");}
function gopn(d,ext,s,id_mag,idx,id_promo,lang,tag,vars) {lggo_gopn(id_mag,idx,id_promo,lang,tag,vars,"","");}

function goo(d,ext,u,id) {u = "http://go." + d + "." + ext + "/nav/o.php?u=" + u + "&id=" + id;lg_open(u);}
function l(u) {location.href = u;}
function lien(u) {location.href = u;}
function ph(lib) {  u = "/"; if (lib) { u = u + lib + ".htm";} location.href = u;}
function owp(n,p) { u = "/" + n + ".htm";if (p) u += "?" + p;lg_open(u);}
function merchantaccess(d) { u = "http://" + d;lg_open(u);}
function rp(n,p) { u = "/" + n + ".htm";if (p) u += "?" + p;location.href = u;}	
function owami(p) { u = "/envoyer_ami.htm?pagecourante=" + p;MM_popup(u,"","scrollbars=yes,width=540,height=730");}
function owrem(p) { u = "/remarque.htm?pagecourante=" + p;MM_popup(u,"","scrollbars=auto,width=540,height=720");}
function inforesult() { u = '/popup.php?type=info_resultat'; MM_popup(u,"","scrollbars=yes,width=540,height=730");}
function szl(z,u) {	if(z.options != null) cp = z.options[z.selectedIndex].value; else cp = z;if (cp == "autre") r = "/zone_livraison.htm?redir=" + u;	else	r = "/p.php?CP=" + cp + "&redir=" + u; location.href = r;}
function goswitchlangue(param,cp){	var tmp;	tmp = param.split("|");	u = tmp[0];	site = tmp[1];	u = "http://" + site + "/p.php?CP=" + cp + "&redir=" + u;lg_open(u);}
function langue(d,n){ var u; u = 'htt' + 'p://'; u += d; u += '.'; u += n;lien(u); }
function fiche(name,id) {u = "/a/" + name + "/id_mag/" + id + "/" + name + ".htm";if (u) location.href = u;}
function redimImage(inImg, n) {  objImage = new Image();objImage.src = inImg;t = 70;w = 0;h = 0; if (objImage.width < t && objImage.height < t) { w = objImage.width; h = objImage.height;} else if ( objImage.width > objImage.height ) { w = t; h = objImage.height / (objImage.width / t);} else if ( objImage.width == objImage.height ) { w = t; h = t;} else { h = t; w = objImage.width / (objImage.height / t);}  if (w > 0 && h > 0) { document.images[n].width = w; document.images[n].height = h;} }
function displayImage(inImg, n, u, l){document.write('<IMG style="cursor:pointer" onclick="' + u + ';return(false);" WIDTH="70" HEIGHT="70" onload="redimImage(\'' + inImg + '\', \'' + n + '\')" SRC="' + inImg + '" NAME="' + n + '" BORDER="0" onerror=b("' + n + '","' + l + '") >');}

function s_submit()
{
	var f = document.f;
	var u = '';
	var lang = f.lang.value;
	if (f.id != null && f.id.value > 0 && f.idx != null && f.idx[0].checked && f.idx[0].value > 0 && f.w2 != null && f.mot != null && f.w2.value == f.mot.value)
		u = "/bp/" + f.idx[0].value + "/" + f.id.value + ".htm";
	else if (f.id_mag != null && f.id_mag[0].checked && f.id_mag[0].value > 0 && f.rep1 != null && f.rep2 != null)
	{
		if (f.mot != null && f.mot.value == "")
			u = f.rep1.value + "_" + f.id_mag[0].value + ".htm";
		else
		{
			t = 1;
			o = 1;
			id = 0;
			nav(f.rep2.value,f.idx.value,"",f.mot.value,"0","","",t,f.id_mag[0].value,o,id);
			return;
		}			
	}	
	else if (f.rep != null && f.idx != null && f.idx[0].checked && f.idx[0].value > 0)
	{
		u = "/a/" + f.rep.value;
		u += "/idx/" + f.idx[0].value;
		if (f.mot != null && f.mot.value != "") {
			u += "/mot/" + urlEncode(ucfirst(f.mot.value),lang);
			
			lg_seolog_user_search(f.idx[0].value, f.mot.value);
		}	
		u += "/" + f.rep.value + ".htm";
	}
	else
	{
		if (f.mot != null && f.mot.value != "") {
			var u = "/s";
			u += "/mot/" + urlEncode(ucfirst(f.mot.value),lang);
			
			lg_seolog_user_search(0, f.mot.value);
		}	
	}	
	if (u) document.location.href = u;
}
function nav(s,idx,mark,kw,p,pmin,pmax,t,id_mag,o,id,lang)  {
	var u;
	if (id > 0 && p == 0 && idx > 0)
		u = "/bp/" + idx + "/" + id + ".htm";
	else if (id_mag > 0 && idx > 0 && p == 0 && kw == "" && o == 1 && pmin == "" && pmax == "")
		u = "/" + idx + "_" + id_mag + ".htm";
	else
	{		
		u = "/a/" + s;
		if (idx > 0) u += "/idx/" + idx;
		if (id_mag > 0) u += "/id_mag/" + id_mag;
		
		if (mark && o == 1) u += "/o/1";
		else if (o != 1) u += "/o/" + o;
		
		if (mark != "") u += "/mark/" + urlEncode(ucfirst(mark),lang);
		if (kw != "") 
			u += "/mot/" + urlEncode(ucfirst(kw),lang);
		
		if (p != 0) u += "/debut/" + p;
		if (pmin != 0) u += "/pmin/" + pmin;
		if (pmax != 0) u += "/pmax/" + pmax;
		if (id != 0) u += "/id/" + id;
		u += "/" + s + ".htm";
	}	
	if (u) document.location.href = u;
}
function price(p,idx,id_mag,mot,mark,T,o,s,id) { var u = ""; var pmin = ""; var pmax = ""; chaine = p.options[p.selectedIndex].value; if (chaine) { tmp = chaine.split("-"); pmin = tmp[0]; pmax = tmp[1]; if (pmin > 0) u += "&pmin=" + pmin; if (pmax > 0) u += "&pmax=" + pmax; } nav(s,idx,mark,mot,0,pmin,pmax,T,id_mag,o,id) }
function m_submit() { var m = document.m; var u = ''; var lang = m.lang.value;if (m.mot != null && m.mot.value != "") u += "/m/w/" + urlEncode(ucfirst(m.mot.value),lang); if (u) document.location.href = u; }
function navmar(kw,p,lang)  {	 u = "/m"; if (kw != "") u += "/w/" + urlEncode(ucfirst(kw),lang); if (p > 0) u += "/p/" + p; if (u) document.location.href = u;}

function LG_RIGHT(iti,w,hp) {
	var a = "php";
	var h = 1200; 
	var z = 0;
	var u = "/if/frame_right." + a + "?iti=" + iti + "&w=" + w + "&hp=" + hp;
	document.write("<IF" + "RAME id='iframe' height='" + h + "' SRC='" + u + "' WIDTH='100%' MARGINWIDTH='" + z + "' MARGINHEIGHT='" + z + "' FRAMEBORDER='" + z + "' SCROLLING='no'>");
	document.write("</IF" + "RAME>");
}
function promo(s,idx,p) {
	var u = "/" + s + "_";
	u += idx;
	u += "_";
	u += p;
	u += ".htm";
	if (u) document.location.href = u;	
}
function evt(idx,p) {
	var u = "/evt/" + idx + "_" + p + ".htm";
	if (u) document.location.href = u;	
}

function u_litige(type)
{
	var u = "ht";u += "tp";
	u += ":";u += "//";
	u += "ww";u += "w.leg";
	u += "uide";u += ".com";
	u += "/mediation/presentation.htm";
	if (u) document.location.href = u;	
}
function u_societe(siren)
{
	var u = "http://www.";
	u += "socie";
	u += "te.com/cg"
	u += "i-bin/recherche?rncs=" + siren;
	if (u) document.location.href = u;	
}

function u_finance(lang) {
	
	var u = "http://www.";
	u += "legu" + "ide.com/";
	if (lang == 'fr') {
		u += "wp-finances/fr/la-societe/";
	} else {
		u += "wp-finances/uk/the-company/";
	}
	
	document.write('<a target="_blank"');
	document.write('href=' + u + '>');
	document.write('<div style="background:white;width:116px;height:18px;"><img src="http://img.webmarchand.com/logo_leguide_group.gif" border="0"></div>');
	document.write('</a>');
}

function u_write_merchant(id) {
	var u = "/marchand/form.htm?id_marchand=" + id;
	if (u) document.location.href = u;	
}

function displayOv(zSr,title) {
	if( zSr != null && zSr.length > 0)
	{
		
		document.write('<table cellpadding="0" cellspacing="0" border="0" width="100%">');
		document.write('<tr>');
		document.write('<td style="padding-left:5px;">');
		document.write('<table cellpadding=0 cellspacing=0 border=0 width="100%">');
				
		document.write('<tr><td  style="padding-left:5px;padding-right:5px;" class="txt4"><font color="#FFFFFF"><a href="http://www.overturenbref.fr/index.php?o=2145" target="_new" style="text-decoration: none; color: #ffffff"><i>- ' + title + ' -</i></A></font></td></tr>');
		document.write('<tr><td height=10></td></tr>');
		
		var k;
		for( k=0; (k < zSr.length); k += 4 ) 
		{
			document.write('<tr bgcolor="#BFE3B7"><td style="padding-left:5px;padding-right:5px;" height="17" class=txt4><a onMouseover="window.status=\'\';return true;" href="'+zSr[k+2]+'" style="text-decoration: none; color: #347926">'+zSr[k+0]+'</a></td></tr>');
			document.write('<tr bgcolor="#DDECDA"><td height=7></td></tr><tr bgcolor="#DDECDA"><td style="padding-left:5px;padding-right:5px;" class=txt2><a onMouseover="window.status=\'\';return true;" href="'+zSr[k+2]+'">'+zSr[k+3]+'</a></td></tr><tr bgcolor="#DDECDA"><td height=10></td></tr><tr bgcolor="#DDECDA"><td style="padding-left:5px;padding-right:5px;" class=txt7><font color="#222222">'+zSr[k+1]+'</font></td></tr><tr bgcolor="#DDECDA"><td height=10></td></tr>');
			document.write('<tr><td height=10></td></tr>');
		}
							
		document.write('</table></td></tr></table>');
	}
}
function displayOvFooter(zSr,title) 
{
	if( zSr != null && zSr.length > 0)
	{
		
		document.write('<table style="border-top:solid 1px #888;padding:10px 25px 10px 25px;" cellpadding="0" cellspacing="0" border="0" width="620" bgcolor="#E1E1F4">');
		document.write('<tr><td>');
		document.write('<table cellpadding=0 cellspacing=0 border=0 width="100%">');
				
		document.write('<tr><td><img src="http://img.webmarchand.com/puce.gif" width="7" height="7" alt="" style="vertical-align:middle">&nbsp;&nbsp;<span class="txt2" style="vertical-align:middle"><b><a href="http://www.overturenbref.fr/index.php?o=2145" target="_new" class="cat"><font color="#222222">' + title + '</font></A></b></span></td></tr>');
		
		var k;
		for( k=0; (k < zSr.length); k += 4 ) 
		{
			document.write('<tr><td style="padding-top:5px;" class="txt4"><a target="_blank" onMouseover="window.status=\'\';return true;" href="'+zSr[k+2]+'"><b>'+zSr[k+3]+'</b></a></td></tr>');
			document.write('<tr><td class="txt4"><font color="#222222">'+zSr[k+1]+'</font></td></tr>');
			document.write('<tr><td style="padding-bottom:5px;" class="txt4"><a target="_blank" onMouseover="window.status=\'\';return true;" href="'+zSr[k+2]+'">'+zSr[k+0]+'</a></td></tr>');
		}
							
		document.write('</table></td></tr></table>');
	}
}

function displayOvErr(zSr,title) 
{
	if( zSr != null && zSr.length > 0)
	{
		
		document.write('<table style="padding-left:25px;padding-right:25px" width="100%" border="0" cellpadding="0" cellspacing="0">');
		document.write('<tr bgcolor="#FFFFFF">');
		document.write('<td height="35" class="txt2"><p><img src="img/puce2.gif" width="7" height="7"> &nbsp;<strong>'+title+'</strong><br/></p></td>');
      	document.write('</tr></table>');
      	document.write('<table width="100%" border="0" cellpadding="0" cellspacing="0">');
      	
		var k;
		for( k=0; (k < zSr.length); k += 4 ) 
		{
			document.write('<tr bgcolor="#EEE6D6"><td height="1" bgcolor="#EEE6D6"></td></tr><tr bgcolor="#EEE6D6"><td bgcolor="#FFFFFF" class="txt2"><table width="100%" border="0" cellspacing="0" cellpadding="0">');
		     document.write('<tr><td width="30">&nbsp;</td><td class="txt2"><a target="_blank" onMouseover="window.status=\'\';return true;" href="'+zSr[k+2]+'" ><strong><br/>'+zSr[k+3]+'</strong></a><br/>'+zSr[k+1]+'<br/></td></tr></table></td></tr>');
		  	document.write('<tr bgcolor="#EEE6D6">');
		    	document.write('<td bgcolor="#FFFFFF" class="txt2"><div align="right">');
		     document.write('<table width="100%" border="0" cellspacing="0" cellpadding="0">');
		     document.write('<tr><td width="74%"><div align="right"></div></td>');
	          document.write('<td width="26%" height="20" bgcolor="#EEE6D6" class="txt2"><div align="center"><a target="_blank" onMouseover="window.status=\'\';return true;" href="'+zSr[k+2]+'">&gt; '+zSr[k]+'</a></div></td>');
		     document.write('</tr></table></div></td></tr>');
		}
		document.write('<tr bgcolor="#EEE6D6"><td height="1" bgcolor="#EEE6D6"></td></tr>');
		document.write('</table>');
	}
}


function ask_form() {
	document.write('<div id="txtask" class="txt2">');
	document.write('<form action="/ask.php" method="GET" target="_blank">');
	document.write('<input type="hidden" id="l" name="l" value="dis" />');
	document.write('<input type="hidden" id="o" name="o" value="2036" />');
	document.write('<input type="hidden" id="qsrc" name="qsrc" value="999" />');
	document.write('<input type="hidden" id="qenc" name="qenc" value="ISO-8859-1" />');
	document.write('<label>Rechercher sur Internet : <input type="text" id="q" name="q" /> </label>');
	document.write('<input type="submit" id="submit" name="submit" value="OK" />');
	document.write('</form>');
	document.write('</div>');
	document.write('<div id="imgask">');
	document.write('<a href="http://fr.ask.com/web" title="Powered by Ask.com">');
	document.write('<img src="http://cimg.leguide.com/ask/logo_ask.gif" id="logoask" name="logoask" alt="Logo Ask" />');
	document.write('</a>');
	document.write('</div>');
}
function tag_doubleclick_orange(iti,hp) {
	var u = Math.round(iti / 1000000);
	var tag = '';
	switch (u) {
		case 1: tag = 'hifiphotovideo'; break;
		case 2: tag = 'informatique'; break;
		case 3: tag = 'telephinternet'; break;
		case 4: tag = 'jeuxvideos'; break;
		case 5: tag = 'modeaccessoire'; break;
		case 6: tag = 'voyages'; break;
		case 7: tag = 'livremusiqfilm'; break;
		case 8: tag = 'sportsloisirs'; break;
		case 9: tag = 'cadfleurgastro'; break;
		case 10: tag = 'maisonjardin'; break;
		case 11: tag = 'automoto'; break;
		case 12: tag = 'bebesenfants'; break;
		case 13: tag = 'santebeaute'; break;
		case 14: tag = 'electromenage'; break;
		default: 
			if (hp == 1) {
				tag = 'hp'; 
			} else {
				tag = 'autres'; 
			}	
			break;
	}
	return tag;
}
function LG_MR300x250(iti,hp) {
	document.write('<iframe width="300" height="250" scrolling="No" marginheight="0" marginwidth="0" frameborder="0" SRC="/if/medium-rectangle.php?iti=' + iti + '&hp=' + hp + '"></iframe>');
}

function close_msg(elem) {
	$(elem).slideUp();
}
$(document).ready(function(){
	// last_update
	$(".last_update a.trigger").click( 
		function () { 
			$(".last_update .msg").html('<p>2 fois par jour, Webmarchand.com met à jour les informations envoyées par les sites marchands.</p>');
			$(".last_update .msg").slideDown();
			setTimeout ("close_msg('.last_update .msg')", 4000 ); 
			return false;
			
		}
	);
	$(".gopt").click( function () {
		$(this).parents("table.product").find('td table img').trigger('click');
		return false;});	
})
