/**
 * 判断浏览器
 */
var Sys={};
var Gift_obj={};
var Gift_numobj={};
var ua=navigator.userAgent.toLowerCase();
Sys.ie=(s=ua.match(/msie ([\d.]+)/)) ? true : false;
Sys.ie6=(s=ua.match(/msie ([0-6]\.+)/)) ? s[1] : false;
Sys.ie7=(s=ua.match(/msie ([7]\.+)/)) ? s[1] : false;
Sys.ie8=(s=ua.match(/msie ([8]\.+)/)) ? s[1] : false;
Sys.firefox=(s=ua.match(/firefox\/([\d.]+)/)) ? true : false;
Sys.chrome=(s=ua.match(/chrome\/([\d.]+)/)) ? true : false;
Sys.opera=(s=ua.match(/opera.([\d.]+)/)) ? s[1] : false;
Sys.safari=(s=ua.match(/version\/([\d.]+).*safari/)) ? s[1] : false;
Sys.ie6&&document.execCommand("BackgroundImageCache",false,true);
String.prototype.hasString=function(a){
	if(typeof a=="object"){
		for(var b=0,c=a.length;b<c;b++)
		   if(!this.hasString(a[b]))
		   	  return false;
			return true
	}else if(this.indexOf(a)!=-1)
		return true
};
/*加载函数*/
$(function(){
   var objnav=$('.nav_loc');
   $('#index').hover(function(){objnav.css("backgroundPosition","0 -77px")},function(){objnav.css("backgroundPosition","0 0")})
   $('#about').hover(function(){
	   $('#product_tip,#demo_tip').hide();
	   objnav.css("backgroundPosition","0 -154px");
	   $('#commpany_tip').show();
	  },function(){
		 objnav.css("backgroundPosition","0 0");
		 $('#commpany_tip').hide();
})
   $('#product').hover(function(){
	    var that=$(this);
		$('#demo_tip,#product_tip').hide();
	   	objnav.css("backgroundPosition","0 -231px");
		$('#product_tip').show();
	},function(){
		objnav.css("backgroundPosition","0 0");
		$('#product_tip').hide();
	}
   )
   $('#demo').hover(function(){
		var that=$(this);
		$('#product_tip,#commpany_tip').hide();
	   	objnav.css("backgroundPosition","0 -308px");
		$('#demo_tip').show();
	},function(){
		objnav.css("backgroundPosition","0 0");
		$('#demo_tip').hide();
	}
)
   $('#contact').hover(function(){
	   	objnav.css("backgroundPosition","0 -385px")
	},function(){
			objnav.css("backgroundPosition","0 0")
	})
   
   $('.left li').not('.hover').hover(function(){
	 	 $(this).addClass('hover');
	  },function(){
		 $(this).removeClass('hover');
	 }
   )
   
   var curUrl=window.location.href;
   if(curUrl.hasString("dzdsxj") || curUrl.hasString("hmmj") || curUrl.hasString("ssvideo") || curUrl.hasString("wordsj")){
	  objnav.css("backgroundPosition","0 -231px");	   
   }else if(curUrl.hasString("dxcs") || curUrl.hasString("zntx")){
	  objnav.css("backgroundPosition","0 -308px");   
   }else if(curUrl.hasString("tel")){
	  objnav.css("backgroundPosition","0 -385px");  
   }else if(curUrl.hasString("about") || curUrl.hasString("qywh")){
	  objnav.css("backgroundPosition","0 -154px");    
   }else{
		objnav.css("backgroundPosition","0 -77px");      
   }
})

