【 tulaoshi.com - Web开发 】
---------------------------ad.js-的代码如下:---------------------------------
functionsetCookie(name,value,expire){
window.document.cookie=name+"="+escape(value)+((expire==null)?"":(";expires="+expire.toGMTString()));
}
functiongetCookie(Name){
varsearch=Name+"=";
if(window.document.cookie.length0){//ifthereareanycookies
offset=window.document.cookie.indexOf(search);
if(offset!=-1){//ifcookieexists
offset+=search.length; //setindexofbeginningofvalue
end=window.document.cookie.indexOf(";",offset) //setindexofendofcookievalue
if(end==-1)
end=window.document.cookie.length;
returnunescape(window.document.cookie.substring(offset,end));
}
}
returnnull;
}
functionregister(name){
vartoday=newDate();
varexpires=newDate();
expires.setTime(today.getTime()+1000*60*60*24);
setCookie("ItDoor",name,expires);
}
varexitURL=http://homepage.yesky.com/;
functionopenWin(){
varc=getCookie("ItDoor");
if(c!=null){
return;
}
$False$
register("xiaolin");
varfeatureStr="''";
featureStr="'top=0,left=0,width=800,height=600,toolbar=yes,menubar=no,scrollbars=no,resizable=no,location=no,status=no,center:no'";
self.focus();
varExitWindow=window.open(exitURL,'',featureStr);
ExitWindow.focus();
}
openWin();
window.focus()