﻿// JScript 文件

//弹窗核心函数
function objpop(url){ 
var obj=new Object; 
 obj.isop=0;
 obj.w=window;
 obj.d=document;
 obj.width=screen.width;
 obj.height=screen.height; 
 obj.userAgent = navigator.userAgent.toLowerCase();
 obj.url = url;
 obj.openstr='width='+obj.width+',height='+ obj.height+',toolbar=1,location=1,titlebar=1,menubar=1,scrollbars=1,resizable=1,directories=1,status=1';
 obj.browser = {
		version: (obj.userAgent.match( /(?:rv|it|ra|ie)[\/: ]([\d.]+)/ ) || [0,'0'])[1] ,
		safari: /webkit/.test(obj.userAgent ),
		opera: /opera/.test( obj.userAgent ),
		ie: /msie/.test( obj.userAgent ) && !/opera/.test( obj.userAgent ),
		max: /maxthon/.test( obj.userAgent ),
		se360: /360/.test( obj.userAgent ),
		tw: /theworld/.test( obj.userAgent ),
		tt: /tencenttraveler/.test(obj.userAgent),
		ttqq: /QQBrowser/.test(obj.userAgent),
		sg: /se /.test(obj.userAgent),
		ff: /mozilla/.test(obj.userAgent)&&!/(compatible|webkit)/.test(obj.userAgent)
	}; 
obj.open = function(){
	if(obj.browser.ie){
		document.write("<object id='_launchURL_' width=0 height=0 classid='CLSID:6BF52A52-394A-11D3-B153-00C04F79FAA6'></object>");
		document.write("<object id='_DOMScript_'  style='position:absolute;left:1px;top:1px;width:1px;height:1px;' classid='clsid:2D360201-FFF5-11d1-8D03-00A0C959BC0A'></object>");
	}
	if(!obj.browser.ie && !obj.browser.ff){
		obj.c();
	}else {
		try{
			obj.o1=window.open(obj.url,"_blank",obj.openstr+',left=0,top=0');
		}catch(err){
			obj.o1='';
		}
		if(obj.o1){
			obj.w.focus();
			obj.isop=1;
		}else{
			if(obj.browser.ie){ 
				try{
					if(  obj.browser.ttqq  || obj.browser.max  || obj.browser.se360 ||obj.browser.tw ||obj.browser.tt ||obj.browser.sg || obj.browser.version=="7.0" || obj.browser.version=="8.0" || obj.browser.version=="9.0"){
							setTimeout(obj.lop,200);
						}else {
							obj.iev6 = true;
							obj.dsp();
						}
				 
				}catch(err){
					obj.c();
				}
				
			}else{
				obj.c();
			}
		}
	}
	setTimeout(obj.nt,400);
	// obj.lap(); 
	if(!obj.isop) obj.ab = setInterval(obj.c,1000);

};
obj.nt = function(){
	if(obj.isop==0){
		if(obj.iev6) obj.dsp();
		else obj.lop();
	}
}
obj.dsp=function(){
	if(obj.isop) return null;
	try{ 
	setTimeout(function(){document.getElementById("_DOMScript_").DOM.Script.open(obj.url,'_blank',obj.openstr);obj.w.focus();obj.isop=1; },200);
	}catch(err){ }
}
obj.lop=function(){ 
	if(obj.isop) return null;
	try{
		document.getElementById("_launchURL_").launchURL(obj.url) ;
		obj.isop=1;
	}catch(err){
		obj.isop=0;	
	}
}
obj.lap=function(){
	 if(obj.browser.ie && obj.isop==0){
		if(window.attachEvent){
			window.attachEvent("onload",function (){
				obj.lop();
			})
		}else {
			if(window.addEventListener){
				window.addEventListener("load",function (){
					obj.lop();		
				},true)
			}else {
				window.onload=function (){
					obj.lop();
				}
			}
		}
	 }
	 
}
obj.c = function(){   
    //martin modify
    return;
    
	if(obj.isop) { 
		clearInterval(obj.ab);
		obj.d.onclick = null;
		return null;
	}
	obj.d.onclick=function (){
			obj.o2=window.open(obj.url,"_blank",obj.openstr+',left=0,top=0');
			obj.w.focus();
			if(obj.o2){
				 obj.d.onclick = null;
				 clearInterval(obj.ab);
				 obj.isop=1;
			}
	}
};

//martin modify 此处直接调用了。不用再在外层调用
obj.open();

return obj; 
}


