//头部菜单
$(function(){
	$("#navigation  li").hover(
		  function(){
			if(!$(this).find("a").hasClass("m_over")){
			   remove_css();  //移除头部样式
			   $(this).find("a").addClass("m_over");  //增加样式
			}
			
			$(this).find("ul").show();   //显示下拉
				
		  },
		  function(){
		  $(this).find("a").removeClass("m_over");  //移除样式
		  $(this).find("ul").hide();  //隐藏下拉
		  
		  });
	})
	
//清空头部样式
function remove_css(){
	$("#navigation  li a").each(function(){
	   if($(this).hasClass("m_over"))  $(this).removeClass("m_over");
	
	})
}



//登录检测
function CheckForm_head()
{
	if(document.UserLogin.username.value=="")
	{
		
		alert("请输入用户名|手机号|会员号");
		document.UserLogin.username.focus();
		return false;
	}
	
	if(document.UserLogin.password.value =="")
	{
		alert("请输入密码");
		document.UserLogin.password.focus();
		return false;
	}
	return true;
}
function openScript(url, width, height)
{
	var Win = window.open(url,"UserControlPad",'width=' + width + ',height=' + height + ',resizable=1,scrollbars=yes,menubar=yes,status=yes' );
}



var b_v = navigator.appVersion;
		 	var IE6 = b_v.search(/MSIE 6/i) != -1; 
		 	if (IE6){
			 	
			 	}else{	  
				   	$(document).ready(function(){
				   	$(".nav_main ul>li").each(function() {  			  
					    var path = window.location.pathname.split("/");
					    var path11 = window.location.pathname.split("?");
					    var path1 = '/'+ path[1]+'/';	
					    var path0 = '/'+ path[1]
				   	    if ($(this).find("a").attr("href")==path0 || $(this).find("a").attr("href")==path1 || $(this).find("a").attr("href")==path11){
				   	     		$(this).children("a").removeClass('hover').addClass('nav_img');
				   	    }else if (path11[0] == '/file.php' || path11[0] == '/article.php'){
				   	    		$(".nav_main ul>li").children("a").eq(0).removeClass('hover').addClass('nav_img');
					   	}else if(path0 == '/hotel_t.php' || path0 == '/hotel_d.php'){
								$(".nav_main ul>li").children("a").eq(4).removeClass('hover').addClass('nav_img');
					   	     }
				   		});
				   	});	
		 		}	   
		
