
/******* 页面调用JS 入口 ************/

function switchPic(screen) {
	if (screen > MaxScreen) {
		screen = 1 ;
	}
	
	///**********设置 显示的图片**************/
	
	oTransContainer.filters[0].Apply(); //给图片轮换添加滤镜效果(只有IE浏览器支持)
	
	for (i=1;i<=MaxScreen;i++) {
		document.getElementById("Switch_"+i).style.display = "none" ;
	}
	document.getElementById("Switch_"+screen).style.display = "block" ;
	
	oTransContainer.filters[0].Play(duration=2); //给图片轮换添加滤镜效果
	
	///**********设置 显示的图片 END **************/
	
	
	/**********设置  **************/
	showSwitchNav(screen);
	showSwitchTitle(screen);

	CurScreen = screen  ;
}

/**********设置 数字导航 **************/
function showSwitchNav(screen) {
	var NavStr = "" ;
	for (i=1;i<=MaxScreen;i++) {
		if (i == screen) {
			NavStr += '<li onmouseover="pauseSwitch();" onmouseout="goonSwitch();"><a href="'+Switcher[screen]['link']+'" target="_blank">'+i+'</a></li>' ;
		}
		else {
			NavStr += '<li onmouseover="goManSwitch('+i+');" onmouseout="goonSwitch();" ><a href="'+Switcher[screen]['link']+'" target="_blank">'+i+'</a></li>' ;
		}              /**************************************/
		                /**** onmouseover="pauseSwitch();" 产生的结果是需要单击才能切换图片  *********/
		                /**** onmouseover="goManSwitch('+i+');"产生的结果是鼠标滑动即可切换图片**********/
		                /**************************************/
		
	}
	document.getElementById("SwitchNav").innerHTML = NavStr ;
}

/**********设置 数字导航旁边的标题 **************/
function showSwitchTitle(screen) {
	var titlestr = "" ;
	titlestr = '<h3><a href="'+Switcher[screen]['link']+'" target="_blank">'+Switcher[screen]['title']+'</a></h3>' ;
	document.getElementById("SwitchTitle").innerHTML = titlestr ;
}

/**********设置图片切换的时间长短 **************/
function reSwitchPic() {
	refreshSwitchTimer = null;
	switchPic(CurScreen+1);
	refreshSwitchTimer = setTimeout('reSwitchPic();', 6000);
}

/**********设置图片切换暂停 **************/
function pauseSwitch() {
	clearTimeout(refreshSwitchTimer);
}
/**********设置图片继续切换 **************/
function goonSwitch() {
	clearTimeout(refreshSwitchTimer);
	refreshSwitchTimer = setTimeout('reSwitchPic();', 6000);
}

/**********设置显示当前index对应的图片 **************/
function goManSwitch(index) {
	clearTimeout(refreshSwitchTimer);
	
	CurScreen = index - 1 ;
	reSwitchPic();
}





