function switchPic(screen) {
	if (screen > MaxScreen) {
		screen = 1 ;
	}
	for (i=1;i<=MaxScreen;i++) {
		$("#Switch_"+i)
		.fadeOut("slow")
		.css
		({display: "none"});
	}
	$("#Switch_"+ screen)
	.fadeIn("slow")
	.css
	({display: "block"});
	
	showSwitchNav(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="javascript:void(0);" target="_self" class="sel">'+i+'</a></li>' ;
		}
		else {
			NavStr += '<li onmouseover="goManSwitch('+i+');" onmouseout="goonSwitch();" ><a href="javascript:void(0);" target="_self">'+i+'</a></li>' ;
		}
	}
	$("#SwitchNav").html(NavStr);
}
function reSwitchPic() {
	refreshSwitchTimer = null;
	switchPic(CurScreen+1);
	refreshSwitchTimer = setTimeout('reSwitchPic();', 4000);
}
function pauseSwitch() {
	clearTimeout(refreshSwitchTimer);
}

function goonSwitch() {
	clearTimeout(refreshSwitchTimer);
	refreshSwitchTimer = setTimeout('reSwitchPic();', 4000);
}
function goManSwitch(index) {
	clearTimeout(refreshSwitchTimer);
	CurScreen = index - 1 ;
	reSwitchPic();
}
function Search_Area()
{
	var City = document.getElementById("City").value;
	if (City != '')
	{
		if (City == "")
			return (false);
		else
		{
			var url = "/hotel/ajax_server.asp";
			$.post(
				url,
				{
					City:			City,
					action:			'search_area'
				},
				function (msg) {
					get_area(msg);
				}
			);
		}
	}
}
function get_area(msg)		
{
	var str = msg;
	var area_list = document.getElementById("Hotel_Area");
	area_list.options.length=0;
	var arrstr = new Array();
	arrstr = str.split("|");
	area_list.options.add(new Option( "选择区域",""));  
	if(str.length>0)   
	{
		for(var i=0;i<arrstr.length;i++)
		{
			var subarrstr=new Array
			subarrstr=arrstr[i].split(",")
			area_list.options.add(new Option(subarrstr[1],subarrstr[1])); 
		}

	}	
}

