/* (c) 2010 Swelen Medusa Tracker v0.7.6 */
(function(){var c,l=window,m=document,j=!!m.getElementsByClassName,k=[];function n(a){a.each=function(b){for(i=0;i<a.length;i++){b.apply(a[i],[])}return a};a.show=function(){return a.each(function(){this.style.display="block"})};a.hide=function(){return a.each(function(){this.style.display="none"})};a.click=function(b){return a.each(function(){c.attach(this,"click",b)})};a.toggle=function(b,d){fn=function(){if(!c.togs[a]){c.togs[a]=true;b.apply(this,[])}else{if(c.togs[a]===true){c.togs[a]=false;d.apply(this,[])}}};return a.each(function(){c.attach(this,"click",fn)})};a.hover=function(b,d){return a.each(function(){c.attach(this,"mouseover",b);if(d){c.attach(this,"mouseout",d)}})};a.on=function(d,b){return a.each(function(){c.attach(this,d,b)})};return a}l.$w=$w=function(d,b,f){var a=typeof d;if(a==="function"){return c.attach(window,"load",d)}else{if(a==="string"){return n(c(d,b,f))}else{if(a==="object"){return n(d)}}}};c=l._=function(t,d,h){if(k[t]&&!h&&!d){return k[t]}d=d||m;var a=function(o){return d.getElementsByTagName(o)};var g=[],b=0;switch(t.charAt(0)){case"#":b=t.slice(1);g=m.getElementById(b);if(m.all&&g.id!==b){g=m.all[b]}g=g?[g]:[];break;case".":var f=t.slice(1);if(j){g=(b=(g=d.getElementsByClassName(f)).length)?g:[]}else{f=" "+f+" ";var v=a("*"),s=0,u;while(u=v[s++]){if((" "+u.className+" ").indexOf(f)!=-1){g[b++]=u}}g=b?g:[]}break;default:g=(b=(g=a(t)).length)?g:[];break}return(h||!!d)?g:k[t]=g};c.togs=[];c.attach=function(a,f,b){var g,d=function(h){c.bind(h,this,b)};if(a.addEventListener){a.addEventListener(f,d,false)}else{if(a.attachEvent){a._cb=function(h){c.bind(h,event.srcElement,b)};a.attachEvent("on"+f,a._cb)}else{if(typeof a["on"+f]=="function"){g=a["on"+f];a["on"+f]=function(){c.bind(e,a,b);g()}}else{a["on"+f]=d}}}return a};c.bind=function(h,a,d){var h=h?h:window.event,g=h.charCode||false,b=h.keyCode||false,f=h.which||false;d.apply(a,[{e:h,key:g?g:(b?b:(f?f:0))}])}})();(function(){var a=this._$welen=window._$welen||{}})();(function(){var win=window,doc=document;_$welen.tracker={json:{},cookie:"",host:win.location.hostname};_$welen.plugins={suggest:{delayed:false,launched:false}};_$welen.cookie={value:"",set:function(name,value,expires,path,domain,secure){var today=new Date(),e=(expires)?expires*1000*60*60*24:"";today.setTime(today.getTime());var expires_date=new Date(today.getTime()+(e));doc.cookie=name+"="+escape(value)+((expires)?";expires="+expires_date.toGMTString():"")+((path)?";path="+path:"")+((domain)?";domain="+domain:"")+((secure)?";secure":"")},get:function(check_name){var a_all_cookies=doc.cookie.split(";"),a_temp_cookie="",cookie_name="",cookie_value="",b_cookie_found=false;for(i=0;i<a_all_cookies.length;i++){a_temp_cookie=a_all_cookies[i].split("=");cookie_name=a_temp_cookie[0].replace(/^\s+|\s+$/g,"");if(cookie_name==check_name){b_cookie_found=true;if(a_temp_cookie.length>1){cookie_value=unescape(a_temp_cookie[1].replace(/^\s+|\s+$/g,""))}return cookie_value}a_temp_cookie=null;cookie_name=""}if(!b_cookie_found){return null}}};_$welen.panic={callback:function(ServerResponse){this.json=_$welen.json.decode(ServerResponse);if(this.json.http){}}};_$welen.json={decode:function(text){return !(/[^,:{}\[\]0-9.\-+Eaeflnr-u \n\r\t]/.test(text.replace(/"(\\.|[^"\\])*"/g,"")))&&eval("("+text+")")}};_$welen.api={url:"",lastInserted:false,build:function(u,params){var q="";for(var i in params){q+="&"+i+"="+params[i]}this.url=u+q},request:function(keep){if(this.lastInserted!==false&&keep!==true){$w("head")[0].removeChild(this.lastInserted)}this.lastInserted=this.get(this.url)},get:function(url){var s=doc.createElement("script"),h=$w("head")[0];s.setAttribute("charset","UTF-8");s.setAttribute("type","text/javascript");s.setAttribute("src",url);h.appendChild(s);return s}};this.GetMedusaTracker=function(stck){var a,pm;this.multiple=false;this.ds_code="";this.id_user=0;this.id_site=0;this.page_top_url="";this.page_inv_url="";this.page_ref_url="";this.page_lastmod="";this.vSW=0;this.vSH=0;this.vSAW=0;this.vSAH=0;this.vSCD=0;this.vTZ="";this.vHL="";this.vJE="";this.vNPL="";this.vNML="";this.vCOO=0;this.GetInstance=function(){if(win.swelen_medusa){win.swelen_medusa+=1}else{win.swelen_medusa=1}return win.swelen_medusa};this.GetBrowserDetails=function(){var dat=new Date(),scr=win.screen,nav=navigator;if(scr){this.vSW=scr.width;this.vSH=scr.height;this.vSAW=scr.availWidth;this.vSAH=scr.availHeight;this.vSCD=scr.colorDepth}this.vTZ=-dat.getTimezoneOffset();this.vHL=history.length;if(nav.javaEnabled()){this.vJE=nav.javaEnabled()}if(nav.plugins){this.vNPL=nav.plugins.length}if(nav.mimeTypes){this.vNML=nav.mimeTypes.length}if(nav.cookieEnabled){this.vCOO=1}};this.GetPageLocation=function(){if(win.top.location==doc.location){this.page_top_url=doc.location;this.page_inv_url=doc.location}else{this.page_top_url=win.top.location;this.page_inv_url=doc.location}this.page_lastmod=Date.parse(doc.lastModified)/1000;this.page_ref_url=doc.referrer};if(this.GetInstance()!=1){this.multiple=true;return false}a=stck.split("-");this.ds_code=a[0];this.id_user=a[1];this.id_site=a[2];this.GetBrowserDetails();this.GetPageLocation();pm=new PluriMetrics(this);if(_$welen.cookie.get("_medusa")){_$welen.cookie.value=_$welen.cookie.get("_medusa")}else{_$welen.cookie.value="";_$welen.cookie.set("_medusa_first_visit","yes",365,"/",_$welen.tracker.host,"")}pm.cook=_$welen.cookie.value;return pm};win.SwelenMedusa_callBack=function(serverResponse){_$welen.tracker.json=_$welen.json.decode(serverResponse);var t=_$welen.tracker.json;if(t.cook!=_$welen.cookie.value){_$welen.cookie.set("_medusa",escape(t.cook),365,"/",_$welen.tracker.host,"")}if(t.nb_visits>1){_$welen.cookie.set("_medusa_first_visit","no",365,"/",_$welen.tracker.host,"")}if(t.plug_suggest==1){if(_$welen.suggest){_$welen.suggest.launch()}else{_$welen.plugins.suggest.delayed=true;_$welen.api.get("http://shea.swelen.com/medusa_suggest.js?v=0.7.5")}}};function PluriMetrics(mytrack){this.api="http://thx.swelen.com/plurimetrics?client=medusa";this.cook="";this.hostname=_$welen.tracker.host;this.page_title=doc.title;this.page_segment="";this.page_item="";this.test=false;this.suggest=true;this.page=function(opt){this.suggest=(opt.suggest===false)?false:true;this.page_title=(opt.title)?opt.title:doc.title};this.Analyse=function(){var pg_thumb="";$w("img").each(function(){img=this;if(img.getAttribute("tag")&&img.getAttribute("tag")=="picture"){pg_thumb=img.getAttribute("src")}});var j={clt:mytrack.id_user,sit:mytrack.id_site,cook:this.cook,vSW:mytrack.vSW,vSH:mytrack.vSH,vSAW:mytrack.vSAW,vSAH:mytrack.vSAH,vSCD:mytrack.vSCD,vTZ:mytrack.vTZ,vHL:mytrack.vHL,vJE:mytrack.vJE,vNPL:mytrack.vNPL,vNML:mytrack.vNML,vCOO:mytrack.vCOO,test:this.test?1:0,pg_suggest:this.suggest?1:0,pg_dom:swelEncoder(this.hostname),pg_top:swelEncoder(mytrack.page_top_url),pg_inv:swelEncoder(mytrack.page_inv_url),pg_ref:swelEncoder(mytrack.page_ref_url),pg_lastmod:mytrack.page_lastmod,pg_thumb:swelEncoder(pg_thumb),pg_title:swelEncoder(this.page_title),pg_segment:swelEncoder(this.page_segment),pg_item:swelEncoder(this.page_item),plug_suggest:1,plug_search:0,shake:swelShaker()};_$welen.api.build(this.api,j);_$welen.api.request()}}win.swelShaker=function(){var axd=new Date();var shake=axd.getDate()+""+axd.getMonth()+1+""+axd.getFullYear()+""+axd.getHours()+""+axd.getMinutes()+""+axd.getSeconds();return shake};win.swelEncoder=win.encodeURIComponent||escape})();