/*<![CDATA[*/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 c=0;c<a.length;c++){var e=a[c].split("=");if(!(!e||e.length!=2)){var o=unescape(e[0]);e=unescape(e[1]);e=decodeURIComponent(e);b[o]=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,c){a='<a href="#'+b+'">@'+a.replace(/\t|\n/g,"")+" </a> \n";appendReply(a,c)} function appendReply(a,b){var c;if(document.getElementById(b)&&document.getElementById(b).type=="textarea")c=document.getElementById(b);else{showError("Cannot find the comment text box!");return false}if(scriptParams.threadcmnts)c.value="";if(c.value.indexOf(a)>-1)showMessage("You've already replied this comment!");else c.value=c.value.replace(/\s|\t|\n/g,"")==""?a:c.value.replace(/[\n]*$/g,"")+"\n\n"+a;if(!scriptParams.threadcmnts){$("#respond").ScrollTo(500);c.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 c=a.css({height:"auto",position:"absolute",visibility:"hidden"}).height();a.css({opacity:0,height:0,position:"static",visibility:"visible"});a.animate({opacity:1,height:c},500,function(){a.removeAttr("style");b&&typeof b=="function"&&b()})}var contentWidth=580; function processContent(){$(".entry img").each(function(){var a=$(this).width(),b=$(this).height();b=a/b;var c=contentWidth,e=$(this).parents(".wp-caption");if(e.length>0){e.width(a+14);if(e.width()>contentWidth){c=contentWidth-14;resizeToFit($(this),c,b);e.width(contentWidth)}}else a>contentWidth&&resizeToFit($(this),contentWidth,b)});if(scriptParams.hidesmallimgbdr){$(".entry img").each(function(){var a=$(this),b=a.width(),c=a.height();if(scriptParams.smallimgwidth>0&&scriptParams.smallimgheight> 0)if(scriptParams.smallimglogic=="and")b<=scriptParams.smallimgwidth&&c<=scriptParams.smallimgheight>0&&a.addClass("no-border");else{if(b<=scriptParams.smallimgwidth||c<=scriptParams.smallimgheight>0)a.addClass("no-border")}else if(scriptParams.smallimgwidth>0)b<scriptParams.smallimgwidth&&a.addClass("no-border");else if(scriptParams.smallimgheight>0)c<scriptParams.smallimgheight&&a.addClass("no-border");else a.addClass("no-border")});$("img.no-border").parents(".wp-caption").each(function(){$(this).width($(this).width()- 4)})}$(".entry object").each(function(){var a=$(this).find("embed"),b=a.width(),c=a.height();c=b/c;if(b>contentWidth){resizeToFit($(this),contentWidth,c);resizeToFit(a,contentWidth,c)}});$.browser.msie&&$.browser.version<=7&&$(".entry table").not(".wp_syntax table").each(function(){$(this).find("tr:not(thead tr, tfoot tr):odd").addClass("even")})}var commentWidth=[378,516,490,456,422,388]; function processComments(){$(".comment-body img").each(function(){var a=$(this).width(),b=$(this).height();b=a/b;var c=$(this).parents(".comment-body").parent().attr("class").match(/depth-(\d)/);c=c?c[1]:1;a>commentWidth[c]&&resizeToFit($(this),commentWidth[c],b)})}function processTooltip(a){a.find(".comment-body img").each(function(){var b=$(this).width(),c=$(this).height();c=b/c;b>commentWidth[0]&&resizeToFit($(this),commentWidth[0],c)})}function resizeToFit(a,b,c){a.width(b).height(b/c)} var commentCache=[]; $(document).ready(function(){var a=$(".top-menu-window"),b=a.children("ul"),c=0,e=[];e.unshift(0);b.children("li").each(function(){c+=$(this).width();e.push(c)});if(e[e.length-1]>a.width()){b.width(c);var o=$('<div class="scroller scroller-left" style="display:none;"></div>'),t=$('<div class="scroller scroller-right"></div>');o.insertBefore(a);t.insertAfter(a);var u=$(".scroller-left").width()-10,j=a.width()-u,k=u,s,p=b.children(".current-cat, .current_page_item, .current_page_ancestor, .current_menu_item, .current-menu-item, .current-menu-ancestor"),l= function(d,g){o.fadeIn(100);d||(d=200);var f=j-k,i;if(f<c){for(var h=0;h<e.length;h++)if(e[h]>f){i=e[h];break}k=j-i;b.animate({"margin-left":k},d,g);j-k>=c&&t.fadeOut(100)}},v=function(d,g){t.fadeIn(100);d||(d=200);var f=0-k,i;if(f>0){for(var h=0;h<e.length+1;h++)if(e[h]>=f){i=e[h-1];break}k=u-i;b.animate({"margin-left":k},d,g);0-k<=0&&o.fadeOut(100)}},m=false,x=function(){m||l(100,x)},y=function(){m||v(100,y)};if(c>j){$(".scroller-right").mousedown(function(){m=false;l();s=setTimeout(function(){x()}, 500)}).bind("mouseup mouseout",function(){m=true;clearTimeout(s)});$(".scroller-left").mousedown(function(){m=false;v();s=setTimeout(function(){y()},500)}).bind("mouseup mouseout",function(){m=true;clearTimeout(s)});b.children("li").children("a").mouseover(function(){var d=$(this).parent();if(d.position().left<0)v();else d.position().left+d.width()>j&&l()});if(p.length>0){var w=function(){if(p.position().left>j)l(20,w);else if(p.width()>j)l(20);else p.position().left+p.width()>j&&l(20,w)};w()}}}else b.width(e[e.length- 1]).css({"float":"right","margin-right":5});b.children("li").mouseenter(function(){a.stop().height($(document).height()-a.offset().top-45);var d=$(this).position().left+152>j||$(this).offset().left+200>a.offset().left+a.width();$(this).children("ul:not(:animated)").removeAttr("style").animate(d?{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");$("a[href*=#]:not(.comment-reply-link, .cancel-comment-reply-link)").live("click",function(){if(location.pathname.replace(/^\//,"")==this.pathname.replace(/^\//,"")&&location.hostname==this.hostname&&location.search==this.search){var d=$(this).attr("href");d=d.substring(d.indexOf("#"));d!="#"&&$(d).ScrollTo(300);return false}return true});if(window.XMLHttpRequest){var q= $("#fixed-nav");q.fadeTo(0,0.25);var z=$("#page");$("body").mousemove(function(d){d.pageX>q.offset().left+q.width()&&d.pageX>z.offset().left?q.stop().fadeTo(100,0.25):q.stop().fadeTo(100,1)})}processContent();$(".wp_syntax_wrapper").live("hover",function(d){d.type=="mouseover"?$(this).children(".wp_syntax_lang").stop().fadeTo(200,0):$(this).children(".wp_syntax_lang").stop().fadeTo(200,1,function(){$(this).removeAttr("style")})});processComments();$(".comment").live("mouseenter",function(){$(this).addClass("hover").parents(".comment").removeClass("hover")}).live("mouseleave", function(){$(this).removeClass("hover")});$("#toggle-info").click(function(){var d=$("#comment-author-info");d.css("display")=="none"&&d.slideDown(500);$("#commentform .comment-notes").animate({opacity:"0",height:"0",marginBottom:"0"},500,function(){$(this).remove()});return false});$("#comment").focus(textAreaFixCursorPosition);$(".comment-reply-link").live("click",function(){var d=$(this).parent().parent().parent();reply(d.children().children("span.author").text(),d.attr("id"),"comment");return false}); $("li:not(.tooltip)>.comment-body a[href^=#comment-]").live("mouseover",function(){var d,g,f;if((g=$(this).attr("href").match(/#comment-(\d+)/))!=null){d=g[1];if(commentCache[d]){f=commentCache[d];g=$(this).parents(".comment-list");f.appendTo(g).stop().fadeTo(200,1)}else{f=$(".tooltip");if(f.length>0)f.stop().children().remove();else f=$('<li class="tooltip"></li>');g=$("#comment-"+d);if(g.length>0){f.append(g.children().clone());f.addClass(g.attr("class")).find(".actions").remove();f.children("ul").remove(); f.appendTo(g.parent()).stop().fadeTo(200,1);commentCache[d]=f}else{if(!ajaxGetComment)return;f.appendTo($(this).parents(".comment-list")).stop().fadeTo(200,1);ajaxGetComment(d,f,function(){commentCache[d]=f})}}var i=$(this).offset(),h=$("#page").offset();g=i.left-h.left;i=i.top-h.top+$(this).height();f.css({left:g+30,top:i+10});processTooltip(f)}}).live("mouseout",function(){$(".tooltip").stop().fadeTo(200,0,function(){$(this).detach()})});$("#comment").autoResize({extraSpace:0});$("#comment.quick-submit").keydown(function(d){d= window.event?window.event:d;d!=null&&d.ctrlKey&&d.keyCode==13&&$("#commentform").submit()});var r=$("#s"),n=$("#s-msg");r.val()!=""&&n.fadeTo(0,0);r.focus(function(){r.val()==""?n.stop().fadeTo(200,0.25):n.stop().fadeTo(200,0,function(){$(this).hide()})}).blur(function(){r.val()==""&&n.stop().fadeTo(200,1,function(){$(this).removeAttr("style")})}).keyup(function(){r.val()==""?n.stop().fadeTo(200,0.25):n.stop().fadeTo(200,0,function(){$(this).hide()})})});/*]]>*/
