jQuery(document).ready(function($){
	//在这下面加代码
//滚动
 $(function() {
var $sidebar = $("#tuijian"),
$window = $(window),
offset = $sidebar.offset(),
topPadding = 15;
$window.scroll(function() {
if ($window.scrollTop() > offset.top) {
$sidebar.stop().animate({
marginTop: $window.scrollTop() - offset.top + topPadding
});
} else {
$sidebar.stop().animate({
marginTop: 0
});
}
});
});	
	
	
//侧边栏链接滑动
$('.sidebar a').hover(function() {  
 $(this).stop().animate({'left': '5px'}, 'fast');  
 }, function() {  
$(this).stop().animate({'left': '0px'}, 'fast');  

 }); 	
//图片渐显
$(function () {
$('img').hover(
function() {$(this).fadeTo("fast", 0.5);},
function() {$(this).fadeTo("fast", 1);
});
});
//滑动效果
$body = (window.opera) ? (document.compatMode == "CSS1Compat" ? $('html') : $('body')) : $('html,body');// 这行是 Opera 的补丁, 少了它 Opera 是直接用跳的而且画面闪烁 by willin
$('#add-comment').click(function(){
	$body.animate({scrollTop: $('#author_info').offset().top}, 1000);
	return false;
});
$('#pinglun').click(function(){
	$body.animate({scrollTop: $('#top').offset().top}, 1000);
	return false;
});
//载入效果
$('.post h2 a').click(function(){
    $(this).text('@@@Loading@@@');
    window.location = $(this).attr('href');
    });
//漂亮标题 
$("a").mouseover(function(e){
	this.myTitle = this.title;
	this.myHref = this.href;
	this.myHref = (this.myHref.length > 30 ? this.myHref.toString().substring(0,30)+"..." : 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.8","top":(e.pageY+20)+"px","left":(e.pageX+10)+"px"}).show('fast');
}).mouseout(function(){this.title = this.myTitle;$('#tooltip').remove();
}).mousemove(function(e){$('#tooltip').css({"top":(e.pageY+20)+"px","left":(e.pageX+10)+"px"});
});




 //在这上面加
});
