
var $dr=function(func){if(typeof window.addEvent=='undefined'){if(typeof window.domreadyEvents=='undefined'){window.domreadyEvents=[];}
window.domreadyEvents.push(func);}else{window.addEvent('domready',function(){func();});}}
var $drInit=function(){if(typeof window.domreadyEvents!='undefined'){window.domreadyEvents.each(function(func){func();});}}
function d(){if(typeof window.console!='undefined'){for(var i=0,l=arguments.length;i<l;i++){if(i in arguments)console.debug(arguments[i]);}}}
var $=function(ele){if(typeof window.MooTools!='undefined'){Window.implement('$',function(el,nc){return document.id(el,nc,this.document);});return document.id(ele);}else{return document.getElementById(ele);}}
var SECOND=1000;var MINUTE=60*SECOND;var HOUR=60*MINUTE;var DAY=24*HOUR;var WEEK=7*DAY;var ClientClass=function(){this.storage={};this._features={};this.features={'sessionStorage':function(){try{return!!sessionStorage.getItem;}catch(e){return false;}},'localStorage':function(){try{return!!localStorage.getItem;}catch(e){return false;}},'JSON':function(){return typeof JSON!='undefined'&&typeof JSON.stringify!='undefined';}};this.supports=function(feature){if(typeof this._features[feature]!='undefined'){return this._features[feature];}
if(typeof this.features[feature]!='undefined'){this._features[feature]=this.features[feature]();return this._features[feature];}
return null;};this.storageSet=function(key,value,expires){var stored={value:value,expires:false}
if(typeof expires!='undefined'){if(expires){stored.expires=expires>WEEK?expires:new Date().getTime()+expires;}else{stored.expires=false;}}else{stored.expires=new Date().getTime()+DAY;}
if(this.storable()){localStorage.setItem(key,JSON.stringify(stored));}else{this.storage[key]=stored;}
return value;};this.storageGet=function(key){var stored=null;if(this.storable()){var stored=localStorage.getItem(key);if(!stored||stored==null){return null;}else{stored=JSON.parse(stored);}}else if(typeof this.storage[key]!='undefined'){stored=this.storage[key];};if(stored!==null){now=new Date().getTime();if(stored.expires&&stored.expires<now){this.storageRemove(key);}else{return stored.value;}}
return null;};this.storageRemove=function(key){if(this.storable()){localStorage.removeItem(key);}else if(typeof this.storage[key]!='undefined'){delete(this.storage[key]);}};this.sessionSet=function(key,value,expires){return this.storageSet(this.sessionKey(key),value,expires);};this.sessionGet=function(key){return this.storageGet(this.sessionKey(key));};this.sessionRemove=function(key){this.storageRemove(this.sessionKey(key));};this.sessionKey=function(key){if(typeof this.sess=='undefined'){var sess=document.cookie.match('(?:^|;)\\s*AFFILORAMA_SESS=([^;]*)');this.sess=sess[1];}
return this.sess+'.'+key;};this.storable=function(){return this.supports('localStorage')&&this.features.JSON();}};var Client=new ClientClass();
/* Mon, 4 Jul 2011 22:56:23 GMT init */
var datClientCodebase='/cjs/';var datClientTesting='/cjs/';var datClientName='affilorama';var datVersion='ga-v4.js';var datProfileID='UA-225833-4';function gqp(name){name=name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");var regexS="[\\?&]"+name+"=([^&#]*)";var regex=new RegExp(regexS);var results=regex.exec(window.location.href);if(results==null)return"";else return results[1];}
function setCookie(c_name,value,expiredays){var exdate=new Date();exdate.setDate(exdate.getDate()+expiredays);document.cookie=c_name+"="+escape(value)+((expiredays==null)?"":";expires="+exdate.toGMTString());}
function getCookie(c_name){if(document.cookie.length>0){c_start=document.cookie.indexOf(c_name+"=");if(c_start!=-1){c_start=c_start+c_name.length+1;c_end=document.cookie.indexOf(";",c_start);if(c_end==-1)c_end=document.cookie.length;return unescape(document.cookie.substring(c_start,c_end));}}return"";}
function include(filename){document.write(unescape("%3Cscript src='"+filename+"' type='text/javascript'%3E%3C/script%3E"));}
function includeAS(file){var a=document.createElement('script');a.type='text/javascript';a.async=true;a.src=file;var b=document.getElementsByTagName('script')[0];b.parentNode.insertBefore(a,b);}
var _gaq=_gaq||[];_gaq.push(['_setAccount',datProfileID]);_gaq.push(['_setDomainName','none']);_gaq.push(['_setAllowLinker',true]);var datURL=document.location.href.toLowerCase();datTest=gqp('datalicious');if(datTest=='test'){setCookie('datCookie','test',1);}
if(datTest==datClientName){setCookie('datCookie',datClientName,1);}
datCookieValue=getCookie('datCookie');if(datCookieValue=='test'||datTest=='test'||datCookieValue==datClientName||datTest==datClientName){if(datCookieValue=='test'||datTest=='test'){var datCodebase='//www.datalicious.com/clients/'+datClientName+'/livetest/js/';}else{var datCodebase=datClientTesting;}}else{if(datURL.indexOf('datalicious.')>-1){var datCodebase='//www.datalicious.com/clients/'+datClientName+'/latestcode/js/';}else{var datCodebase=datClientCodebase;}}
includeAS(('https:'==document.location.protocol?'https://ssl':'http://www')+'.google-analytics.com/ga.js');function DataliciousPageTop(){var WRInitTime=(new Date()).getTime();document.write('<div id="ClickTaleDiv" style="display: none;"></div>');if(document.location.protocol!='https:')
document.write(unescape("%3Cscript%20src='http://s.clicktale.net/WRb.js'%20type='text/javascript'%3E%3C/script%3E"));}
function DataliciousPageMiddle(){}
function DataliciousPageBottom(){setSegment();pushGWO();campaign_stacking(_gaq,3);if(location.href.match(new RegExp("affilorama\.com\/afterpurchase"))&&typeof(purchaseItems)!=='undefined'){trackPurchase(purchaseItems);}
_gaq.push(['_trackPageview']);if(location.pathname=="/"&&location.host=="www.affilorama.com"){if(typeof ClickTale=='function')ClickTale(40723,0.0112,"www");}}
/* Mon, 4 Jul 2011 22:56:22 GMT datalicious */
function filterExit(exitLocation){var validLocations=['twitter.com','facebook.com','stumbleupon.com','digg.com','del.icio.us','google.com/reader','zeadoo.com','sphinn.com'];for(i=0;i<validLocations.length;i++)
{if(exitLocation.indexOf(validLocations[i])>-1){_gaq.push(['_trackEvent','exitLocations',validLocations[i],location.href]);}}}
function pushRating(ratingValue){var pageTitleH1=document.querySelector('h1').innerHTML;var siteSection=document.querySelector('#primary ul li a[class=on]').getAttribute("title");var currentHref=location.href;_gaq.push(['_trackEvent','rateItem',siteSection+': '+pageTitleH1,currentHref,ratingValue]);}
function setSegment(){if(document.cookie.indexOf("__utmv=")>-1){var utmvArray=getCookie('__utmv').split(',');var userSegment='';for(i=0;i<utmvArray.length;i++){if(utmvArray[i].indexOf('UserSegments=')>-1)
userSegment=utmvArray[i];}
userSegment=userSegment.split('=');if(userSegment!=''){var page_url=document.location.href.toLowerCase();var currentSegment=userSegment[2].toLowerCase();if(page_url.match(new RegExp("affilorama\.com\/upgrade"))&&currentSegment=='suspect'){_gaq.push(['_setCustomVar',1,'UserSegments','prospect',1]);setCookie('__dlpurchase',new Date().getTime()+"|"+"No Product",365);}
if(page_url.match(new RegExp("affilorama\.com\/afterpurchase"))&&(currentSegment=='prospect'||currentSegment=='ex-customer')){_gaq.push(['_setCustomVar',1,'UserSegments','customer',1]);}
if(page_url.match(new RegExp("affilorama\.com\/thoughts"))&&currentSegment=='customer'){_gaq.push(['_setCustomVar',1,'UserSegments','ex-customer',1]);if(typeof(productName)!=='undefined'){_gaq.push(['_trackEvent','productUnsubscription',productName]);}}}}else{_gaq.push(['_setCustomVar',1,'UserSegments','suspect',1]);}}
function trackToolClick(toolName,toolHref){if(toolName.indexOf("View Tool: ")>-1)
toolName=toolName.substr(11,toolName.length);_gaq.push(['_trackEvent','viewTool',toolName,toolHref]);}
function homeRegister(){_gaq.push(['_trackPageview','/homepage_register']);}
function pushGWO()
{if(document.cookie.indexOf("__utmx=")>-1){var cookie_array=getCookie('__utmx').split(':');var combination_id=cookie_array[2];if(combination_id){var getIDs=combination_id.split('.');var comboArray=getIDs[0].split('-');var comboString='';for(i=0;i<comboArray.length;i++){if(comboArray[i]==0){comboString=comboString+"Original"+"0";}else{comboString=comboString+"Variant"+comboArray[i];}
if(i+1!=comboArray.length){comboString=comboString+"-";}}
_gaq.push(['_setCustomVar',2,'GoogleWebsiteOptimiser',comboString,2]);}}}
function trackPurchase(purchaseItems){if(typeof purchaseItems[0]!==undefined){if(purchaseItems.length>0){var productString='';for(i=0;i<purchaseItems.length;i++){productString=productString+purchaseItems[i];if(i+1!=purchaseItems.length){productString=productString+"|";}}
if(productString!==''){productString=productString.toLowerCase().replace(/ /g,"_");_gaq.push(['_trackPageview','/afterpurchase?products='+productString]);trackPrevious(purchaseItems,productString);}}}}
eval(function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('m s(a,b){b=b.G(/[\\[]/,"\\\\\\[").G(/[\\]]/,"\\\\\\]");t c="[\\\\?&]"+b+"=([^&#]*)";t d=H T(c);t e=d.U(a);2(e==y)n"";g n e[1]}m u(a){a=a.o(a.8(\'://\')+3,a.h);a=a.o(0,a.8("/"));n a}m z(a,b,c){t d=H V();d.W(d.X()+c);4.j=a+"="+Y(b)+((c==y)?"":";Z="+d.10())+";11=/"}m A(a){2(4.j.h>0){l=4.j.8(a+"=");2(l!=-1){l=l+a.h+1;v=4.j.8(";",l);2(v==-1)v=4.j.h;n 12(4.j.o(l,v))}}n""}m 13(a,b,c){2(c==y)c=14;I=A("J");2(I==\'\'){5=\'K\';2(s(B.C.D,\'15\')!=\'\'){5=\'L\'}g{6=s(B.C.D,\'16\');2(6!=\'\'){2(6==\'K\'||6==\'L\'||6==\'r\'||6==\'17\'||6==\'18\'||6==\'19\'||6==\'M\'){5=6}g{5=\'1a\'}}g{2(4.w!=\'\'&&u(B.C.D.E())!=u(4.w.E())){r=1b;N="1c:q,1d:1e,1f:7,1g.O:q,O:q,1h:p,1i:q,1j:q,F:7,F:1k,1l:7,1m:q,1n:q,1o:7,1p:7,1q:1r,1s:7,1t:q,1u:1v,1w:P,1x:q,1y:1z,1A:P,1B:1C,1D:q,F:q,1E:7,1F:q,1G:q,1H:1I,1J:1K,1L:q,1M:k,1N:q,1O:q,1P:q,1Q:q,1R:7,1S:q,1T:q,1U:1V";9=N.1W(\',\');x=u(4.w);x=x.E();1X(i=0;i<9.h;i++){Q=9[i].o(0,9[i].8(":"));R=9[i].o(9[i].8(":")+1,9[i].h);2(x.8(Q)>=0){2(s(4.w,R)!=\'\')r=1Y}}2(r){5=\'r\'}g{5=\'M\'}}}}f=A("S");2(f==\'\'){f=5}g{f=f+\'-\'+5}1Z=5;z("S",f,c);z("J",5);a.20([\'21\',b,\'22\',f,1])}}',62,127,'||if||document|currentMedium|medium|query|indexOf|seKey||||||fullStacking|else|length||cookie||c_start|function|return|substring|||seo|__stack_getParameterValue|var|__stack_getHostName|c_end|referrer|referrerHostName|null|__stack_setCookie|__stack_getCookie|window|location|href|toLowerCase|aol|replace|new|sessionStacking|__dlsession|dir|adw|ref|seKeyString|google|qs|se|kp|__dlstacking|RegExp|exec|Date|setDate|getDate|escape|expires|toGMTString|path|unescape|campaign_stacking|365|gclid|utm_medium|sem|cpc|cpm|cam|false|daum|eniro|search_word|naver|images|yahoo|msn|bing|encquery|lycos|ask|altavista|netscape|cnn|about|terms|mamma|alltheweb|voila|rdata|virgilio|live|baidu|wd|alice|yandex|text|najdi|mama|seznam|search|wp|szukaj|onet|qt|szukacz|yam|pchome|kvasir|sesam|ozu|terra|mynet|ekolay|rambler|words|split|for|true|lastStacking|push|_setCustomVar|Stack'.split('|'),0,{}))
function getCookieVars(c_name,split_char,sub_split){if(document.cookie.indexOf(c_name+"=")>-1){var cookieArray=new Array();var currentVar=new Array();var getCookieArray=getCookie(c_name).split(split_char);if(sub_split!=null){for(i=0;i<getCookieArray.length-1;i++){currentVar=getCookieArray[i].split(sub_split);cookieArray[currentVar[1]]=currentVar[2];}}else{cookieArray=getCookieArray;}}
return cookieArray;}
function getPurchaseDuration(){var duration_cookie=getCookie('__dlpurchase').split("|");var previous=duration_cookie[0];var now=new Date().getTime();var days=Math.floor((now-previous)/(1000*60*60*24));return days;}
function trackPrevious(purchaseItems,productString){var customArray=getCookieVars("__utmv",",","=");var currentPurchases=0;if(typeof(customArray['NumberOfPurchases'])!=='undefined'){currentPurchases=parseInt(customArray['NumberOfPurchases']);}
currentPurchases++;_gaq.push(['_setCustomVar',4,'NumberOfPurchases',currentPurchases,1]);var previousProduct=getCookie('__dlpurchase').split("|");var previousProductString='';for(i=0;i<previousProduct.length;i++){previousProductString=previousProductString+previousProduct[i];if(i+1!=previousProduct.length){previousProductString=previousProductString+"|";}}
var product='';for(i=0;i<purchaseItems.length;i++){for(j=1;j<previousProduct.length;j++){_gaq.push(['_trackEvent','purchaseDurations',purchaseItems[i],unescape(previousProduct[j]),getPurchaseDuration()]);}}
for(j=1;j<previousProduct.length;j++){_gaq.push(['_trackEvent','noOfPurchaseDurations',currentPurchases,unescape(previousProduct[j]),getPurchaseDuration()]);}
setCookie('__dlpurchase',new Date().getTime()+"|"+productString,365);}
/* Thu, 19 Aug 2010 04:46:51 GMT ga-v4 */
