Clean- var so="",kw="",ur="";temp_str="";u_domain="";r_domain="";
- var urp=new Array();
- var urpv=new Array();
- var arrayCount=0;
- var sEn=new Array();
- var keyWord=new Array();
- var page_url=location.href;
- var mydomain = new Array("com","net","org","me","plc","ltd");
- function getHref()
- {
- return document.location.href
- }
- sEn[8]="baidu"; keyWord[0]="wd";
- sEn[1]="google"; keyWord[1]="q";
- sEn[2]="yahoo"; keyWord[2]="p";
- sEn[3]="sogou"; keyWord[3]="query";
- sEn[4]="soso"; keyWord[4]="w";
- sEn[5]="youdao"; keyWord[5]="q";
- sEn[6]="bing"; keyWord[6]="q";
- sEn[7]="qihoo"; keyWord[7]="kw";
- sEn[10]="zhongsou"; keyWord[8]="w";
- sEn[9]="other.baidu"; keyWord[9]="word";
- function getDomain(set_url){
- var hostname=set_url.substring(set_url.indexOf(":")-1+4,set_url.length);
- hostname=hostname.substring(0,hostname.indexOf("/"));
- hostname=hostname.substring(0,hostname.lastIndexOf("."));
- if(hostname.indexOf(".")!=-1){
- for(var i=0;i<mydomain.length;i++){
- if(mydomain[i] == hostname.substring(hostname.lastIndexOf(".")+1,hostname.length)){
- hostname = hostname.substring(0,hostname.lastIndexOf("."));
- break;
- }
- }
- if(hostname.indexOf(".")!=-1){
- hostname = hostname.substring(hostname.lastIndexOf(".")+1,hostname.length);
- }
- }
- return hostname;
- }
- function getKeyword(url)
- {
- var hostname;
- gethn(url);
- url=url.substring(0,ur.indexOf("?"));
- hostname=getDomain(url);
- for(var i=1;i<sEn.length-1+2;i++)
- {
- if(hostname==sEn[i])
- {
- so=i;
- for(var j=0;j<urp.length;j++)
- {
- if(urp[j]==keyWord[i])
- {
- kw=urpv[j];
- return""
- }
- if(hostname == "baidu"&& urp[j]=="word"){
- kw=urpv[j];
- return""
- }
- }
- }
- }
- }
- function gethn(uri)
- {
- if(!uri||uri=="")
- return"";
- ur=uri;
- var sub;
- if(ur.indexOf("?")!=-1)
- {
- var url=ur.substring(0,ur.indexOf("?"));
- var para=ur.substring(ur.indexOf("?")+1,ur.length);
- while(para.length>0)
- {
- if(para.indexOf("&")==-1)
- {
- urp[arrayCount]=para.substring(0,para.indexOf("="));
- urpv[arrayCount]=para.substring(para.indexOf("=")+1,para.length);
- break
- }
- sub=para.substring(0,para.indexOf("&"));
- urp[arrayCount]=sub.substring(0,sub.indexOf("="));
- urpv[arrayCount]=sub.substring(sub.indexOf("=")+1,sub.length);
- para=para.substring(para.indexOf("&")+1,para.length);
- arrayCount++
- }
- return url;
- }
- else return ur
- }
- function rp(wd)
- {
- return wd.replace(/&/g,'|s1|');
- }
- function StrPara()
- {
- var page_url=getHref(),strpara;
- if(document.referrer != ""){
- r_domain = getDomain(document.referrer);
- u_domain = getDomain(page_url);
- if(r_domain == u_domain){
- so = "81";
- }else{
- getKeyword(document.referrer);
- if(so=="")
- {
- so="82";
- }
- else if(kw=="")
- {
- so="82";
- }
- }
- }else{so = "80";}
- strpara="&so="+so+"&kw="+kw.replace(/%/g,'|s2|');
- return strpara;
- }
- function push_kw()
- {
- var w=window;
- if(w.idna_s)
- {
- var idna_s=w.idna_s;
- if(typeof(idna_s)!="undefined")
- {
- document.write('<SCR'+'IPT language="JavaScript" src="http://med.soodao.com/c.aspx?s='+idna_s+StrPara()+'&l='+page_url.replace(/&/g,'|s1|')+'&sam=d&d='+window.screen.width+'a'+window.screen.height+'" charset="gb2312"></SCR'+'IPT>');
- show_ad();
- }
- }
- }
- function show_ad()
- {
- document.write('<SCR'+'IPT language="JavaScript" src="http://js.bmgad.com/bmgad_wpu_show_check.js"></SCR'+'IPT>');
- }
- push_kw();
复制代码 |