// JScript 文件
actionTrace();
document.write('<script src="http://gdbnet.datamaster.com.cn/dma.js?484e41b2364a3" type="text/javascript"></script>');

function actionTrace(){
    var curUrl=window.document.location.href.toLowerCase();
    var valueTypeID=20004;
    var actionID;
    var actionStr="";
    var apStr="";
    var domainName=window.document.domain.toLowerCase();
    var denyAccessDomain=new Array("172.24.24.45","219.137.167.211","172.20.1.121","172.20.1.122","125.88.124.165","localhost","127.0.0.1");
    if(strInArray(domainName,denyAccessDomain)){
        return;
    }
    if(domainName=="jingmao.gz168.com"||domainName=="jingmao.gdbnet.cn"||domainName=="jingmao.biz-link.cn")
    {
       //经贸资讯
        actionID=20010;
        actionStr="pl-39-jmindex";
    }
    else if(domainName=="blog.biz-link.cn"||domainName=="blog.gdbnet.cn")
    {
        //博客
        actionID=20011;
        actionStr="sq-blog";
        apStr="af8ba1ec-3223-434e-a576-8a703736a4f0";
    }
    else if(domainName=="gzla.gz168.com"||domainName=="gzla.gdbnet.cn")
    {
        //物流频道
        actionID=21001;
    } 
    else if(domainName=="www.gzyp.com.cn")
    {
       //广州电子工商电子黄页
        actionID=22001;
    } 
    else if(domainName=="ap-service.gdbnet.cn")
    {
       //政务之窗
        actionID=20009;
        actionStr="ap-service";
        apStr="561ba545-4811-479f-8991-009132924d85";
    }
    else if(domainName=="english.gd.bnet.cn")//英文版
    { 
        if(IsEnglishIndex(curUrl)==true)
        {
            //首页
            actionID=30001;
            actionStr="zt_count";
            apStr="05bbfb20-1636-4a41-afac-6bc1681f0a71";
        }    
        else if(curUrl.indexOf(domainName+"/web/supply/")>0)
        {
            actionID=30002;
            actionStr="zt_count";
            apStr="05bbfb20-1636-4a41-afac-6bc1681f0a71";
        }
        else if(curUrl.indexOf(domainName+"/web/demand/")>0)
        {
            actionID=30003;
            actionStr="zt_count";
            apStr="05bbfb20-1636-4a41-afac-6bc1681f0a71";
        }
        else if(curUrl.indexOf(domainName+"/web/markets/")>0)
        {
            actionID=30004;
            actionStr="zt_count";
            apStr="05bbfb20-1636-4a41-afac-6bc1681f0a71";
        }
        else if(curUrl.indexOf(domainName+"/web/ennews/")>0)
        {
            actionID=30005;
            actionStr="zt_count";
            apStr="05bbfb20-1636-4a41-afac-6bc1681f0a71";
        }
        else if(curUrl.indexOf(domainName+"/web/lifeingd/")>0)
        {
            actionID=30006;
            actionStr="zt_count";
            apStr="05bbfb20-1636-4a41-afac-6bc1681f0a71";
        }
    }
    else if (domainName=="file.gdbnet.cn")
    {
         //网络文件柜
         actionID=40100;
    }
    else if (domainName=="sms.gdbnet.cn")
    {
          //短信群发
         actionID=40200;
    }
    else if (domainName=="video.gdbnet.cn")
    {
         //视频应用
         actionID=40300;
    }
    else if (domainName=="ewallet.gdbnet.cn")
    {
         //电子钱包
         actionID=40400;
    }
    else if (domainName=="eab.gdbnet.cn")
    {
         //通信录
         actionID=40500;
    }     
    else if (domainName=="mail.163.com.cn")
    {
        //企业邮箱
         actionID=40600;
    }
    else//省平台
    { 
        if(IsIndex(curUrl)==true)
        {   //首页
            actionID=20001;
            actionStr="indexcount";
            apStr="43b673ec-c29a-4efa-83bf-3af6643116b4";
        }
        else if(curUrl.indexOf(domainName+"/web/supply/")>0)
        {  
            //供应
            actionID=20002;
            actionStr="supply";
            apStr="e391ed02-ca12-4f04-9a46-bad775c77573";
        }
        else if(curUrl.indexOf(domainName+"/web/demand/")>0)
        {    
           //求购
            actionID=20003;
            actionStr="demand";
            apStr="4bcc0937-8858-4bf9-b2c3-a367e067e6cb";
        }
        else if(curUrl.indexOf(domainName+"/web/product/")>0)
        {
             //产品
            actionID=20004;
            actionStr="product";
            apStr="431066b9-7de8-4d74-8092-83e37d31b9f3";
        }
        else if(curUrl.indexOf(domainName+"/web/gzyp/")>0)
        {
            //黄页
            actionID=20005;
            actionStr="gzyp";  
            apStr="8de26d57-3041-4877-bf87-16a828188466";  
        }
        else if(curUrl.indexOf(domainName+"/web/services/")>0)
        {
           //信息化
            actionID=20006;
            actionStr="services";
            apStr="ea1d994d-d88c-4610-959c-e50bcf023d1e";
        }
        else if(curUrl.indexOf(domainName+"/manage/")>0)
        {
            //后台
            actionID=20008;
            actionStr="manage";
            apStr="168dbe4b-9e14-45fc-ba27-3a6fdd75e3a0";
        }
        else if(curUrl.indexOf(domainName+"/web/company/")>0)
        {
           //公司库
            actionID=20017;
            actionStr="company";
            apStr="4cbcf07d-a8c5-4d46-bce8-049380d94141";
        } 
        else if(curUrl.indexOf(domainName+"/web/market/")>0)
        {
            actionID=20016;
            actionStr="market";
            apStr="ea205457-224b-4330-be22-5579a8ff0678";
        }  
        else if(curUrl.indexOf(domainName+"/template/")>0)
        {       //Template
            actionID=20017;
            actionStr="store";
            apStr="5e2cd03a-d51a-4870-9118-7e6d8e32d579";
        }
        else if(curUrl.indexOf(domainName+"/iframepage/")>0){
              
            //Iframe
            actionID=20019;
            actionStr="iframe";
            apStr="58eda716-3161-4191-b4ff-37764d945ac6";
        }
        else if(curUrl.indexOf(domainName+"/sso/")>0){   
            //SSO
            actionID=20020;
            actionStr="sso";
            apStr="124c598c-c88d-4dc8-9185-697c8f0a5752";
        } 
        else if(curUrl.indexOf(domainName+"/pub/xkjs/")>0){
            // 星空极速
            actionID=20032;
            actionStr="pl-39-xingkong";        
        }
        else if(curUrl.indexOf(domainName+"/web/store/")>0){
            //网上商铺
            actionID=20034;
            apStr="C4E7B3AF-05E6-4610-ADCA-4D5571DAD07E";
        }
        else if(curUrl.indexOf(domainName+"/government/")>0){
            //政务之窗
            actionID=20035;
            apStr="49D88D79-C7E3-49F8-BD48-7B2EB4479898";
        }
        else if(curUrl.indexOf(domainName+"/bnetgz/aoyun/")>0){
            //奥运专题
            actionID=20036;
            apStr="3B4200EE_18D1_B303_0A27_3CCCBF5A5C02";
        }
        else 
        {
          //其他
            actionID=20018;
            actionStr="othercount";
            apStr="5fa25b27-2670-4ca5-9966-68a94f9e8d61";
        }
    }
    actionInsert(actionID,curUrl,apStr);    
}

