// JavaScript Document
var cis,xp=-87,s,xf,j=8,lr=1,dir,timer,as=0,asb=1,timer2,mode,total,con,newu,intval,ints=0,sh,shtimer,shc,ttimer=0;
var txt=new Array();
//·µ»Ø¶¥¶Ë
function top(){
	sh=document.documentElement.scrollTop;
	shc=Math.round(sh*0.10);
	etop();	
	}
function etop(){
	sh-=shc;
	if(shc>12){
		shc-=6;
		}
	if(sh>=0){ 
	window.scrollTo(0,sh);
	shtimer=setTimeout("etop()",10);
	}else{
		window.scrollTo(0,0);
		clearTimeout(shtimer);
		}
	}
function m(obj){
	obj.style.backgroundImage=(!cis)?"none":"url(../../../../images_gev5/top_menu2.jpg)";
	cis=!cis;
	}
function m_inner(obj){
	obj.style.backgroundImage=(!cis)?"none":"url(../../../../images_gev5/top_menu2_inner.jpg)";
	cis=!cis;
	}
function slide(n){
		clearTimeout(timer2);
	    ints=0;
    if(n==0){
		document.getElementById("arl").className="ar_img2";
		}else if(n==total){
			document.getElementById("arr").className="ar_img2";
			}else if(n<0){
				n=0;
				return false;
				}else if(n>total){
					n=total;
					return false;
					}else{
				 document.getElementById("arr").className="ar_img";
				 document.getElementById("arl").className="ar_img";
					}
	s=document.getElementById("slimg"),xf=-(91+178*(n-1)+(n-1)*6);
	txt=(con[n].getElementsByTagName("div")[0].innerHTML).split("|");
	getid("ititle").innerHTML=txt[0];	
	getid("itime").innerHTML=txt[1];
	getid("icon").innerHTML=txt[2];
	if(lr<n){
		dir=1;
		}else if(lr>n){
			dir=0;
			}else{
				dir=2;
				}
	as=lr=n;
	animation();
	return true;
	}
function animation(){
	//document.getElementById("test").innerHTML="xp="+xp+",xf="+xf+as;
	j++;	
	if(dir==1){
		xp-=j;
		timer=setTimeout("animation()",20);
		s.style.marginLeft=xp+"px";
		if(xp<=xf){
			s.style.marginLeft=xf+"px";
			xp=xf;
			clearTimeout(timer);
			j=8;
			}
		}
	if(dir==0){
		xp+=j;	
		timer=setTimeout("animation()",20);
		s.style.marginLeft=xp+"px";
		if(xp>=xf){
			s.style.marginLeft=xf+"px";
			xp=xf;
			clearTimeout(timer);
			j=8;
			}
		}
}
function sli(d){
	clearTimeout(timer2);
	ints=0;
	if(d==1){
		slide(lr-1);
		}else{
			slide(lr+1);
			}
	}
function start_slide(){
	total=document.getElementById("slimg").getElementsByTagName("span").length-1;
	con=document.getElementById("slimg").getElementsByTagName("span");
	setTimeout("start_slide()",15000);
	if(ints==0){ ntval=setInterval("auto_slide()",9000);}
	}
function auto_slide(){
	if(ttimer==0){
		start_slide();
		ttimer=1;
		}
	if(ints==0){
		clearInterval(ntval);
		ints=1;
		}
    as+=asb;
	slide(as);
	if(as<=0){
		asb=1;
		as=0;
		}else if(as>=total){
			asb=-1;
			as=total;
			}
	timer2=setTimeout("auto_slide()",4000);
	}
function getid(id){
	return document.getElementById(id);
	}
window.onload=function(){
	correctPNG();
}
function snew(numb,obj){
	newu=getid("newuser").getElementsByTagName("ul");
	for(var i=0;i<newu.length;i++){
		newu[i].style.display="none";
		}
	newu[numb-1].style.display="block";
	}
//change Tabs
function ctabs(order){
	newu=getid("wjyztabs").getElementsByTagName("a");
	for(var i=1;i<=4;i++){
		newu[i-1].className="w_t_a";
		getid("infozone"+i).style.display="none";
	}
	newu[order-1].className="w_t_c";
	getid("infozone"+order).style.display="block";
	}

//sroll img
var mar_tc;
function mar_st(){
	serverInit();
	var mar_o=document.getElementById('infozone2');
	window.setInterval(function(){window.clearTimeout(mar_tc);mar_o.firstChild.style.marginLeft='0px';scrollup(mar_o,244,0);},5000);
}
function scrollup(mar_o,mar_d,mar_c){
	if(mar_d==mar_c){
		var mar_t=mar_o.firstChild.cloneNode(true);
		mar_o.removeChild(mar_o.firstChild);mar_o.appendChild(mar_t);
		mar_t.style.marginTop=mar_o.firstChild.style.marginTop='0px';		
	}
	else{
		mar_ch=false;var s=20,mar_c=mar_c+s,mar_l=(mar_c>=mar_d?mar_c-mar_d:0);
		mar_o.firstChild.style.marginTop=-mar_c+mar_l+'px';
		window.setTimeout(function(){scrollup(mar_o,mar_d,mar_c-mar_l)},2);
	}
}
function correctPNG() // correctly handle PNG transparency in Win IE 5.5 & 6.
{
    var arVersion = navigator.appVersion.split("MSIE")
    var version = parseFloat(arVersion[1])
    if ((version >= 5.5) && (document.body.filters))
    {
       for(var j=0; j<document.images.length; j++)
       {
          var img = document.images[j]
          var imgName = img.src.toUpperCase()
          if (imgName.substring(imgName.length-3, imgName.length) == "PNG")
          {
             var imgID = (img.id) ? "id='" + img.id + "' " : ""
             var imgClass = (img.className) ? "class='" + img.className + "' " : ""
             var imgTitle = (img.title) ? "title='" + img.title + "' " : "title='" + img.alt + "' "
             var imgStyle = "display:inline-block;" + img.style.cssText
             if (img.align == "left") imgStyle = "float:left;" + imgStyle
             if (img.align == "right") imgStyle = "float:right;" + imgStyle
             if (img.parentElement.href) imgStyle = "cursor:hand;" + imgStyle
             var strNewHTML = "<span " + imgID + imgClass + imgTitle
             + " style=\"" + "width:" + img.width + "px; height:" + img.height + "px;" + imgStyle + ";"
             + "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader"
             + "(src=\'" + img.src + "\', sizingMethod='scale');\"></span>"
             img.outerHTML = strNewHTML
             j = j-1
          }
       }
    }    
}
var sl1,sl1n=0,sl1inter,sl1num=0,sl1len;
function serverInit(){	
	sl1=getid("servername");
	sl1.scrollTop=0;
	sl1len=sl1.innerHTML.split("|");
	sl1.innerHTML="";
	for(var i=0;i<sl1len.length;i++){
		sl1.innerHTML+=(sl1len[i]+"<br />");
		}
	sl1.innerHTML+=sl1len[0];
	setInterval(scrollstart,4000);
}
function scrollstart(){
	if(sl1.scrollTop>=(sl1len.length*20)){sl1.scrollTop=0;}
	sl1inter=setInterval(scrollserver,10);	
	}
function scrollserver(){
	if(sl1n<20){
		sl1n++;
		sl1.scrollTop++;
		}else{
			sl1n=0;
			clearInterval(sl1inter);
			}		
	}