function G(A){if(A.constructor==String){A=document.getElementById(A)}if(!A){return null}var B=Element.prototype;if(A.wrapVersion==B.wrapVersion){return A}for(var C in B){A[C]=B[C]}return A}function T(B,A){return G(B).getElementsByTagName(A)}function Class(F,E){var A=F.constructor==Object?undefined:F.constructor;if(E){var H=function(){E.call(this)}}var D=A||H||new Function();if(E){function C(){}C.prototype=E.prototype;D.prototype=new C()}for(var B in F){D.prototype[B]=F[B]}D.constructor=D;return D}var Element=new Class({constructor:function(A){if(!A){return }if(A.constructor==String){A=document.createElement(A)}return G(A)}});Element.prototype={wrapVersion:1,css:function(B){var D=arguments.length;if(D>1&&D%2==0){for(var H=0;H<D;H+=2){var C=arguments[H],A=arguments[H+1];if(typeof C=="string"&&typeof A=="string"){this.style[C]=A}}}else{if(D==1){if(typeof B=="string"){var F=this.currentStyle||document.defaultView.getComputedStyle(this,null);return F[B]}else{for(var E in B){this.style[E]=B[E]}}}}return this},addClass:function(A){var B=this.className.split(/\s+/);B.push(A);this.className=B.join(" ");return this},removeClass:function(B){var C=this.className.split(/\s+/);var A=C.length;while(A--){if(C[A]==B){C.splice(A,1)}}this.className=C.join(" ");return this},setOpacity:function(A){this.style.display=A<0.01?"none":"";if(!this.currentStyle||!this.currentStyle.hasLayout){this.style.zoom=1}if(window.ActiveXObject){this.style.filter=(A==1)?"":"alpha(opacity="+A*100+")"}this.style.opacity=A;return this}};function Focus(A){this.iTabs=A.iTabs;this.iMods=A.iMods;this.gap=A.gap||3000;this.switchEffect=A.switchEffect||this.switchEffect;this.currentIndex=0;this.nextIndex=1;this.iTabsCount=this.iTabs.length;this.fadeGap=30;this.state=0;this.step=0.05;this.switchState=0;this.timer=null;this.fadeInTimer=null;this.fadeOutTimer=null;this.init()}Focus.prototype={init:function(){var B=this;for(var A=0;A<B.iTabsCount;A++){B.iTabs[A].index=A;G(B.iMods[A]).setOpacity(0);B.iTabs[A].onclick=B.modSwitch()}G(B.iMods[B.currentIndex]).setOpacity(1);
//debugger;
var i_index=this.iTabsCount-1-B.nextIndex;
	
	i_index=4-i_index;
	

G(B.iTabs[i_index]).className="current";
B.autoPlay()},modSwitch:function(){var A=this;return function(C){C=C||window.event;var B=C.srcElement||C.target;window.clearInterval(A.timer);

if(G(B).className!="current")
{A.state=1;
	if(A.switchState==1)
	{window.clearInterval(A.fadeOutTimer);
		window.clearInterval(A.fadeInTimer);
		A.iMods[A.currentIndex].setOpacity(0);
		A.iMods[A.nextIndex].setOpacity(1);
		A.currentIndex=A.nextIndex;
		A.nextIndex=B.getAttribute("timg")}
		A.nextIndex=B.getAttribute("timg");
		A.switchEffect()}else{A.state=0;A.autoPlay()}return false}},switchEffect:function(){var C=this;C.switchState=1;window.clearInterval(C.fadeInTimer);window.clearInterval(C.fadeOutTimer);
	
	
	var i_index=this.iTabsCount-1-C.currentIndex;
	i_index=4-i_index;
	G(C.iTabs[i_index]).className="";
	//debugger;
	i_index=this.iTabsCount-1-C.nextIndex;
	
	i_index=4-i_index;
	
	
	
	G(C.iTabs[i_index]).className="current";
	var A=1;var B=0;C.fadeOutTimer=window.setInterval(function(){window.clearInterval(C.fadeInTimer);G(C.iMods[C.currentIndex]).setOpacity(A-0.1);A=A-C.step;if(A<0.8&&B<1){G(C.iMods[C.nextIndex]).setOpacity(B+0.1);B=B+C.step}if(A<0){window.clearInterval(C.fadeOutTimer);G(C.iMods[C.currentIndex]).css("display","none");G(C.iMods[C.nextIndex]).css("display","");C.fadeInTimer=window.setInterval(function(){G(C.iMods[C.nextIndex]).setOpacity(B+0.1);B=B+C.step;if(B>1){window.clearInterval(C.fadeInTimer);C.currentIndex=C.nextIndex;C.switchState=0;C.nextIndex=(C.nextIndex+1)%C.iTabsCount;if(C.state==1){C.autoPlay()}}},C.fadeGap)}},C.fadeGap)},autoPlay:function(){var A=this;A.state=0;A.timer=window.setInterval(function(){A.switchEffect()},A.gap)}};function setBannerCont(){var C=[];C.push('<div class="bannerwrapper"><div id="bannerfocuswrapper">');if(bdWWW2ImgList.length>1){for(var D=1;D<=bdWWW2ImgList.length;D++){C.push('<a href="#" timg="'+(D-1)+'">'+(D)+"</a>")}}C.push('</div><div id="bannerimgwrapper">');for(var D=0,A=bdWWW2ImgList.length;D<A;D++){C.push('<a  href="'+bdWWW2ImgList[D].url+'" target="_blank"><img dalt="'+bdWWW2ImgList[D].title+'" src="'+bdWWW2ImgList[D].imgsrc+'" /></a>')}C.push("</div></div>");G("adplacehold210").innerHTML=C.join("");if(bdWWW2ImgList.length>1){var B=new Focus({iTabs:T("bannerfocuswrapper","a"),iMods:T("bannerimgwrapper","a"),gap:3000,step:0.05})}}function www2HomeBottom(A){if(A&&A.url&&A.imgsrc){var B=G("adplacehold52");if(B){B.innerHTML='<a href="'+A.url+'" target="_blank"><img src="'+A.imgsrc+'"/></a>'}}}var bdWWW2ImgList=[];function www2HomeBanner(A){bdWWW2ImgList=A;setBannerCont()};
