//<!--
//\include\js\cobrand\cobrand_determine.js@@\main\15

var siteID="0";var cobrandID="0";var ebCBMicroBrands=new Array(new Array("100","techrepublic"),new Array("101","lego"),new Array("102","calibratedcode"));var ebMBCookieName="mb";function ebayLoadCobrandFiles()
{var cbFiles=new Array();cbFiles[cbFiles.length]=cobrandDir+"cobrand_constants.js";cbFiles[cbFiles.length]=cobrandDir+"cobrand_variables.js";cbFiles[cbFiles.length]=cobrandDir+"cobrand_objects.js";cbFiles[cbFiles.length]=countryCobrandDir+"cobrand_country_objects.js";cbFiles[cbFiles.length]=cobrandDir+"cobrand_functionality.js";for(var i=0;i<cbFiles.length;i++)
document.write(scriptOpen+cbFiles[i]+scriptClose);}
function ebayCheckParams(pQStr)
{var pArr=pQStr.substr(1).split("&"),p;for(var i=0;i<pArr.length;i++)
{p=pArr[i].split("=");if(p[0]&&p[1])
{if(((p[0]=="ht")&&(p[1]!="1"))||((p[0]=="s_partnerid")&&(p[1]!="1"))||((p[0]=="co_partnerid")&&(p[1]!="1")))
return true;}}
return false;}
function ebayParamsCobranded()
{if(ebayCheckParams(thisPageURI))
return true;return ebayCheckParams(lastPageURI);}
function ebayIsNotCobranded()
{var tpURL=thisPageURL.substring(thisPageURL.indexOf("://")+3,thisPageURL.length);tpURL=tpURL.substring(0,tpURL.indexOf("/"));var lpURL=lastPageURL.substring(lastPageURL.indexOf("://")+3,lastPageURL.length);lpURL=lpURL.substring(0,lpURL.indexOf("/"));var tpArr=tpURL.split(dot);var lpArr=lpURL.split(dot);var rv=false;if(!ebayParamsCobranded())
{if((tpArr.length<3)&&(lpArr.length<3))
return true;var uktwFlag=false;if(tpArr.length==3)
{if(tpArr[0]=="sandbox")
return false;if((tpArr[0]==www)||(tpArr[0]==ebPages)||(tpArr[0]==ebListings)||stringContains(tpArr[0],cgi)||stringContains(tpArr[0],scgi)||stringContains(tpArr[0],ebSearch))
rv=true;}
else if(tpArr.length==4)
{var ls=tpArr[1]+dot+tpArr[2]+dot+tpArr[3];if((ls==(ebStr+".co.uk"))||(ls==("tw."+ebStr+dotCom)))
{rv=true;uktwFlag=true;}}
if(rv)
{if((lpArr.length>3)&&!uktwFlag)
rv=false;else if(lpArr.length<3)
rv=true;else if(!((lpArr[0]==www)||(lpArr[0]==ebPages)||(lpArr[0]==ebListings)||stringContains(lpArr[0],cgi)||stringContains(lpArr[0],scgi)))
rv=false;}}
return rv;}
function ebayCheckMicroBrand()
{for(var j=0;j<ebCBMicroBrands.length&&isNotCobranded;j++)
{if(stringContains(lastPageURL,ebCBMicroBrands[j][1])||(ReadCookie(ebMBCookieName)==ebCBMicroBrands[j][0]))
isNotCobranded=false;}}
function ebayInitCobrandDetermine()
{isNotCobranded=true;ebayCheckMicroBrand();var s_partnerid;if(s_partnerid||!isNotCobranded||!ebayIsNotCobranded())
ebayLoadCobrandFiles();}
window.writeHeader=new Function();window.writeFooter=new Function();window.writeBrow=new Function();window.ebayCBCreateCobrands=new Function();if(globals)
ebayInitCobrandDetermine();sTime=new Date();brow=true;atc=true;cbc=true;
// -->
