geoLookupNeeded="false";adsNeedGeo="";pixelTaggingNeeded="false";tsCookies3rd="%COOKIES%";
/*! END BASE HEADER */
var tsSitePlacementProperties = [];
String.prototype.tsTrim = function () { return this.replace(/^\s+|\s+$/g, ''); };
Date.prototype.mGetDay = function () {
return (this.getDay() + 6) %7;
};
/* --- Create the TS object only once (shared between placements)  */
if(window.G === undefined){window.G = window;}
var TS = {};
TS.getCookieValue = function (cookieName) {
var exp = new RegExp (escape(cookieName) + "=([^;]+)");
if (exp.test (document.cookie + ";")) {
exp.exec (document.cookie + ";");
return unescape(RegExp.$1);
}
else {return false;}
};
TS.getQParamFromStr = function (str, paramName)
{
var regex = new RegExp("[\\?&]"+paramName+"=([^&#]*)");
var qParam = regex.exec(str);
if(qParam === null){
return "";
}
return qParam[1];
};
TS.getQParam = function (paramName)
{
return this.getQParamFromStr(window.location.href,paramName);
};
TS.PosPopUp = function (id,x,y,offset)
{
var el = document.getElementById(id);
el.style.left=x+offset;
el.style.top=y-document.body.scrollTop+offset;
};
TS.getRand = function ()
{
var uu=Math.round(Math.random()*2147483647);
return uu;
};
TS.getRandomNr = function (max)
{
var ranNum= Math.floor(Math.random()*(max));
return ranNum;
};
TS.getBrowserProperties = function ()
{
return '&tsSW='+self.screen.width+'&tsSH='+self.screen.height+'&tsSC='+self.screen.colorDepth+'&tsPD='+self.screen.pixelDepth;
};
TS.encode = function (s,u)
{
if (typeof(encodeURIComponent) == 'function') {
if (u) {return encodeURI(s);}
else {return encodeURIComponent(s);}
}
else {
return escape(s);
}
};
TS.isDebug = function ()
{
if(window.location.href.indexOf('tsDebug=1') !== -1){
return true;
}
else{
return false;
}
};
TS.isLogDebug = function ()
{
if(window.location.href.indexOf('tsDebug=2') !== -1){
return true;
}
else{
return false;
}
};
TS.log = function(msg)
{
if (TS.isLogDebug() && window.console && window.console.firebug)
{
console.log(msg);
}
};
TS.renderDebugAd = function (height, width, text)
{
var randPopUpId = this.getRandomNr(1000);
document.write('<div id="tsDebugPop_'+randPopUpId+'" style="display:none;border:#666 1px solid;width:200px;height:110px;text-align:left;background:#eee;position:fixed;z-index:99;left:40%;top:40%;padding:0px 5px 10px 5px;"><p style="cursor:pointer;text-align:right;margin:0px;" onclick="this.parentNode.style.display=\'none\';">X</p>Height<br/><input onkeyup="document.getElementById(\'tsDebugAd_'+randPopUpId+'\').style.height=this.value+\'px\';"><br />Width:<br/><input onkeyup="document.getElementById(\'tsDebugAd_'+randPopUpId+'\').style.width=this.value+\'px\';"></div>');
document.write('<button id="tsDebugAd_'+randPopUpId+'" onclick="TS.PosPopUp(\'tsDebugPop_'+randPopUpId+'\',this.offsetLeft,this.offsetTop,20);document.getElementById(\'tsDebugPop_'+randPopUpId+'\').style.display=\'block\';" style="border:#000 0px solid;background-image:none;background-color:#ff17fc;text-align:center;font-size:12px;color:#fff; height:'+height+'px;width:'+width+'px;">' + text + '</button>');
};
/* TS Variables ----------------------------------------------------------------------------------------------------- */
TS.bd=document;
TS.dl=TS.bd.location;
TS.ho = (TS.dl.hostname && TS.dl.hostname != "")  ? TS.encode(TS.dl.hostname) : "";
TS.lp = (TS.dl.pathname && TS.dl.pathname != "") ? TS.dl.pathname : "";
TS.qu = (TS.dl.search && TS.dl.search != "") ? TS.encode(TS.dl.search) : "";
TS.ref = (TS.bd.referrer && TS.bd.referrer != "") ? TS.encode(TS.bd.referrer) :"";
TS.session = TS.getCookieValue("ts_session") ? TS.getCookieValue("ts_session") : "";
TS.uid = TS.getCookieValue("ts_uid") ? TS.getCookieValue("ts_uid") : "";
TS.uv = TS.getCookieValue("ts_uv") ? TS.getCookieValue("ts_uv") : "";
TS.bp = TS.getBrowserProperties() || "";
var tsUrl = (tsUrl === undefined) ? "" : tsUrl;
TS.tsUrl = (tsUrl != "") ? escape(tsUrl) : "";
TS.countryCode=TS.getQParam('tsCountryCode') ||"%COUNTRY_CODE%";
TS.regionCode=TS.getQParam('tsRegionCode') ||"%REGION_CODE%";
var headerShown = "false";
var adsRenderedInSlot = 0;  /* Reset  the number of ads rendered in this current slot  (This var used to be named "success" ) */
if(G.tsAdsRendered_right_slot === undefined){G.tsAdsRendered_right_slot =[];}
if(G.tsAdsRendered_right === undefined){G.tsAdsRendered_right=0;}
function tsApplyRandom(content)
{
var rand = TS.getRand();
content = content.replace(/\[timestamp\]/g, rand);
return content;
}
function tsPlacementHit()
{
var url = "http://script.tailsweep.com/siteplacementhit/418988" + "?sitePlacements=1,"+G.ts_currentSlot_right +"&tsSession="+TS.session+"&tsUid="+TS.uid+"&tsUV="+TS.uv+"&tsUrl="+TS.tsUrl;
TS.writeStatImg(url);
}
/*
END Site Ads -------------------------------------------------------
*/
if(G.rightIdx === undefined){G.rightIdx = 1;};
G.ts_currentSlot_right = (G.ts_currentSlot_right === undefined) ? 1 : G.ts_currentSlot_right+1;
var currentSlot = G.ts_currentSlot_right;
G.tsAdsRendered_right_slot[currentSlot-1]=0;
G.ts_right_maxAds = 3;
if( currentSlot == rightIdx )
{
G.ts_slotsEntered = currentSlot+1-rightIdx;      TS.log("right - maxAds =  "+G.ts_right_maxAds + ", slotsEntered = "+G.ts_slotsEntered);
if(TS.isDebug() || true)
{
document.write('<style type="text/css">.tailsweep-div{text-align:center;font-family: arial,verdana,sans-serif;font-size: 12px;color: #000;margin: 0 auto; padding: 0; display: block;} .smallBr{font-size: 1px;line-height: 0;} .tailsweep-host,.tailsweep-host:link{color:green;font-size:10} .tailsweep-buylink{font-size:12px} .tailsweep-link{color:#00c;font-size:12px;font-weight:bold} .tailsweep-title{color:#00c;font-size:12px;font-weight:bold}</style>');
if (typeof(tsAdStyle)=="undefined") {var tsAdStyle="";}
document.write('<div class="tailsweep-div" id="tailsweep-div-right" style="'+tsAdStyle+'">');
if(TS.isDebug())
{
TS.renderDebugAd(600, 160, 'Tailsweep Debug<br />right');
}
else
{
}
TS.log("right - Rendering buylink");
document.write('<div class="tailsweep-div" style="'+tsAdStyle+'">'+"<a class='tailsweep-buylink' href='http://www.tailsweep.se/advertisers.do'>Annonsera h&auml;r</a>"+'</div>');
document.write('</div>');
}
tsPlacementHit();
}

