HopScore={scores:[],apiKey:"",hash:"",lang:"",isIE6:false,originalApiKey:"",gatObject:null,trackerID:"UA-8044114-2",initializeAfterLoad:function(){HopScore.getScores();if(HopScore.gatObject==null&&typeof(_gat)!="undefined"){HopScore.gatObject=_gat}if(HopScore.gatObject!=null){HopScore.Utils.Trackers.init(HopScore.scores)}HopScore.Resources.setResources(HopScore.lang);HopScore.Utils.ReferenceStyleSheet(HopScore.Resources.hopscoreCSSURL);if(HopScore.scores.length>0){HopScore.retrieveScores()}},initialize:function(){if(/MSIE 6/i.test(navigator.userAgent)){return;HopScore.isIE6=true}HopScore.originalApiKey=HopScore.apiKey;var b=new Array();b[0]=HopScore.apiKey;var a=Math.floor(Math.random()*b.length);HopScore.apiKey=b[a];DomReady.ready(function(){HopScore.initializeAfterLoad()})},getScores:function(){var c=document.body.getElementsByTagName("a");for(var a=0;a<c.length;a++){if(c[a].className=="hopscore_score"||c[a].className=="mini_hopscore_score"){if(!HopScore.isIE6){c[a].rel="hopscore_framelyte";c[a].rev="border: 0; overflow: auto; width: 460px; height: 425px; margin-bottom: 15px"}else{c[a].href="#"}HopScore.scores.push(new Score(c[a]));if(!HopScore.isIE6){if(HopScore.scores[HopScore.scores.length-1].id!=undefined){if(HopScore.scores[HopScore.scores.length-1].id.substring(0,3)=="EAN"){var b=new RegExp("(/"+HopScore.originalApiKey+"/)","g");c[a].href=c[a].href.replace(b,"/"+HopScore.apiKey+"/")}}}}}},retrieveScores:function(){if(HopScore.apiKey!=""&&HopScore.hash!=""){var b="";b+="apikey="+HopScore.apiKey+"&hash="+HopScore.hash+"&";for(var a=0;a<HopScore.scores.length;a++){b+="i[]="+encodeURIComponent(HopScore.scores[a].id);b+="&n[]="+encodeURIComponent(HopScore.scores[a].nom);b+="&c[]="+encodeURIComponent(HopScore.scores[a].company)+"&"}HopScore.API.JSONPRequest("HopScore.retrieveScoresCallback",HopScore.API.rootUrlGetScores,b)}},retrieveScoresCallback:function(hopscore_json){var hopscore_object=eval(hopscore_json);if(hopscore_object!=null&&hopscore_object.length>0){HopScore.Utils.LyteBox.initializeLyteBoxFiles();for(var hopscore_i=0;hopscore_i<hopscore_object.length;hopscore_i++){for(var hopscore_j=0;hopscore_j<HopScore.scores.length;hopscore_j++){if(hopscore_object[hopscore_i].id==HopScore.scores[hopscore_j].id&&!HopScore.scores[hopscore_j].initialized){HopScore.scores[hopscore_j].score_initialize(hopscore_object[hopscore_i].id,hopscore_object[hopscore_i].score==undefined?-1:hopscore_object[hopscore_i].score,hopscore_object[hopscore_i].position,hopscore_object[hopscore_i].saving==undefined?-1:hopscore_object[hopscore_i].saving,hopscore_object[hopscore_i].categoryName==undefined?"None":hopscore_object[hopscore_i].categoryName,hopscore_object[hopscore_i].ref==undefined?"None":hopscore_object[hopscore_i].ref);break}}}}HopScore.raiseInitializationCompleted()},getScoreAvailability:function(b){if(b!=null&&b!=""&&b!=undefined){for(var a=0;a<HopScore.scores.length;a++){if(HopScore.scores[a].id==b&&HopScore.scores[a].score>0){return true}}}return false},raiseInitializationCompleted:function(){if(HopScore.initializationCompleted!=null){HopScore.initializationCompleted()}},initializationCompleted:function(){}};HopScore.Resources={Localized:null,setResources:function(a){switch(a){case"fr":HopScore.Resources.Localized=HopScore.Resources.fr;break;default:HopScore.Resources.Localized=HopScore.Resources.en;break}HopScore.Resources.initResources()},initResources:function(){if(HopScore.apiKey==null||HopScore.apiKey==undefined||HopScore.apiKey==""){HopScore.apiKey="default"}HopScore.Resources.hopscoreClientURL=HopScore.Resources.hopscoreDomainURL+HopScore.Resources.hopscoreStaticURL+HopScore.apiKey+"/";HopScore.Resources.hopscoreClientImagesBaseURL=HopScore.Resources.hopscoreClientURL+HopScore.Resources.hopscoreImagesURL;HopScore.Resources.Localized.hopscoreImagesURL=HopScore.Resources.hopscoreClientImagesBaseURL+HopScore.Resources.Localized.hopscoreLocalizedURL;HopScore.Resources.hopscoreMiniImagesURL=HopScore.Resources.hopscoreClientImagesBaseURL+HopScore.Resources.hopscoreImagesMiniFolder;HopScore.Resources.hopscoreCSSURL=HopScore.Resources.hopscoreClientURL+HopScore.Resources.hopscoreCSSPath+HopScore.Resources.hopscoreCSSFileName;HopScore.Resources.hopscoreLyteBoxCSSURL=HopScore.Resources.hopscoreClientURL+HopScore.Resources.hopscoreCSSPath+HopScore.Resources.hopscoreLyteBoxCSSFileName;HopScore.Resources.hopscoreLyteBoxJSURL=HopScore.Resources.hopscoreDomainURL+HopScore.Resources.hopscoreWidgetURL+HopScore.Resources.hopscoreLyteBoxJSFileName},hopscoreDomainURL:"http://api.hopscore.com/",hopscoreStaticURL:"static/",hopscoreWidgetURL:"static/widget/",hopscoreImagesURL:"widget/images/",hopscoreImagesMiniFolder:"miniwidget/",hopscoreCSSPath:"widget/css/",hopscoreCSSFileName:"hopscore.css",hopscoreLyteBoxCSSFileName:"hopscore.lytebox.css",hopscoreLyteBoxJSFileName:"hopscore.lytebox.js",hopscoreStandardImagesURL:"http://api.hopscore.com/static/default/widget/images/"};HopScore.Resources.en={catchPhrase:"+  Click for more information",propulsePar:"powered by",hopscoreConsoText:"save ",hopscoreConsoUnit:" &euro; <br/>on your bill",hopscoreLocalizedURL:""};HopScore.Resources.fr={catchPhrase:"+ de d&eacute;tails",propulsePar:"propuls&eacute; par",hopscoreConsoText:"&Eacute;conomisez<br/>sur vos factures",hopscoreConsoUnit:" <sup>&euro;</sup>",hopscoreLocalizedURL:"fr/"};function Score(a){this.id="";this.nom="";this.initialized=false;this.company="";this.score=-1;this.position="";this.saving=-1;this.htmlElement=a;this.categoryName="";this.ref="";this.size=-1;this.onmouseoutWatchDog=0;switch(a.className){case"mini_hopscore_score":this.size=1;break;case"hopscore_score":this.size=2;break;default:this.size=-1}for(var b=0;b<a.childNodes.length;b++){switch(a.childNodes[b].className){case"hopscore_id":this.id=a.childNodes[b].innerHTML;break;case"hopscore_name":this.nom=a.childNodes[b].innerHTML;break;case"hopscore_company":this.company=a.childNodes[b].innerHTML;break;default:}}}Score.prototype={score_initialize:function(f,e,a,d,c,b){this.score=e;if(this.score>10){this.score=10}else{if(this.score<1){this.score=1}}this.position=a;this.id=f;this.saving=d;this.categoryName=c;this.ref=b;this.raiseRequested();HopScore.Utils.removeChildrenFromNode(this.htmlElement);switch(this.size){case 1:this.score_instanciate_mini();break;case 2:this.score_instanciate();break;default:}},setOnMiniScoreAction:function(a){return function(){this.style.background="url("+HopScore.Resources.hopscoreMiniImagesURL+"bg_"+a+"_on.gif) Transparent top no-repeat"}},setOffMiniScoreAction:function(a){return function(){this.style.background="url("+HopScore.Resources.hopscoreMiniImagesURL+"bg_"+a+"_off.gif) Transparent top no-repeat"}},score_instanciate_mini:function(){this.htmlElement.style.background="url("+HopScore.Resources.hopscoreMiniImagesURL+"bg_"+Math.round(this.score)+"_off.gif) Transparent top no-repeat";this.htmlElement.onmouseover=this.setOnMiniScoreAction(Math.round(this.score));this.htmlElement.onmouseout=this.setOffMiniScoreAction(Math.round(this.score));this.htmlElement.className="mini_hopscore_score_visible";this.htmlElement.style.display="";this.initialized=true},score_instanciate:function(){var e=document.createElement("div");e.className="hopscore_top";e.style.background="url("+HopScore.Resources.Localized.hopscoreImagesURL+"/top_"+Math.round(this.score)+".gif) Transparent top no-repeat";if(!/MSIE 6/i.test(navigator.userAgent)){var d=document.createElement("p");d.className="hopscore_question";d.innerHTML=HopScore.Resources.Localized.catchPhrase;e.appendChild(d)}this.htmlElement.appendChild(e);if(this.saving>=1){var g=document.createElement("div");g.className="hopscore_module_electric";g.style.background="url("+HopScore.Resources.hopscoreClientImagesBaseURL+"module_electric.gif) no-repeat Transparent";var b=document.createElement("span");b.innerHTML=HopScore.Resources.Localized.hopscoreConsoText;g.appendChild(b);var f=document.createElement("span");f.innerHTML=Math.round(this.saving)+HopScore.Resources.Localized.hopscoreConsoUnit;f.className="hopscore_module_unit";g.appendChild(f);this.htmlElement.appendChild(g)}var a=document.createElement("div");a.className="hopscore_bottom";var c=document.createElement("img");c.className="hopscore_logo";c.src=HopScore.Resources.hopscoreClientImagesBaseURL+"logo_hopscore.gif";a.appendChild(c);var h=document.createElement("span");h.innerHTML=HopScore.Resources.Localized.propulsePar;a.appendChild(h);this.htmlElement.appendChild(a);this.htmlElement.className="hopscore_score_visible";this.htmlElement.style.display="";this.raiseLoaded();this.initialized=true},raiseLoaded:function(){if(this.Loaded!=null){this.Loaded(this)}},raiseRequested:function(){if(this.Requested!=null){this.Requested(this)}},raiseMouseOvered:function(){if(this.MouseOvered!=null){this.MouseOvered(this)}},raiseClicked:function(){if(this.Clicked!=null){this.Clicked(this)}},Loaded:function(){},Requested:function(){},MouseOvered:function(){},Clicked:function(){}};HopScore.API={rootUrlGetScores:"http://api.hopscore.com/scores.jsonp?",hopscore_jsonp_done:false,hopscore_jsonp_script:""};HopScore.API.JSONPRequest=function(b,a,c){HopScore.API.hopscore_jsonp_script=document.createElement("script");HopScore.API.hopscore_jsonp_script.src=a+"callback="+b+"&"+c;HopScore.API.hopscore_jsonp_done=false;HopScore.API.hopscore_jsonp_script.onload=HopScore.API.hopscore_jsonp_script.onreadystatechange=function(){if(!HopScore.API.hopscore_jsonp_done&&(!this.readyState||this.readyState=="loaded"||this.readyState=="complete")){HopScore.API.hopscore_jsonp_done=true;HopScore.API.hopscore_jsonp_script.onload=HopScore.API.hopscore_jsonp_script.onreadystatechange=null;document.getElementsByTagName("head")[0].removeChild(HopScore.API.hopscore_jsonp_script)}};document.getElementsByTagName("head")[0].appendChild(HopScore.API.hopscore_jsonp_script)};HopScore.Utils={removeChildrenFromNode:function(a){if(!a){return false}if(typeof(a)=="string"){a=document.getElementById(a)}while(a.hasChildNodes()){a.removeChild(a.firstChild)}return true},addEvent:function addEvent(c,b,d){if(c.addEventListener){c.addEventListener(b,d,true);return true}else{if(c.attachEvent){var a=c.attachEvent("on"+b,d);return a}else{return false}}return true},ReferenceStyleSheet:function(a){var b=document.createElement("link");b.rel="stylesheet";b.href=a;b.type="text/css";document.getElementsByTagName("head").item(0).appendChild(b);b=null},ReferenceScriptFile:function(b){var a=document.createElement("script");a.type="text/javascript";a.language="javascript";a.src=b;document.getElementsByTagName("head").item(0).appendChild(a);a=null}};HopScore.Utils.Trackers={};HopScore.Utils.Trackers.init=function(a){HopScore.Utils.Trackers.GA.init(a)};HopScore.Utils.Trackers.GA={tracker:null};HopScore.Utils.Trackers.GA.init=function(b){if(HopScore.gatObject!=null){HopScore.Utils.Trackers.GA.tracker=HopScore.gatObject._getTracker(HopScore.trackerID);HopScore.Utils.Trackers.GA.tracker._initData();HopScore.Utils.Trackers.GA.tracker._trackPageview();for(var a=0;a<b.length;a++){HopScore.Utils.Trackers.GA.setTrackersOnHopScoreElement(b[a])}}};HopScore.Utils.Trackers.GA.setTrackersOnHopScoreElement=function(a){a.htmlElement.onmousedown=function(b){a.raiseClicked()};a.htmlElement.onmouseover=function(b){a.raiseMouseOvered()};a.Clicked=function(b){HopScore.Utils.Trackers.GA.Clicked(b)};a.MouseOvered=function(b){HopScore.Utils.Trackers.GA.MouseOvered(b)};a.Requested=function(b){HopScore.Utils.Trackers.GA.Requested(b)};a.Loaded=function(b){HopScore.Utils.Trackers.GA.Loaded(b)};if(a.htmlElement.captureEvents){a.htmlElement.captureEvents(Event.MOUSEDOWN);a.htmlElement.captureEvents(Event.MOUSEOVER)}};HopScore.Utils.Trackers.GA.trackEvent=function(a,b){if(HopScore.Utils.Trackers.GA.tracker!=null){HopScore.Utils.Trackers.GA.tracker._trackEvent(a.categoryName,"Widget - "+b,a.ref,Math.round(a.score))}};HopScore.Utils.Trackers.GA.Loaded=function(a){HopScore.Utils.Trackers.GA.trackEvent(a,"Loaded");return false};HopScore.Utils.Trackers.GA.Requested=function(a){HopScore.Utils.Trackers.GA.trackEvent(a,"Requested");return false};HopScore.Utils.Trackers.GA.MouseOvered=function(a){HopScore.Utils.Trackers.GA.trackEvent(a,"MouseOver");return false};HopScore.Utils.Trackers.GA.Clicked=function(a){HopScore.Utils.Trackers.GA.trackEvent(a,"Click");HopScore.LyteBox.hopscoreLytebox.start(a.htmlElement,false,true);return false};HopScore.Utils.LyteBox={initializeLyteBoxFiles:function(){HopScore.Utils.ReferenceStyleSheet(HopScore.Resources.hopscoreLyteBoxCSSURL);HopScore.Utils.ReferenceScriptFile(HopScore.Resources.hopscoreLyteBoxJSURL)}};(function(){var i=window.DomReady={};var h=navigator.userAgent.toLowerCase();var c={version:(h.match(/.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/)||[])[1],safari:/webkit/.test(h),opera:/opera/.test(h),msie:(/msie/.test(h))&&(!/opera/.test(h)),mozilla:(/mozilla/.test(h))&&(!/(compatible|webkit)/.test(h))};var d=false;var e=false;var g=[];function a(){if(!e){e=true;if(g){for(var j=0;j<g.length;j++){g[j].call(window,[])}g=[]}}}function f(j){var k=window.onload;if(typeof window.onload!="function"){window.onload=j}else{window.onload=function(){if(k){k()}j()}}}function b(){if(d){return}d=true;if(document.addEventListener&&!c.opera){document.addEventListener("DOMContentLoaded",a,false)}if(c.msie&&window==top){(function(){if(e){return}try{document.documentElement.doScroll("left")}catch(k){setTimeout(arguments.callee,0);return}a()})()}if(c.opera){document.addEventListener("DOMContentLoaded",function(){if(e){return}for(var k=0;k<document.styleSheets.length;k++){if(document.styleSheets[k].disabled){setTimeout(arguments.callee,0);return}}a()},false)}if(c.safari){var j;(function(){if(e){return}if(document.readyState!="loaded"&&document.readyState!="complete"){setTimeout(arguments.callee,0);return}if(j===undefined){var k=document.getElementsByTagName("link");for(var l=0;l<k.length;l++){if(k[l].getAttribute("rel")=="stylesheet"){j++}}var m=document.getElementsByTagName("style");j+=m.length}if(document.styleSheets.length!=j){setTimeout(arguments.callee,0);return}a()})()}f(a)}i.ready=function(k,j){b();if(e){k.call(window,[])}else{g.push(function(){return k.call(window,[])})}};b()})();