// JavaScript Document
$(function(){
	$('#navs li,.menu').hover(function()
	{
		//$nwidth = $(this).find('.menu li').width() * $(this).find('.menu li').size();
		//$(this).find('.menu').width($nwidth);
		//$(this).stop().find('.navbg').animate({height:45},500);
		$(this).stop().find('.menu').css({opacity:1});
		$(this).stop().find('.menu').show();
		$(this).addClass("on");
	},
	function()
	{
		$(this).stop().find('.menu').css({opacity:0});
		$(this).stop().find('.menu').hide();
		//$(this).stop().find('.navbg').animate({height:0},10);
		$(this).removeClass("on");
	});	
	
	$(".subnav li").hover(
	  function () {
		$(this).stop().find('.smenu').css({opacity:1});
		$(this).stop().find('.smenu').show();
		$(this).addClass("on");
	  },
	  function () {
		$(this).stop().find('.smenu').css({opacity:0});
		$(this).stop().find('.smenu').hide();
		//$(this).stop().find('.navbg').animate({height:0},10);
		$(this).removeClass("on");
	  }
	);
	
	$('.bmenu').hover(function()
	{
		
		$('.ul-menu').stop().show();
	},
	function()
	{
		$('.ul-menu').stop().hide();
	
	});	
	
	$('.fixedTop').click(function(){
		$(window).scrollTop(0);
	});
	
	$('.dotScroll').click(function(){
		$("body,html").animate({
			scrollTop:$('#main').offset().top //让body的scrollTop等于pos的top，就实现了滚动
		})
	});
	
	

});	


/*
$(function(){
	$('#navs li').hover(function()
	{
		//$nwidth = $(this).find('.menu li').width() * $(this).find('.menu li').size();
		//$(this).find('.menu').width($nwidth);
		$(this).children("a.na").animate({opacity:0},10);
		$(this).children("a.na").hide()
		$(this).stop().find('.menu').show();
		$(this).children(".menu").animate({top:0,opacity:1},500);
		
		$(this).addClass("on");
	},
	function()
	{
		$(this).find('.menu').css("opacity","0");
		$(this).stop().find('.menu').hide();
		$(this).children(".menu").animate({top:"100px",opacity:0},800);
		$(this).children("a.na").animate({opacity:1},0);
		$(this).children("a.na").show()
		$(this).removeClass("on");
	});	
});	

*/

/*$(function(){
	$('#navs li').hover(function()
	{
		//$nwidth = $(this).find('.menu li').width() * $(this).find('.menu li').size();
		//$(this).find('.menu').width($nwidth);
		$(this).children("a").animate({opacity:0},10);
		$(this).find('.menu').css("opacity","1");
		$(this).find('.menu').show();
		$(this).addClass("on");
	},
	function()
	{
		$(this).find('.menu').css("opacity","0");
		$(this).stop().find('.menu').hide();
		$(this).children("a").animate({opacity:1},0);
		$(this).removeClass("on");
	});	
});	*/