function extractParams(){var a=document.getElementsByTagName("script");a=a[a.length-1].src.replace(/^[^\?]+\??/,"");return parseQuery(a)}function parseQuery(a){var b={};if(!a)return b;a=a.split("&");for(var d=0;d<a.length;d++){var e=a[d].split("=");if(!(!e||e.length!=2)){var c=unescape(e[0]);e=unescape(e[1]);e=decodeURIComponent(e);b[c]=e}}return b} function textAreaFixCursorPosition(){var a;if(a=document.getElementById("comment"))if(document.selection){var b=a.createTextRange();b.text=a.value;b.collapse(false)}else if(typeof a.selectionStart=="number"&&typeof a.selectionEnd=="number")a.selectionStart=a.selectionEnd=a.value.length}function reply(a,b,d){a='<a href="#'+b+'">@'+a.replace(/\t|\n/g,"")+" </a> \n";appendReply(a,d)} function appendReply(a,b){var d;if(document.getElementById(b)&&document.getElementById(b).type=="textarea")d=document.getElementById(b);else{showError("Cannot find the comment text box!");return false}if(d.value.indexOf(a)>-1){showMessage("You've already replied this comment!");jQuery("#comment").ScrollTo(500);d.focus();return false}d.value=d.value.replace(/\s|\t|\n/g,"")==""?a:d.value.replace(/[\n]*$/g,"")+"\n\n"+a;jQuery("#respond").ScrollTo(500);d.focus()}var imageCache=[]; function loadImage(){for(var a=arguments.length;a--;){var b=document.createElement("img");b.src=arguments[a];imageCache.push(b)}}function fadingSlideDown(a,b){var d=a.css({height:"auto",position:"absolute",visibility:"hidden"}).height();a.css({opacity:0,height:0,position:"static",visibility:"visible"});a.animate({opacity:1,height:d},500,function(){a.removeAttr("style");b&&typeof b=="function"&&b()})}var contentWidth=596,commentWidth=520; function processContent(){jQuery(".entry img").each(function(){var a=jQuery(this).width(),b=jQuery(this).height();b=a/b;a>contentWidth&&jQuery(this).width(contentWidth).height(contentWidth/b)});jQuery(".comment-body img").each(function(){var a=jQuery(this).width(),b=jQuery(this).height();b=a/b;a>commentWidth&&jQuery(this).width(commentWidth).height(commentWidth/b)});jQuery(".entry .wp-caption").removeAttr("style");jQuery("object").each(function(){var a=jQuery(this).find("embed"),b=a.width(),d=a.height(); d=b/d;if(b>contentWidth){jQuery(this).width(contentWidth).height(contentWidth/d);a.width(contentWidth).height(contentWidth/d)}});jQuery.browser.msie&&jQuery.browser.version<=7&&jQuery(".entry table").not(".wp_syntax table").each(function(){jQuery(this).find("tr:not(thead tr, tfoot tr):odd").addClass("even")})}var commentCache=[]; jQuery(document).ready(function(){loadImage(scriptParams.tmpldir+"/images/loading.gif");jQuery("a[href*=#]:not(.reply-button)").live("click",function(){if(location.pathname.replace(/^\//,"")==this.pathname.replace(/^\//,"")&&location.hostname==this.hostname&&location.search==this.search){var c=jQuery(this).attr("href");c=c.substring(c.indexOf("#"));c!="#"&&jQuery(c).ScrollTo(300);return false}return true});if(window.XMLHttpRequest){var a=jQuery("#fixed-nav");a.fadeTo(0,0.25);var b=jQuery("#page"); jQuery("body").mousemove(function(c){c.pageX>a.offset().left+a.width()&&c.pageX>b.offset().left?a.stop().fadeTo(100,0.25):a.stop().fadeTo(100,1)})}processContent();jQuery(".comment").live("mouseenter",function(){jQuery(this).addClass("hover").parents(".comment").removeClass("hover")}).live("mouseleave",function(){jQuery(this).removeClass("hover")});jQuery("#toggle-info").click(function(){var c=jQuery("#comment-author-info");c.css("display")=="none"&&c.slideDown(500);jQuery("#comment-form .message").animate({opacity:"0", height:"0",marginBottom:"0"},500,function(){jQuery(this).remove()});return false});jQuery(".allowed-tags").hide();jQuery("#comment").focus(function(){jQuery(".allowed-tags").slideDown(500)}).focus(textAreaFixCursorPosition);jQuery(".reply-button").live("click",function(){var c=jQuery(this).parents("li.comment");reply(c.find("span.author").text(),c.attr("id"),"comment");return false});jQuery("li:not(.tooltip)>.comment-body a[href^=#comment-]").live("mouseover",function(){var c,g,f;if((g=jQuery(this).attr("href").match(/#comment-(\d+)/))!= null){c=g[1];if(commentCache[c]){f=commentCache[c];g=jQuery(this).parents(".comment-list");f.appendTo(g).stop().fadeTo(200,1)}else{f=jQuery(".tooltip");if(f.length>0)f.stop().children().remove();else f=jQuery('<li class="tooltip"></li>');g=jQuery("#comment-"+c);if(g.length>0){f.append(g.children().clone());f.addClass(g.attr("class")).find(".actions").remove();f.appendTo(g.parent()).stop().fadeTo(200,1);commentCache[c]=f}else{if(ajaxGetComment==null)return;f.appendTo(jQuery(this).parents(".comment-list")).stop().fadeTo(200, 1);ajaxGetComment(c,f,function(){commentCache[c]=f})}}var h=jQuery(this).offset(),i=jQuery("#page").offset();g=h.left-i.left;h=h.top-i.top+jQuery(this).height();f.css({left:g+30,top:h+10})}}).live("mouseout",function(){jQuery(".tooltip").stop().fadeTo(200,0,function(){jQuery(this).detach()})});jQuery("#comment.quick-submit").keydown(function(c){c=window.event?window.event:c;c!=null&&c.ctrlKey&&c.keyCode==13&&jQuery("#comment-form").submit()});var d=jQuery("#s"),e=jQuery("#s-msg");d.val()!=""&&e.fadeTo(0, 0);d.focus(function(){d.val()==""?e.stop().fadeTo(200,0.25):e.stop().fadeTo(200,0,function(){jQuery(this).hide()})}).blur(function(){d.val()==""&&e.stop().fadeTo(200,1)}).keyup(function(){d.val()==""?e.stop().fadeTo(200,0.25):e.stop().fadeTo(200,0,function(){jQuery(this).hide()})})});