
document.write('<link rel="shortcut icon" href="/images/favicon.ico" mce_href="/images/favicon.ico" type="image/x-icon">');
//LoadJS("pngfix","jquery.pngFix.js") //加载PNG图片透明插件

$(function(){
	//根据当前导航显示默认二级菜单
	
	var nva_cid=0;
	$(".header .h_nva ul li").each(function(i){
		if($(this).find("a").attr("class") == "active"){
			nva_cid = i;
		}
	})
	
	$(".h_townva ol").hide();
	$(".h_townva ol").eq(nva_cid).show(); //显示默认二级菜单
			
	$(".header .h_nva ul li a").mouseover(function(){
		
		if($(this).attr("class")!="active"){	
		$(this).css("color","#444")
		$(this).css("background","url(/templates/image/h_nva_aHover_left_bg.gif) left top no-repeat")	
		$(this).find("span").css("background","url(/templates/image/h_nva_aHover_right_bg.gif) right top no-repeat")
		$(this).css("background","url(/templates/image/nva2Hover_left.gif) left top no-repeat")
		$(this).find("span").css("background","url(/templates/image/nva2Hover_right.gif) right top no-repeat")
		//$(this).addClass("active")
		}
		
		//显示二级菜单
		var thistext = $.trim($(this).text())
		
		$(".header .h_nva ul li").each(function(i){
			var text_temp = $.trim($(this).text())
			if(text_temp == thistext){
				nva_cid = i; //循环找到当前活动菜单的集合ID值
				
			}
			
		})
		
		$(".h_townva ol").hide();
		$(".h_townva ol").eq(nva_cid).show();
		
	}); 
	$(".header .h_nva ul li a").mouseout(function(){
		if($(this).attr("class")!="active"){
		$(this).css("color","#FFF")
		$(this).css("background","")	
		$(this).find("span").css("background","")
		}
	});
	
	$(".header .h_nva ul li a.active").css("background","url(/templates/image/h_nva_aHover_left_bg.gif) left top no-repeat")
	$(".header .h_nva ul li a.active").find("span").css("background","url(/templates/image/h_nva_aHover_right_bg.gif) right top no-repeat")
	$(".header .h_nva ul li a.active").css("background","url(/templates/image/nva2Hover_left.gif) left top no-repeat")
	$(".header .h_nva ul li a.active").find("span").css("background","url(/templates/image/nva2Hover_right.gif) right top no-repeat")
	$(".header .h_nva ul li a.active").css("color","#444")
	
	
	//首页下一页按钮
	
	//首页推荐线路
	pagenext($(".screen"),0,"height")
	$(".screen").parent().find(".next_left").click(function(){
		var spaceone=pagenext($(".screen"),-1,"height")
		movepage($(".screen"),"height",spaceone)
	})
	$(".screen").parent().find(".next_right").click(function(){
		var spaceone=pagenext($(".screen"),1,"height")
		movepage($(".screen"),"height",spaceone)
	})
	//首页Hot线路
	pagenext($(".screen1"),0,"width")
	$(".screen1 .next_left:first").click(function(){
		var spaceone=pagenext($(".screen1"),-1,"width")
		movepage($(".screen1"),"width",spaceone)
	})
	$(".screen1 .next_right:first").click(function(){
		var spaceone=pagenext($(".screen1"),1,"width")
		movepage($(".screen1"),"width",spaceone)
	})
	//首页推荐游船
	pagenext($(".screen2"),0,"height")
	$(".screen2 .next_left:first").click(function(){
		var spaceone=pagenext($(".screen2"),-1,"height")
		movepage($(".screen2"),"height",spaceone)
	})
	$(".screen2 .next_right:first").click(function(){
		var spaceone=pagenext($(".screen2"),1,"height")
		movepage($(".screen2"),"height",spaceone)
	})
	//首页推荐一地线路
	pagenext($(".screen3"),0,"height")
	$(".screen3 .next_left:first").click(function(){
		var spaceone=pagenext($(".screen3"),-1,"height")
		movepage($(".screen3"),"height",spaceone)
	})
	$(".screen3 .next_right:first").click(function(){
		var spaceone=pagenext($(".screen3"),1,"height")
		movepage($(".screen3"),"height",spaceone)
	})
	//首页推荐城市
	pagenext($(".screen4"),0,"width")
	$(".screen4").parent().find(".next_left").click(function(){
		var spaceone=pagenext($(".screen4"),-1,"width")
		movepage($(".screen4"),"width",spaceone)
	})
	$(".screen4").parent().find(".next_right").click(function(){
		var spaceone=pagenext($(".screen4"),1,"width")
		movepage($(".screen4"),"width",spaceone)
	})

//	$(".next_right").click(function(){
//		
//		//统计离它最近的Ol的项目数
//		var prevObject = $(this).parent().parent()
//		var screenheight = $(prevObject).find("ol:visible").parent().height()
//		//设置总页数
//		var tolpage //li 的总数,也即page总数
//		var liheight = 1
//		//统计li的总高度
//		$(prevObject).find("ol:visible li").each(function(i){
//				liheight += $(this).height(); //循环找到当前活动菜单的集合ID值	
//		})
//
//		tolpage = liheight/screenheight
//		tolpage = Math.ceil(tolpage)
//		//alert(tolpage)
//		//当前页码
//		if(page<tolpage){
//			page = page + 1
//			$(prevObject).find(".next_page").html(page+" of "+tolpage)
//			//移动显示区域
//			 $(prevObject).find("ol").animate({"top" : -((page-1)*screenheight)+'px'}, "slow");
//			
//		}
//	})

});

//如果是IE6则加载Jquery.PNG图片透明插件

if(IsIE6()=="IE6"){
	var ltemp = LoadFile(Path_Js+"/DD_belatedPNG_0.0.8a-min.js");
	
	$(function(){
			DD_belatedPNG.fix('.logo');   
			   })
	
	}


//首页右边table面板
if($("#tablepanel_1")){
	$(function(){
		$(".tablep_1").hide()
		$(".tablep_1:first").show()
		pagenext($(".screen1"),0,"width")
		$("#tablepanel_1 span").click(function(){
			ShowTablePanel("#tablepanel_1 span",this,"active",".tablep_1")
			if($(".tablep_1:visible").attr("class")!=$(".tablep_1:first").attr("class")){
			pagenext($(".tablep_1:visible"),0,"height")
			}
			else{pagenext($(".tablep_1:visible"),0,"width")}
			
			//ShowTablePanelContent(".tablep_1",$(this).attr("title"))
		})		   
	})
	
}

//首页中间主题table面板
if($("#tablepanel_2")){
	$(function(){
		$(".tablep_2").hide()
		$(".tablep_2:first").show()
		pagenext($(".screen1"),0,"width")
		$("#tablepanel_2 span").click(function(){
			ShowTablePanel("#tablepanel_2 span",this,"active",".tablep_2")
			$("#tablepanel_2 span").removeClass("spanbg")
			$(this).addClass("spanbg")
		})		   
	})
	
}

//首页左边边table面板
if($(".mml_content")){
	$(function(){
		$(".mml_content ul li").click(function(){
			ShowTablePanel(".mml_content ul li",this,"active",".mmlc_tab_right")
		})		   
	})
	
}

//Deals页面 table面板
if($(".list_nva")){
	$(function(){
		$(".nva_table").hide()
		$(".nva_table:first").show()
		$(".list_nva ul li span").click(function(){
			//alert($(this).parent("li").html())
			ShowTablePanel(".list_nva ul li span",this,"active",".nva_table")
		})		   
	})
	
}

