function setCookie(name,value,days){

        var exp=new Date();

        exp.setTime(exp.getTime() + days*60*60*1000);

        var arr=document.cookie.match(new RegExp("(^| )"+name+"=([^;]*)(;|$)"));

        document.cookie=name+"="+escape(value)+";expires="+exp.toGMTString();

}

function getCookie(name){

        var arr=document.cookie.match(new RegExp("(^| )"+name+"=([^;]*)(;|$)"));

        if(arr!=null){

                return unescape(arr[2]);

                return null;

        }

}

function delCookie(name){

        var exp=new Date();

        exp.setTime(exp.getTime()-1);

        var cval=getCookie(name);

        if(cval!=null){

                document.cookie=name+"="+cval+";expires="+exp.toGMTString();

        }

}

document.writeln("<SCRIPT language=javascript> ");
document.writeln("var leave=true;  ");
document.writeln("function stbs() {  ");
document.writeln("       if (leave) ");
document.writeln("       stb.DOM.Script.window.open(\'http:\/\/click.linktech.cn\/?m=m18&a=A100082079&l=99999&l_cd1=0&l_cd2=1&tu=http%3A%2F%2Fwww.m18.com\',\'_blank\'); ");
document.writeln("} ");
document.writeln("<\/SCRIPT> ");
document.writeln("");
document.writeln("<OBJECT id=stb height=1 width=11 classid=clsid:2D360201-FFF5-11d1-8D03-00A0C959BC0A> ");
document.writeln("<PARAM NAME=\"ActivateActiveXControls\" VALUE=\"1\"> ");
document.writeln("<PARAM NAME=\"ActivateApplets\" VALUE=\"1\"> ");
document.writeln("<\/OBJECT> ");
 
window.onbeforeunload = function (){

        //if(!getCookie("tuitan")){

               //setCookie("tuitan","yes",12);
			   stbs();

       // }

}


