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