
function x(o,iId)
{var link="";$A(b[iId]).each(function(o){if(o.constructor===Number&&Math.round(o,0)===o)
{link+=aLib[o];}
else
{link+=o;}})
o.href=link;}
function save_alerts()
{var x=document.forms['products'];var n=x.elements.length;var is_set=false;for(var i=0;i<n;i++)
{if(x.elements[i].checked)is_set=true;}
if(is_set)document.forms['products'].submit();else alert(NOT_CHECKED_ALERT);}
function check_search(defaulttext){if(document.getElementById('search_bar_input').value.length<2){alert(MINSEARCHTEXT);return false;}else{if(document.getElementById('search_bar_input').value==defaulttext){return false;}else{if(document.getElementById('search_bar_input').value){document.getElementById('reach_form').submit()}else{return false;}}}}
function check_search_light(defaulttext){if(document.getElementById('search_bar_input').value.length<2){return false;}}
function clickclear(thisfield,defaulttext){if(thisfield.value==defaulttext){thisfield.value="";}}
function clickrecall(thisfield,defaulttext){if(thisfield.value==""){thisfield.value=defaulttext;}}
function tws(x)
{var l='';for(i=0;i<arguments.length;i++){l=l+arguments[i];}
if(l.charAt(0)=='#')l=l.substring(1,l.length);window.status=l;}
function twt(m)
{var l='';for(i=0;i<arguments.length;i++){l=l+arguments[i];}
document.write(l);}
function twl(m)
{var l='';for(i=1;i<arguments.length;i++){l=l+arguments[i];}
if(l.charAt(0)=='#')l=l.substring(1,l.length);if(m==0)window.location.href=l;else
{if(m==2)
{var iUID=new Date().getTime();l=l+"&uid="+iUID;}
win=window.open(l,'_new'+(new Date()*1));if(win!=null&&win!='null'&&win!='undefined')win.focus();}}
function _twl(x)
{var l='';for(i=1;i<arguments.length;i++){l=l+arguments[i];}
if(l.charAt(0)=='#')l=l.substring(1,l.length);return l;}
function f(o)
{var re=/twl(\(.*\))/;var m=re.exec(o.onclick.toString());if(m&&m[1])
{var s=eval("_twl"+m[1]);o.href=s;}}
function goHome()
{l="/";window.location.href=l;}
function log_ysm(host,url)
{pageTracker._trackPageview('/asclick/'+host);window.open(url,'_blank');}
function switchDiv(id)
{var c='filter';var x=document.getElementsByTagName("div");c+='_sub_div';for(var i=0;i<x.length;i++){var div=x[i];if(div.id==id){if(div.className==c)div.className="";else if(div.className=="")div.className=c;}}}
function hideShow(id)
{var mainlayer=document.getElementById(id+"Main");var txt=document.getElementById(id+"Switch");var fullbox=document.getElementById("FullBox");var filterbox=document.getElementById("FilterBox");var n='no';switchDiv(id+"SubMain");switchDiv(id+"Sub");n+='ne';if(fullbox.className=="fullbox"){filterbox.style.display=n;txt.innerHTML="&lt;&lt; "+BACK_LINK+"</b>";fullbox.innerHTML=mainlayer.innerHTML;fullbox.className="";}
else
{fullbox.innerHTML="";fullbox.className="fullbox";txt=document.getElementById(id+"Switch");txt.innerHTML="&gt;&gt; "+MORE_LINK;filterbox.style.display="";}
return false;}
function welcome(lang_id)
{if(lang_id==2)
{Dialog.alert({url:"/pp/welcome/fr.html",options:{method:'get'}},{windowParameters:{className:"alphacube",width:650},okLabel:"Voir les offres"});}}
function adultBox(title,typeback)
{var param;if(typeback=="ok")
{param="typeback=1"}
else
{param="";}
startTwengaPopup(title,'/pp/win_adult.php',param,'527',false,true);YAHOO.util.Event.onAvailable('adult_script',function(){eval($('adult_script').innerHTML);},this);}
function trim(value){var temp=value;var obj=/^(\s*)([\W\w]*)(\b\s*$)/;if(obj.test(temp)){temp=temp.replace(obj,'$2');}
var obj=/  /g;while(temp.match(obj)){temp=temp.replace(obj," ");}
return temp;}
function openPopupFbMs(url,name,height,width,opt_show_scrollbars)
{if(url.indexOf("facebook"))
YAHOO.TWENGA.track('/share/facebook');else
YAHOO.TWENGA.track('/share/myspace');var scrollbar_param=opt_show_scrollbars?",scrollbars=1":"";var newwindow=window.open(url,name,'height='+height+',width='+width+scrollbar_param);if(newwindow&&!newwindow.opener){newwindow.opener=window;}
if(window.focus){newwindow.focus()}
return false;}
YAHOO.namespace("TWENGA");Effect.QueueThis=Class.create();Object.extend(Object.extend(Effect.QueueThis.prototype,Effect.Base.prototype),{initialize:function(element){this.element=$(element);this.func=arguments[1];this.start(arguments[2]);},finish:function(position){this.func(this.element);}});if($("key_word_seach")&&$("key_word_seach").value!=""){YAHOO.util.Event.onAvailable('key_word_seach',function(){$('key_word_seach').focus();},this);}else{YAHOO.util.Event.onAvailable('search_bar_input',function(){$('search_bar_input').focus();},this);}
YAHOO.util.Event.addListener(window,"load",function(){});YAHOO.TWENGA.emailFriend=function(iId,sType,iSiteid)
{var oForm=document.createElement("FORM");oForm.style.display="none";if(sType=="rb"){oForm.action="/email-friend.php?continue="+escape(top.location);oForm.target="_top";}else{oForm.action="/email-friend.php?continue="+escape(document.location.href);}
oForm.method="POST";var oInput=document.createElement("INPUT");oInput.type="text";oInput.name="checked_products[0][type]";oInput.value=sType;oForm.appendChild(oInput);var oInput=document.createElement("INPUT");oInput.type="text";oInput.name="checked_products[0][id]";oInput.value=iId;oForm.appendChild(oInput);var oInput=document.createElement("INPUT");oInput.type="text";oInput.name="checked_products[0][site_id]";oInput.value=iSiteid;oForm.appendChild(oInput);document.body.appendChild(oForm);setTimeout(function(){oForm.submit();},100);return true;}
YAHOO.TWENGA.addPriceAlert=function(cType,iId,iSiteid)
{var oForm=document.createElement("FORM");oForm.action="/account.php?type="+cType+"&id="+iId+"&site_id="+iSiteid+"&a=1&continue="+escape(document.location.href);oForm.method="POST";oForm.style.display="none";var oInput=document.createElement("INPUT");oInput.type="text";oInput.name="checked_products[]";oInput.value=cType+"_"+iId+"_"+iSiteid;oForm.appendChild(oInput);document.body.appendChild(oForm);setTimeout(function(){oForm.submit();},100);return true;}
trace=function(sMessage,id)
{if(!id)id=1;if(!$('debug'))
{var oDiv=document.createElement("DIV");oDiv.id="debug";oDiv.style.position="absolute";oDiv.style.left="0px";oDiv.style.top="0px";document.body.parentNode.insertBefore(oDiv,document.body);}
if(!$('debug_'+id))
{var oDiv=document.createElement("DIV");oDiv.id="debug_"+id;oDiv.style.backgroundColor="#000";oDiv.style.cssFloat="left";oDiv.style.float="left";oDiv.style.color="#fff";oDiv.style.width="400px";oDiv.style.height="200px";oDiv.style.overflow="auto";oDiv.observe("click",function(){this.innerHTML="";}.bind(oDiv));document.body.parentNode.insertBefore(oDiv,document.body);$('debug').appendChild(oDiv);}
var oDiv=document.createElement("DIV");oDiv.innerHTML="["+$('debug_'+id).childNodes.length+"] "+sMessage;$('debug_'+id).insertBefore(oDiv,$('debug_'+id).childNodes[0]);}
YAHOO.TWENGA.swapTwengaBarItem=function(id)
{YAHOO.TWENGA.tmpTwengaBarItem=id;if(!onDemand("/js2/item_bottom.js","YAHOO.nsItemBottom",function()
{$('item_bar').style.display="block";YAHOO.nsItemBottom.registerEvent(0,YAHOO.TWENGA.removeTwengaBarItem);YAHOO.nsItemBottom.load();YAHOO.TWENGA._swapTwengaBarItem(YAHOO.TWENGA.tmpTwengaBarItem);}))YAHOO.TWENGA._swapTwengaBarItem(YAHOO.TWENGA.tmpTwengaBarItem);}
YAHOO.TWENGA._swapTwengaBarItem=function(id)
{if($(id).hasClassName("icon_save_on"))
{YAHOO.nsItemBottom.removeItem(id);}
else
{if(YAHOO.nsItemBottom.addItem(id))
{$(id).innerHTML=REMOVE_FROM_COMPARE;$(id).removeClassName("icon_save");$(id).addClassName("icon_save_on");}}}
YAHOO.TWENGA.removeTwengaBarItem=function(id)
{$(id).innerHTML=ADD_TO_COMPARE;$(id).removeClassName("icon_save_on");$(id).addClassName("icon_save");}
YAHOO.TWENGA.track=function(Event)
{if(pageTracker)
pageTracker._trackPageview(Event);return true;}
YAHOO.namespace('menuTop');YAHOO.menuTop.init=function()
{$("right_menu_bar_1").cleanWhitespace();$A($("right_menu").getElementsByTagName("A")).each(function(o){var o=$(o);if(o.className=="first")return;if(o.hasClassName("selected"))
{var aPos=Position.positionedOffset(o.previousSibling);var aPos2=Position.positionedOffset(o);if(aPos[1]==aPos2[1])
o.previousSibling.style.backgroundImage="url(http://s0.twenga.com/img/"+YAHOO.theme.id+"/right_menu/right_menu_bar_a_left.gif)";o.style.backgroundImage="url(http://s1.twenga.com/img/"+YAHOO.theme.id+"/right_menu/right_menu_bar_a_right.gif)";}
Event.observe(o,"mouseover",function(){if(this.previousSibling&&this.previousSibling.hasClassName("selected"))
{var aPos=Position.positionedOffset(this.previousSibling);var aPos2=Position.positionedOffset(this);if(aPos[1]==aPos2[1])
this.previousSibling.style.backgroundImage="url(http://s0.twenga.com/img/"+YAHOO.theme.id+"/right_menu/right_menu_bar_a_join.gif)";this.style.backgroundImage="url(http://s1.twenga.com/img/"+YAHOO.theme.id+"/right_menu/right_menu_bar_a_right.gif)";}
else if(this.nextSibling&&this.nextSibling.hasClassName("selected"))
{this.previousSibling.style.backgroundImage="url(http://s0.twenga.com/img/"+YAHOO.theme.id+"/right_menu/right_menu_bar_a_left.gif)";this.style.backgroundImage="url(http://s0.twenga.com/img/"+YAHOO.theme.id+"/right_menu/right_menu_bar_a_join.gif)";}
else if(!this.hasClassName("selected"))
{var aPos=Position.positionedOffset(this.previousSibling);var aPos2=Position.positionedOffset(this);if(aPos[1]==aPos2[1])
this.previousSibling.style.backgroundImage="url(http://s0.twenga.com/img/"+YAHOO.theme.id+"/right_menu/right_menu_bar_a_left.gif)";this.style.backgroundImage="url(http://s1.twenga.com/img/"+YAHOO.theme.id+"/right_menu/right_menu_bar_a_right.gif)";}}.bind(o),false);Event.observe(o,"mouseout",function(){if(this.previousSibling&&this.previousSibling.hasClassName("selected"))
{this.previousSibling.style.backgroundImage="url(http://s1.twenga.com/img/"+YAHOO.theme.id+"/right_menu/right_menu_bar_a_right.gif)";this.style.backgroundImage="url(http://s0.twenga.com/img/"+YAHOO.theme.id+"/right_menu/right_menu_bar_a_right_empty.gif)";}
else if(this.nextSibling&&this.nextSibling.hasClassName("selected"))
{var aPos=Position.positionedOffset(this.nextSibling);var aPos2=Position.positionedOffset(this);if(aPos[1]==aPos2[1])
this.style.backgroundImage="url(http://s0.twenga.com/img/"+YAHOO.theme.id+"/right_menu/right_menu_bar_a_left.gif)";else
this.style.backgroundImage="url(http://s0.twenga.com/img/"+YAHOO.theme.id+"/right_menu/right_menu_bar_a_right_empty.gif)";this.previousSibling.style.backgroundImage="url(http://s0.twenga.com/img/"+YAHOO.theme.id+"/right_menu/right_menu_bar_a_right_empty.gif)";}
else if(!this.hasClassName("selected"))
{this.previousSibling.style.backgroundImage="url(http://s0.twenga.com/img/"+YAHOO.theme.id+"/right_menu/right_menu_bar_a_right_empty.gif)";this.style.backgroundImage="url(http://s0.twenga.com/img/"+YAHOO.theme.id+"/right_menu/right_menu_bar_a_right_empty.gif)";}}.bind(o),false);})}