﻿	var Path = window.location.pathname;
	var sCurClass=0;
	function GetPath()
	{
		if (Path.indexOf("/index/") > -1) {
			sCurClass=0;
		}
		else if(Path.indexOf("/about/") > -1)
		{
			sCurClass=1;
		}
		else if(Path.indexOf("/brand/") > -1)
		{
			sCurClass=2;
		}
		else if(Path.indexOf("/career/") > -1)
		{
			sCurClass=3;
		}
		else if(Path.indexOf("/contact/") > -1)
		{
			sCurClass=4;
		}
	}
		function resetState(){
			$("#Nav .Title").removeClass("cur");
			$("#Nav .Title").eq(sCurClass).addClass("cur");
		//alert(sCurClass);
		}	
		function hovertitle(i){
			$("#Nav .Title").removeClass("cur");
			$("#Nav .Title").eq(i).addClass("cur");	
		}
	$(function(){
		GetPath();
		$("#Nav .Item").each(function(i){
			$(this).hover(function(){
				hovertitle(i);
				if($(this).find(".SubNav")!=""&&$(this).find(".SubNav").height()>20){
					$("#Nav .Item").eq(i).find(".SubNav").show();
					$("#Nav .Item").eq(i).find(".NavArrow").show();
				}	
			},function(){
					$(this).find(".SubNav").hide();	
					$("#Nav .Item").eq(i).find(".NavArrow").hide();
					resetState();
			})	
		})	
		$(".SubItem").each(function(i){
			$(this).hover(function(){
				$(".SubItem").eq(i).addClass("SubCur");	
			},function(){
				$(".SubItem").eq(i).removeClass("SubCur");	
			})
		})
	})
