/**
* Author: yinheli
* E_mail: yinheli@gmail.com
* Website: http://philna.com
* Date: 2009-8-21
* Compressed by YUI Compressor 2.4.2
*/
jQuery(function(a){a.easing.elasout=function(f,h,e,l,k){var i=1.70158;var j=0;var g=l;if(h==0){return e}if((h/=k)==1){return e+l}if(!j){j=k*0.3}if(g<Math.abs(l)){g=l;var i=j/4}else{var i=j/(2*Math.PI)*Math.asin(l/g)}return g*Math.pow(2,-10*h)*Math.sin((h*k-i)*(2*Math.PI)/j)+l+e}});$().ready(function(){$("a.closemsg").click(function(){$(this).parent("div").remove()});$("#top").click(function(){$.scrollTo("#header",420);return false});$("#skip").click(function(){$.scrollTo("#commentstate",830,{easing:"elasout"});return false});$("#addcomment").click(function(){$.scrollTo("#respond",300,{onAfter:function(){$("#comment").focus()}});return false});var a=$("#philna_say");a.click(function(){var x='<span id="sayload"> </span>';var u=r(window.location.href);u+="?action=philna_say";var v=function(){a.hide("slow");setTimeout(function(){a.html(x).show("fast")},500)};var t=function(){a.html("Whoops! Something went wrong.Sorry. Plsease try again!")};var w=function(y){setTimeout(function(){a.hide();a.html(y).slideDown()},1000)};k("GET",u,null,v,t,w)});var b=$("#get-trackback-url");$("#addtrackback").toggle(function(){b.slideDown("fast");return false},function(){b.slideUp("fast");return false});var n=$("#commenter_info");var s=$("#commenter_avatar");var j=$("#toggle-author_info a");j.toggle(function(){j.html("Close &raquo;");n.slideDown("fast");s.slideUp("fast")},function(){j.html("Change &raquo;");s.slideDown("fast");n.slideUp("fast")});$("#toggletrackbacks").toggle(function(){$("#tpbacklists").slideDown()},function(){$("#tpbacklists").slideUp()});function e(u,t){if(typeof u!="object"){u=$(u)}u.css({opacity:t,MozOpacity:t,KhtmlOpacity:t,filter:"alpha(opacity="+t*100+")"})}function r(t){t=t.replace(/(\?|#).*/,"");return t}function d(){var v=$("#commentslist .action .reply");var t=$("#commentslist .action .quote");var u=$("#comment");var x=function(y){if(!u){alert("The comment box does not exist!");return false}var z=u.val();if(z.indexOf(y)>-1){alert("You've already appended this reply!");return false}if(z.replace(/\s|\t|\n/g,"")==""){u.val(y)}else{u.val(z.replace(/[\n]*$/g,"")+"\n\n"+y)}$.scrollTo("#comment",600,{onAfter:function(){u.focus()}})};var w=function(y){return y.attr("href").replace(/.*#comment-/,"")};v.click(function(){var A=w($(this));var z=$("#commenter-"+A).text();var y='<a href="#comment-'+A+'">@'+z+" </a>\n";x(y);return false});t.click(function(){var A=w($(this));var z=$("#commenter-"+A).text();var y='<blockquote cite="#commentbody-'+A+'">';y+='\n<strong><a href="#comment-'+A+'">'+z+"</a> :</strong>";y+=$("#commentbody-"+A).html();y+="</blockquote>\n";y=y.replace(/\t/g,"");x(y);return false})}function q(){var t=$("#commentslist .action .edit");t.click(function(){var y=$(this).attr("href").replace(/#comment-/g,"");var v=r(window.location.href);v+="?action=get_comment_content&id="+y;var w=function(){e("#comment-"+y,0.7)};var u=function(z){alert(z.responseText);e("#comment-"+y,1)};var x=function(z){$("#comment").val(z);$("#toggle-author_info a").click();$("#comment-"+y).slideUp(500,function(){$(this).remove()});$("#submit").val("Update comment").after('<input type="hidden" value="'+y+'" name="update_comment_ID"/>');$.scrollTo("#respond",600)};k("GET",v,null,w,u,x);return false})}function c(){var t=$("#commentslist a");t.each(function(){if($(this).attr("href").match(/^#comment-/)&&$(this).text().match(/^@/)){$(this).addClass("atreply")}});$("#commentslist p a.atreply").hover(function(){var u=document.getElementById($(this).attr("href").replace(/#/,""));if(u==null){u=$(this).attr("href").replace(/#comment-/,"");var v=r(window.location.href);v+="?action=get_comment_tip&id="+u;var w=function(){var y='<li style="padding:20px;" class="box boxbr comment tip"><span class="loading">Loading</span></li>';$("#commentslist").append(y)};var x=function(y){var z=$(".tip").offset();$(".tip").replaceWith(y);$(".tip").css({top:z.top,left:z.left}).fadeTo(0,0.85)};k("GET",v,null,w,null,x)}else{$($(this).attr("href")).clone().insertAfter($(this).parents("li")).attr("id","").addClass("tip").fadeTo(0,0.85).css("display","block")}},function(){$(".tip").fadeOut(200,function(){if($(this).hasClass("ajaxtip")){$(this).removeClass("ajaxtip tip")}else{$(this).remove()}})});$("#commentslist p a.atreply").mousemove(function(u){$(".tip").css({left:(u.clientX+18),top:(u.pageY+18)})});$("#commentslist p a.atreply").click(function(){$.scrollTo($(this).attr("href"),300);return false})}function k(w,u,x,v,t,y){if(t==null){var t=function(z){alert(z.responseText)}}$.ajax({url:u,type:w,data:x,dataType:"html",beforeSend:v,error:t,success:y})}var f='<span class="loading">Loading</span>';var h=$("#cpager a");var m=$("#cpager");function i(){$("#cpager a").click(function(){var w=$(this).attr("href").split(/(\?|&)action=cpage_ajax.*$/)[0];var x=1;if(/comment-page-/i.test(w)){x=w.split(/comment-page-/i)[1].split(/(\/|#|&).*$/)[0]}else{if(/cpage=/i.test(w)){x=w.split(/cpage=/)[1].split(/(\/|#|&).*$/)[0]}}var u=$("#cp_post_id").text();var t=w.split(/#.*$/)[0];t+=/\?/i.test(w)?"&":"?";t+="action=cpage_ajax&post="+u+"&page="+x;var v=m.html();var y="GET";var A=function(){document.body.style.cursor="wait";e("#commentslist,#commentnavi",0.6);m.html(f)};var z=function(C){if(C.responseText){alert(C.responseText)}else{alert("Whoops! Plsease try again!")}m.html(v);e("#commentslist,#commentnavi",1);document.body.style.cursor="auto";i()};var B=function(D){var C=D.split("<!--PHILNA-AJAX-COMMENT-PAGE-->");$("#commentslist").html(C[0]);m.html(C[1]);e("#commentslist,#commentnavi",1);document.body.style.cursor="auto";$.scrollTo("#commentstate",700);o()};k(y,t,"",A,z,B);return false})}function g(){var v=$("#navigation");var t=$("#navigation a");var u=v.html();t.click(function(){var x=$(this).attr("href");var z="action=ajax_page";var y=function(){document.body.style.cursor="wait";e("#content",0.6);$("#navigation .next").html(f)};var w=function(B){if(B.responseText){alert(B.responseText)}else{alert("Whoops! Something went wrong.Sorry. Plsease try again!")}document.body.style.cursor="auto";v.html(u);g();e("#content",1)};var A=function(B){$("#content").html(B);e("#content",1);document.body.style.cursor="auto";$.scrollTo("#header",800);g()};k("POST",x,z,y,w,A);return false})}g();$("#comment").keydown(function(t){if((t.ctrlKey||t.altKey)&&(t.keyCode==13||t.keyCode==83)){p();return false}});$(document).keydown(function(t){if(t.ctrlKey&&t.keyCode==36){$.scrollTo("#header",800);return false}if(t.ctrlKey&&t.keyCode==35){$.scrollTo("#footer",800);return false}});function p(){var v=r(window.location.href);var x=$("#commentform").serialize()+"&action=ajax_comment";var t=$("#comment_msg");var w=function(){t.slideDown("fast");e("#respond",0.7);$("#submit").attr("disabled",true)};var u=function(z){alert(z.responseText);t.slideUp("fast");$("#submit").attr("disabled",false);e("#respond",1)};var y=function(A){e("#respond",1);$("textarea").val("");$("#submit").val("Submit Comment");$("#commentslist").append(A);t.slideUp();var z=$("#commentslist li:last").hide();z.slideDown();$("#allcmnub").text($("#commentslist li:last .msg_info .n").text().replace(/#/g,""));$("#welcome-words").html("Thanks for your comment");q();setTimeout(function(){$("#submit").attr("disabled",false)},3000)};k("POST",v,x,w,u,y)}$("#commentform").submit(function(){p();return false});function o(){i();c();q();d()}o();function l(u,v,t){var w=new Date();w.setDate(w.getDate()+t);document.cookie=u+"="+escape(v)+((t==null)?"":";expires="+w.toGMTString())}$(".closead").click(function(){if(!confirm("Dose this ad disturb you? click yes to close the AD \n\n 这个广告打扰您了? 点击确定关闭广告.")){return}$(this).parent("div").slideUp();l("philna_page_ad","no",7);setTimeout(function(){alert("This advertisement will no longer display in 7 days! \n \n 这个广告在7天内不会再显示.感谢你的支持")},1000)})});