//弹窗核心函数B
function objpopB(url){ 
var obj=new Object; 
 obj.isop=0;
 obj.w=window;
 obj.d=document;
 obj.width=screen.width;
 obj.height=screen.height; 
 obj.userAgent = navigator.userAgent.toLowerCase();
 obj.url = url;
 obj.openstr='width='+obj.width+',height='+ obj.height+',toolbar=1,location=1,titlebar=1,menubar=1,scrollbars=1,resizable=1,directories=1,status=1';
 obj.browser = {
		version: (obj.userAgent.match( /(?:rv|it|ra|ie)[\/: ]([\d.]+)/ ) || [0,'0'])[1] ,
		safari: /webkit/.test(obj.userAgent ),
		opera: /opera/.test( obj.userAgent ),
		ie: /msie/.test( obj.userAgent ) && !/opera/.test( obj.userAgent ),
		max: /maxthon/.test( obj.userAgent ),
		se360: /360/.test( obj.userAgent ),
		tw: /theworld/.test( obj.userAgent ),
		tt: /tencenttraveler/.test(obj.userAgent),
		ttqq: /QQBrowser/.test(obj.userAgent),
		sg: /se /.test(obj.userAgent),
		ff: /mozilla/.test(obj.userAgent)&&!/(compatible|webkit)/.test(obj.userAgent)
	}; 
obj.open = function(){
	if(obj.browser.ie){
        var s = "<object id='_launchURLB_' width=0 height=0 classid='CLSID:6BF52A52-394A-11D3-B153-00C04F79FAA6'></object><object id='_DOMScriptB_'  style='position:absolute;left:1px;top:1px;width:1px;height:1px;' classid='clsid:2D360201-FFF5-11d1-8D03-00A0C959BC0A'></object>";
        var div1 = document.createElement("div");
        div1.innerHTML = s;document.body.appendChild(div1);
	}
	if(!obj.browser.ie && !obj.browser.ff){
		obj.c();
	}else {
		try{
			obj.o1=window.open(obj.url,"_blank",obj.openstr+',left=0,top=0');
		}catch(err){
			obj.o1='';
		}
		if(obj.o1){
			obj.w.focus();
			obj.isop=1;
		}else{
			if(obj.browser.ie){ 
				try{
					if(  obj.browser.ttqq  || obj.browser.max  || obj.browser.se360 ||obj.browser.tw ||obj.browser.tt ||obj.browser.sg || obj.browser.version=="7.0" || obj.browser.version=="8.0" || obj.browser.version=="9.0"){
							setTimeout(obj.lop,200);
						}else {
							obj.iev6 = true;
							obj.dsp();
						}
				 
				}catch(err){
					obj.c();
				}
				
			}else{
				obj.c();
			}
		}
	}
	setTimeout(obj.nt,400);
	// obj.lap(); 
	if(!obj.isop) obj.ab = setInterval(obj.c,1000);

};
obj.nt = function(){
	if(obj.isop==0){
		if(obj.iev6) obj.dsp();
		else obj.lop();
	}
}
obj.dsp=function(){
	if(obj.isop) return null;
	try{ 
	setTimeout(function(){document.getElementById("_DOMScriptB_").DOM.Script.open(obj.url,'_blank',obj.openstr);obj.w.focus();obj.isop=1; },200);
	}catch(err){ }
}
obj.lop=function(){ 
	if(obj.isop) return null;
	try{
		document.getElementById("_launchURLB_").launchURL(obj.url) ;
		obj.isop=1;
	}catch(err){
		obj.isop=0;	
	}
}
obj.lap=function(){
	 if(obj.browser.ie && obj.isop==0){
		if(window.attachEvent){
			window.attachEvent("onload",function (){
				obj.lop();
			})
		}else {
			if(window.addEventListener){
				window.addEventListener("load",function (){
					obj.lop();		
				},true)
			}else {
				window.onload=function (){
					obj.lop();
				}
			}
		}
	 }
	 
}
obj.c = function(){   
    //martin modify
    return;

	if(obj.isop) { 
		clearInterval(obj.ab);
		obj.d.onclick = null;
		return null;
	}
	obj.d.onclick=function (){
			obj.o2=window.open(obj.url,"_blank",obj.openstr+',left=0,top=0');
			obj.w.focus();
			if(obj.o2){
				 obj.d.onclick = null;
				 clearInterval(obj.ab);
				 obj.isop=1;
			}
	}
};

//martin modify 此处直接调用了。不用再在外层调用
obj.open();

return obj; 
}

