//<!--
//\include\js\cookies.js@@\main\22

function EbayCookie(name,value,domain,path,expires,secure,isCookielet)
{if(!this.objType)
this.objType="EbayCookie";if(typeof(EBayObject)=="function")
{this.base=EBayObject;this.base(null,name);}
else
{this.parent=null;this.name=name;}
this.value=value;this.value=value||"";if(typeof(thisPageURL)!="undefined"&&domain==null)
{if(!thisPageURL.contains(qaDom))
{this.domain=countryDomain.substring(0,countryDomain.length-1);if(this.domain.contains("es.ebay.")||this.domain.contains("tw.ebay."))
{this.domain=".ebay.com";}}
else
{this.domain=".ebay.com";}}
else
{this.domain=domain;}
this.path=path?path:"/";this.secure=secure;this.isCookielet=isCookielet;this.cookielets=new Array();this.expires=expires;this.parseCookie=EbayParseCookie;this.addCookielet=EbayAddCookieLet;this.read=EbayReadCookie;this.set=EbaySetCookie;this.getCookielet=EbayGetCookielet;}
function EbayCookielet(name,value,expi)
{this.name=name;this.value=value?value:'';expi=expi?expi:'';var temp=expi;if(isNaN(expi))
{expi=temp.hex2Dec();this.expirationDecBy1000=expi;expi=expi*1000;this.expirationDec=expi;this.expirationHex=this.expirationDecBy1000.dec2Hex();}
else
{this.expirationDec=expi;this.expirationDecBy1000=Math.floor(expi/1000);this.expirationHex=this.expirationDecBy1000.dec2Hex();}}
function EbayGetCookielet(name)
{var c=this.cookielets[name],v="";if(c)v=c.value;return v;}
function EbayParseCookie(start)
{var mycookielets=new Array();var strCookielets="";if(start)
{var input=this.value;mycookielets=input.split("^");for(i in mycookielets)
{var x=mycookielets[i].split("=");if(x[0]!=""&&x[1]!="")
{var outVal=x[1];for(var j=2;j<x.length;j++)
{outVal+="="+x[j];}
this.addCookielet(x[0],outVal);}}}
else
{strCookielets="^";var cl=this.cookielets;for(i in cl)
{if(cl[i])
strCookielets+=cl[i].name+"="+cl[i].value+"^";}
this.value=strCookielets;}}
function EbayReadCookie()
{var cookie_list=' '+document.cookie,cookie_key=' '+this.name+'=',cookie_offs=(document.cookie?cookie_list.indexOf(cookie_key):-1);if(cookie_offs>=0)
{var cookie_val=cookie_list.substring(cookie_offs+cookie_key.length),cookie_end=cookie_val.indexOf(';');this.value=unescape(cookie_end<0?cookie_val:cookie_val.substring(0,cookie_end));if(this.isCookielet)
{this.parseCookie(true);}}}
function EbaySetCookie()
{with(this)
{if(isCookielet)
{parseCookie(false);}
if((isNaN(value)&&value.length<4000)||(value+'').length<4000)
{document.cookie=(name?name+'=':'')+(value?escape(value):'')+(domain?'; domain='+domain:'')+(path?'; path='+path:'')+(expires?'; expires='+expires.toGMTString():'')+(secure?'; secure='+escape(secure):'');}
else
{if(isQA)
alert("ERROR: Cookie data could not be set over 4kb.");}}}
function EbayAddCookieLet(name,value,expiration)
{this.cookielets[name]=new EbayCookielet(name,value,expiration);}
function EbayOldWriteCookie(name,value,domain,path,expires,secure)
{if(expires=='yes')
{expires=new Date("Jan 02, 2004 12:00:00 GMT");}
else if(expires=='delete')
{expires=new Date("May, 01 1999 12:00:00 GMT");}
var x=new EbayCookie(name,value,domain,path,expires,secure,false);x.set();}
window.WriteCookie=EbayOldWriteCookie;function EbayOldWrite2YearCookie(name,value,domain,path,expires,secure)
{var x;if(!expires)
{var offset=2;now=new Date();year=now.getYear();now.setYear(year+offset);expires=now.valueOf();}
x=new EbayCookie(name,value,domain,path,expires,secure,false);}
window.Write2YearCookie=EbayOldWrite2YearCookie;function EbayOldReadCookie(name)
{var x=new EbayCookie(name);x.read();return x.value;}
window.ReadCookie=EbayOldReadCookie;function EbayOldReadMultiCookie(cook,cooklet)
{var x=new EbayCookie(cook,null,null,null,null,null,true);x.read();return x.getCookielet(cooklet);}
window.readMultiCookie=EbayOldReadMultiCookie;function EbayOldWriteMultiCookie(name,cooklet,value,domain,path,expires)
{var x=new EbayCookie(name,null,domain,path,expires,null,true);x.read();x.addCookielet(cooklet,value);x.set();}
window.writeMultiCookie=EbayOldWriteMultiCookie;function EbayOldDeleteCookie(name,domain,path)
{var expireDate=new Date(1);var x=new EbayCookie(name,null,domain,path,expireDate,null,false);x.set();}
window.DeleteCookie=EbayOldDeleteCookie;function EbayDPCookie(name,value,domain,path,expires,secure,isCookielet)
{this.base=EbayCookie;this.base(name,value,domain,path,expires,secure,isCookielet);this.parseCookie=EbayDPParseCookie;this.set=EbaySetDPCookie;this.getCookieletObj=EbayGetCookieletObj;if(!expires)
{var offset=2;now=new Date();year=now.getYear();now.setYear(year+offset);this.expires=now;}
else
{this.expires=expires;}}
function EbaySetDPCookie()
{with(this)
{if(isCookielet)
{parseCookie(false);}
if((isNaN(value)&&value.length<4000)||(value+'').length<4000)
{document.cookie=(name?name+'=':'')+(value?value:'')+(domain?'; domain='+domain:'')+(path?'; path='+path:'')+(expires?'; expires='+expires.toGMTString():'')+(secure?'; secure='+escape(secure):'');}
else
{if(isQA)
alert("ERROR: Cookie data could not be set over 4kb = cookie length = "+value.length);}}}
function EbayGetCookieletObj(name)
{var c=this.cookielets[name];return c;}
function EbayReadDPCookielet(cook,cooklet)
{var x=new EbayDPCookie(cook,null,null,null,null,null,true);x.read();return x.getCookielet(cooklet);}
function EbayDPWriteMultiCookie(name,cooklet,value,domain,path,expires)
{var today=(new Date()).getTime();var defexp=new Date(today+(YEAR*1))
var x=new EbayDPCookie(name,null,domain,path,defexp,null,true);x.read();x.addCookielet(cooklet,value,expires);x.set();}
function EbayDPParseCookie(start)
{var mycookielets=new Array();var strCookielets="";if(start)
{var input=this.value;input=input.substring(1,input.length);mycookielets=input.split("^");for(i in mycookielets)
{c=mycookielets[i];expi=c.substring(c.length-8,c.length);c=c.substring(0,c.length-8);var x=c.split("/");if(x[0]!=""&&x[1]!="")
{var outVal=unescape(c.substring(c.indexOf("/")+1,c.length));this.addCookielet(x[0],outVal,expi);}}}
else
{strCookielets="";var today=new Date();var cl=this.cookielets;for(i in cl)
{if(cl[i])
{var expirationDate=new Date(cl[i].expirationDec);var timeToExpire=expirationDate-today;if(timeToExpire>0)
strCookielets+=cl[i].name+"/"+escape(cl[i].value)+cl[i].expirationHex+"^";}}
if(strCookielets!="")
{this.value="b"+strCookielets;}
else
{this.value="";}}}
var CookieDomain=".ebay.com";var thisHost=location.hostname.toLowerCase();if(thisHost.indexOf(".ebay")>0)
CookieDomain=thisHost.substring(thisHost.indexOf(".ebay"));
// -->
