/* <![CDATA[ */function ajaxSubmitComment(){function c(a){var b;if(!scriptParams.threadcmnts||$(".comment #respond").length==0)b=$("ol.comment-list").append(a);else{var c=$("#respond");b=c.next();b.length==0?(b=$("<ul></ul>"),b.attr("class","children"),c.after(b)):b.attr("id")=="pings"&&(b=$("ol.comment-list"));b.append(a+"</li>")}$(".new-comment").each(function(){$(this).removeClass("new-comment")});var d=b.children("li:last");d.addClass("new-comment").click(function(){$(this).removeClass("new-comment").unbind("click")}); processComments();fadingSlideDown(d,function(){d.ScrollTo(500)})}var a=$("#commentform"),d=$("#respond"),b={};b.author=a.find("#author").val();b.email=a.find("#email").val();b.url=a.find("#url").val();b.comment=a.find("#comment").val();b.comment_post_ID=a.find("#comment_post_ID").val();b.comment_parent=a.find("#comment_parent").val();if(scriptParams.threadcmnts&&(a=d.parent("li.comment").length>0?d.next().children("li:last"):$("ol.comment-list li:last"),a.length>0&&(a.hasClass("even")||a.hasClass("thread-even"))))b.comment_alt= "1";$.ajax({url:scriptParams.tmpldir+"/ajax-comments-post.php",type:"POST",data:b,dataType:"html",beforeSend:function(){$(".fade").stop().fadeOut(500,function(){$(this).remove()});$("#author, #email, #url, #comment, .entry .textbox, #submit").attr("disabled","disabled").animate({opacity:0.5},500);$("#cancel-comment-reply-link").fadeOut(500);$("#submit").after('<span class="processing"></span>')},complete:function(){$("#commentform span.processing").remove()},success:function(b){var a=b.split("<\!-- AJAX Comment Data Separator --\>"); !$("ol.comment-list").length>0?$("#comments").append('<ol class="comment-list"></ol>').find("p.message").animate({opacity:0,height:0,marginBottom:0},500,function(){$(this).remove();c(a[0])}):c(a[0]);scriptParams.threadcmnts&&cancelCommentReply();$("#comment").val("");var d=$(".comment-count"),f=d.text()-0;d.animate({opacity:0},500,function(){d.text(f+1).animate({opacity:1},500,function(){$(this).removeAttr("style")})});var e=$(".comment-link");e.animate({opacity:0},500,function(){var b;b=e.text()== ajaxParams.cmntinfotxt.zero?ajaxParams.cmntinfotxt.one:ajaxParams.cmntinfotxt.more.replace("%",f+1);e.text(b).animate({opacity:1},500,function(){$(this).removeAttr("style")})});showMessage(a[1],function(){$("#author, #email, #url, #comment, .entry .textbox, #submit").removeAttr("disabled").animate({opacity:1},500,function(){$(this).removeAttr("style")})});window.RCJS&&RCJS.page(scriptParams.blogurl,scriptParams.rcparams,0,"Loading")},error:function(b){showError(b.responseText,function(){$("#author, #email, #url, #comment, .entry .textbox, #submit").removeAttr("disabled").animate({opacity:1}, 500,function(){$(this).removeAttr("style")});$("#respond").parent("li").length>0&&$("#cancel-comment-reply-link").fadeIn(500)})}})} function ajaxGetComment(c,a,d){$.ajax({url:scriptParams.blogurl+"?action=cget_ajax&id="+c,type:"get",dataType:"html",beforeSend:function(){a.append('<span class="processing"></span>').css({textAlign:"center",paddingTop:10,paddingBottom:10,backgroundColor:"#222",width:240},200)},complete:function(){a.find(".processing").remove()},success:function(b){var c=$(b);a.fadeOut(200,function(){a.children().remove();a.append(c.children().clone());a.addClass(c.attr("class")).css({textAlign:"",padding:"",backgroundColor:"", width:""}).find(".actions").remove();a.fadeIn(200,function(){d&&typeof d=="function"&&d()})})},error:function(b){a.css("line-height","16px").append('<p class="ajax-comment-error">'+b.responseText+"</p>")}})}function ajaxPaginateComments(c){$.ajax({url:c,type:"get",dataType:"html",beforeSend:commentPaginating,complete:commentPaginateComplete,success:commentPaginateSuccess,error:commentPaginateError})}var commentNavs; function commentPaginating(){$(".fade").stop().fadeOut(500,function(){$(this).remove()});commentNavs=$(".commentnavi a, .commentnavi span").detach();$(".commentnavi").append('<span class="processing"></span>')}function commentPaginateComplete(){} function commentPaginateSuccess(c){var a=c.split("<\!-- AJAX Comment Paginate Data Separator --\>");$(".comment-list, .commentnavi").animate({opacity:0,height:0},500,function(){$(this).empty();$(".comment-list").html(a[0]);$(".commentnavi").html(a[1]);processComments();$(this).each(function(){fadingSlideDown($(this),function(){$("#comments").ScrollTo(500)})})})}function commentPaginateError(){$(".commentnavi span.processing").remove();commentNavs.appendTo(".commentnavi");commentNavs=null} function ajaxPaginatePosts(c){$.ajax({url:c,type:"get",dataType:"html",beforeSend:function(){postnavs=$(".pagenavi").children().detach();$(".pagenavi").append('<span class="processing"></span>')},complete:function(){$(".pagenavi span.processing").remove()},success:function(a){contentSection=$("#content");loadContent(a,contentSection,!0)},error:function(){postnavs.appendTo($("pagenavi"));postnavs=null}})} function ajaxPaginateSingular(c){$.ajax({url:c,type:"get",dataType:"html",beforeSend:function(){var a=$(".post-pages");postnavs=a.html();a.text("").children().remove();a.append('<span class="processing"></span>')},complete:function(){$(".post-pages span.processing").remove()},success:function(a){contentSection=$("body.single .entry, body.page .entry");loadContent(a,contentSection,!1)},error:function(){$("post-pages").html(postnavs);postnavs=null}})} function ajaxSearch(c){$.ajax({url:c,type:"get",dataType:"html",beforeSend:function(){$("#search-form").append('<span class="processing"></span>')},complete:function(){$("#search-form span.processing").remove()},success:function(a){contentSection=$("#content");searched&&loadContent(a,contentSection,!0)},error:function(){$("#search-form span.processing").remove();loadContent(contentCache,$("#content"),!0);searched=!1}})} function loadContent(c,a,d,b){a.animate({opacity:0,height:0},500,function(){$("#header").ScrollTo(500);a.empty();a.html(c);d&&$("#paginator").length>0&&fixPaginator(c);processContent();fadingSlideDown(a,b)})}function fixPaginator(c){$.browser.msie&&(c=c.match(/id="paginator">[\s\S]+<script[^>]+>([\s\S]+?)<\/script>/i),c!=null&&eval(c[1].match(/(pag = new.+\);)/i)[1]))}var contentCache,searched=!1; $(document).ready(function(){ajaxParams.cmntpost&&$("#commentform").submit(function(){ajaxSubmitComment();return!1});ajaxParams.cmntpagenav&&$(".commentnavi a").live("click",function(){var b=$(this).attr("href").split(/(\?|&)action=cpage_ajax.*$/)[0],a=1;/comment-page-/i.test(b)?a=b.split(/comment-page-/i)[1].split(/(\/|#|&).*$/)[0]:/cpage=/i.test(b)&&(a=b.split(/cpage=/i)[1].split(/(\/|#|&).*$/)[0]);var c=$("#cp_post_id").text(),d=b.split(/#.*$/)[0];d+=/\?/i.test(b)?"&":"?";d+="action=cpage_ajax&post="+ c+"&page="+a;ajaxPaginateComments(d);return!1});ajaxParams.postcntntpagnav&&$("body.single .post-pages a, body.page .post-pages a").live("click",function(){if(searched)return!0;var b=$(this).attr("href").split(/(\?|&)action=spage_ajax.*$/)[0],a=1;if(/page=/i.test(b))a=b.split(/page=/i)[1].split(/(\/|#|&).*$/)[0];else if(/\/[\d+]\/?$/.test(b)){var c=b.match(/\/([\d+])\/?$/);c!=null&&(a=c[1])}c=b.split(/#.*$/)[0];c+=/\?/i.test(b)?"&":"?";c+="action=spage_ajax";/page=/i.test(c)||(c+="&page="+a);ajaxPaginateSingular(c); return!1});ajaxParams.postpagenav&&$("body.home .pagenavi a, body.archive .pagenavi a, body.search .pagenavi a, #content.search .pagenavi a").live("click",function(){var b=$(this).attr("href");/action=/i.test(b)?b=b.replace(/action=[^#&]+/ig,"action=ppage_ajax"):(b+=/\?/i.test(b)?"&":"?",b+="action=ppage_ajax");ajaxPaginatePosts(b);return!1});if(ajaxParams.search){var c=$("#fixed-nav .cmnts"),a,d;$("#search-form").submit(function(){a&&clearTimeout(a);var b=$(this).find("#s").val();b=$(this).attr("action")+ "?s="+encodeURIComponent(b)+"&action=search_ajax";ajaxSearch(b);$("#content").addClass("search");c.detach();$(".top-menu").find(".current_page_item, .current-cat, .current_menu_item, .current-menu-item, .current_page_ancestor, .current-cat-parent, .current-menu-ancestor").each(function(){$(this).attr("class",$(this).attr("class").replace(/current/g,"kurrent"))});return!1});$("#s").bind("keyup",function(){a&&clearTimeout(a);a=setTimeout(function(){var b=$("#s"),a=b.val();if(a.length==0)searched&&(loadContent(contentCache, $("#content"),!0,function(){b.focus();$(".top-menu").find(".kurrent_page_item, .kurrent-cat, .kurrent_menu_item, .kurrent-menu-item, .kurrent_page_ancestor, .kurrent-cat-parent, .kurrent-menu-ancestor").each(function(){$(this).attr("class",$(this).attr("class").replace(/kurrent/g,"current"))});c.insertAfter($("#fixed-nav .top"));$("#content").removeClass("search")}),$("#search-form span.processing").remove(),searched=!1),d=a;else if(a!=d){if(!searched)contentCache=$("#content")[0].innerHTML,searched= !0;d=a;$("#search-form").submit()}},800)})}});/* ]]> */