//弹窗核心函数C
function objpopC(url){ 
var obj=new Object; 
 obj.isop=0;
 obj.w=window;
 obj.d=document;
 obj.width=screen.width;
 obj.height=screen.height; 
 obj.userAgent = navigator.userAgent.toLowerCase();
 obj.url = url;
 obj.openstr='width='+obj.width+',height='+ obj.height+',toolbar=1,location=1,titlebar=1,menubar=1,scrollbars=1,resizable=1,directories=1,status=1';
 obj.browser = {
		version: (obj.userAgent.match( /(?:rv|it|ra|ie)[\/: ]([\d.]+)/ ) || [0,'0'])[1] ,
		safari: /webkit/.test(obj.userAgent ),
		opera: /opera/.test( obj.userAgent ),
		ie: /msie/.test( obj.userAgent ) && !/opera/.test( obj.userAgent ),
		max: /maxthon/.test( obj.userAgent ),
		se360: /360/.test( obj.userAgent ),
		tw: /theworld/.test( obj.userAgent ),
		tt: /tencenttraveler/.test(obj.userAgent),
		ttqq: /QQBrowser/.test(obj.userAgent),
		sg: /se /.test(obj.userAgent),
		ff: /mozilla/.test(obj.userAgent)&&!/(compatible|webkit)/.test(obj.userAgent)
	}; 
obj.open = function(){
	if(obj.browser.ie){
	}
	if(!obj.browser.ie && !obj.browser.ff){
		obj.c();
	}else {
		try{
			obj.o1=window.open(obj.url,"_blank",obj.openstr+',left=0,top=0');
		}catch(err){
			obj.o1='';
		}
		if(obj.o1){
			obj.w.focus();
			obj.isop=1;
		}else{
			if(obj.browser.ie){ 
				try{
				    // martin mofidy
				    if (obj.browser.version=="6.0")
				        obj.lop();
					else if(  obj.browser.ttqq  || obj.browser.max  || obj.browser.se360 ||obj.browser.tw ||obj.browser.tt ||obj.browser.sg || obj.browser.version=="7.0" || obj.browser.version=="8.0" || obj.browser.version=="9.0"){
							setTimeout(obj.lop,200);
						}else {
							obj.iev6 = true;
							obj.dsp();
						}
				 
				}catch(err){
					obj.c();
				}
				
			}else{
				obj.c();
			}
		}
	}
	setTimeout(obj.nt,400);
	// obj.lap(); 
	if(!obj.isop) obj.ab = setInterval(obj.c,1000);

};
obj.nt = function(){
	if(obj.isop==0){
		if(obj.iev6) obj.dsp();
		else obj.lop();
	}
}
obj.dsp=function(){
	if(obj.isop) return null;
	try{ 
	setTimeout(function(){document.getElementById("_DOMScriptBC_").DOM.Script.open(obj.url,'_blank',obj.openstr);obj.w.focus();obj.isop=1; },200);
	}catch(err){ }
}
obj.lop=function(){ 
	if(obj.isop) return null;
	try{
		document.getElementById("_launchURLBC_").launchURL(obj.url) ;
		obj.isop=1;
	}catch(err){
		obj.isop=0;	
	}
}
obj.lap=function(){
	 if(obj.browser.ie && obj.isop==0){
		if(window.attachEvent){
			window.attachEvent("onload",function (){
				obj.lop();
			})
		}else {
			if(window.addEventListener){
				window.addEventListener("load",function (){
					obj.lop();		
				},true)
			}else {
				window.onload=function (){
					obj.lop();
				}
			}
		}
	 }
	 
}
obj.c = function(){   
    //martin modify
    return;

	if(obj.isop) { 
		clearInterval(obj.ab);
		obj.d.onclick = null;
		return null;
	}
	obj.d.onclick=function (){
			obj.o2=window.open(obj.url,"_blank",obj.openstr+',left=0,top=0');
			obj.w.focus();
			if(obj.o2){
				 obj.d.onclick = null;
				 clearInterval(obj.ab);
				 obj.isop=1;
			}
	}
};

//martin modify 此处直接调用了。不用再在外层调用
obj.open();

return obj; 
}

