/* <![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 d=0;d<a.length;d++){var e=a[d].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 showMessage(a,b){$("#commentform .fade").remove();$("#submit").after('<span class="fade ajax-comment-msg">'+a+"</span>");$("#commentform .fade").delay(2E3).fadeOut(500,function(){$(this).remove();b&&typeof b=="function"&&b()})}function showError(a,b){$("#commentform .fade").remove();$("#submit").after('<span class="fade ajax-comment-error">'+a+"</span>");$("#commentform .fade").delay(2E3).fadeOut(500,function(){$(this).remove();b&&typeof b=="function"&&b()})} function reply(a,b,d){var e;if(document.getElementById(d)&&document.getElementById(d).type=="textarea")e=document.getElementById(d);else{showError("Cannot find the comment text box!");return false}if(scriptParams.atreply){a='<a href="#'+b+'">@'+a.replace(/\t|\n/g,"")+" </a> \n";appendReply(e,a,d)}if(!scriptParams.threadcmnts){$("#respond").ScrollTo(500);e.focus()}} function appendReply(a,b){if(scriptParams.threadcmnts)a.value="";if(a.value.indexOf(b)>-1)showMessage("You've already replied this comment!");else a.value=a.value.replace(/\s|\t|\n/g,"")==""?b:a.value.replace(/[\n]*$/g,"")+"\n\n"+b}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=640; function processContent(){$(".entry img").load(function(){var a=$(this).width(),b=$(this).height();b=a/b;var d=contentWidth,e=$(this).parents(".wp-caption");if(e.length>0){e.width(a+14);if(e.width()>contentWidth){d=contentWidth-14;resizeToFit($(this),d,b);e.width(contentWidth)}}else a>contentWidth&&resizeToFit($(this),contentWidth,b)});if(scriptParams.hidesmallimgbdr){$(".entry img").load(function(){var a=$(this),b=a.width(),d=a.height();if(scriptParams.smallimgwidth>0&&scriptParams.smallimgheight> 0)if(scriptParams.smallimglogic=="and")b<=scriptParams.smallimgwidth&&d<=scriptParams.smallimgheight>0&&a.addClass("no-border");else{if(b<=scriptParams.smallimgwidth||d<=scriptParams.smallimgheight>0)a.addClass("no-border")}else if(scriptParams.smallimgwidth>0)b<scriptParams.smallimgwidth&&a.addClass("no-border");else if(scriptParams.smallimgheight>0)d<scriptParams.smallimgheight&&a.addClass("no-border");else a.addClass("no-border")});$("img.no-border").load(function(){var a=$(this).parents(".wp-caption"); a.width(a.width()-4)})}$(".entry img").each(function(){if(this.complete||$.browser.msie&&parseInt($.browser.version)==6)$(this).trigger("load")});$(".entry object").each(function(){var a=$(this).find("embed"),b=a.width(),d=a.height();if(!b||!d){b=$(this).width();d=$(this).height()}d=b/d;if(b>contentWidth){resizeToFit($(this),contentWidth,d);resizeToFit(a,contentWidth,d)}});$.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").load(function(){var a=$(this).width(),b=$(this).height();b=a/b;var d=$(this).parents(".comment-body").parent().attr("class").match(/depth-(\d)/);d=d?d[1]:1;a>commentWidth[d]&&resizeToFit($(this),commentWidth[d],b)});$(".entry img").each(function(){if(this.complete||$.browser.msie&&parseInt($.browser.version)==6)$(this).trigger("load")})} function processTooltip(a){a.find(".comment-body img").each(function(){var b=$(this).width(),d=$(this).height();d=b/d;b>commentWidth[0]&&resizeToFit($(this),commentWidth[0],d)})}function resizeToFit(a,b,d){a.width(b).height(b/d)}var commentCache=[]; $(document).ready(function(){var a=$(".top-menu-window"),b=a.children("ul"),d=0,e=[];e.unshift(0);b.children("li").each(function(){d+=$(this).width();e.push(d)});if(e[e.length-1]>a.width()){b.width(d);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(c,g){o.fadeIn(100);c||(c=200);var f=j-k,i;if(f<d){for(var h=0;h<e.length;h++)if(e[h]>f){i=e[h];break}k=j-i;b.animate({"margin-left":k},c,g);j-k>=d&&t.fadeOut(100)}},v=function(c,g){t.fadeIn(100);c||(c=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},c,g);0-k<=0&&o.fadeOut(100)}},m=false,x=function(){m||l(100,x)},y=function(){m||v(100,y)};if(d>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 c=$(this).parent();if(c.position().left<0)v();else c.position().left+c.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 c=$(this).position().left+152>j||$(this).offset().left+200>a.offset().left+a.width();$(this).children("ul:not(:animated)").removeAttr("style").animate(c?{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 c=$(this).attr("href");c=c.substring(c.indexOf("#"));c!="#"&&$('[name="'+c.substring(1)+'"], '+c).ScrollTo(300);return false}return true}); if(window.XMLHttpRequest){var q=$("#fixed-nav");q.fadeTo(0,0.25);var z=$("#page");$("body").mousemove(function(c){c.pageX>q.offset().left+q.width()&&c.pageX>z.offset().left?q.stop().fadeTo(100,0.25):q.stop().fadeTo(100,1)})}processContent();$(".wp_syntax_wrapper").live("hover",function(c){c.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 c=$("#comment-author-info");c.css("display")=="none"&&c.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 c=$(this).parent().parent().parent(); reply(c.children().children("span.author").text(),c.attr("id"),"comment");return false});$("li:not(.tooltip)>.comment-body a[href^=#comment-]").live("mouseover",function(){var c,g,f;if((g=$(this).attr("href").match(/#comment-(\d+)/))!=null){c=g[1];if(commentCache[c]){f=commentCache[c];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-"+c);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[c]=f}else{if(!ajaxGetComment)return;f.appendTo($(this).parents(".comment-list")).stop().fadeTo(200,1);ajaxGetComment(c,f,function(){commentCache[c]=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});scriptParams.quicksubmit&&$("#comment").keydown(function(c){c=window.event?window.event:c;c!=null&&c.ctrlKey&&c.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()})})});/* ]]> */
