document.writeln('<script type="text/javascript" src="js/plugin/weather/jquery.simpleWeather-1.8.min.js"></script>');
$(function() {
		//天气
	$.simpleWeather({
			location: 'datong, China',
			unit: 'c',
			success: function(weather) {
				h = '<p class="thumb"><img src="'+weather.thumbnail+'"/></p>';
				h += '<p> '+weather.high+'&deg;C - '+weather.low+'&deg;C</p>';
				//html += '<p><strong>当前</strong>: '+weather.temp+'&deg; '+weather.units.temp+'</p>';+weather.high+'&deg; '+weather.units.temp+
				//html += '<p><strong>Currently</strong>: '+weather.currently+' - <strong>Forecast</strong>: '+weather.forecast+'</p>';
				//html += '<p><img src="'+weather.image+'"></p>';
				
				$(".weather").html(h);
			},
			error: function(error) {}
	});
	
	//判断如果主菜单下没有子菜单,删除多作标签ul,并且删除最后一个li的背景
	$(".menuitem li").each(function(){
		if($(this).find('ul > li').size()==0)
		{
			$(this).find('ul').remove();
		}
		$(this).find('ul > li:last a').addClass('notbg');
	});
	
	$(".menuitem li").hover(function(){
		$(this).children("ul:hidden").fadeIn(700);
	},function(){  
		$(this).children("ul:visible").fadeOut(200);
	}); 
	 
	$(".bmenu a,.jdmenu a").click(function() {
		var pr = $(this).parents('ul');
		var inx = pr.find('a').index(this);
		pr.find('a').removeClass("active");
		$(this).addClass("active");
		$(".bubox ul").hide().eq(inx).show();
	})
})