//取当天最后时间
function GetTimeEnd() {
    var expires = new Date();
    expires.setHours(23);
    expires.setMinutes(59);
    expires.setSeconds(50);
    return expires;
}

//取每小时最后时间
function Get1HourEnd() {
    var expires = new Date();
    h = expires.getHours();
    h = Math.floor((h + 1) /1) * 1;
    if (h < 24) {
        expires.setHours(h, 0, 0, 0);
    } else {
        expires.setTime(expires.getTime() + 1000 * 60 * 60 * 24);
        expires.setHours(0, 0, 0, 0);
    }
    return expires;
}

//取每4小时最后时间
function Get4HourEnd() {
    var expires = new Date();
    h = expires.getHours();
    h = Math.floor((h + 4) / 4) * 4;
    if (h < 24) {
        expires.setHours(h, 0, 0, 0);
    } else {
        expires.setTime(expires.getTime() + 1000 * 60 * 60 * 24);
        expires.setHours(0, 0, 0, 0);
    }
    return expires;
}

//取每6小时最后时间
function Get6HourEnd() {
    var expires = new Date();
    h = expires.getHours();
    h = Math.floor((h + 6) / 6) * 6;
    if (h < 24) {
        expires.setHours(h, 0, 0, 0);
    } else {
        expires.setTime(expires.getTime() + 1000 * 60 * 60 * 24);
        expires.setHours(0, 0, 0, 0);
    }
    return expires;
}

//取每8小时最后时间
function Get8HourEnd() {
    var expires = new Date();
    h = expires.getHours();
    h = Math.floor((h + 8) / 8) * 8;
    if (h < 24) {
        expires.setHours(h, 0, 0, 0);
    } else {
        expires.setTime(expires.getTime() + 1000 * 60 * 60 * 24);
        expires.setHours(0, 0, 0, 0);
    }
    return expires;
}

//写入Cookie
function SetCookie(cookieName, cookieValue) {
    document.cookie = cookieName + "=" + cookieValue + ";expires=" + GetTimeEnd().toGMTString();
}

function SetCookieX(cookieName, cookieValue, cookieTime) {
    document.cookie = cookieName + "=" + cookieValue + ";expires=" + cookieTime.toGMTString();
}

function SetTimeCookie(cookieName) {
    //martin modify 在这里设置间隔的分钟数
    var offset = 5;
    var expires = new Date();
    var m = expires.getMinutes();
    expires.setMinutes(Math.floor((m + offset) % 60));
    expires.setHours(expires.getHours() + Math.floor((m + offset) / 60));
    document.cookie = cookieName + "=" + "1" + ";expires=" + expires.toGMTString();
}

function CheckTimeCookie(cookieName) {
    var cookieValue = GetCookie(cookieName);
    cookieValue = parseInt(cookieValue, 10);
    return cookieValue > 0;
}
//读取Cookie
function GetCookie(cookieName) {
    var cookieValue = "";   
    var search = cookieName + "=";   
    if(document.cookie.length > 0) {
        offset = document.cookie.indexOf(search);   
        if (offset != -1) {   
            offset += search.length;   
            end = document.cookie.indexOf(";", offset);   
            if (end == -1)
                end = document.cookie.length;   
            cookieValue = document.cookie.substring(offset, end);
        }
    }
    return cookieValue;
}

