/*pub-2|2011-10-25 10:13:15*/KSLITE.declare("inf-main",["inf-chk","inf-request","inf-fix"],function(a,b){b.run=function(b){var c=a("inf-request"),d=a("inf-chk").Def,e=a("inf-fix").fix(b);d(e,function(){c.getRequest(e,function(b){KSLITE.provide(["inf-distype-"+b.t.distype],function(){a("inf-distype-"+b.t.distype).display(b)})})})}}),KSLITE.declare("inf-cur",[],function(a,b){var c=window,d=document,e={},f={},g={};e.ali=["taobao.com","alimama.com","alibaba.com","alipay.com","alisoft.com","linezing.com","tanx.com","mmstat.com"],e.kws=["wd","p","q","keyword","kw","w","key","word","query","name"],e.zmax=6,e.alimama="http://z.alimama.com/alimama.php",e.alimamal="http://z.alimama.com/alimamal.php",e.ecpm="http://t.alimama.com/alimama.php",e.ecpml="http://t.alimama.com/alimamal.php",e.tl={maxl:10,maxc:10,tc:[4,8,12],ts:[12,14,16],zmax:20,tc1:"tc1"},e.schmax=10,e.tk={tksc:"tksc1"},e.richcnt="0-0-0",e.rseed=4973,e.limit=.9,e.sc="sc1",e.mc="mc1",g.data={},g.units=[],g.p1=[],g.p2=[],g.ali=function(){var a,b=d.domain.split("."),c=e.ali,f;if(b.length>1){f="@"+b[b.length-2]+"."+b[b.length-1];if(("@"+c.join("@")).indexOf(f)>-1)return!0}return!1}(),g.bof=function(){try{var a=top.document.location;return!1}catch(b){return!0}}(),g.frm=function(){var a=!0;try{a=self.location!=top.location}catch(b){}return a}(),g.cw=window,g.mw=window,g.cd=g.cw.document,g.md=g.mw.document,g.u=function(){if(g.bof&&g.md.referrer)return g.md.referrer;if(g.frm)try{return top.document.location.href}catch(a){return g.md.referrer}return g.md.location.href}(),g.r=function(){var a="";try{a=top.document.referrer}catch(b){}return a===null&&(a=""),a}(),g.dx=function(){return g.data[e.sc]},f.one=function(a){return d.getElementById(a)},f.after=function(a,b){var c,e,f,g,h;if(!a||!b)return;c=d.createElement("div"),c.innerHTML=b,e=a.parentNode,f=a.nextSibling;while(c.childNodes.length!==0)g=c.childNodes[0],f?e.insertBefore(g,f):e.appendChild(g);c=null},f.pos=function(a,b){function d(a){return a.offsetParent?a.offsetLeft+d(a.offsetParent):a.offsetLeft}function e(a){return a.offsetParent?a.offsetTop+e(a.offsetParent):a.offsetTop}var g=f.one(a),h=d(g),i=e(g),j=c;if(b)try{if(j.parent.window&&typeof j.parent.window!="undefined"&&j!=j.parent)while(j.location!=window.top.location)h+=d.call(j.parent,j.frameElement),i+=e.call(j.parent,j.frameElement),j=j.parent.window}catch(k){}return[h,i]},e.zone={},e.zone._m="a",e.zone._ac=document.getElementsByTagName("body")[0],f.put=function(a){var b=e.zone._m,c=e.zone._ac;b=="a"?f.after(c,a):b=="c"?c.innerHTML=a:d.write(a)},f.bencodeUtf8=function(a){var b="";for(var c=0;c<a.length;c++){var d=a.charCodeAt(c);d<128?d==46||d==40||d==41||d>47&&d<58||d>64&&d<91||d>96&&d<123?b+=a.charAt(c):b+=bhex(d):127<d&&d<2048?(b+=bhex(d>>6|192),b+=bhex(d&63|128)):2047<d&&d<65536?(b+=bhex(d>>12|224),b+=bhex(d>>6&63|128),b+=bhex(d&63|128)):65535<d&&d<2097152?(b+=bhex(d>>18|240),b+=bhex(d>>12&63|128),b+=bhex(d>>6&63|128),b+=bhex(d&63|128)):2097151<d&&d<67108864?(b+=bhex(d>>24|248),b+=bhex(d>>18&63|128),b+=bhex(d>>12&63|128),b+=bhex(d>>6&63|128),b+=bhex(d&63|128)):67108863<d&&d<2147483648&&(b+=bhex(d>>30|252),b+=bhex(d>>24&63|128),b+=bhex(d>>18&63|128),b+=bhex(d>>12&63|128),b+=bhex(d>>6&63|128),b+=bhex(d&63|128))}return b},f.bencodeUrl=function(a){return typeof encodeURIComponent=="function"?encodeURIComponent(a.toString()):f.bencodeUtf8(a.toString())},f.p2s=function(a,b,c){c||(c={});var d=function(a,b){var c=0,d=/[^\x00-\xff]/;for(var e=0;e<a.length;e++){var f=a.charAt(e),g=1;d.test(f)&&(g=2),c=c+g;if(c>b*2)return a.substr(0,e)}return a},e=[];for(var g in a){var h=a[g],i=g.split("_");if(i.length<2)break;var j=i[1];if(j=="i")/[\D]/.test(h)&&(h=0),e.push(b+"_"+i[0]+"="+h);else if(j=="c"){h.indexOf("#")===0&&(h=h.substr(1));if(/[^0-9a-fA-F]/.test(h)||h.toString().length!=6)h="FFFFFF";e.push(b+"_"+i[0]+"="+h)}else j=="s"&&(c[i[0]]?h=d(h,c[i[0]]):h=d(h,10),e.push(b+"_"+i[0]+"="+f.bencodeUrl(h)))}return e},f.baddUnit=function(a){var b=new Date,c=b.getTime(),d={};d.w=window,d.pid=a.p.pid,d.t=c,d.tp=a.p.type,d.sz=a.p.sizecode,g.units.push(d)},f.baddCount=function(a,b){var c=0;for(var d=0;d<g.units.length;d++){g.units[d].pid==b.p.pid&&(c+=1);if(c>1)return}g.data[a]?g.data[a]++:g.data[a]=1},b.C=e,b.U=f,b.R=g}),KSLITE.declare("inf-antifraud",["inf-cur"],function(a,b){function l(){function l(a,b){var c="",d=1,e;d=Math.floor(a.length/b);if(d==1)c=a.substr(0,b);else for(e=0;e<b;e++)c+=a.substr(e*d,1);return c}var a="",b="",c,d,f,g,h=location,i="";if(j.ali){c=(" "+e.cookie).split(";");for(d=0;d<c.length;d++)if(c[d].indexOf(" cna=")===0){b=c[d].substr(5,24);break}}if(b===""){cu=h.search.length>9?h.search:(h.pathname.length>9?h.pathname:h.href).substr(1),c=document.cookie.split(";");for(d=0;d<c.length;d++)c[d].split("=").length>1&&(i+=c[d].split("=")[1]);i.length<16&&(i+="0123456789abcdef"),b=l(cu,8)+l(i,16)}for(d=1;d<=32;d++)f=k.floor(k.random()*16),b&&d<=b.length&&(g=b.charCodeAt(d-1),f=(f+g)%16),a+=f.toString(16);return"cg="+a}function m(){var a=k.floor(k.random()*1e4)+10001;try{j.sid?a=j.sid:(a=a-10001,j.sid=a)}catch(b){}return"ac="+a}function n(){var a=0,b=16,c=0,d,e,f,h,i,l=g[0]||4973;for(f=1;f<=b;f++)d=k.random(),e=k.random(),k.pow(d,2)+k.pow(e,2)<=1&&a++,f<=12&&(c=c+d);return h="pr"+String.fromCharCode(97+a),i=k.round(c*l)|(j.md.body?j.md.body.clientWidth:0)<<16,h+"="+i+"&cas="+h}function o(){var a,b=1,c=-1;return j.md&&(a=j.md.body,b=a.clientHeight,c=a.clientWidth),"cbh="+b+"&cbw="+c}function p(){var a,b,c="mm_ti_",d="<img name='"+c+"' id='"+c+"' style='width:0px;height:0px;padding:0px;margin:0px;border:0px;vertical-align:baseline;' border=0 />";i.put(d),b=i.pos(c,!0);try{a=i.one(c),a&&a.parentNode.removeChild(a)}catch(e){}return"sx="+b[0]+"&sy="+b[1]}function q(){var a=d.screen,b=0,c=0,e=0,f=0,g=0;try{b=a.width,c=a.height,e=a.availHeight,f=a.availWidth,g=a.colorDepth}catch(h){}return"re="+b+"x"+c+"&cah="+e+"&caw="+f+"&ccd="+g}function r(){var a="-1",b=navigator,c,d;if(b.plugins&&b.plugins.length){for(c=0;c<b.plugins.length;c++)if(b.plugins[c].name.indexOf("Shockwave Flash")!=-1){a=b.plugins[c].description.split("Shockwave Flash ")[1];break}}else if(window.ActiveXObject)for(d=10;d>=2;d--)try{var e=new Function("return new ActiveXObject('ShockwaveFlash.ShockwaveFlash."+d+"');");if(e){a=d+".0";break}}catch(f){}return a!="-1"&&(a=a.substring(0,a.indexOf(".")+2)),"cf="+a}function s(){var a=[],b=navigator;return a.push("ctz="+ -((new Date).getTimezoneOffset()/60)),a.push("chl="+history.length),a.push("cja="+(b.javaEnabled()?"1":"0")),a.push("cpl="+(b.plugins?b.plugins.length:0)),a.push("cmm="+(b.mimeTypes?b.mimeTypes.length:0)),a.push(r()),a.join("&")}var c=a("inf-cur"),d=window,e=document,f={},g=c.C,h=g.zone,i=c.U,j=c.R,k=Math;f.get=function(){return f.f||(f.f=[q(),s()].join("&")),[f.f,l(),m(),n(),o(),p()]},b.Def=f}),KSLITE.declare("inf-pageinfo",["inf-cur"],function(a,b){function l(){var a="0",b="alimamapid=",c=navigator.userAgent.toLowerCase(),d;try{d=top.location.href}catch(e){d=j.md.referrer}return c.indexOf("fox/ss")>-1&&d.indexOf(b)>-1&&d.substr(d.indexOf(b)+b.length)==g.zone.i&&(a="1"),"iss="+a}function m(){var a=location.host,b,c,d;if(-1<a.lastIndexOf("taobao.com")&&10===a.length-a.lastIndexOf("taobao.com")){b=e.cookie;if(b){b=(" "+b).split(";");for(c=0;c<b.length;c++){d=b[c].split("=");if(d[0].indexOf(" tracknick")===0)return d[1]?"uid="+d[1]:""}}}return""}function n(){var a=j.dx();return"dx="+(a?a:"")}function o(){return"u="+k(j.u)}function p(){return"r="+k(j.r)}function q(a){var b=g.kws,c,d,e;if(a)for(c=0;c<b.length;c++){d=new RegExp("[^1-9a-zA-Z]"+b[c]+"=([^&]*)"),e=a.match(d);if(e){d=new RegExp("^[0-9]*$");if(e[1].match(d)===null)return e[1]}}return""}function r(){var a=q(j.u);return a===""&&j.r&&(a=q(j.r)),"k="+a}function s(){var a="";try{a=j.md.title}catch(b){}return"tt="+k(a)}function t(a){var b="-1",c=1,f=1;if(j.frm){d.innerHeight?(c=d.innerWidth,f=d.innerHeight):e.documentElement&&e.documentElement.clientHeight?(c=e.documentElement.clientWidth,f=e.documentElement.clientHeight):e.body&&(c=e.body.clientWidth,f=e.body.clientHeight);if(f>2*a.p.height||c>2*a.p.width)b=k(d.location.href)}return"fu="+b}var c=a("inf-cur"),d=window,e=document,f={},g=c.C,h=g.zone,i=c.U,j=c.R,k=encodeURIComponent;f.get=function(a){var b;return f.f||(f.f=[l(),o(),r(),s(),p(),t(a)].join("&"),b=m(),b&&(f.f=b+"&"+f.f)),[n(),f.f]},b.Def=f}),KSLITE.declare("inf-request",["inf-antifraud","inf-pageinfo","inf-cur"],function(a,b){b.getRequest=function(b,c){function f(a,b,c){if(!a||a===""||!b||b==="")return;c.push(a+"="+b)}var d=a("inf-cur");d.R.p1=d.R.p1.length?d.R.p1:a("inf-antifraud").Def.get(),d.R.p2=d.R.p2.length?d.R.p2:a("inf-pageinfo").Def.get(b);var e=[];KSLITE.provide(["inf-type-"+b.p.type],function(){e=a("inf-type-"+b.p.type).getP(b)});var g=[];f("i",b.p.pid,g),f("w",b.p.width,g),f("h",b.p.height,g),f("sz",b.p.sizecode,g),e.length&&g.push(e.join("&")),g.push(d.R.p1.join("&")),f("rp",b.p.referpid,g),f("refpos",b.p.refpos,g),f("t",b.p.type,g),f("tc",b.p.titlecolor,g),f("dc",b.p.descolor,g),f("bgc",b.p.bgcolor,g),f("bdc",b.p.bordercolor,g),f("lc",b.p.linkcolor,g),f("bmc",b.p.bottomcolor,g),f("as",b.p.anglesize,g),f("bgp",b.p.bgpic,g),f("ic",b.p.icon,g),f("tlul",b.p.underline,g),f("tlfs",b.p.fontsize,g),typeof b.p.custom=="string"&&f("ctm",d.U.bencodeUrl(b.p.custom),g),f("pf","1",g),typeof b.p.p4p_kw=="string"&&f("p4p_kw",d.U.bencodeUrl(b.p.p4p_kw),g),typeof b.p.p4p_ai=="string"?(b.p.p4p_ai=="1"||b.p.p4p_ai=="2"||b.p.p4p_ai=="3")&&f("p4p_ai",b.p.p4p_ai,g):f("p4p_ai","1",g),g.push(d.R.p2.join("&")),b.url+=g.join("&"),c(b)}}),KSLITE.declare("inf-chk",["inf-cur"],function(a,b){b.Def=function(b,c){function e(a){var b=!0,c=0;for(var e=0;e<d.R.units.length;e++)d.R.units[e].pid==a.p.pid&&(c+=1),c>1&&(b=!1);return b}var d=a("inf-cur");b.url=d.C.alimama+"?",b.p.type&&b.p.type=="i"&&(b.url=d.C.ecpm+"?"),function(){typeof b.p.height=="undefined"&&(b.p.height=0),typeof b.p.width=="undefined"&&(b.p.width=0)}(),KSLITE.provide(["inf-type-"+b.p.type],function(){var g=a("inf-type-"+b.p.type);d.U.baddUnit(b),g.prerun(b),e(b)&&g.chk(b)&&c()})}}),KSLITE.declare("inf-fix",[],function(a,b){b.fix=function(a){var b={};b.p=a,b.url="",b.adiframe={},b.adiframe.id="tanx-a-"+b.p.pid,b.adiframe.css="",b.t={},b.btl={l:1,c:1,s:12,n:4},b.p.type=="j"&&(b.p.limit=.1);if(b.p.type=="a"||b.p.type=="b"||b.p.type=="j")b.p.type=2;return b.t.distype="default",b.p.type==2&&(b.p.displaytype=="a"||b.p.displaytype=="c")&&(b.t.distype="float_win"),b.p.type==2&&b.p.displaytype=="b"&&(b.t.distype="float_couplet"),b.p.type=="i"&&(b.t.distype="script"),b.bcl={},b.p.refpos=function(a){var b="",c=("&"+location.search.substring(1)).split("&refpos=");if(c[1]){var d=c[1].split("&")[0].split(",");if(d[1])var e=d[1];e&&e!="null"&&(e=="b"||e=="e")&&(b=e)}return b===""&&(a.type=="2"||a.type=="j"?a.displaytype=="a"||a.displaytype=="c"?b="b":a.displaytype=="b"?b="e":b="a":b="null"),","+b+",null"}(b.p),b}}),KSLITE.declare("inf-type-2",["inf-cur"],function(a,b){var c=a("inf-cur");b.chk=function(a){var b=!0;return c.R.data[c.C.sc]>c.C.zmax&&(b=!1),b},b.prerun=function(a){if(c.C.alimama!="http://z.alimama.com/docom.php"){var b=a.p.limit||c.C.limit,d={11:[760,90],12:[468,60],14:[728,90],15:[950,90],16:[658,60],13:[250,60],21:[120,600],22:[120,240],23:[160,600],31:[180,250],32:[250,300],33:[360,190],34:[250,250],35:[200,200],36:[336,280],37:[300,250],38:[290,200]},e=a.p.width,f=a.p.height,g=a.p.sizecode;if(d[g]){var h=d[g][0],i=d[g][1];h*b>e&&(a.p.width=Math.round(h*b)),i*b>f&&(a.p.height=Math.round(i*b))}}c.U.baddCount(c.C.sc,a)},b.getP=function(a){return[]}}),KSLITE.declare("inf-type-i",["inf-cur"],function(a,b){function c(a){return!0}function d(a){return}function e(a){return[]}b.chk=c,b.prerun=d,b.getP=e}),KSLITE.declare("inf-distype-default",["inf-distype-iframe"],function(a,b){b.display=function(b){a("inf-distype-iframe").display(b)}}),KSLITE.declare("inf-distype-iframe",[],function(a,b){b.display=function(a){function c(){var f=document.getElementById(a.adiframe.id);if(!f&&b<5){b++,setTimeout(function(){c()},b*500);return}if(!f)return;f.marginWidth=0,f.marginHeight=0,f.scrolling="no",f.src=a.url,f.frameBorder=0,f.style.cssText=a.adiframe.css,f=document.getElementById(a.adiframe.id+"_clone"),f&&(f.marginWidth=0,f.marginHeight=0,f.scrolling="no",f.src=a.url,f.frameBorder=0,f.style.cssText=a.adiframe.css),f=undefined}typeof a.p.underfilter=="number"?a.adiframe.css+="position:relative;width:"+a.p.width+"px; height:"+a.p.height+"px;":a.p.type=="f"&&a.p.width===0?a.adiframe.css+="width:100%; height:"+a.p.height+"px;":a.adiframe.css+="width:"+a.p.width+"px; height:"+a.p.height+"px; ",a.adiframe.css+="border:0;";var b=0;c()}}),KSLITE.declare("inf-distype-script",[],function(a,b){b.display=function(a){var b=document.createElement("script"),c=document,d=c.getElementsByTagName("head")[0];b.charset="gbk",b.async=!0,b.src=a.url,d.insertBefore(b,d.firstChild)}})
