/*AsThis menu*/
$(".Amenu dt").toggle(function() {
	$(this).addClass('focus');
	$(this).next('dd:first').css({visibility: "visible", display: "none"}).slideDown("fast");
},
function(){
	$(this).removeClass('focus');
	$(this).next('dd:first').css({visibility: "hidden"});
});

/* cookie */
~function(doc){
	jQuery.cookie=function(key,val,opt){
		if(null==key)return doc.cookie;
		if(val!==''+val&&val!==+val)
		{
			var ck = ';' + doc.cookie.replace(/;\s+/g,";") + ';'; //防止搜索"str"的value有test_str的cookie名称
			return unescape((ck.match(';' + key+'=(.*?);')||0)[1]||'');//过滤后查找;str的位置
		}
		opt=opt||{};
		var it,date=new Date,cookie=key+'='+encodeURIComponent(val);
		date.setDate(date.getDate()+(''!==val?opt.expires||30:-1));
		opt.expires=date.toUTCString();
		for(it in opt)opt.hasOwnProperty(it)&&opt[it]&&(cookie+=';'+it+'='+opt[it]);
		doc.cookie=cookie;
	}
}(window.document);

/*go2top*/
(function() {
	jQuery(window).scroll(function () {
		if (jQuery(this).scrollTop() != 0) {
			$("#go2top").css('top', jQuery('html').scrollTop() + 300).fadeIn();
		} else {
			$("#go2top").fadeOut();
		}
	});
})();
$("#go2top").click(function(){
	jQuery('html').animate({
		scrollTop: 0
	},
	600);
});
