/* 这个是那个跳动控件的原函数 使用方式可以登录 后面的网站查看jRumble v1.3 - http://jackrugile.com/jrumble - MIT License */
$(document).ready(function(){$('.description,.post_t h2 a,.avatar,.yui-nav li').jrumble();$('#commentform .submit').hide()});

(function($){$.fn.jrumble=function(s){var t={rangeX:2,rangeY:2,rangeRot:1,rumbleSpeed:10,rumbleEvent:'hover',posX:'left',posY:'top'};var u=$.extend(t,s);return this.each(function(){$obj=$(this);var f;var g=u.rangeX;var h=u.rangeY;var i=u.rangeRot;g=g*2;h=h*2;i=i*2;var j=u.rumbleSpeed;var k=$obj.css('position');var l=u.posX;var m=u.posY;var n;var o;var p;if(l==='left'){n=parseInt($obj.css('left'),10)}
if(l==='right'){n=parseInt($obj.css('right'),10)}
if(m==='top'){o=parseInt($obj.css('top'),10)}
if(m==='bottom'){o=parseInt($obj.css('bottom'),10)}
function rumbler(a){var b=Math.random();var c=Math.floor(Math.random()*(g+1))-g/2;var d=Math.floor(Math.random()*(h+1))-h/2;var e=Math.floor(Math.random()*(i+1))-i/2;if(a.css('display')==='inline'){p=true;a.css('display','inline-block')}
if(c===0&&g!==0){if(b<.5){c=1}else{c=-1}}
if(d===0&&h!==0){if(b<.5){d=1}else{d=-1}}
if(k==='absolute'){a.css({'position':'absolute','-webkit-transform':'rotate('+e+'deg)','-moz-transform':'rotate('+e+'deg)','-o-transform':'rotate('+e+'deg)','transform':'rotate('+e+'deg)'});a.css(l,n+c+'px');a.css(m,o+d+'px')}
if(k==='fixed'){a.css({'position':'fixed','-webkit-transform':'rotate('+e+'deg)','-moz-transform':'rotate('+e+'deg)','-o-transform':'rotate('+e+'deg)','transform':'rotate('+e+'deg)'});a.css(l,n+c+'px');a.css(m,o+d+'px')}
if(k==='static'||k==='relative'){a.css({'position':'relative','-webkit-transform':'rotate('+e+'deg)','-moz-transform':'rotate('+e+'deg)','-o-transform':'rotate('+e+'deg)','transform':'rotate('+e+'deg)'});a.css(l,c+'px');a.css(m,d+'px')}}
var q={'position':k,'-webkit-transform':'rotate(0deg)','-moz-transform':'rotate(0deg)','-o-transform':'rotate(0deg)','transform':'rotate(0deg)'};if(u.rumbleEvent==='hover'){$obj.hover(function(){var a=$(this);f=setInterval(function(){rumbler(a)},j)},function(){var a=$(this);clearInterval(f);a.css(q);a.css(l,n+'px');a.css(m,o+'px');if(p===true){a.css('display','inline')}})}
if(u.rumbleEvent==='click'){$obj.toggle(function(){var a=$(this);f=setInterval(function(){rumbler(a)},j)},function(){var a=$(this);clearInterval(f);a.css(q);a.css(l,n+'px');a.css(m,o+'px');if(p===true){a.css('display','inline')}})}
if(u.rumbleEvent==='mousedown'){$obj.bind({mousedown:function(){var a=$(this);f=setInterval(function(){rumbler(a)},j)},mouseup:function(){var a=$(this);clearInterval(f);a.css(q);a.css(l,n+'px');a.css(m,o+'px');if(p===true){a.css('display','inline')}},mouseout:function(){var a=$(this);clearInterval(f);a.css(q);a.css(l,n+'px');a.css(m,o+'px');if(p===true){a.css('display','inline')}}})}
if(u.rumbleEvent==='constant'){var r=$(this);f=setInterval(function(){rumbler(r)},j)}})}})(jQuery);
/*跳动的函数结束啦~~~你什么都看不到了~~~哈哈~~*/

(function(a){a.backstretch=function(l,b,j){function m(c){try{h={left:0,top:0},e=f.width(),d=e/k,d>=f.height()?(i=(d-f.height())/2,g.centeredY&&a.extend(h,{top:"-"+i+"px"})):(d=f.height(),e=d*k,i=(e-f.width())/2,g.centeredX&&a.extend(h,{left:"-"+i+"px"})),a("#backstretch, #backstretch img:not(.deleteable)").width(e).height(d).filter("img").css(h)}catch(b){}"function"==typeof c&&c()}var n={centeredX:!0,centeredY:!0,speed:0},c=a("#backstretch"),g=c.data("settings")||n;c.data("settings");var f="onorientationchange"in window?a(document):a(window),k,e,d,i,h;b&&"object"==typeof b&&a.extend(g,b);b&&"function"==typeof b&&(j=b);a(document).ready(function(){if(l){var b;0==c.length?c=a("<div />").attr("id","backstretch").css({left:0,top:0,position:"fixed",overflow:"hidden",zIndex:-999999,margin:0,padding:0,height:"100%",width:"100%"}):c.find("img").addClass("deleteable");b=a("<img />").css({position:"absolute",display:"none",margin:0,padding:0,border:"none",zIndex:-999999}).bind("load",function(b){var d=a(this),e;d.css({width:"auto",height:"auto"});e=this.width||a(b.target).width();b=this.height||a(b.target).height();k=e/b;m(function(){d.fadeIn(g.speed,function(){c.find(".deleteable").remove();"function"==typeof j&&j()})})}).appendTo(c);0==a("body #backstretch").length&&a("body").append(c);c.data("settings",g);b.attr("src",l);a(window).resize(m)}});return this}})(jQuery);

