var KB=function(a){this.nod=new Array();return this.init(a)};KB.prototype={version:"1.0",init:function(c){c=c||document;if(c.nodeType){return this}else{if(typeof c=="string"){this.proStr=c;this.nodParent=document;var a=c.split(":");if(a.length>1){for(var b=0;b<a.length;b++){this.getNodes(a[b])}return this}else{return this.getNodes(c)}}}},getNodes:function(a){this.proStr=a;if(a.indexOf("=")!=-1){this.getId()}else{if(a.indexOf("@")!=-1){this.getCN()}else{if(a.indexOf("&")!=-1){this.getN()}else{this.getEN()}}}this.nodParent=this.nod[1];typeof this.nodParent=="undefined"?this.nodParent=document:this.nodParent;return this},getChild:function(e){var d=new Array();if(typeof this.nod[0]=="undefined"){return d}var b=this.nod[0].getElementsByTagName(e);for(var a=0;a<b.length;a++){d.push(b[a])}return d},getParent:function(){var a=new Array();for(var b=1;b<this.nod.length;b++){a.push(this.nod[b].parentNode)}return a},getId:function(){var b=this.proStr.split("=");this.nod[0]=this.nod[1]=this.nodParent.getElementById(b[1]);return this},getCN:function(){var b=this.proStr.split("@");var e=this.nodParent.getElementsByTagName(b[0]);var d=1;for(var c=0;c<e.length;c++){if((" "+e[c].className+" ").indexOf(" "+b[1]+" ")!=-1){this.nod[d]=e[c];d++}}if(d>1){this.nod[0]=this.nod[1]}else{this.nod[0]=document}return this},getN:function(){var b=this.proStr.split("&");var e=this.nodParent.getElementsByTagName(b[0]);var d=1;for(var c=0;c<e.length;c++){if(e.item(c).getAttribute(b[1])){this.nod[d]=e[c];d++}}if(d>1){this.nod[0]=this.nod[1]}else{this.nod[0]=document}return this},getEN:function(){var c=this.nodParent.getElementsByTagName(this.proStr);var b=1;for(var a=0;a<c.length;a++){this.nod[a+1]=c[a];b++}if(b>1){this.nod[0]=this.nod[1]}else{this.nod[0]=document}return this},getNod:function(b){var a=this.nod.length-1;if(b<0){b=0}if(b>=a){this.nod[0]=this.nod[a];return this}this.nod[0]=this.nod[b];this.nodParent=this.nod[0];return this},val:function(a){if(!a){a=0}if(this.nod.length>0){for(var b=0;b<this.nod.length;b++){if(b==a){return this.nod[b].innerHTML}}}return null},value:function(a){if(a){return this.nod[0].value=a}else{return this.nod[0].value}},setVal:function(a){this.nod[0].innerHTML=a;return this},hidden:function(){if(arguments.length==0){for(var a=0;a<this.nod.length;a++){this.nod[a].style.display="none"}}else{this.nod[arguments[0]].style.display="none"}},show:function(){if(arguments.length==0){for(var a=0;a<this.nod.length;a++){this.nod[a].style.display="block"}}else{this.nod[arguments[0]].style.display="block"}},setCss:function(c,b){if(KB.bom.webkit){return this.nod[0].style.cssText+=c+":"+b}c=c.replace("-","");for(var a in this.nod[0].style){if(c.toLowerCase()==a.toLowerCase()){this.nod[0].style[a]=b;return}}},css:function(f,d){var b=this.nod[0];if(d){this.nod[0]=d}f=f.split(/=|,/);for(var a=0;a<f.length;a=a+2){try{this.setCss(f[a],f[a+1])}catch(c){}}this.nod[0]=b},set:function(b,a){this.nod[0][b]=a;return this},get:function(a){return typeof(this.nod[0][a])=="undefined"?(this.nod[0].getAttribute(a)==null?null:this.nod[0].getAttribute(a)):this.nod[0][a]},getStyle:function(a){if(this.get(a)!=null){return this.get(a)}if(this.nod[0].currentStyle&&typeof(this.nod[0].currentStyle[a]!="undefined")){return this.nod[0].currentStyle[a]}if(window.getComputedStyle){a=a.replace(/([A-Z])/g,"-$1");a=a.toLowerCase();return window.getComputedStyle(this.nod[0],"").getPropertyValue(a)}if(this.nod[0].style.cssText&&this.nod[0].style.cssText.indexOf(a)!=-1){var b=this.nod[0].style.cssText.split("/^"+a+":|;$/");return b.length>1?b[1]:b[0]}},request:{onload:function(){},pars:"",method:"",ckpa:function(b){var e=[];if(b.constructor==Array){for(var d=0;d<b.length;d++){e.push(encodeURIComponent(b[d].name)+"="+encodeURIComponent(b[d].value))}}else{if(b.constructor==Object){for(var c in b){e.push(encodeURIComponent(c)+"="+encodeURIComponent(b[c]))}}}return e.join("&").replace(/%20/g,"+")},load:function(a){var b=new Date().getTime();a.indexOf("?")!=-1?this.url=a+"&ajaxt="+b:this.url=a+"?ajaxt="+b;try{var c=this.ckpa(this.pars)}catch(f){alert(f.message)}if(window.ActiveXObject){this.xmlHttp=new ActiveXObject("Microsoft.XMLHTTP")}else{if(window.XMLHttpRequest){this.xmlHttp=new XMLHttpRequest()}}if(this.method.toLowerCase()=="post"){this.xmlHttp.open("POST",this.url,true);this.xmlHttp.setRequestHeader("content-length",c.length);this.xmlHttp.setRequestHeader("content-type","application/x-www-form-urlencoded");this.xmlHttp.setRequestHeader("Cache-Control","no-cache");this.xmlHttp.send(c)}else{this.xmlHttp.open("GET",this.url,true);this.xmlHttp.setRequestHeader("Cache-Control","no-cache");this.xmlHttp.send(null)}var d=this;this.xmlHttp.onreadystatechange=function(){if(d.xmlHttp.readyState==4){if(d.xmlHttp.status==200){d.onload(d.xmlHttp)}else{if(d.xmlHttp.status==404){try{d.nofound()}catch(g){}}else{if(d.xmlHttp.status==500){try{d.webError()}catch(g){}}else{try{d.error()}catch(g){}}}}}}}},dd:function(a,b){if(!b){b=this.nod[0]}new KB.dragDrop(a,this.nod[0],b)},Click:function(a){KB.reg(this.nod[0],"click",a);return this},nodeState:{},clicked:function(a,d){var b=this;for(var c=1;c<this.nod.length;c++){KB.reg(b.nod[c],"click",a);KB.reg(b.nod[c],"click",function(){var e=b.nodeState.nod;if(b.nodeState.nod){e.className=b.nodeState.lastClass}b.nodeState.nod=b.nod[c];b.nodeState.lastClass=b.nod[c].className;b.nod[c].className=d})}return this},hover:function(e){var a=new Array();var b=this;for(var d=1;d<this.nod.length;d++){var c=this.nod[d].className;a[d]=this.nod[d];KB.reg(a[d],"mouseover",function(){if(b.nodeState.nod){if(a[d]==b.nodeState.nod){return}}a[d].className=e});KB.reg(a[d],"mouseout",function(){if(b.nodeState.nod){if(a[d]==b.nodeState.nod){return}}a[d].className=c})}return this},getWidth:function(){return this.nod[0].offsetWidth},getHeight:function(){return this.nod[0].offsetHeight},alpha:function(c,d){var b=0;if(typeof(d)=="object"){this.nod[b]=d}else{b=d;if(d==""||d==null){b=0}}var a=KB.sys();if(a.ie){this.nod[b].style.zoom=1}this.nod[b].style.opacity=c/10;this.nod[b].style.filter="alpha(opacity="+c*10+")";return this},each:function(a){for(var b=1;b<this.nod.length;b++){a.call(this,this.nod[b],b)}}};KB.prototype.play=function(c){if(c==""||c==null){c=0}this.alpha(0,c);var a=this.nod[c];var b=0;(function(){if(b==10){return}b++;a.style.opacity=b/10;a.style.filter="alpha(opacity="+b*10+")";setTimeout(arguments.callee,50)})()};KB.prototype.display=function(c){if(c==""||c==null){c=0}this.alpha(10,c);var a=this.nod[c];var b=10;(function(){if(b==0){return}b--;a.style.opacity=b/10;a.style.filter="alpha(opacity="+b*10+")";setTimeout(arguments.callee,50)})()};KB.prototype.domain="alibaba.com";KB.prototype.cookie=document.cookie;KB.prototype.getCookie=function(a){if(a){var b=this.cookie.match(new RegExp("(^| )"+a+"=([^;]*)(;|$)"));if(b!=null){return unescape(b[2])}return null}else{return this.cookie}};KB.prototype.setCookie=function(b,d,a){if(!a){a=30}var c=a;var e=new Date();e.setTime(e.getTime()+c*24*60*60*1000);this.cookie=document.cookie=b+"="+escape(d)+";expires="+e.toGMTString()+";domain="+this.domain+";path=/"};KB.prototype.setTemCookie=function(a,b){this.cookie=document.cookie=a+"="+escape(b)+";domain="+this.domain+";path=/"};KB.prototype.delCookie=function(a){var c=new Date();c.setTime(c.getTime()-1);var b=this.getCookie(a);if(b!=null){this.cookie=document.cookie=a+"="+b+";expires="+c.toGMTString()}};KB.sys=function(){var c={};var a=navigator.userAgent.toLowerCase();var b;(b=a.match(/webkit\/([\d.]+)/))?c.webkit=b[1]:0;(b=a.match(/msie ([\d.]+)/))?c.ie=b[1]:(b=a.match(/firefox\/([\d.]+)/))?c.firefox=b[1]:(b=a.match(/chrome\/([\d.]+)/))?c.chrome=b[1]:(b=a.match(/opera.([\d.]+)/))?c.opera=b[1]:(b=a.match(/version\/([\d.]+).*safari/))?c.safari=b[1]:0;return c};KB.bom=KB.sys();KB.reg=function(c,a,b){if(c.addEventListener){c.addEventListener(a,b,false)}else{if(c.attachEvent){c.attachEvent("on"+a,b)}else{c["on"+a]=b}}};KB.delReg=function(c,a,b){if(c.removeEventListener){c.removeEventListener(a,b,false)}else{if(c.detachEvent){c.detachEvent("on"+a,b)}else{delete c["on"+a]}}};KB.dragDrop=function(b,a,d){if(!d){d=a}this.target=d;this.nod=a;this.fun=b;new KB("null").css("cursor=move",d);this.x=0;this.y=0;var c=this;this.move=function(){var i=arguments[0]||window.event;var h=i.pageX||i.clientX;var f=i.pageY||i.clientY;var g=h-c.x;var e=f-c.y;c.nod.style.top=e+"px";c.nod.style.left=g+"px"};this.down=function(){var e=new KB();KB.delReg(document.body,"mouseup",c.up);KB.delReg(document.body,"mouseout",c.up);var f=arguments[0]||window.event;c.x=f.layerX||f.offsetX;c.y=f.layerY||f.offsetY;e.alpha(4,c.nod);e.css("position=absolute",c.nod);KB.reg(document.body,"mousemove",c.move);KB.reg(document.body,"mouseup",c.up);KB.reg(document.body,"mouseout",c.up);delete e};this.up=function(){new KB().alpha(10,c.nod);KB.delReg(document.body,"mousemove",c.move);KB.delReg(document.body,"mouseup",c.up);KB.delReg(document.body,"mouseout",c.up);c.fun()};KB.reg(d,"mousedown",this.down)};KB.ready=function(a){if(!window.__load_events){var b=function(){if(arguments.callee.done){return}arguments.callee.done=true;if(window.__load_timer){clearInterval(window.__load_timer);window.__load_timer=null}for(var c=0;c<window.__load_events.length;c++){window.__load_events[c]()}window.__load_events=null};if(document.addEventListener){document.addEventListener("DOMContentLoaded",b,false)}if(window.attachEvent){document.attachEvent("onreadystatechange",function(){if(document.readyState==="complete"){document.detachEvent("onreadystatechange",arguments.callee);b()}})}if(/WebKit/i.test(navigator.userAgent)){window.__load_timer=setInterval(function(){if(/loaded|complete/.test(document.readyState)){b()}},10)}window.onload=b;window.__load_events=[]}window.__load_events.push(a)};KB.getPos=function(j){var a=KB.sys();var c=j;if(c.parentNode===null||c.style.display=="none"){return false}var i=null;var h=[];var f;if(c.getBoundingClientRect){f=c.getBoundingClientRect();var b=Math.max(document.documentElement.scrollTop,document.body.scrollTop);var d=Math.max(document.documentElement.scrollLeft,document.body.scrollLeft);return{x:f.left+d,y:f.top+b}}else{if(document.getBoxObjectFor){f=document.getBoxObjectFor(c);var g=(c.style.borderLeftWidth)?parseInt(c.style.borderLeftWidth):0;var e=(c.style.borderTopWidth)?parseInt(c.style.borderTopWidth):0;h=[f.x-g,f.y-e]}else{h=[c.offsetLeft,c.offsetTop];i=c.offsetParent;if(i!=c){while(i){h[0]+=i.offsetLeft;h[1]+=i.offsetTop;i=i.offsetParent}}if(a.opera||(a.safari&&c.style.position=="absolute")){h[0]-=document.body.offsetLeft;h[1]-=document.body.offsetTop}}}if(c.parentNode){i=c.parentNode}else{i=null}while(i&&i.tagName!="BODY"&&i.tagName!="HTML"){h[0]-=i.scrollLeft;h[1]-=i.scrollTop;if(i.parentNode){i=i.parentNode}else{i=null}}return{x:h[0],y:h[1]}};KB.format=function(d,c){var g=new KB();try{if(c){var b=new Array();b.push(d[0]);b=b.concat(d);g.nod=b;return g}g.nod[0]=g.nod[1]=d}catch(h){}return g};KB.grid=function(){};KB.isNode=function(a){if(!document.getElementById(a)){return false}return true};KB.dailog=function(a){this.id=a;return this};KB.dailog.prototype={xy:{x:0,y:0},pid:null,id:null,width:null,height:null,title:null,model:"model3",setTitle:function(a){this.title=a;return this},setWidth:function(a){this.width=a;return this},setHeight:function(a){this.height=a;return this},setPid:function(a){this.pid=a;return this},setDebug:function(a,b){this.debugX=a;this.debugY=b;return this},closeDailog:function(){return this},exec:function(){if(this.id==null){return}KB.getZdiv();var c=$KB("*="+this.id);var m=KB.getDocumentSize("Height");var g=KB.getDocumentSize("Width");var o=KB.getDocumentSize("Top");if(this.width!=null){var k=parseInt(this.width);c.css("width="+k+"px")}if(this.height!=null){var f=parseInt(this.height);c.css("height="+f+"px")}if(!KB.isNode("_kb_dailog_"+this.id)){var e=document.createElement("div");e.id="_kb_dailog_"+this.id;e.className=this.model;document.body.appendChild(e);this.dom=e;e.innerHTML='<div class="'+this.model+'_title" id="_kb_dailog_'+this.id+'_title">'+this.title+'<span class="icon34 model_close" id="close_dailog_'+this.id+'"></span></div><div class="'+this.model+'_body autoheight" id="_kb_dailog_body_'+this.id+'"></div>';var a=document.getElementById("_kb_dailog_body_"+this.id);var b=$KB("*="+this.id);a.appendChild(b.nod[0]);(function(h,n){KB.reg(h,"click",function(){KB.closeDailog(n)})})($KB("*=close_dailog_"+this.id).nod[0],this)}var l=$KB("*=_kb_dailog_"+this.id);l.css("z-index=9611,position=absolute,display=none");c.css("display=block");l.show();var i,d;(i=c.getStyle("width"))=="auto"?i=c.getWidth():i;(d=c.getStyle("height"))=="auto"?d=c.getHeight():d;i=parseInt(i);if(i>0){l.css("width="+parseInt(i)+"px")}d=parseInt(d);if(d>0){l.css("height="+parseInt(d)+"px")}if(this.pid==null){this.xy.x=(g-parseInt(l.getStyle("width")))/2;this.xy.y=parseInt(o+100)}else{var j=KB.getPos(document.getElementById(this.pid));if(j.x&&j.y){this.xy=j}var f=parseInt(l.getHeight());if(m-this.xy.y<f*2){this.xy.y-=f}}this.xy.x=(938-parseInt(l.getWidth()))/2;if(this.debugX!==undefined&&this.debugY!==undefined){this.xy.x+=parseInt(this.debugX);this.xy.y+=parseInt(this.debugY)}if(this.xy.x<0){this.xy.x=0}if(this.xy.y<0){this.xy.y=0}l.css("left="+this.xy.x+"px,top="+this.xy.y+"px")}};KB.closeDailog=function(b){try{$KB("*=kb_zdiv").hidden();$KB("*=_kb_dailog_"+b.id).hidden();b.closeDailog()}catch(a){}};KB.getIframeSize=function(l,g){var j=0;var i=/^\d+$/;try{if(l.contentDocument&&l.contentDocument.documentElement){var f=l.contentDocument.documentElement["offset"+g];i.test(f)?f:f=0;var d=l.contentDocument.documentElement["scroll"+g];i.test(d)?d:d=0;var m=l.contentDocument.documentElement["client"+g];i.test(m)?m:m=0;j=Math.max(f,d,m)}if(l.contentDocument&&l.contentDocument.body){var f=l.contentDocument.body["offset"+g];i.test(f)?f:f=0;var d=l.contentDocument.body["scroll"+g];i.test(d)?d:d=0;var m=l.contentDocument.body["client"+g];i.test(m)?m:m=0;j=Math.max(j,f,d,m)}if(l.document&&l.document.body){var f=l.document.body["offset"+g];i.test(f)?f:f=0;var d=l.document.body["scroll"+g];i.test(d)?d:d=0;var m=l.document.body["client"+g];i.test(m)?m:m=0;j=Math.max(j,f,d,m)}}catch(k){}return j};KB.getDocumentSize=function(b){var c,a,d;c=document.ownerDocument||document.contentDocument||document;a=c.compatMode=="CSS1Compat"?c.documentElement:c.body;d=a["client"+b];d=a["scroll"+b];d=a["offset"+b];return Math.max(a["client"+b],a["scroll"+b],a["offset"+b])};KB.openWindow=function(a,b){KB.getZdiv()};KB.openTip=function(){};KB.getZdiv=function(){if(!KB.isNode("kb_zdiv")){var e=document.createElement("div");e.id="kb_zdiv";e.className="kb_zdiv";e.index=9600;document.body.appendChild(e);var d=-4;var c=-4;if(KB.bom.ie=="6.0"){d=-4}var a=KB.getDocumentSize("Width")+d;var b=KB.getDocumentSize("Height")+c;e.style.width=KB.getDocumentSize("Width")+d+"px";e.style.height=KB.getDocumentSize("Height")+c+"px";e.innerHTML='<iframe style="width:'+a+"px; height:"+b+'px; z-index:-1; opacity:0; filter:alpha(opacity=0);"></iframe>'}else{new KB("div=kb_zdiv").show()}};KB.loading=function(){if(!KB.isNode("kb_loading")){var a=document.createElement("div");a.id="kb_loading";a.className="kb_loading";a.index=9700;document.body.appendChild(a);a.innerHTML='<ins class="loading_gif"></ins><p class="font26">data loading...</p>';a.style.width=document.body.offsetWidth+"px";a.style.height=document.body.offsetHeight+"px"}else{new KB("div=kb_loading").show()}};KB.inputTip=function(b,a,d,c){(function(){b.onfocus=function(){if(b.value==a){b.value="";b.className=c}}})();(function(){b.onblur=function(){if(b.value==""){b.value=a;b.className=d}}})()};KB.tab=new Array();KB.regListChange=function(a,e,d,c,b){if(!KB.tab[e]){KB.tab[e]={nod:"0"}}for(var f=0;f<a.length;f++){(function(g){KB.reg(a[g],"click",function(){b(g);a[KB.tab[e].nod].className=c;a[g].className=d;KB.tab[e].nod=g})})(f)}};KB.regHover=function(d,c,b,f,a){for(var e=1;e<d.nod.length;e++){if(f.length>0){if(" "+d.nod[e].className+" ".indexOf(" "+f+" ")!=-1){continue}}(function(g){KB.reg(d.nod[g],"mouseover",function(){d.css("position=relative",d.nod[g]);if(c!=null){d.nod[g].className=c}if(a){a(d,g,true)}});KB.reg(d.nod[g],"mouseout",function(){d.css("position=static",d.nod[g]);if(b!=null){d.nod[g].className=b}if(a){a(d,g,false)}})})(e)}};function $KB(a){return new KB(a)}var tips={htmlstr:'<div class="tips_box"><div class="tips_content"></div><div class="tips_bottom">&nbsp;</div><div class="tips_arr_left" id="tips_arr"></div></div>'};tips.init=function(){tips.createBox();var a=new KB("*&tips");KB.regHover(a,null,null,"",tips.active);if(tips.arr.length>0){tips.formatArr()}};tips.set=function(a){tips.arr.push(a)};tips.formatArr=function(){for(var b=0;b<tips.arr.length;b++){if(tips.arr[b].id&&tips.arr[b].text){var a=new KB("*="+tips.arr[b].id);a.set("tips",tips.arr[b].text);if(tips.arr[b].width){a.set("tipswidth",tips.arr[b].width)}(function(c){KB.regHover(c,null,null,"",tips.active)})(a)}}};tips.createBox=function(){var a=document.createElement("div");a.id="tips";a.className="tips";a.innerHTML=tips.htmlstr;document.body.appendChild(a);KB.reg(a,"mouseover",function(){tips.out=false});KB.reg(a,"mouseout",function(){tips.out=true})};tips.xdebug=0;tips.ydebug=0;tips.i="";tips.width=200;tips.arr=new Array();tips.active=function(d,h,u){if(tips.i==h){if(!u){tips.out=true;return}}tips.i=h;tips.out=false;var r=new KB("div=tips");var e=r.getChild("div");var b=d.nod[h].getAttribute("tips");var l=tips.width;if(d.nod[h].getAttribute("tipswidth")){l=d.nod[h].getAttribute("tipswidth")}r.css("width="+l+"px");for(var f=0;f<e.length;f++){if(e[f].className=="tips_bottom"){e[f].style.width=l+"px"}if(e[f].className=="tips_content"){e[f].innerHTML=b;e[f].style.width=l-20+"px"}}var q=document.body.clientWidth;var s=document.body.clientHeight;var o=KB.getPos(d.nod[h]);var j=d.nod[h].offsetWidth;var m=d.nod[h].offsetHeight;var p=parseInt(o.x)+j+tips.xdebug+5;var n=parseInt(o.y)+tips.xdebug;var c=new KB("div=tips_arr");r.show();var a=parseInt(r.getHeight());if((p+parseInt(l))>q){p=p-j-l;c.nod[0].className="tips_arr_right"}else{c.nod[0].className="tips_arr_left"}if((n+a)>s){n=n+m-a;c.css("top="+(a-m)+"px")}else{c.css("top=15px")}var r=new KB("div=tips");r.css("left="+p+",top="+n+",z-index=9800");tips.display()};tips.out=false;tips.display=function(){if(tips.out){var a=new KB("div=tips");a.hidden()}else{setTimeout("tips.display()",1000)}};
