// JavaScript Document
// JavaScript Document
　
////////////自动切换新闻面板/////////////////
////////////////
 
var intOpecity;
function startSWN(){ intNews=setInterval("autoSw()",3000); }
function stopSWN(){ 
	try { 
		clearInterval(intNews); 
	} catch(e){	}
}

function mSw(int){ //SHUBIAO移动到类别上时进行面板切换并关闭自动切换
	swicthPal('localN','provinceN','countryN',int);
	stopSWN();
}

function autoSw(){	 //根据全局参数swkey来切换哪一块面板显示
	swicthPal('localN','provinceN','countryN',swKey);
 	swKey++;
 	if(swKey>2) swKey=0;
 }
		   
 function swicthPal(id1,id2,id3,intKey){ //根据指定值切换第几个面板显示
	 _obj=(arguments.length>3)?$(arguments[intKey]):$(id1);
	 $(id1).style.display="none";
	$(id2).style.display="none";
	$(id3).style.display="none"; 
	
	//显示遮罩层并开始渐变，再显示新闻层。
	_obj.style.display="block";
		Element.cleanWhitespace(_obj); //表理空白节点以应对不同浏览器对<ul>与<li>之间的空白的不同处理	
	_obj.childNodes[0].className="firstNewsTitle";
	
	$("flashFugaiNews").style.display="block";
	intOpecity=setInterval("setOpacity(\"flashFugaiNews\",0,-30)",200);  //setOpacity(divname,endOpercity,stepValue,delay) 
	
 
	// 设置标题

 
}

function setOpacity(divname,endValue,stepValue){	
	var sd=navigator.appName;
	if(sd!="Microsoft Internet Explorer"){ 
		stepValue=stepValue/100;
	 
		endValue=endValue/100;
		 
		var nowOp=$(divname).style.opacity; 
		if(parseFloat(nowOp)+parseFloat(stepValue)<=parseFloat(endValue)) {
			//停止渐变，隐藏层，清除定时器
			$(divname).style.display="none";
			$(divname).style.opacity=1.0;
			clearInterval(intOpecity);
		}
		else{
			//降低透明度parseFloat(nowOp)+parseFloat(stepValue)<parseFloat(endValue)
			 
			$(divname).style.opacity=parseFloat(nowOp)+parseFloat(stepValue);
			 
		}
	}
	else{
		var nowOp=$(divname).filters.alpha.opacity;
		if(nowOp+stepValue<=endValue) {
			//停止渐变，隐藏层，清除定时器
			$(divname).style.display="none";
			$(divname).filters.alpha.opacity=100;
			clearInterval(intOpecity);
		}
		else{
			//降低透明度
			$(divname).filters.alpha.opacity=nowOp+stepValue;
		}
	}
}
/////
///////////////
 ////////////自动切换新闻面板///////////////// 
 //////////////////自动切换六要素面板///////////////////////
 //////-----------------------------------///////////////////
　

function startSW(){	//开始六要素面板的切换
	 int=setInterval("swicthPal2()",5000);
}

function clearSW(){	//停止六要求面板的切换
	clearInterval(int);
}

function swicthPal2(){	
//切换六要素面板，配合FLASH闪动效果
		// reloadDiv("flashTable","FlashID");
		$("flashTable").style.display="block";
		 
		$("six1").style.display=($("six1").style.display=="none")?"block":"none";
		$("six2").style.display=($("six2").style.display=="none")?"block":"none";
		int2=setInterval("hideFlash()",1000);
	}
function hideFlash(){
	//隐藏FLASH动画
	$("flashTable").style.display="none";
	clearInterval(int2);
}
 
///////////////-------------------///////////////
//////////////////////////////////////////////////////////////


 function getFlashMovieObject(movieName)
{
	if (window.document[movieName])
	{
		return window.document[movieName];
		}
	if (navigator.appName.indexOf("Microsoft Internet")==-1)
	{
		if (document.embeds && document.embeds[movieName])
		return document.embeds[movieName];
	}
	else // if (navigator.appName.indexOf("Microsoft Internet")!=-1)
	{
		return document.getElementById(movieName);
	}
}