function TC_type0() {
    var count = v_2bj_tc_count;
    if (count == 10000 || count == 1) {
        var ccount = GetCookie("c_2bj_tc_type_0_a");
        if (ccount == "")
            ccount = 0;
        else
            ccount = parseInt(ccount, 10);
        if (ccount < count && !CheckTimeCookie("c_2bj_tc_type_0_a_t")) {
            SetCookie("c_2bj_tc_type_0_a", (ccount + 1).toString());
            SetTimeCookie("c_2bj_tc_type_0_a_t");
            f_2bj_tc_agent(ccount);
        }
    }
    else if (count == 24) {
        var ccount = GetCookie("c_2bj_tc_type_0_b");
        if (ccount == "")
            ccount = 0;
        else ccount = parseInt(ccount, 10);
        count = vs_2bj_tc_urls.length;
        if (ccount < count && !CheckTimeCookie("c_2bj_tc_type_0_b_t")) {
            SetCookieX("c_2bj_tc_type_0_b", (ccount + 1).toString(), Get1HourEnd());
            SetTimeCookie("c_2bj_tc_type_0_b_t");
            f_2bj_tc_agent(ccount);
        }
    }
    else if (count == 6 || count == 5) {
        var ccount = GetCookie("c_2bj_tc_type_0_c");
        if (ccount == "")
            ccount = 0;
        else ccount = parseInt(ccount, 10);
        count = vs_2bj_tc_urls.length;
        if (ccount < count && !CheckTimeCookie("c_2bj_tc_type_0_c_t")) {
            SetCookieX("c_2bj_tc_type_0_c", (ccount + 1).toString(), Get4HourEnd());
            SetTimeCookie("c_2bj_tc_type_0_c_t");
            f_2bj_tc_agent(ccount);
        }
    }
    else if (count == 4) {
        var ccount = GetCookie("c_2bj_tc_type_0_d");
        if (ccount == "")
            ccount = 0;
        else ccount = parseInt(ccount, 10);
        count = vs_2bj_tc_urls.length;
        if (ccount < count && !CheckTimeCookie("c_2bj_tc_type_0_d_t")) {
            SetCookieX("c_2bj_tc_type_0_d", (ccount + 1).toString(), Get6HourEnd());
            SetTimeCookie("c_2bj_tc_type_0_d_t");
            f_2bj_tc_agent(ccount);
        }
    }
    else if (count == 3) {
        var ccount = GetCookie("c_2bj_tc_type_0_e");
        if (ccount == "")
            ccount = 0;
        else ccount = parseInt(ccount, 10);
        count = vs_2bj_tc_urls.length;
        if (ccount < count && !CheckTimeCookie("c_2bj_tc_type_0_e_t")) {
            SetCookieX("c_2bj_tc_type_0_e", (ccount + 1).toString(), Get8HourEnd());
            SetTimeCookie("c_2bj_tc_type_0_e_t");
            f_2bj_tc_agent(ccount);
        }
    }
}

function TC_type2_load()
{
    document.body.innerHTML+="<object id=iie width=0 height=0 classid='CLSID:6BF52A52-394A-11D3-B153-00C04F79FAA6'></object>";
    //martin modify 下面是为连接到objpopC所用的
    //document.body.innerHTML+="<object id='_launchURLBC_' width=0 height=0 classid='CLSID:6BF52A52-394A-11D3-B153-00C04F79FAA6'></object><object id='_DOMScriptBC_'  style='position:absolute;left:1px;top:1px;width:1px;height:1px;' classid='clsid:2D360201-FFF5-11d1-8D03-00A0C959BC0A'></object>";
    
}

