String.prototype.hasString=function(o){if(typeof o=='object'){for(var i=0;i<o.length;i++){if(!this.hasString(o[i]))return false;}
return true;}
else if(this.indexOf(o)!=-1)return true;}
var UI={tip:function(){this.Tip.build();},select:function(n){this.Select.build(n);},gotop:function(n){this.Gotop.build(n);},ajax:function(o){},get:function(url,o,f){if(window.ActiveXObject){var xmlHttp=new ActiveXObject('Microsoft.XMLHTTP');}else if(window.XMLHttpRequest){var xmlHttp=new XMLHttpRequest();}
xmlHttp.onreadystatechange=function(){if(xmlHttp.readyState==4){f(xmlHttp.responseText);}else{return false;}}
if(o!=undefined){url+='?'+o;}
xmlHttp.open('GET',url,true)
xmlHttp.send(null);},animate:function(o,name,num,call){var delay=setInterval(function(){var cur=UI.C(o,name);if(name=='opacity'){cur=cur*100;num*=100;}
else cur=(cur=='auto'?0:Number(cur.slice(0,-2)));if(Math.abs(num-cur)<3){cur=num;clearInterval(delay);eval(call);}
UI.C(o,name,(name!='opacity'?(cur+(num-cur)*0.4)+'px':(cur+(num-cur)*0.4)/100+''));},40);return delay;},cookie:function(n,v,d){if(v==undefined){var N=n+'=',C=document.cookie.split(';');for(var i=0;i<C.length;i++){var c=C[i];while(c.charAt(0)==' ')c=c.substring(1,c.length);if(c.indexOf(N)==0)return decodeURIComponent(c.substring(N.length,c.length));}
return null;}
else{var k='';if(d){var D=new Date();D.setTime(D.getTime()+d*24*60*60*1000);k='; expires='+D.toGMTString();}
document.cookie=n+'='+v+k+'; path=/';}},getX:function(o){return o.offsetParent?o.offsetLeft+UI.getX(o.offsetParent):o.offsetLeft;},getY:function(o){return o.offsetParent?o.offsetTop+UI.getX(o.offsetParent):o.offsetTop;},hide:function(o){if(typeof o=='string')o=this.G(o);o.style.display='none';},show:function(o){if(typeof o=='string')o=this.G(o);o.style.display='block';},toggle:function(o){if(typeof o=='string')o=this.G(o);if(this.C(o,'display')=='none'){this.show(o);}
else this.hide(o);},hasClass:function(o,n){if(('&'+o.className.replace(/ /gi,'& &')+'&').hasString('&'+n+'&'))return true;return false;},addClass:function(o,n){if(!o.className){o.className=n;}
else if(this.hasClass(o,n)){return false;}
else o.className+=' '+n;},removeClass:function(o,n){o.className=('&'+o.className.replace(/ /gi,'& &')+'&').replace('&'+n+'&','').replace(/&/g,'');},toggleClass:function(o,n){if(this.hasClass(o,n))this.removeClass(o,n);else this.addClass(o,n);},node:{ELEMENT:1,ATTRIBUTE:2,TEXT:3,CDATA_SECTION:4,ENTITY:6,COMMENT:8,DOCUMENT:9,DOCUMENT_TYPE:10},next:function(o){var n=o.nextSibling;if(n==null)return false;return(n.nodeType!=this.node.ELEMENT)?this.next(n):n;},prev:function(o){var n=o.previousSibling;if(n==null)return false;return(n.nodeType!=this.node.ELEMENT)?this.prev(n):n;},A:function(o,n,v){if(v==undefined){return o.getAttribute(n);}
else o.setAttribute(n,v);},C:function(o,n,v){if(v==undefined){if(o.currentStyle){if(n=='opacity'){return o.style.filter.indexOf('opacity=')>=0?(parseFloat(o.style.filter.match(/opacity=([^)]*)/)[1])/100):'1';}
return o.currentStyle[n];}
else if(window.getComputedStyle){n=n.replace(/([A-Z])/g,'-$1');n=n.toLowerCase();return window.getComputedStyle(o,null).getPropertyValue(n);}}
else{if(n=='opacity'&&UI.Browser.ie){o.style.filter=(o.filter||'').replace(/alpha\([^)]*\)/,'')+'alpha(opacity='+v*100+')';}
else o.style[n]=v;}},DC:function(n){return document.createElement(n);},E:function(e){e=window.event||e;this.stop=function(){e.cancelBubble=true;}
this.target=e.target||e.srcElement;return this;},EA:function(o,n,f){if(typeof f=='string'){var tmp=f;f=function(e){eval(tmp);}}
if(o.addEventListener){o.addEventListener(n,f,false);return true;}
else if(o.attachEvent){var r=o.attachEvent('on'+n,f);return r;}
else return false;},ER:function(o,n,f){if(o.removeEventListener){o.removeEventListener(n,f,false);return true;}
else if(o.detachEvent){var r=o.detachEvent('on'+n,f);return r;}
else return false;},ET:function(e){return e.target||e.srcElement;},G:function(n){return document.getElementById(n);},GT:function(o,n){return o.getElementsByTagName(n);},GC:function(o,n){var arr,t,l,el=[];if(arguments.length==1){arr=o.split('.');o=document;}
else arr=n.split('.');t=arr[0]==''?'*':arr[0];arr.shift();for(var i=0 in arr){arr[i]='&'+arr[i]+'&';}
l=this.GT(o,t);for(var i=0;i<l.length;i++){var c='&'+l[i].className.replace(/ /gi,'& &')+'&';if(c.hasString(arr))el.push(l[i]);}
return el.length>0?el:false;},Browser:(function(){var b={},i=navigator.userAgent;b.ie6=i.hasString('MSIE 6')&&!i.hasString('MSIE 7');b.ie=i.hasString('MSIE');b.opera=i.hasString('Opera');b.safari=i.hasString('WebKit');return b;})()}
UI.Flash=function(o,src,width,height){o.innerHTML='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="'+width+'" height="'+height+'" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0"><param name="allowScriptAccess" value="always" /><param name="movie" value="'+src+'" /><param name="quality" value="high" /><param name="wmode" value="transparent" /><embed src="'+src+'" width="'+width+'" height="'+height+'" quality="high" wmode="transparent" pluginspage="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash" allowScriptAccess="always" type="application/x-shockwave-flash"/></object>';}
UI.DropMenu=function(o){o.open=false;if(typeof o.id=='string')o.id=UI.G(o.id);if(o.max==undefined)o.max=10;if(o.type==undefined)o.type=['click','click'];else if(o.type.length==1)o.type=[o.type,o.type];if(o.menu!=undefined){if(typeof o.menu=='string')o.menu=UI.G(o.menu);if(!o.id||!o.menu)return false;if(o.multi){o.parent=o.id.parentNode;var li=UI.GT(o.menu,'li');if(li.length>o.max){var height=UI.C(li[0],'height');height=height=='auto'?20:height.slice(0,-2);o.menu.style.height=o.max*height+'px';o.menu.style.overflow='auto';}}
UI.EA(document,o.type[1],function(e){if(o.open){if(UI.E(e).target!=o.id){UI.hide(o.menu);if(o.multi)UI.removeClass(o.parent,'on');o.open=false;}}});UI.EA(o.id,o.type[0],function(e){if(o.type=='mouseover'){UI.E(e).stop();UI.show(o.menu);}
else UI.toggle(o.menu);if(o.multi)UI.toggleClass(o.parent,'on');o.open=o.menu.style.display=='block'?true:false;});if(o.hover){UI.EA(o.id,'mouseover',function(e){UI.addClass(this,o.hover);});UI.EA(o.id,'mouseout',function(e){UI.removeClass(this,o.hover);});}
UI.EA(o.menu,o.type[1],function(e){UI.E(e).stop();});}
else{}}
UI.ShowBar=function(o){this._body=UI.G(o.id);if(!this._body)return false;this._cont=UI.GC(this._body,'.cont')[0];this._li=UI.GT(this._cont,'li');this._first=this._li[0];this._next=UI.GC(this._body,'.next')[0];this._prev=UI.GC(this._body,'.prev')[0];o.speed=o.speed||1500;this.cur=1;this.num=this._li.length;this.animate=o.animate!=undefined?o.animate:true;this.autoplay=o.autoplay!=undefined?o.autoplay:true;this.pause=o.pause;this.connect=o.connect;this.step=Number(UI.C(this._first,o.action=='marginTop'?'height':'width').slice(0,-2));this.delay=setInterval('if ('+o.name+'.autoplay) '+o.name+'.next()',o.speed);this.delay2=null;this.page=o.page;this.tmp_cur=0;if(this.connect)this._li[0].parentNode.appendChild(this._li[0].cloneNode(true));if(this.page){if(UI.GC(this._body,'.page').length>0){this._page=UI.GC(this._body,'.page')[0];this._li2=UI.GT(this._page,'li');for(var i=0;i<this.num;i++){UI.EA(this._li2[i],this.page,o.name+'.play('+(i+1)+')');}}
else{this._page=UI.DC('ul'),html=[];this._page.className='page';for(var i=0;i<this.num;i++){html[i]='<li '+(!i?'class="on" ':'')+'on'+this.page+'="'+o.name+'.play('+(i+1)+')">'+(i+1)+'</li>';}
this._page.innerHTML=html.join('');this._body.appendChild(this._page);this._li2=UI.GT(this._page,'li');}}
if(o.action=='opacity'){for(var i=0;i<this.num;i++){UI.C(this._li[i],'opacity',0);}
UI.C(this._li[0],'opacity',1);}
this._next.onclick=function(){eval(o.name+'.next()');}
this._prev.onclick=function(){eval(o.name+'.prev()');}
this._first.parentNode.onmouseover=function(){eval('if('+o.name+'.pause) clearInterval('+o.name+'.delay)');}
this._first.parentNode.onmouseout=function(){eval('if('+o.name+'.pause) '+o.name+'.delay = setInterval(\''+o.name+'.next()\','+o.speed+')');}
this._next.onmouseover=this._prev.onmouseover=this._first.parentNode.onmouseover;this._next.onmouseout=this._prev.onmouseout=this._first.parentNode.onmouseout;this.show=function(){if(this.page){if(this.tmp_cur!=null){this._li2[this.tmp_cur].className='';}
var cur_page=this.cur>this.num?0:this.cur-1;this._li2[cur_page].className='on';this.tmp_cur=cur_page;}
if(this.animate){clearInterval(this.delay2);if(o.action=='opacity'){this.delay2=UI.animate(this._li[this.cur-1],o.action,1,'clearInterval('+o.name+'.delay2);');this.tmp_cur=this.cur>this.num?0:this.cur-1;}
else this.delay2=UI.animate(this._first,o.action,-this.step*(this.cur-1),'clearInterval('+o.name+'.delay2);');}
else{if(o.action=='opacity'){}
else this._first.style[o.action]=-this.step*(this.cur-1)+'px';}}
this.next=function(){this.cur++;if(this.connect){if(this.cur>this.num+1){this._first.style.marginTop='';this.cur=2;}}
else if(this.cur>this.num)this.cur=1;this.show();}
this.prev=function(){this.cur--;if(this.cur<1)this.cur=this.num;this.show();}
this.play=function(n){this.cur=n;this.show();}}
UI.Select=function(o){this._body=UI.G(o.id);this._input=UI.GT(this._body,'input')[0];this._select=UI.GT(this._body,'select')[0];this._ul=UI.DC('ul');this._input.value=this._select.options[this._select.selectedIndex].innerHTML;this.cur=this._select.selectedIndex;var li=[];for(var i=0;i<this._select.options.length;i++){var text=this._select.options[i].innerHTML;li[i]='<li'+(text==this._input.value?' class="on"':'')+' onmouseover="UI.addClass(this,\'hover\')" onmouseout="UI.removeClass(this,\'hover\')" onclick="'+o.name+'.select(this.innerHTML,'+i+');UI.addClass(this,\'on\')" title="'+text+'">'+text+'</li>'}
this._ul.innerHTML=li.join('');this._body.appendChild(this._ul);this._li=UI.GT(this._ul,'li');if(UI.Browser.ie6){this._cover=UI.DC('div');this._cover.style.cssText='position:absolute;';this._cover.innerHTML='<iframe src="about:blank" style="position:absolute;z-index:-1;"></iframe>';this._body.appendChild(this._cover);var iframe=UI.GT(this._cover,'iframe')[0];}
UI.EA(this._body,'click','UI.toggleClass('+o.name+'._body,"on");'+o.name+'.iframe();');UI.EA(document,'click','e=window.event||e;if(UI.ET(e)!='+o.name+'._input) UI.removeClass('+o.name+'._body,"on");');this.select=function(n,i){this._input.value=n;UI.A(this._select.options[this.cur],'selected','');UI.removeClass(this._li[this.cur],'on');UI.A(this._select.options[i],'selected','selected');this._select.value=this._select.options[i].value;this.cur=i;}
this.iframe=function(){if(UI.Browser.ie6){iframe.style.width=this._ul.offsetWidth+'px';iframe.style.height=this._ul.offsetHeight+'px';this._cover.style.top=UI.C(this._ul,'top');this._cover.style.left=UI.C(this._ul,'left');}}}
UI.Dialog=function(o){this._body=document.createElement('div');this._body.className='dialog2';this._body.innerHTML=(UI.Browser.ie6?'<iframe src="about:blank" class="cover_select"></iframe>':'')+'<div class="bg"></div><div style="margin:-'+o.height/2+'px 0 0 -'+o.width/2+'px;width:'+o.width+'px;height:'+o.height+'px;" class="wrap"><div class="title">'+o.title+'</div><div class="close '+(o.close!=false?'':'hide')+'" onclick="'+o.name+'.hide()" title="Close"></div><div class="cont"><div class="loading" style="display:none;"><span>loading...</span></div><iframe allowtransparency="true" src="'+o.url+'" style="height:'+o.height+'px;" scrolling="auto" frameborder="no" onload="" class="iframe"></iframe></div><b class="cor_1"></b><b class="cor_2"></b><b class="cor_3"></b><b class="cor_4"></b></div>';document.body.appendChild(this._body);this._wrap=UI.GC(this._body,'div.wrap')[0];this._title=UI.GC(this._body,'div.title')[0];this._close=UI.GC(this._body,'div.close')[0];this._iframe=UI.GC(this._body,'iframe.iframe')[0];this._display=true;this._titleHeight=this._title.offsetHeight;this.checkHeight=function(height){this._iframe.style.height=height-this._titleHeight+'px';}
this.checkHeight(o.height);this.hide=function(){document.body.removeChild(this._body);this._display=false;}
this.show=function(o){if(o){if(o.title)this._title.innerHTML=o.title;if(o.width){this._wrap.style.width=o.width+'px';this._wrap.style.marginLeft=-o.width/2+'px';}
if(o.height){this._wrap.style.height=o.height+'px';this._wrap.style.marginTop=-o.height/2+'px';this.checkHeight(o.height);}
if(o.url)this._iframe.setAttribute('src',o.url);if(o.close)this._close.className='close'+(o.close!=false?'':'hide');}
if(!this._display){document.body.appendChild(this._body);this._display=true;}}}
UI.Gotop={title:'返回顶部',className:'gotop',text:'Top',body:UI.DC('a'),_delay:null,build:function(id){this.body.className=this.className;this.body.title=this.title;this.body.innerHTML=this.text;this.body.href='#'+(id||'');document.body.appendChild(this.body);this.body.onfocus=function(){this.blur();}
UI.EA(window,'scroll',function(){clearTimeout(UI.Gotop._delay);UI.Gotop._delay=setTimeout(function(){(window.scrollY||document.documentElement.scrollTop)<52?UI.Gotop.body.style.display='none':UI.Gotop.body.style.display='block';},50);});}}
if(UI.Browser.ie6){try{document.execCommand('BackgroundImageCache',false,true);}catch(e){}}
