var scrollNewsCt=0;
var pauseTime=10*1000;
var timer1;

function hideAllClips() {
	for (i=0; i<3; i++){
		var allClips="ADcon"+i;
		var ADm="ADm"+i;
		document.getElementById(allClips).style.display="none";
		document.getElementById(ADm).className="ADmenuOff";
		}
	}
	
function clip_Switch(n) {
	var curClip="ADcon"+n;
	var curADm="ADm"+n;
	hideAllClips();
	document.getElementById(curClip).style.display="block";
	document.getElementById(curADm).className="ADmenuOn";
	scrollNewsCt=n; 
	}
	
function fwdScroll() {
	stopScroll();
	clip_Switch(scrollNewsCt);
	scrollNewsCt+=1;
	if (scrollNewsCt==3) {
		scrollNewsCt=0;
		}
		timer1=setTimeout("fwdScroll()",pauseTime);
	}
	
function stopScroll() {
	clearTimeout(timer1);
	}

function bwdScroll() {
	stopScroll();
	scrollNewsCt-=1;
	if (scrollNewsCt==0) {
		scrollNewsCt=3;
		}
		clip_Switch(scrollNewsCt);
		timer1=setTimeout("bwdScroll()",pauseTime);
	}


//---------------------------------------

		function GetObj(objName){
			if(document.getElementById){
				return eval('document.getElementById("' + objName + '")');
			}else if(document.layers){
				return eval("document.layers['" + objName +"']");
			}else{
				return eval('document.all.' + objName);
			}
		}
		function ADMenu(index,flag){
			for(var i=0;i<3;i++){/* 最多支持9个标签 */
				if(GetObj("ADcon"+i)&&GetObj("ADm"+i)){
					GetObj("ADcon"+i).style.display = 'none';
					GetObj("ADm"+i).className = "ADmenuOff";
				}
			}
			if(GetObj("ADcon"+index)&&GetObj("ADm"+index)){
				GetObj("ADcon"+index).style.display = 'block';
				GetObj("ADm"+index).className = "ADmenuOn";
			}
		}
		

function showmenu(sid)
{
	whichEl = eval("sub" + sid);
	imgmenu = eval("img" + sid);
	if (whichEl.style.display == "none")
	{
		eval("sub" + sid + ".style.display=\"\";");
		imgmenu.background="admin/images/an_5.jpg";
	}
	else
	{
		eval("sub" + sid + ".style.display=\"none\";");
		imgmenu.background="admin/images/an_4.jpg";
	}
}
var flag=false;
function DrawImage(ImgD,FitWidth,FitHeight){
   var image=new Image();
   image.src=ImgD.src;
   //alert(image.width);
   if(image.width>0 && image.height>0){
    flag=true;
    if(image.width/image.height>= FitWidth/FitHeight){
     if(image.width>FitWidth){  
     ImgD.width=FitWidth;
     ImgD.height=(image.height*FitWidth)/image.width;
     }else{
     ImgD.width=image.width;  
     ImgD.height=image.height;
     }
     //ImgD.alt="点击图片放大("+image.width+"×"+image.height+")";
     }
    else{
     if(image.height>FitHeight){  
     ImgD.height=FitHeight;
     ImgD.width=(image.width*FitHeight)/image.height;    
     }else{
     ImgD.width=image.width;  
     ImgD.height=image.height;
     }
     //ImgD.alt="点击图片放大("+image.width+"×"+image.height+")";
     }
    }
}