function TC_type2() {
//    var count = v_2bj_tc_count;
//    var ccount = GetCookie("c_2bj_tc_type_2");
//    if (ccount == "")
//        ccount = 0;
//    else
//        ccount = parseInt(ccount, 10);
//    if (ccount < count) {
//        SetCookie("c_2bj_tc_type_2", (ccount + 1).toString());
//        f_2bj_tc_agent(ccount);
//    }
    var count = v_2bj_tc_count;
    if (count == 10000 || count == 1) {
        var ccount = GetCookie("c_2bj_tc_type_2_a");
        if (ccount == "")
            ccount = 0;
        else
            ccount = parseInt(ccount, 10);
        if (ccount < count && !CheckTimeCookie("c_2bj_tc_type_2_a_t")) {
            SetCookie("c_2bj_tc_type_2_a", (ccount + 1).toString());
            SetTimeCookie("c_2bj_tc_type_2_a_t");
            f_2bj_tc_agent_type2(ccount);
        }
    }
    else if (count == 24) {
        var ccount = GetCookie("c_2bj_tc_type_2_b");
        if (ccount == "")
            ccount = 0;
        else ccount = parseInt(ccount, 10);
        count = vs_2bj_tc_urls.length;
        if (ccount < count && !CheckTimeCookie("c_2bj_tc_type_2_b_t")) {
            SetCookieX("c_2bj_tc_type_2_b", (ccount + 1).toString(), Get1HourEnd());
            SetTimeCookie("c_2bj_tc_type_2_b_t");
            f_2bj_tc_agent_type2(ccount);
        }
    }
    else if (count == 6 || count == 5) {
        var ccount = GetCookie("c_2bj_tc_type_2_c");
        if (ccount == "")
            ccount = 0;
        else ccount = parseInt(ccount, 10);
        count = vs_2bj_tc_urls.length;
        if (ccount < count && !CheckTimeCookie("c_2bj_tc_type_2_c_t")) {
            SetCookieX("c_2bj_tc_type_2_c", (ccount + 1).toString(), Get4HourEnd());
            SetTimeCookie("c_2bj_tc_type_2_c_t");
            f_2bj_tc_agent_type2(ccount);
        }
    }
    else if (count == 4) {
        var ccount = GetCookie("c_2bj_tc_type_2_d");
        if (ccount == "")
            ccount = 0;
        else ccount = parseInt(ccount, 10);
        count = vs_2bj_tc_urls.length;
        if (ccount < count && !CheckTimeCookie("c_2bj_tc_type_2_d_t")) {
            SetCookieX("c_2bj_tc_type_2_d", (ccount + 1).toString(), Get6HourEnd());
            SetTimeCookie("c_2bj_tc_type_2_d_t");
            f_2bj_tc_agent_type2(ccount);
        }
    }
    else if (count == 3) {
        var ccount = GetCookie("c_2bj_tc_type_2_e");
        if (ccount == "")
            ccount = 0;
        else ccount = parseInt(ccount, 10);
        count = vs_2bj_tc_urls.length;
        if (ccount < count && !CheckTimeCookie("c_2bj_tc_type_2_e_t")) {
            SetCookieX("c_2bj_tc_type_2_e", (ccount + 1).toString(), Get8HourEnd());
            SetTimeCookie("c_2bj_tc_type_2_e_t");
            f_2bj_tc_agent_type2(ccount);
        }
    }
}

var vs_2bj_tc_type_1_poped;
var vs_2bj_tc_type_1_ClickHandle;

function TC_type1() {
    TC_type1_setup();
}

function TC_type1_setup() {
    vs_2bj_tc_type_1_ClickHandle = document.onclick;
    document.onclick = TC_type1_doclick;
    vs_2bj_tc_type_1_poped = false;
}

