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