//<!--
//\include\js\cobrand\cobrand_functionality.js@@\main\13

function eBayCBQueryCobranded(pCBObj)
{var str=location.search;var ps=str.substr(1).split("&");for(var i=0;i<ps.length;i++)
{var p=unescape(ps[i]).split("=");if(country=="tw")
p=ps[i].split("=");if(((p[0]=="ht")&&(p[1]==pCBObj.ht))||((p[0]==ebCID)&&(p[1]==pCBObj.co_partnerid))||((p[0]==ebSID)&&(p[1]==pCBObj.s_partnerid)))
return true;}
return false;}
function ebayCBGetURLException(){var exObj=this.findExceptionObj("getURLException");if(!exObj||(exObj.values.length<2)||(!exObj.conditions))
return;this.siteLogic=exObj.values[0]+this.siteLogic+')&&'+
exObj.getConditions()+exObj.values[1];this.siteLogicNotForURLMunging=exObj.values[0]+this.siteLogicNotForURLMunging+')&&'+
exObj.getConditions()+exObj.values[1];}
function ebayCBSetUpURLMunger()
{var preStr='cbThisPageURLContains("';var postStr='")';for(var j=0;j<this.cbURLIdentifiers.length;j++)
{this.siteLogic+=preStr+this.cbURLIdentifiers[j]+postStr+or;}
this.siteLogic=this.siteLogic.substring(0,this.siteLogic.length-2);if(this.getURLException)
this.getURLException();}
function ebayCBIsThisCobrand()
{return(eBayCBQueryCobranded(this)||eval(this.siteLogic)||ebHTCookie.getCookielet("ht").is(this.ht));}
function ebayCBDetectCobrand(){var regExp=/cbThisPageURIParams/g;this.siteLogic=this.siteLogic.replace(regExp,"cbThisPageURIContains");var setCobrandObj='if('+this.siteLogic+')';setCobrandObj+='ebIsCobranded=true;';return setCobrandObj;}
function ebayCBWriteHeader(){if(ebSelCBObj&&ebSelCBObj.writeHeader){var autos="";if(((cbThisPageContains(ebmStr+"/")||cbThisPageContains(ebmStr+dot))&&!cbThisPageContains(ebUsingSSL)))
autos=ebmHdr+dot;var hdrStr=scriptOpen+countryCobrandDir+ebHdrDir+
autos+ebHdrFile+ebSelCBObj.headerName+jsExt+scriptClose;document.write(hdrStr);}}
window.writeHeader=ebayCBWriteHeader;function ebayCBWriteBrow(){var browStr=scriptOpen+countryCobrandDir+ebBrowFile+scriptClose;document.write(browStr);}
window.writeBrow=ebayCBWriteBrow;function ebayCBWriteFooter(){var showFooter=true;if(typeof(noCobrandHeader)!="undefined")
showFooter=!noCobrandHeader;if(ebSelCBObj&&ebSelCBObj.writeFooter&&showFooter){var ftrStr=scriptOpen+countryCobrandDir+ebFtrFile+
ebSelCBObj.headerName+jsExt+scriptClose;document.write(ftrStr);cbf=true;}}
window.writeFooter=ebayCBWriteFooter;function ebayCBWriteATC()
{return;}
window.writeATC=ebayCBWriteATC;function ebayCBMicroBrand()
{var pageName;if(!pageName)pageName="";var mbFile="";for(var i=0;i<ebCBMBPages.length&&(mbFile=="");i++)
{if((pageName.toLowerCase()).indexOf(ebCBMBPages[i])==0)
{for(var j=0;j<ebCBMicroBrands.length&&(mbFile=="");j++)
{if(cbLastPageURLContains(ebCBMicroBrands[j][1])||(ReadCookie(ebMBCookieName)==ebCBMBIDs[j][0]))
mbFile=ebCBMicroBrands[j][1]+jsExt;}}}
if(mbFile!="")
{ebSelCBObj=ebCBArray["1"]
var of=scriptOpen+countryCobrandDir+ebCBMBFilePrefix+mbFile;of+=scriptClose;document.write(of);}
return(mbFile!="");}
function ebayCBInitCobranding()
{ebayCBCreateCobrands();if(typeof(EbayCookie)!="undefined")
{ebHTCookie=new EbayCookie("ebay",null,null,"/",null,null,true);ebHTCookie.read();}
for(var i in ebCBArray)
{ebCBArray[i].setUpURLMunger();if(ebCBArray[i].isThisCobrand())
{ebSelCBObj=ebCBArray[i];ebHTCookie.addCookielet("ht",ebSelCBObj.ht);ebHTCookie.set();break;}}
ebayCBMicroBrand();if(ebSelCBObj)
siteID=cobrandID=ebSelCBObj.siteID;else
siteID=cobrandID="0";if((ebSelCBObj&&(ebSelCBObj.ht!="1"))||cbThisPageURLContains(https)||cbThisPageURLContains(scgi+dot))
{if(!ebSelCBObj)
ebSelCBObj=ebCBArray["1"];}}
ebayCBInitCobranding();
// -->