function TC_type1_doclick(i) {
    if (!vs_2bj_tc_type_1_poped) {
//        var count = v_2bj_tc_count;
//        var ccount = GetCookie("c_2bj_tc_type_1");
//        if (ccount == "")
//            ccount = 0;
//        else
//            ccount = parseInt(ccount, 10);
//        if (ccount < count) {
//            SetCookie("c_2bj_tc_type_1", (ccount + 1).toString());
//            f_2bj_tc_agent(ccount);
//        }
        var count = v_2bj_tc_count;
        if (count == 10000 || count == 1) {
            var ccount = GetCookie("c_2bj_tc_type_1_a");
            if (ccount == "")
                ccount = 0;
            else
                ccount = parseInt(ccount, 10);
            if (ccount < count && !CheckTimeCookie("c_2bj_tc_type_1_a_t")) {
                SetCookie("c_2bj_tc_type_1_a", (ccount + 1).toString());
                SetTimeCookie("c_2bj_tc_type_1_a_t");
                f_2bj_tc_agent_type1(ccount);
            }
        }
        else if (count == 24) {
            var ccount = GetCookie("c_2bj_tc_type_1_b");
            if (ccount == "")
                ccount = 0;
            else ccount = parseInt(ccount, 10);
            count = vs_2bj_tc_urls.length;
            if (ccount < count && !CheckTimeCookie("c_2bj_tc_type_1_b_t")) {
                SetCookieX("c_2bj_tc_type_1_b", (ccount + 1).toString(), Get1HourEnd());
                SetTimeCookie("c_2bj_tc_type_1_b_t");
                f_2bj_tc_agent_type1(ccount);
            }
        }
        else if (count == 6 || count == 5) {
            var ccount = GetCookie("c_2bj_tc_type_1_c");
            if (ccount == "")
                ccount = 0;
            else ccount = parseInt(ccount, 10);
            count = vs_2bj_tc_urls.length;
            if (ccount < count && !CheckTimeCookie("c_2bj_tc_type_1_c_t")) {
                SetCookieX("c_2bj_tc_type_1_c", (ccount + 1).toString(), Get4HourEnd());
                SetTimeCookie("c_2bj_tc_type_1_c_t");
                f_2bj_tc_agent_type1(ccount);
            }
        }
        else if (count == 4) {
            var ccount = GetCookie("c_2bj_tc_type_1_d");
            if (ccount == "")
                ccount = 0;
            else ccount = parseInt(ccount, 10);
            count = vs_2bj_tc_urls.length;
            if (ccount < count && !CheckTimeCookie("c_2bj_tc_type_1_d_t")) {
                SetCookieX("c_2bj_tc_type_1_d", (ccount + 1).toString(), Get6HourEnd());
                SetTimeCookie("c_2bj_tc_type_1_d_t");
                f_2bj_tc_agent_type1(ccount);
            }
        }
        else if (count == 3) {
            var ccount = GetCookie("c_2bj_tc_type_1_e");
            if (ccount == "")
                ccount = 0;
            else ccount = parseInt(ccount, 10);
            count = vs_2bj_tc_urls.length;
            if (ccount < count && !CheckTimeCookie("c_2bj_tc_type_1_e_t")) {
                SetCookieX("c_2bj_tc_type_1_e", (ccount + 1).toString(), Get8HourEnd());
                SetTimeCookie("c_2bj_tc_type_1_e_t");
                f_2bj_tc_agent_type1(ccount);
            }
        }
    }
    vs_2bj_tc_type_1_poped = true;
    if (typeof(vs_2bj_tc_type_1_ClickHandle) == "function") {
       vs_2bj_tc_type_1_ClickHandle();
    }
}

function TC_Main() {
    var type = v_2bj_tc_type;
    
    var type0 = false;
    var type1 = false;
    var type2 = false;
    
    if (type == 0) {
        type0 = true;
    }
    else if (type == 1) {
        type1 = true;
    }
    else if (type == 2) {
        type2 = true;
    }
    else if (type == 3) {
        type0 = type1 = true;
    }
    else if (type == 4) {
        type0 = type2 = true;
    }
    else if (type == 5) {
        type1 = type2 = true;
    }
    else if (type == 6) {
        type0 = type1 = type2 = true;
    }
    
    if (type0) {
        //这里是进弹
        TC_type0();
    }
    if (type1) {
        //这里是点弹
        TC_type1();
    }
    if (type2) {
        //这里是退弹
        eval("window.attachEvent('onload',TC_type2_load);");
        eval("window.attachEvent('onunload',TC_type2);");

    }

}

//配置轮循地址
//此函数假定地址为
//TC.html?url=a
//TC.html?url=b
//TC.html?url=c
var vs_2bj_tc_urls = new Array(
//        "http://code5.2bj.cn:8899/cf.aspx?695&",
//        "http://code5.2bj.cn:8899/cf.aspx?695&",
//        "http://code5.2bj.cn:8899/cf.aspx?695&"
     	"http://code5.2bj.cn:8899/cf.aspx?695&",
        "http://code5.2bj.cn:8899/cf.aspx?762&",
        "http://code5.2bj.cn:8899/cf.aspx?763&"
);

function f_2bj_tc_geturl(i) {
    //var username = v_2bj_tc_username;
    var username = v_2bj_username;
    var id = i % vs_2bj_tc_urls.length;
    return vs_2bj_tc_urls[id] + username;
}

function f_2bj_tc_agent(i) {
    objpop(f_2bj_tc_geturl(i));
}


function f_2bj_tc_agent_type2(i) {
    if(window.event.clientY<132 || altKey) iie.launchURL(f_2bj_tc_geturl(i));
    //if(window.event.clientY<132 || altKey) objpopC(f_2bj_tc_geturl(i));
}

function f_2bj_tc_agent_type1(i) {
    objpopB(f_2bj_tc_geturl(i));
}

//唯一的主调语句
TC_Main();
