vjo.ctype("vjo.darwin.core.cobrand.EbaySandbox").needs(["vjo.dsf.client.Browser","vjo.dsf.typeextensions.string.Comparison"]).props({sRedirectString:"ebayredir=",sThisPagePath:"",sThisPageQuery:"",sExceptionLink:null,sCBName:".sandbox",sHT:"99",sQA:"",sCountry:"us",sCountryDomain:".ebay.com",urlIDBranding:function(_1){if(_1.hasAny("&s_partnerid=","&co_partnerid=")){var T=this;var ids=new Array("ht="+T.sHT,"co_partnerid="+T.sHT,"s_partnerid="+T.sHT);_1=_1.replace(/s_partnerid=[0-9]*/g,ids[1]);_1=_1.replace(/co_partnerid=[0-9]*/g,
ids[2]);return _1}return false},cobrandURL:function(_3){if(this.hasSandbox(_3))return _3;var T=this;var qInd=_3.indexOf("?");var path=_3;var query="";var rv;var folder="";var dom=T.sCountryDomain;var st=dom;var off;if(qInd!=-1){path=_3.substring(0,qInd);query=_3.substring(qInd)}if(T.urlDetect(path,query))return _3;rv=T.urlIDBranding(_3);if(rv)return rv;st=_3.indexOf(st);if(st<1)return _3.indexOf("/")==0&&folder!=""&&_3.indexOf(folder)!=0?folder+_3:_3;off=_3.indexOf(dom,st)+dom.length;rv=_3.substring(0,
st);if(!_3.has(T.sCBName+dom)&&!_3.hasAny(T.sExceptionLink))rv+=T.sCBName+dom+folder+_3.substr(off);else if(path.has(T.sCBName+dom)&&!path.hasAny(T.sExceptionLink)){st=dom;st=path.indexOf(st);off=path.indexOf(dom,st)+dom.length;rv=path.substring(0,st);rv+=T.sCBName+dom+folder+path.substr(off)+query}else rv=_3;return rv},isEbayLink:function(_5){if(_5.has(this.sCountryDomain))return true;return false},cobrandLinks:function(){var T=this;var dl=document.links;var len=dl.length;var temp;var txt;for(var i=
0;i<len;i++){temp=false;txt=dl[i].innerText;if(vjo.dsf.client.Browser.bIE&&txt.hasAny("@","http:"))temp=txt;if(T.isEbayLink(dl[i].href))dl[i].href=T.cobrandURL(dl[i].href);else if(T.isRedirectLink(dl[i].href))dl[i].href=T.cobrandRedirectURL(dl[i].href);if(temp)dl[i].innerText=temp}},hasSandbox:function(_8){if(_8.indexOf("sandbox.")!=-1)return true;return false},cobrandRedirectURL:function(_9){var T=this;var r=T.sRedirectString;var curl=_9.substring(_9.indexOf(r)+r.length,_9.length);var rurl;var furl;
if(!T.isEbayLink(curl))return _9;rurl=_9.substring(0,_9.length-curl.length);curl=T.cobrandURL(curl);furl=rurl+curl;return furl},isRedirectLink:function(_b){var l=_b.toLowerCase();return l.has(this.sRedirectString)},cobrandForms:function(){var f=document.forms;var len=f.length;var act;var fe;var eLen;var un="undefined";for(var i=0;i<len;i++){act=f[i].action;if(typeof act=="string")if(this.isEbayLink(act))f[i].action=this.cobrandURL(act);fe=f[i].elements;eLen=fe.length;for(var j=0;j<eLen;j++)with(fe[j])if(typeof type!=
un&&typeof value!=un)if(type.is("hidden")&&value.indexOf("http")==0&&this.isEbayLink(value))value=this.cobrandURL(value)}},updateSiteFormElem:function(_10,pID){if(_10){var idx=_10.value.indexOf("&");var rest="";if(idx!=-1)rest=_10.value.substring(idx);_10.value=pID+rest}},cobrandSearchAttribs:function(){with(this){var df=document.forms;var len=df.length;var dfe;for(var i=0;i<len;i++){dfe=df[i].elements;updateSiteFormElem(dfe["ht"],sHT);updateSiteFormElem(dfe["s_partnerid"],sHT);updateSiteFormElem(dfe["co_partnerid"],
sHT)}}},urlDetect:function(_15,_16){var T=this;var rv=false;var aPathIdentifiers=new Array("."+T.sCBName+".");var aQueryIdentifiers=new Array("ht="+T.sHT,"co_partnerid="+T.sHT,"s_partnerid="+T.sHT);var p;var q;with(this){p=_15||sThisPagePath;rv=p.hasAny(aPathIdentifiers);if(rv);else{q=_16==null?sThisPageQuery:_16;q=q.substr(1).split("&");for(var i=0;i<q.length&&!rv;i++)rv=q[i].isAny(aQueryIdentifiers)}}return rv},cobrandPage:function(){if(this.sThisPagePath.has("sandbox"))with(this){sServer="";if(!sQA===
""){var tpp=sThisPagePath;var c="."+sC;var ex;var len;var i;sServer=tpp.substring(tpp.indexOf("."),tpp.indexOf(c)!=-1?tpp.indexOf(c):tpp.indexOf(sQA));ex=[".motors",sCBName,".listings",".stores"];len=ex.length;for(i=0;i<len;i++)if(sServer.indexOf(ex[i])==0)sServer=sServer.substr(ex[i].length)}cobrandLinks();cobrandForms();cobrandSearchAttribs()}}}).inits(function(){var tp=decodeURI(document.location);var qInd;var p;var sCD;var sC;var t=this.vj$.EbaySandbox;if(tp.has("_W0QQ"))if(tp.split("/").length==
4){tp=tp.replace(/_W0QQ/,"?");tp=tp.replace(/Z/g,"=");tp=tp.replace(/Q3A/g,":");tp=tp.replace(/Q3a/g,":");tp=tp.replace(/Q3B/g,";");tp=tp.replace(/Q3b/g,";");tp=tp.replace(/QQ/g,"&")}qInd=tp.indexOf("?");t.sThisPagePath=tp;if(qInd!=-1){t.sThisPagePath=tp.substring(0,qInd);t.sThisPageQuery=tp.substring(qInd)}t.sQA=t.sThisPagePath.has(".qa.")?".qa":"";p=t.sThisPagePath.split("/");if(p[2]){sCD=p[2].substring(p[2].indexOf(".ebay"));sC=sCD.substring(sCD.lastIndexOf(".")+1);sCD=sCD+"/";if(sC&&!sC.has("com"))t.sCountry=
sC;t.sCountryDomain=sCD}t.sExceptionLink=["developer.ebay.com","dev-forums.ebay.com","affiliates.ebay.com","neighborhoods.ebay.com","forums.ebay.com","resolutioncenter.ebay.com"]}).endType();
vjo.ctype("vjo.darwin.core.greetings.Sandbox").needs(["vjo.dsf.Element","vjo.dsf.EventDispatcher"]).props({init:function(){var l=vjo.dsf.Element.get("registerLink");var s="https://scgi.sandbox.ebay.com/ws/eBayISAPI.dll?RegisterEnterInfo";var t="https://developer.ebay.com/DevZone/sandboxuser/Default.aspx";if(l)if(l.href==s)l.href=t},adBanner:function(){var l=window.location.href;var s="sandbox.";var c;if(l.indexOf(s)!=-1){var _3=document.location.protocol=="https:"?"https://securepics":"http://pics";
c="<sty"+'le type="text/css">#gnheader {background: url('+_3+".ebaystatic.com/aw/pics/devprogram/watermark.gif)}</sty"+"le>";document.write(c)}}}).inits(function(){vjo.darwin.core.greetings.Sandbox.adBanner();vjo.dsf.EventDispatcher.addEventListener(window,"load",function(){vjo.darwin.core.greetings.Sandbox.init()})}).endType();