// 评论栏动画
//By:Zdjzxyy
$(function(){$('#comment').focus(function(){var $details=$('#respond .submit');if($details.length>0){if($(this).hasClass('clicked')==false){$details.slideDown('fast')}}$('#respond .submit').show();$('#respond .message .placeholder').hide();$(this).addClass('clicked');return false})});
/*
$(function(){
	$(".box").hover(function(){
		$(this).find('.metinfo').stop(false,true).show('800');
	},function(){
		$(this).find('.metinfo').stop(false,true).hide('800');
	});
});
	*/
//这个是哪个向天上飞的代码
jQuery(document).ready(function($){$("#shangxia").hide();$body=(window.opera)?(document.compatMode=="CSS1Compat"?$('html'):$('body')):$('html,body');$(window).scroll(function(){if($(window).scrollTop()>100){$("#shangxia").fadeIn(1500)}else{$("#shangxia").fadeOut(1500)}});$('#shang').mouseover(function(){up()}).mouseout(function(){clearTimeout(fq)}).click(function(){$body.animate({scrollTop:0},800)})});function up(){$wd=$(window);$wd.scrollTop($wd.scrollTop()-1);fq=setTimeout("up()",10)}
//TAb 栏效果
jQuery(document).ready(function(a){a(".widget_tabcontent h4 span").click(function(){a(this).addClass("selected").siblings().removeClass();a(".widget_tabcontent > ul").slideUp("1500").eq(a(".widget_tabcontent h4 span").index(this)).slideDown("1500")});a(".widget_tabcontent_post h4 span").click(function(){a(this).addClass("selected").siblings().removeClass();a(".widget_tabcontent_post > ul").slideUp("1500").eq(a(".widget_tabcontent_post h4 span").index(this)).slideDown("1500")})});
//这个是哪个订阅的动画，上下移动~~~~
function lahuan_ac(){$(".lahuan_zi").animate({top:"0px"},1e3,function(){$(".lahuan_zi").animate({top:"-190px"},1e3)}),lahuan_ac_k=setTimeout(function(){lahuan_ac()},5e3)}lahuan_ac_k=setTimeout(function(){lahuan_ac()},3e3),$(".lahuan_zi").unbind("click").bind("click",function(){$(".lahuan_zi").hide()});
/*介个是右下角的那个弹框的JS*/
jQuery(document).ready(function($){$("#navbar").hover(function(){$(this).stop().animate({'right':'+=89px'},350)},function(){$(this).stop().animate({'right':'-89px'},650)})});
/*介个是评论点击回复后在评论框里添加链接*/
/* @reply js by zwwooooo */
jQuery(document).ready(function($){$('.reply').click(function(){var atid='"#'+$(this).parent().parent().parent().attr("id")+'"';var atname=$(this).parent().parent().find('.authorx').text();atname=$.trim(atname);$("#comment").attr("value","<a href="+atid+">@"+atname+"</a>").focus()});$('.cancel-comment-reply a').click(function(){$("#comment").attr("value",'')})})

$('a').hover(function() {if (!jQuery(this).is(":animated")) {jQuery(this).animate({opacity: ".7"},220).animate({opacity: "1"},180);}});
/*介个是表单验证的JS*/
$(function(){$("#robo").change(function(){if($.trim($(this).val())==($("#rnum").attr("value"))&&($.trim($(this).val())!=''))$("#robo").removeClass('error').addClass('valid');else $("#robo").addClass('error')});function is_valid_email(email){return/^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/.test(email)}$('#author,#comment').blur(function(){$(this).removeClass('valid');if($(this).val()==''){$(this).addClass('error')}else{$(this).removeClass('error').addClass('valid')}});$('#email').blur(function(){$(this).removeClass('valid');if(!is_valid_email($(this).val())){$(this).addClass('error')}else{$(this).removeClass('error').addClass('valid')}});$('#comment #submit').click(function(){$('#author,#message,#email').blur();if($('#contact input.error').length>0){return false}})});
/*介个是那个首页评论翻滚效果的JS*/
$(function() {
var scrtime;
$("#recentcomments").hover(function(){
clearInterval(scrtime);
},function(){
scrtime = setInterval(function(){
var $ul = $("#recentcomments");//注意这里面的名字必须与前面插件中我们给ul命名的id相同
var liHeight = $ul.find("li:last").height();
$ul.animate({marginTop : liHeight+3+"px"},1000,function(){
$ul.find("li:last").prependTo($ul);
$ul.find("li:first").hide();
$ul.css({marginTop:0});
$ul.find("li:first").fadeIn(1000);
});
},3000);
}).trigger("mouseleave");
});