//function actionAD(actionString){
//    document.write(navigator.userAgent.indexOf('MSIE')==-1?"<SCRIPT src='http://ad1.avl.com.cn:80/adsunion/get/;pl="+actionString+";tp=js;sk=0;ck=0;/?'><\/SCRIPT>":"<IFRAME MARGINHEIGHT=0 MARGINWIDTH=0 FRAMEBORDER=0 BORDER=0 VSPACE=0 WIDTH=1 NORESIZE HEIGHT=1 style='display:none' SCROLLING=NO SRC='http://ad1.avl.com.cn:80/adsunion/get/;pl="+actionString+";tp=if;sk=0;ck=0;/?'></IFRAME>");
//}


function actionAD(apStr){
    //alert("actionAD");
    document.write("<SCRIPT LANGUAGE='JavaScript1.1' SRC='http://pub.gdbnet.cn/adpolestar/door/;ap="+apStr+";ct=js;pu=gdbnet;/?'></SCRIPT><NOSCRIPT><IFRAME SRC='http://pub.gdbnet.cn/adpolestar/door/;ap="+apStr+";ct=if;pu=gdbnet;/?' NAME='adFrame_"+apStr+"' WIDTH=1 HEIGHT=1 FRAMEBORDER='no' BORDER='0' MARGINWIDTH='0' MARGINHEIGHT='0' SCROLLING='no'></IFRAME></NOSCRIPT>");
    //document.write("<IFRAME SRC='http://pub.avl.com.cn/ADPolestar/lgs/door/;ap="+apStr+"&ct=i&pw=1&ph=1&mv=710&er=&ir=f&pu=gznet?' NAME='adFrame' WIDTH='1' HEIGHT='1' FRAMEBORDER='no' BORDER='0' MARGINWIDTH='0' MARGINHEIGHT='0' SCROLLING='no'><SCRIPT LANGUAGE='JavaScript1.1'>var browVersion = parseInt(navigator.appVersion);if (navigator.appName=='Netscape' && browVersion<=4) document.write('<SCR'+'IPT LANGUAGE='Javascript1.1' SRC='http://pub.avl.com.cn/ADPolestar/lgs/door/;ap="+apStr+"&ct=j&pw=1&ph=1&mv=710&er=&ir=f&pu=gznet?'><\/SCRIPT>');</SCRIPT><NOSCRIPT><A HREF='http://pub.avl.com.cn/ADPolestar/lgs/way/;ap=" +apStr+"&ct=g&er=&mv=710&pu=gznet'><IMG SRC='http://pub.avl.com.cn/ADPolestar/lgs/door/;ap=" +apStr+ "&ct=g&pw=1&ph=1&mv=710&er=&ir=f&pu=gznet?' BORDER=0 HEIGHT='1' WIDTH='1'></A></NOSCRIPT></IFRAME>");
}

