jQuery(document).ready(function($){
$(".widget ul li a").hover(function () {$(this).stop().animate({marginLeft:"+=8"}, 200);},function () {$(this).stop().animate({marginLeft:"0"}, 120);});

$('#switch-sidebar a').toggle(function(){
	$(this).text("Show Sidebar")
	$('#sidebar').hide();
	$('#content').animate({width: "980px"}, '1000');
	},function(){
	$(this).text("Hide Sidebar")
	$('#sidebar').show();
	$('#content').animate({width: "630px"}, '800');
});

$(".post a,#comments a,.widget a").mouseover(function(e){
	this.myTitle = this.title;
	this.myHref = "<span class='linkto'>Link to : </span>"+this.href;
	this.myHref = (this.myHref.length > 80 ? this.myHref.toString().substring(0,80)+"..." : this.myHref);
	this.title = "";
	var tooltip = "<div id='tooltip'><p>"+this.myTitle+"<em>"+this.myHref+"</em>"+"</p></div>";
	$('body').append(tooltip);
	$('#tooltip').css({"opacity":"0","top":(e.pageY+20)+"px","left":(e.pageX+10)+"px"}).animate({opacity:"0.75"}, 500);
}).mouseout(function(){this.title = this.myTitle;$('#tooltip').remove();
}).mousemove(function(e){$('#tooltip').css({"top":(e.pageY+20)+"px","left":(e.pageX+10)+"px"});
});

$('#go-up').click(function(){$('html,body').animate({scrollTop: '0px'}, 800);}); 
//点击id="go-up"对象时，滑动至相对浏览器滚动条为0px（即顶部），时间为800毫秒
$('#go-comt').click(function(){$('html,body').animate({scrollTop:$('#comments').offset().top}, 800);});
//点击id="go-comt"对象时，滑动至id="comments"相对浏览器滚动条的距离，时间为800毫秒
$('#go-down').click(function(){$('html,body').animate({scrollTop:$('#footer').offset().top}, 800);});
//点击id="go-down"对象时，滑动至id="footer"(即底部)相对浏览器滚动条的距离，时间为800毫秒
}); 