jQuery(document).ready(function($) {
    //上下滑动
	$body = (window.opera) ? (document.compatMode == "CSS1Compat" ? $("html") : $("body")) : $("html,body");
	$("#shang").mouseover(function() {
		up()
	}).mouseout(function() {
		clearTimeout(fq)
	}).click(function() {
		$body.animate({
			scrollTop: 0
		},
		600)
	});
	$("#xia").mouseover(function() {
		dn()
	}).mouseout(function() {
		clearTimeout(fq)
	}).click(function() {
		$body.animate({
			scrollTop: $(document).height()
		},
		600)
	});
	$("#comt").click(function() {
		$body.animate({
			scrollTop: $("#comments").offset().top
		},
		600)
	});

	
	//点击文章标题时预加载提示
	$(function(){
    $('#content h2 a,#contentleft #nextlog a').click(function(e){
    e.preventDefault();
    var htm='努力载入中',
      t=$(this).html(htm).unbind('click'),
      i=9;
    ct();
    window.location=this.href;//opera补丁
    function ct(){
      (i<0)?(
        i=9,
        t.html(htm),
        ct()
      ):(
        t[0].innerHTML+='z',
        i--,
        setTimeout(ct,200)
      );
    }//ct End
  });//Click Event End
});//jQuery End

$("#contentleft h2 a,#randlog li a,#newlog li a,#record li a,#blogsort li a,#record li a,#blogtags span a,#link li a,.right a,.left 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'><div class='relative'><div class='tip'></div><p>"+this.myTitle+"</p></div></div>";
	$('body').append(tooltip);
	$('#tooltip').css({"top":(e.pageY+20)+"px","left":(e.pageX-15)+"px"}).show('fast');
	}).mouseout(function(){this.title = this.myTitle;$('#tooltip').remove();
	}).mousemove(function(e){$('#tooltip').css({"top":(e.pageY+20)+"px","left":(e.pageX-15)+"px"});
});


});
})(jQuery);