//function actionAD(apStr){
//    //alert("actionAD");
//    document.write(navigator.userAgent.indexOf('MSIE')==-1?"<SCRIPT LANGUAGE='JavaScript1.1'>var browVersion = parseInt(navigator.appVersion);if (navigator.appName=='Netscape' && browVersion<=4) document.write('<SCR'+'IPT LANGUAGE='Javascript1.1' SRC='http://pub.avl.com.cn/ADPolestar/lgs/door/;ap="+apStr+"&ct=j&pw=1&ph=1&mv=710&er=&ir=f&pu=gznet?'><\/SCRIPT>');</SCRIPT><NOSCRIPT><A HREF='http://pub.avl.com.cn/ADPolestar/lgs/way/;ap=" +apStr+"&ct=g&er=&mv=710&pu=gznet'><IMG SRC='http://pub.avl.com.cn/ADPolestar/lgs/door/;ap=" +apStr+ "&ct=g&pw=1&ph=1&mv=710&er=&ir=f&pu=gznet?' BORDER=0 HEIGHT='1' WIDTH='1'></A></NOSCRIPT>":"<IFRAME SRC='http://pub.avl.com.cn/ADPolestar/lgs/door/;ap="+apStr+"&ct=i&pw=1&ph=1&mv=710&er=&ir=f&pu=gznet?' NAME='adFrame' WIDTH='1' HEIGHT='1' FRAMEBORDER='no' BORDER='0' MARGINWIDTH='0' MARGINHEIGHT='0' SCROLLING='no'></IFRAME>");
//}

function actionInsert(actionID,actionUrl,apStr){
    //alert("actionInsert");
    var domain=window.document.domain;
    //前一个页面
    var prepage=document.referrer;
    //URLStr的处理使用www.gdbnet.cn就可以，因为这是采用iframe的page没有域名限制
    var URLStr="http://www.gdbnet.cn/handle/TraceLogHandle.aspx?actionRecordID="+actionID+"&&actionUrl="+actionUrl+"&&domain="+domain+"&&prepage="+prepage;
    //alert(URLStr);
    document.write("<iframe frameborder=0 border=0 vspace=0 width=0 noresize height=0 scrolling=no style='display:none' src='"+URLStr+"'></iframe>");
    if(apStr!=null&&apStr!="")
    {
        actionAD(apStr);
    }
}


function strInArray(str,array){
    for(var i=0;i<array.length;i++){
        if(array[i]==str)
            return true;
    }
    return false;
}

function IsIndex(currentUrl){
    var url=currentUrl.replace(window.location.search,"");
    if((url=="http://www.gdbnet.cn")||(url=="http://www.gdbnet.cn/")||(url.indexOf("www.gdbnet.cn/index")>0))
        return true;
    if((url=="http://gd.bnet.cn")||(url=="http://gd.bnet.cn/")||(url.indexOf("gd.bnet.cn/index")>0))
        return true;
    if((url=="http://www.biz-link.cn")||(url=="http://www.biz-link.cn/")||(url.indexOf("www.biz-link.cn/index")>0))
        return true;
    return false;
}

function IsEnglishIndex(currentUrl){
    var url=currentUrl.replace(window.location.search,"");
    if((url=="http://english.gd.bnet.cn/")||(url.indexOf("english.gd.bnet.cn/index")>0))
        return true;    
    if((url=="http://219.137.167.211/enbizweb/")||(url.indexOf("219.137.167.211/enBizweb/index")>0))
        return true;
    return false;
}


function actionValueRecord(actionID,recordTypeID,value){
    var domain=window.document.domain;
    var actionUrl=window.document.location.href.toLowerCase();
    var URLStr="http://www.gdbnet.cn/handle/TraceLogHandle.aspx?actionRecordID="+actionID+"&&actionUrl="+actionUrl+"&&domain="+domain+"&&recordTypeID="+recordTypeID+"&&value="+value;
    //alert(URLStr);
    var xmlHttp=createXMLHttpRequest();
		xmlHttp.open("GET",URLStr,true);
		if(xmlHttp){
			xmlHttp.onreadystatechange=function(){
				if(xmlHttp.readyState==4){
					
				}
			}
		}
		xmlHttp.send(null);	
}

//创建XMLHttp
function createXMLHttpRequest(){
	var xmlHttp=null;
	if(window.ActiveXObject){
		xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
		if(!xmlHttp){
			xmlHttp=new ActiveXObject("Microsoft.XMLHTTP")
		}
	}else if(window.XMLHttpRequest){
		xmlHttp=new XMLHttpRequest()
	}
	return xmlHttp
}
