function _$$(id){return document.getElementById(id);}
function _$$$(id){return top.document.getElementById(id);}
function getElementsByClassName(noeud,className){var elements=noeud.getElementsByTagName('*');var elClass=[];for(var i=0;i<elements.length;i++){if(elements[i].className==className){elClass.push(elements[i]);}}
return elClass;}
function softScrollTo(x,y){nextScrollToy=-1;nextScrollTox=-1;nbScrollPareil=0;oldScrollTox=0;oldScrollToy=0;gotoScrollx=x;gotoScrolly=y;softScrollUpdate();}
function get_body_scroll_position_y(){if(navigator.appName=="Microsoft Internet Explorer"){if(document.compatMode=="CSS1Compat"){return document.body.parentNode.scrollTop;}else if(navigator.appName=="Microsoft Internet Explorer"){return document.body.scrollTop;}}else{return window.pageYOffset;}}
function get_body_scroll_position_x(){if(navigator.appName=="Microsoft Internet Explorer"){if(document.compatMode=="CSS1Compat"){return document.body.parentNode.scrollLeft;}else if(navigator.appName=="Microsoft Internet Explorer"){return document.body.scrollLeft;}}else{return window.pageXOffset;}}
function softScrollUpdate(){var scdisty=get_body_scroll_position_y();var scdistx=get_body_scroll_position_x();if(nextScrollToy!=-1){if((scdisty!=nextScrollToy)||(scdistx!=nextScrollTox)){oldScrollToy=scdisty;oldScrollTox=scdistx;nbScrollPareil=4;}}
if((oldScrollTox==scdistx)&&(oldScrollToy==scdisty)){nbScrollPareil=nbScrollPareil+1;}else{nbScrollPareil=0;}
oldScrollToy=scdisty;oldScrollTox=scdistx;if(nbScrollPareil>=2){}else{var x=Math.round(scdistx+(gotoScrollx-scdistx)/4);var y=Math.round(scdisty+(gotoScrolly-scdisty)/4);if((Math.abs(gotoScrolly-y)<2)&&(Math.abs(gotoScrollx-x)<2)){nextScrollToy=-1;nextScrollTox=-1;scrollTo(gotoScrollx,gotoScrolly);}else{nextScrollToy=y;nextScrollTox=x;scrollTo(x,y);setTimeout("softScrollUpdate()",20);}}}
function popupShopzillaCertif(){win=window.open('http://www.shopzilla.fr/10C_-_content--customer_certified','customer_certified_popup','width=420,height=501','toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=yes,resizable=yes,dependent=yes');win.focus();}
function popupBizrateCertif(){win=window.open('http://fr.bizrate.com/content/popup__content--customer_certified.html','customer_certified_popup','width=420,height=501','toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=yes,resizable=yes,dependent=yes');win.focus();}
function popupFianet(){win=window.open('http://www.fia-net.com/annuaire/2605/centrale-d-achat-ubaldi.html','certificat');win.focus();}
function popupKelkoo(){win=window.open('http://hifiphotovideo.kelkoo.fr/ctl/do/maxiMerchantReviews~6022223?sortedby=m','certificat');win.focus();}
function popupPaypal(){win=window.open('https://www.paypal.com/fr/cgi-bin/webscr?cmd=xpt/Marketing/popup/OLCWhatIsPayPal-outside','olcwhatispaypal','toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=yes, width=400, height=350');win.focus();}
function popupAurore(){win=window.open('http://www.carte-de-credit.com/carteAuroreCetelem.php','aurore');win.focus();}
function open_popup(url,width,height){jQuery("#popupLoader").show();jQuery("#overlayPopupContent").addClass("oldpopup");jQuery("#overlayPopup").addClass("oldpopup");var contenu="<iframe id='popupiframe' frameborder='0' src='"+url+"' class='popupoverlayiframe'>loading</iframe>";if(typeof(width)!='undefined'&&typeof(height)!='undefined'){UbaldiOverlay.openWithContent(contenu,width,height);}else{UbaldiOverlay.openWithContent(contenu);}
jQuery("#overlayPopup").unbind("click").click(function(){UbaldiOverlay.close();});}
function popupShopzilla(){win=window.open('http://www.shopzilla.fr/6B_-_mid--131714','certificat');win.focus();}
function popupCiao(){win=window.open('http://www.ciao.fr/Avis/Ubaldi_com__894129','certificat');win.focus();}
function popupBizrate(){win=window.open('http://fr.bizrate.com/ratings_guide/cust_reviews__mid--131714.html','certificat');win.focus();}
function popupIcomparateur(){win=window.open('http://www.i-comparateur.com/avis/commentaires-marchand-315.htm','certificat');win.focus();}
function popupLeguide(){win=window.open('http://www.leguide.com/marchand_28009025.htm','certificat');win.focus();}
function popupShopping(){win=window.open('http://www1.fr.shopping.com/xMR-ubaldi+com~MRD-410175~S-1');win.focus();}
function popupPrixmoinscher(){win=window.open('http://www.prixmoinscher.com/');win.focus();}
function is_email_valide(email){var arobase=email.indexOf("@")
var point=email.lastIndexOf(".")
if((arobase<3)||(point+2>email.length)||(point<arobase+3))
return false
return true}
function form_trouve_elem_par_nom(form,nom_elem){}
function ajax_remplace_action(id_formulaire,session){if(session==undefined){session="";}
if(html_elem=trouve_formulaire(id_formulaire)){html_elem.ajax.value="ajax";html_elem.action=CSite.getUrl("actions_ajax.php")+session
html_elem.target="ajax_frame";}}
function getCookieVal(offset){var endstr=document.cookie.indexOf(";",offset);if(endstr==-1)
endstr=document.cookie.length;return unescape(document.cookie.substring(offset,endstr));}
function LireCookie(nom){var arg=nom+"=";var alen=arg.length;var clen=document.cookie.length;var i=0;while(i<clen){var j=i+alen;if(document.cookie.substring(i,j)==arg)
return getCookieVal(j);i=document.cookie.indexOf(" ",i)+1;if(i==0)
break;}
return null;}
function openAvis(pageAvis)
{var largeur=700;var hauteur=600;var haut=(screen.height-hauteur)/2;var gauche=(screen.width-largeur)/2;window.open(pageAvis,'Avis',"top="+haut+",left="+gauche+",width="+largeur+",height="+hauteur+",menubar=no,scrollbars=yes,statusbar=no");}
function ajax_set_div(nodeName,texte){jQuery("#"+nodeName).html(texte);}
function vide_div(div_name){jQuery("#"+div_name).html("<div style='float:left'></div>");}
function hide_div(div_name){jQuery("#"+div_name).hide();}
function createXHR(){var request=false;try{request=new ActiveXObject('Msxml2.XMLHTTP');}catch(err2){try{request=new ActiveXObject('Microsoft.XMLHTTP');}catch(err3){try{request=new XMLHttpRequest();}catch(err1){request=false;}}}
return request;}
function inscriptionNewsLetter(email){if(!is_email_valide(email)){alert("Veuillez saisir un email valide.");return;}
var xhr=createXHR();xhr.onreadystatechange=function(){if(xhr.readyState==4){if(xhr.status==200)
if(xhr.responseText=="ok"){alert("Vous avez été inscrit à notre newsletter");document.getElementsByName('newsletter')[0].email.value='Votre email';}else{alert("Erreur à l'incsription\n"+xhr.responseText);}
else
alert("Error code "+xhr.status);}};xhr.open("POST","/inscription_newsletter.php",true);xhr.setRequestHeader("Content-Type","application/x-www-form-urlencoded");xhr.send("email="+email);}
function trouve_formulaire(id){var forms=document.forms;for(var i=0;i<forms.length;i++){if(forms[i].id==id){return forms[i];}}
for(var i=0;i<forms.length;i++){if(forms[i].name==id){return forms[i];}}
return false;}
function valide_form(form){var form2=trouve_formulaire(form);if(form2)form2.submit();}
function detectTrackingCode(idCode){return getTrackingCode(idCode).split(" ").join("-");}
function getTrackingCode(idCode){var tab=idCode.split("?");var tto=tab.shift();return tto+"."+"p"+"hp"+(tab.length>0?"?"+tab.join("?"):'');}
function getXTrackingCode(idCode){var tab=idCode.split("?");var tto=tab.shift();return tto.split(" ").join("-")+"."+"ph"+"p"+(tab.length>0?"?"+tab.join("?"):'');}
function trackDeCode(data){var b64="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";var o1,o2,o3,h1,h2,h3,h4,bits,i=0,enc='';do{h1=b64.indexOf(data.charAt(i++));h2=b64.indexOf(data.charAt(i++));h3=b64.indexOf(data.charAt(i++));h4=b64.indexOf(data.charAt(i++));bits=h1<<18|h2<<12|h3<<6|h4;o1=bits>>16&0xff;o2=bits>>8&0xff;o3=bits&0xff;if(h3==64)enc+=String.fromCharCode(o1);else if(h4==64)enc+=String.fromCharCode(o1,o2);else enc+=String.fromCharCode(o1,o2,o3);}while(i<data.length);return(enc);}
jQuery(document).ready(function(){jQuery('.tracking').css('display','inline').click(function(){document.location=detectTrackingCode(trackDeCode(jQuery(this).attr('hdef')));});jQuery('.xtracking').css('display','inline').click(function(){document.location=getXTrackingCode(trackDeCode(jQuery(this).attr('hdef')));});});
