/* <![CDATA[ */if(!window.ajaxParams)var ajaxParams=false;function extractParams(){var a=document.getElementsByTagName("script"),a=a[a.length-1].src.replace(/^[^\?]+\??/,"");return parseQuery(a)}function parseQuery(a){var c={};if(!a)return c;for(var a=a.split("&"),b=0;b<a.length;b++){var d=a[b].split("=");if(d&&d.length==2){var f=unescape(d[0]),d=unescape(d[1]),d=decodeURIComponent(d);c[f]=d}}return c} function textAreaFixCursorPosition(){var a;if(a=document.getElementById("comment"))if(document.selection){var c=a.createTextRange();c.text=a.value;c.collapse(false)}else if(typeof a.selectionStart=="number"&&typeof a.selectionEnd=="number")a.selectionStart=a.selectionEnd=a.value.length} function showMessage(a,c){$("#commentform .fade").remove();$("#submit").after('<span class="fade ajax-comment-msg">'+a+"</span>");$("#commentform .fade").delay(2E3).fadeOut(500,function(){$(this).remove();c&&typeof c=="function"&&c()})}function showError(a,c){$("#commentform .fade").remove();$("#submit").after('<span class="fade ajax-comment-error">'+a+"</span>");$("#commentform .fade").delay(2E3).fadeOut(500,function(){$(this).remove();c&&typeof c=="function"&&c()})} function reply(a,c,b){$("#comment_edit_ID").val()!=0&&!scriptParams.threadcmnts&&cancelCommentEdit();b=$("#"+b);if(b.length==0)return false;scriptParams.atreply&&(a='<a href="#'+c+'">@'+a.replace(/\t|\n/g,"")+" </a> \n",scriptParams.threadcmnts&&b.val(""),b.val().indexOf(a)==-1&&(b.val().replace(/\s|\t|\n/g,"")==""?b.val(a):b.val(b.val().replace(/[\n]*$/g,"")+"\n\n"+a)),textAreaFixCursorPosition());scriptParams.threadcmnts||($("#respond").ScrollTo(500),b.focus())} function editComment(a){var c=$("#comment"),b=$("#comment_edit_ID"),d=a.attr("id").split("comment-")[1];if(b.val()==d)c.focus();else if(b.val()!=0)$("#comment-"+b.val()).fadeTo(200,1),a.fadeTo(200,0.2),b.val(d),c.val(a.children().children(".comment-text").text());else{b.val(d);c.val(a.children().children(".comment-text").text());var f=$("#respond"),b=$("#cancel-comment-reply-link");if(!ajaxParams||!ajaxParams.cmntpost)$('<input type="hidden" name="action" id="action" value="comment_edit" />').insertAfter($("#comment_edit_ID")), d=$("#commentform"),defaultAction=d.attr("action"),d.attr("action",scriptParams.tmpldir+"/comment-edit-post.php").data("action",defaultAction);b.fadeIn(200,function(){$(this).removeAttr("style")});a.fadeTo(200,0.2);textAreaFixCursorPosition();f.find("#reply-title").animate({opacity:0},200,function(){shiftText();$(this).animate({opacity:1},200,function(){$(this).removeAttr("style")});f.ScrollTo(500);c.focus()})}} function cancelCommentEdit(){var a=$("#comment"),c=$("#respond"),b=$("#cancel-comment-reply-link"),d=$("#comment-"+$("#comment_edit_ID").val());$("#comment_edit_ID").val(0);a.val("");if(!ajaxParams||!ajaxParams.cmntpost)$("#action").remove(),a=$("#commentform"),a.attr("action",a.data("action"));b.fadeOut(200).unbind("click");d.fadeTo(200,1,function(){$(this).removeAttr("style")});c.find("#reply-title").animate({opacity:0},200,function(){shiftText();$(this).animate({opacity:1},200,function(){$(this).removeAttr("style")})}); return false}function shiftText(){var a=$("#reply-title"),c=$("#cancel-comment-reply-link"),b=$("#edit-or-reply-title"),d=$("#edit-or-reply-cancel"),f=a.children("small");f.detach();title=a.html();cancel=c.html();a.html(b.html());c.html(d.html());b.html(title);d.html(cancel);f.appendTo(a)}var imageCache=[];function loadImage(){for(var a=arguments.length;a--;){var c=document.createElement("img");c.src=arguments[a];imageCache.push(c)}}var contentWidth=580; function processContent(){$(".entry img").load(function(){var a=$(this).width(),b=$(this).height(),b=a/b,d=contentWidth,f=$(this).parents(".wp-caption");f.length>0?(f.width(a+14),f.width()>contentWidth&&(d=contentWidth-14,resizeToFit($(this),d,b),f.width(contentWidth))):a>contentWidth&&resizeToFit($(this),contentWidth,b)});if(scriptParams.hidesmallimgbdr){var a=function(a){var b=a.width(),d=a.height();scriptParams.smallimgwidth>0&&scriptParams.smallimgheight>0?scriptParams.smallimglogic=="and"?b<= scriptParams.smallimgwidth&&d<=scriptParams.smallimgheight>0&&a.addClass("no-border"):(b<=scriptParams.smallimgwidth||d<=scriptParams.smallimgheight>0)&&a.addClass("no-border"):scriptParams.smallimgwidth>0?b<scriptParams.smallimgwidth&&a.addClass("no-border"):scriptParams.smallimgheight>0?d<scriptParams.smallimgheight&&a.addClass("no-border"):a.addClass("no-border")};$(".entry img").load(function(){var c=$(this);a(c)});$(".entry embed, .entry object, .entry iframe").each(function(){var c=$(this); a(c)});$("img.no-border").load(function(){var a=$(this).parents(".wp-caption");a.width(a.width()-4)})}$(".entry img").each(function(){(this.complete||$.browser.msie&&parseInt($.browser.version)==6)&&$(this).trigger("load")});$(".entry object").each(function(){var a,b,d=$(this).find("embed");d.length>0&&(a=d.width(),b=d.height());if(!a||!b)a=$(this).width(),b=$(this).height();var f=a/b;a>contentWidth?(resizeToFit($(this),contentWidth,f),d.length>0&&resizeToFit(d,contentWidth,f)):$.browser.msie&&$.browser.version== 8&&$(this).width(a).height(b)});$.browser.msie&&$.browser.version<=7&&($(".entry table").not(".wp_syntax table").each(function(){$(this).find("tr:not(thead tr, tfoot tr):odd").addClass("even")}),$("#comment").focus(function(){$(this).val($(this).val())}))}var commentWidth=[378,516,490,456,422,388]; function processComments(){$(".comment-body img").load(function(){var a=$(this).width(),c=$(this).height(),c=a/c,b=$(this).parents(".comment-body").parent().attr("class").match(/depth-(\d)/),b=b?b[1]:1;a>commentWidth[b]&&resizeToFit($(this),commentWidth[b],c)});scriptParams.hidesmallimgbdr&&($(".comment-body img").load(function(){var a=$(this),c=a.width(),b=a.height();scriptParams.smallimgwidth>0&&scriptParams.smallimgheight>0?scriptParams.smallimglogic=="and"?c<=scriptParams.smallimgwidth&&b<=scriptParams.smallimgheight> 0&&a.addClass("no-border"):(c<=scriptParams.smallimgwidth||b<=scriptParams.smallimgheight>0)&&a.addClass("no-border"):scriptParams.smallimgwidth>0?c<scriptParams.smallimgwidth&&a.addClass("no-border"):scriptParams.smallimgheight>0?b<scriptParams.smallimgheight&&a.addClass("no-border"):a.addClass("no-border")}),$("img.no-border").load(function(){var a=$(this).parents(".wp-caption");a.width(a.width()-4)}));$(".comment-body img").each(function(){(this.complete||$.browser.msie&&parseInt($.browser.version)== 6)&&$(this).trigger("load")})}function processTooltip(a){a.find(".comment-body img").each(function(){var a=$(this).width(),b=$(this).height();a>commentWidth[0]&&resizeToFit($(this),commentWidth[0],a/b)})}function resizeToFit(a,c,b){a.width(c).height(c/b)}var commentCache=[]; $(document).ready(function(){var a=$(".top-menu-window"),c=a.children("ul"),b=0,d=[];d.unshift(0);c.children("li").each(function(){b+=$(this).width();d.push(b)});if(d[d.length-1]>a.width()){c.width(b);var f=$('<div class="scroller scroller-left" style="display:none;"></div>'),r=$('<div class="scroller scroller-right"></div>');f.insertBefore(a);r.insertAfter(a);var s=$(".scroller-left").width()-10,g=a.width()-s,i=s,q,m=c.children(".current-cat, .current_page_item, .current_page_ancestor, .current_menu_item, .current-menu-item, .current-menu-ancestor"), j=function(a,y){f.fadeIn(100);a||(a=200);var n=g-i,e;if(n<b){for(var h=0;h<d.length;h++)if(d[h]>n){e=d[h];break}i=g-e;c.animate({"margin-left":i},a,y);g-i>=b&&r.fadeOut(100)}},t=function(a,b){r.fadeIn(100);a||(a=200);var n=0-i,e;if(n>0){for(var h=0;h<d.length+1;h++)if(d[h]>=n){e=d[h-1];break}i=s-e;c.animate({"margin-left":i},a,b);0-i<=0&&f.fadeOut(100)}},k=false,w=function(){k||j(100,w)},x=function(){k||t(100,x)};if(b>g&&($(".scroller-right").mousedown(function(){k=false;j();q=setTimeout(function(){w()}, 500)}).bind("mouseup mouseout",function(){k=true;clearTimeout(q)}),$(".scroller-left").mousedown(function(){k=false;t();q=setTimeout(function(){x()},500)}).bind("mouseup mouseout",function(){k=true;clearTimeout(q)}),c.children("li").children("a").mouseover(function(){var a=$(this).parent();a.position().left<0?t():a.position().left+a.width()>g&&j()}),m.length>0)){var u=function(){m.position().left>g?j(20,u):m.width()>g?j(20):m.position().left+m.width()>g&&j(20,u)};u()}}else c.width(d[d.length-1]).animate({"margin-left":a.width()- d[d.length-1]-5},500);c.children("li").mouseenter(function(){a.stop().height($(document).height()-a.offset().top-45);var b=$(this).position().left+152>g||$(this).offset().left+200>a.offset().left+a.width();$(this).children("ul:not(:animated)").removeAttr("style").animate(b?{opacity:"show",height:"show",right:"0"}:{opacity:"show",height:"show",left:"0"},100);$(this).children("a").addClass("hover")}).mouseleave(function(){$(this).children("ul").animate({opacity:"hide",height:"hide"},100);a.animate({height:45}, 100);$(this).children("a").removeClass("hover")});loadImage(scriptParams.tmpldir+"/images/loading.gif");$("body").delegate("a[href*=#]:not(.comment-reply-link, #cancel-comment-reply-link, .comment-edit-link, .commentnavi a)","click",function(){if($(this).is("li:not(.tooltip)>.comment-body a[href^=#comment-]")){var a,b,c;if((a=$(this).attr("href").match(/#comment-(\d+)/))!=null)b=a[1];c=$(".commentnavi .page-numbers.current").text();if((a=$.parseJSON($("#comment-page-number").val()))&&c!=a[b]){c=document.URL.split(/#.*$/)[0].split(/\/comment-page-[\d]+\//)[0]; var d=$("#cp_post_id").text();c+=/\?/i.test(c)?"&":"?";ajaxParams&&ajaxParams.cmntpagenav?(c+="action=cpage_ajax&post="+d+"&page="+a[b],ajaxPaginateComments(c,function(){$("#comment-"+b).ScrollTo(500)})):(c+="cpage="+a[b],window.location.href=c+"#comment-"+b)}else $("#comment-"+b).ScrollTo(300)}return location.pathname.replace(/^\//,"")==this.pathname.replace(/^\//,"")&&location.hostname==this.hostname&&location.search==this.search?(a=$(this).attr("href"),a=a.substring(a.indexOf("#")),a!="#"&&$('[name="'+ a.substring(1)+'"], '+a).ScrollTo(300),false):true});if(window.XMLHttpRequest){var o=$("#fixed-nav");o.fadeTo(0,0.25);var z=$("#page");$("body").mousemove(function(a){a.pageX>o.offset().left+o.width()&&a.pageX>z.offset().left?o.stop().fadeTo(100,0.25):o.stop().fadeTo(100,1)})}processContent();$("#content").delegate(".wp_syntax_wrapper","hover",function(a){a.type=="mouseenter"?$(this).children(".wp_syntax_lang").stop().fadeTo(200,0.2):$(this).children(".wp_syntax_lang").stop().fadeTo(200,1,function(){$(this).removeAttr("style")})}); processComments();$("#reaction").delegate(".comment","mouseenter",function(a){$(this).addClass("hover").parents(".comment").removeClass("hover");a.stopPropagation()}).delegate(".comment","mouseleave",function(){$(this).removeClass("hover").parent().closest(".comment").addClass("hover")});$("#toggle-info").click(function(){var a=$("#comment-author-info");a.css("display")=="none"&&a.slideDown(500);$("#commentform .comment-notes").animate({opacity:"hide",height:"hide",marginBottom:"hide"},500,function(){$(this).remove()}); return false});if($("#comment").length>0){var e=$("#comment").get(0);$(".smiley-select").click(function(){var a=$(this).attr("alt");if(document.selection)e.focus(),sel=document.selection.createRange(),sel.text=a,e.focus();else if(e.selectionStart||e.selectionStart=="0"){var b=e.selectionEnd,c=b;e.value=e.value.substring(0,e.selectionStart)+a+e.value.substring(b,e.value.length);c+=a.length;e.focus();e.selectionStart=c;e.selectionEnd=c}else e.value+=a,e.focus()})}$(".comment-reply-link").live("click", function(){var a=$(this).parent().parent().parent();reply(a.children().children("span.author").text(),a.attr("id"),"comment");return false});scriptParams.commentquickedit&&!scriptParams.threadcmnts&&$(".comment-edit-link").live("click",function(){var a=$(this).parent().parent().parent();editComment(a,"comment");return false});var v=$("#cancel-comment-reply-link");v.length>0&&(scriptParams.threadcmnts?v.click(cancelCommentReplyOrEdit):scriptParams.commentquickedit&&v.click(cancelCommentEdit));$("#comments").delegate("li:not(.tooltip)>.comment-body a[href^=#comment-]", "mouseenter",function(){var a,b,c;if((b=$(this).attr("href").match(/#comment-(\d+)/))!=null){a=b[1];if(commentCache[a])c=commentCache[a],b=$(this).parents(".comment-list"),c.appendTo(b).stop().fadeTo(200,1);else if(c=$(".tooltip"),c.length>0?c.stop().children().remove():c=$('<li class="tooltip"></li>'),b=$("#comment-"+a),b.length>0)c.append(b.children().clone()),c.addClass(b.attr("class")).find(".actions").remove(),c.children("ul").remove(),c.appendTo(b.parent()).stop().fadeTo(200,1),commentCache[a]= c;else{if(!ajaxGetComment)return;c.appendTo($(this).parents(".comment-list")).stop().fadeTo(200,1);ajaxGetComment(a,c,function(){commentCache[a]=c})}var d=$(this).offset(),e=$("#page").offset();b=d.left-e.left;d=d.top-e.top+$(this).height();c.css({left:b+30,top:d+10});processTooltip(c)}}).delegate("li:not(.tooltip)>.comment-body a[href^=#comment-]","mouseleave",function(){$(".tooltip").stop().fadeTo(200,0,function(){$(this).detach()})});$("#comment").autoResize({extraSpace:0});scriptParams.quicksubmit&& $("#comment").keydown(function(a){a=window.event||a;a!=null&&a.ctrlKey&&a.keyCode==13&&$("#submit").click()});var p=$("#s"),l=$("#s-msg");p.val()!=""&&l.fadeTo(0,0);p.focus(function(){p.val()==""?l.stop().fadeTo(200,0.25):l.stop().fadeTo(200,0,function(){$(this).hide()})}).blur(function(){p.val()==""&&l.stop().fadeTo(200,1,function(){$(this).removeAttr("style")})}).keyup(function(){p.val()==""?l.stop().fadeTo(200,0.25):l.stop().fadeTo(200,0,function(){$(this).hide()})})});/* ]]> */
