
function setTab(m,n)
{
	
	var tli=document.getElementById("menu"+m).getElementsByTagName("li");
	var mli=document.getElementById("main"+m).getElementsByTagName("ul");
	var url=document.getElementById("url"+m);
	
	for(i=0;i<tli.length;i++){
		tli[i].className=i==n?"hover":"";
		mli[i].style.display=i==n?"block":"none";
		if(i==n){
		url.href = tli[i].id;
		}
	}
	
}

function showDiv(obj,num,len)
{
	for(var id = 1;id<=len;id++)
	{
		var ss=obj+id;
		var snav=obj+"nav"+id;
		var surl=obj+"url"+id;
		if(id==num){
			try{document.getElementById(ss).style.display="block"}catch(e){};
			try{document.getElementById(snav).className="hover"}catch(e){};
			try{document.getElementById(surl).style.display="inline"}catch(e){};
		}else{
			try{document.getElementById(ss).style.display="none"}catch(e){};
			try{document.getElementById(snav).className="moveout"}catch(e){};
			try{document.getElementById(surl).style.display="none"}catch(e){};
		}
	}
}


function $a(id,tag){var re=(id&&typeof id!="string")?id:document.getElementById(id);if(!tag){return re;}else{return re.getElementsByTagName(tag);}}
function addImg(url){var img=new Image();img.src=url;return img;}

function HtmlMove(id,tag,path,rate,upbt,downbt,pgtime,lis)
{
	var mous=false,o=$a(id);o.onmouseover=function(){mous=true;};o.onmouseout=function(){mous=false;};
	var fg=tag.split('/'),as=$a(o,fg[1]),fx=(path=="scrollRight"||path=="scrollLeft")?"scrollLeft":"scrollTop";
	var ow=fx=="scrollTop"?as[0].offsetHeight:as[0].offsetWidth,pw=fx=="scrollTop"?o.offsetHeight:o.offsetWidth;
	var pgli=lis||Math.floor((pw+ow/2)/ow),pg=Math.floor((as.length+(pgli-1))/pgli),pgmx=ow*pgli,now=0,mx,d;
	var os=$a(o,fg[0])[0];os.innerHTML+=os.innerHTML;d=setInterval(function(){go_to((path=="scrollTop"||path=="scrollLeft")?true:false);},pgtime);
	if(upbt)
	{
		var ups=$a(upbt),uimg=addImg(ups.src),uimg1=addImg(ups.src.replace(/(.*)(\.\w{3})/,"$1_$2"));
		ups.onmouseover=function(){this.src=uimg1.src;};ups.onmouseout=function(){this.src=uimg.src;}
		$a(upbt).onmousedown=function(){clearInterval(d);go_to(true);d=setInterval(function(){go_to(true);},pgtime);}
	}
	if(downbt)
	{
		var down=$a(downbt),dimg=addImg(down.src),dimg1=addImg(down.src.replace(/(.*)(\.\w{3})/,"$1_$2"));
		down.onmouseover=function(){this.src=dimg1.src;};down.onmouseout=function(){this.src=dimg.src;}
		down.onmousedown=function(){clearInterval(d);go_to(false);d=setInterval(function(){go_to(false);},pgtime);}
	}
	function go_to(fxs){if(mous){return;};var ex;
	if(fxs){if(now<pg){now++;}else{now=1;o[fx]=0;}mx=now*pgmx;ex=setInterval(function(){(o[fx]+rate<mx)?(o[fx]+=rate):o[fx]=mx;if(o[fx]==mx){clearInterval(ex);}},15);}
	else{if(now>0){now--;}else{now=pg-1;o[fx]=pg*pgmx;}mx=now*pgmx;ex=setInterval(function(){(o[fx]-rate>mx)?(o[fx]-=rate):o[fx]=mx;if(o[fx]==mx){clearInterval(ex);}},15);}}
}

function changes(id,div_num,total)
{
for(i=1;i<=total;i++)
{
  if(i==id)
   {
	 document.getElementById("head"+div_num+"_"+i).className="show";
     document.getElementById("body"+div_num+"_"+i).style.display="";
   }
  else
   {
     document.getElementById("head"+div_num+"_"+i).className="on";
     document.getElementById("body"+div_num+"_"+i).style.display="none";
   }
}
}

