//Animated Menu
$(".nav li a").wrapInner('<span class="out"></span>');$(".nav li a").each(function(){$('<span class="over">'+$(this).text()+'</span>').appendTo(this)});$(".nav li a").hover(function(){$(".out",this).stop().animate({'top':'45px'},250);$(".over",this).stop().animate({'top':'0px'},250)},function(){$(".out",this).stop().animate({'top':'0px'},250);$(".over",this).stop().animate({'top':'-45px'},250)});
//subnav
function displaySubMenu(li){var subMenu=li.getElementsByTagName("ul")[0];subMenu.style.display="block";}function hideSubMenu(li){var subMenu=li.getElementsByTagName("ul")[0];subMenu.style.display="none";};
//rss
$('#rssurl,#rsstip').mouseover(function(){if(window.willhide)clearTimeout(window.willhide);$('#rsstip').fadeIn(500)});$('#rssurl,#rsstip').mouseout(function(){window.willhide=setTimeout(function(){$('#rsstip').fadeOut(500)},750)});
//tab
$('#tab-title span').mouseover(function(){ $(this).addClass("current").siblings().removeClass(); $("."+$(this).attr("id")).show().siblings().hide(); });
//ad
$('.boxgrid.caption').hover(function(){$(".cover",this).stop().animate({top:'0px'},{queue:false,duration:160})},function(){$(".cover",this).stop().animate({top:'141px'},{queue:false,duration:160})});
//loading
$('.title h2 a,.readmore a').click(function(){$(this).text('页面载入中……');window.location=$(this).attr('href')});
//link move
$('.sidebar li a,.extra li a,.st-related-posts li a,.car-monthlisting li a').hover(function() {$(this).stop().animate({'marginLeft': '5px'}, 'fast');}, function() {$(this).stop().animate({'marginLeft': '0px'}, 'fast');});
//scroll
$('a[href*=#]').click(function() {if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') && location.hostname == this.hostname) {var $target = $(this.hash);$target = $target.length && $target || $('[name=' + this.hash.slice(1) +']');if ($target.length) {var targetOffset = $target.offset().top;$('html,body') .animate({scrollTop: targetOffset}, 1000);return false;}}});
//search
$(window).scroll(function(){var bodyTop=0;if(typeof window.pageYOffset!='undefined'){bodyTop=window.pageYOffset}else if(typeof document.compatMode!='undefined'&&document.compatMode!='BackCompat'){bodyTop=document.documentElement.scrollTop}else if(typeof document.body!='undefined'){bodyTop=document.body.scrollTop}$("#hellobaby").css("top",250+bodyTop)});