if (typeof(HasRun) == "undefined")
var HasRun = 0;
else
HasRun = HasRun +1;
var color_url;
var color_text;
var color_border;
var color_bg;
var strADVID = "111"; // 120 x 150
var strPID = "401127";
var strWebRoot = "http://www5.contextweb.com/xt2/";
var strHintsOn = "";
var strChannel = "PubDefined";
var lvCAlign;
var lvCDLen = 0;
var lvNumAds = 1;
var lvArea
var SFormat = "160X600";
var strDefLevel = "8,7";
var Surl;
Surl = escape("");
if (Surl == ""){
if (document.location == top.location)
Surl=escape(document.location);
else
Surl=escape(document.referrer);
}
if (strWebRoot == "")
{
strWebRoot = "http://www5.contextweb.com/xt2/";
}
// determine Ad Alignment based on Width
if (160 >= 600 && 160 != 700) lvCAlign = "H";
else lvCAlign = "V";
// determine amount of ads based on dimensions
lvArea = 160 * 600;
if (lvArea >= 7200 && lvArea <= 28080) {
lvNumAds = 1;
if (lvArea <= 7200)
lvCDLen = 0;
else lvCDLen = 40;
}
else if (lvArea >= 28080 && lvArea <= 56160){
lvNumAds = 2;
lvCDLen = 70;
}
else if (lvArea >= 56160 && lvArea <= 85000 && 600 < 300){
lvNumAds = 3;
lvCDLen = 70;
}
else if (lvArea >= 70000 && lvArea <= 100000 && 600 >= 280 && 160 <= 485){
lvNumAds = 4;
lvCDLen = 70;
}
//else if (lvArea >= 100000 && lvArea <= 250000 && 160 <= 485 && 160 >= 300){
else if (lvArea >= 100000 && 160 >= 300){
lvNumAds = 5;
lvCDLen = 70;
}
else if (160 == "500" && 600 == "500"){ // special case for 500 x 500 pop-under
lvNumAds = 5;
lvCDLen = 70;
}
if (600 == "600"){
lvNumAds = 6;
lvCDLen = 70;
}
if (strPID == "401078"){
var aCh = new Array ("parenting & family","home & decoration","shopping","style & fashion","food & drink");
var iCh = Math.floor( Math.random() * aCh.length );
lvNumAds = 5;
lvCDLen = 55;
Surl = unescape(Surl);
posSemi = Surl.indexOf(";jsessionid");
posQues = Surl.indexOf("?");
Surl1 = Surl.substring(0,posSemi)
if (posSemi != -1){
if (posQues != -1) {
Surl2 = Surl.substring(posQues,Surl.length);
Surl = Surl1 + Surl2;
} else Surl = Surl1;
}
if (window.RegExp) {
var re = new RegExp("_requestid=[^&]*", "g");
Surl = Surl.replace(re,'');
}
Surl = escape(Surl);
strHintsOn = "true";
strChannel = escape(aCh[iCh]);
}
if (strPID == "400281"){
lvNumAds = 5;
lvCDLen = 150;
}
if (typeof(contextweb_color_url) == "undefined")
color_url = escape("#0033CC");
else
color_url = escape(contextweb_color_url);
if (typeof(contextweb_color_text) == "undefined")
color_text = escape("#000000");
else
color_text = escape(contextweb_color_text);
if (typeof(contextweb_color_border) == "undefined")
color_border= escape("#0033CC");
else
color_border= escape(contextweb_color_border);
if (typeof(contextweb_color_bg) == "undefined")
color_bg= escape("#FFFFFF");
else
color_bg= escape(contextweb_color_bg);
var qNumAds = "";
if (qNumAds != ""){
lvNumAds = qNumAds;
}
if (SFormat == "RSS"){
lvCAlign = "R";
lvCDLen = "80";
SFormat = "468X60";
}
var strRand = Math.floor( Math.random() * 1000000 );
var iRun = 200;
var Sstr= strWebRoot + "ContextAd.aspx?usgeo=1&Action=VIEWAD&SiteID=&TpltID=2&CAlign=" + lvCAlign + "&CDLen=" + lvCDLen + "&NumAds=" + lvNumAds + "&CBgC="+color_bg+"&CUrlC="+color_url+"&CTextC="+color_text+"&CBorderC="+color_border+"&Width=160&Height=600&PubDef=1&RUN=200&CWFormat=160X600&ADVID=111&PID=401127&bf=1&bpa=1&HintsOn="+strHintsOn+"&Kw="+strChannel+"&chnl="+strChannel+"&cwa=8431632536626510593574&fechp=100&cach=2880&DefLev="+strDefLevel+"&CWurl="+Surl;
document.writeln("");
if (window.RegExp) {
var re = /^((400159)|(400338)|(400619)|(401590)|(401602)|(400863))$/g;
if ( re.test( strPID ) == 0 ) {
strDefLevel = "7";
}
else {
var SstrQA = "http://www6.contextweb.com/xt3/" + "ContextAd.aspx?usgeo=1&Action=VIEWAD&SiteID=&TpltID=2&CAlign=" + lvCAlign + "&CDLen=" + lvCDLen + "&NumAds=" + lvNumAds + "&CBgC="+color_bg+"&CUrlC="+color_url+"&CTextC="+color_text+"&CBorderC="+color_border+"&Width=160&Height=600&PubDef=1&RUN="+iRun+"&CWFormat=160X600&ADVID=111&PID=401127&bf=1&bpa=1&HintsOn=&Kw=&chnl=PubDefined&cwa=8431632536626510593574&fechp=100&cach=2880&DefLev="+strDefLevel+"&CWurl="+Surl;
document.writeln("");
}
}