(function(){var a={getData:function(c,b,d){if(d){$("#"+b).prepend('<div id="'+d+'"></div>')}$.get(c,function(e){$("#"+b).html(e)})},resizeImages:function(){var b=$("#main").width();var d=$("#mainInner").width();var c=d>b?b:d;$("#mainInner .preview img, #mainInner .articleText img").each(function(){var f=$(this);var e=f.width();if(e>c){f.height(Math.floor(c/e*f.height()));f.width(c)}})},emoticonInit:function(c,d){var b=$("#"+c);$("#"+d+" a").bind("click",function(){b.trigger("jyxoFormHint");b.val(b.val()+" "+$(this).attr("title")+" ")})},forumPostInit:function(d,b,e){var c=$("#"+d);c.before('<input class="reaction" name="reaction" type="hidden" /><div class="reaction></div>').prev("div.reaction").width(c.width());$("."+e+" a[rel=new]").click(function(){c.prevAll("div.reaction").html("");c.prevAll("input.reaction").val("");c.prevAll("input:text").val("");c.nextAll("#quoteId").val("")});$("."+e+" a[rel=react]").click(function(){quoteText="<blockquote>"+$(this).nextAll("."+b).html()+"</blockquote>";c.prevAll("div.reaction").html(quoteText);c.prevAll("input.reaction").val(quoteText);c.prevAll("input:text").val("Re: "+$(this).prevAll("h3").text());c.nextAll("#quoteId").val($(this).attr("name"))})}};window.Ublog=a;$.fn.extend({changeValue:function(c){var b=this.attr("value");if(b=="insert"){$("#"+c).attr("value","").show()}else{$("#"+c).hide().attr("value",b)}}})})();(function(){var b={maxRows:14,toggleText:"toggle",childClass:"",reduce:false};function d(f,e){if("undefined"!==typeof e){$.extend(b,e)}if(false==b.reduce){return}f.each(function(){var h=null;if(""!==b.childClass){h=$(this).find("."+b.childClass)}else{h=$(this)}var g=b.maxRows*parseInt(h.css("line-height"));if(h.height()>g){h.attr("maxHeight",g);h.css({overflow:"hidden",cursor:"pointer"});toggleLink=$('<span class="commentToggle commentToggleOpened">'+b.toggleText+"</span>").css({cursor:"pointer"}).bind("click",function(){h.click()});h.after(toggleLink);h.click(c).click()}})}window.Ublog.commentResizer=d;function c(){var e=$(this);e.unbind("click",c).click(a).height(parseInt(e.attr("maxHeight")));e.next(".commentToggle").removeClass("commentToggleOpened").addClass("commentToggleClosed")}function a(){var e=$(this);e.unbind("click",a).click(c).css("height","auto");e.next(".commentToggle").removeClass("commentToggleClosed").addClass("commentToggleOpened")}})();(function(){var b=null;var g=false;var f=null;function j(k){var m=$("#discussPager");if(1===m.length&&"undefined"!==typeof k){m.click(d);$("#discussShowAll").removeClass("hidden").click(a)}var l=$("#ublog_DiscussForm");l.submit(e)}window.Ublog.commentReact=j;function d(k){$link=$(k.target);if(true!==g){g=true;$button=$link.parent();$loader=$('<div class="ajaxLoader"></div>').insertAfter($button);$.getJSON($link.attr("href"),function(m){Ublog.commentResizer($(m.boxData).children("div").attr("visibility","hidden").insertAfter($button));var n=$loader.offset().top;$loader.remove();$("html").animate({scrollTop:n},2000);g=false;var l=m.callbackData;if(0<l){$link.attr("href",$link.attr("href").replace(/\d+$/,l))}else{$button.remove()}})}return false}function a(m){if(true!==g){g=true;var l=$(m.target),n=l.parent(),k=$('<div class="hidden"></div>').insertAfter(n);n.jyxoBubble({bubbleClass:"bubbleError",onClose:function(o){g=false}});n.jyxoBubbleShow("note",l.attr("rel"));h(l,n,k)}return false}function h(l,m,k){if(true===g){$.getJSON(l.attr("href"),function(o){Ublog.commentResizer($(o.boxData).children("div").prependTo(k));var n=o.callbackData;if(0<n){m.find("a").attr("href",l.attr("href").replace(/\d+$/,n));h(l,m,k)}else{m.jyxoBubbleShow("note","");m.remove();k.removeClass("hidden");g=false}})}else{k.removeClass("hidden")}}function e(){var n,m;var l=$("#text").val().match(/\[\d+\]/g);if(null!==l){for(var k=0;k<l.length;k++){n=l[k].slice(1,-1);m=$("#ref"+n).attr("name");b.append('<input type="hidden" name="commentIdPairs[]" value="'+n+":"+m+'" />')}}}function c(n){var k=$("#text");k.trigger("jyxoFormHint");var o=$(n).siblings("a:first").html();var m="",l=k.val();if(""!==l){m=l+"\n\n"}m+="["+o+"] ";k.val(m);k.focus();return false}window.Ublog.addRef=c;var i={referredClone:[],tree:[],preservedNode:0,chopper:null,show:function(m){if(false===g){var k=$(m),l=k.attr("name");if(!k.data("popupOn")){g=true;i.initReferred(l,k);g=false}if(true===k.data("popupOn")){i.preserve(l)}else{parentId=k.closest(".popupRef").attr("id");if(parentId){parentId=parentId.match(/\d+$/)[0]}else{parentId=0}i.chop(0,parentId);var n=i.referredClone[l];k.data("popupOn",true);n.data("popupSwitch",k);i.tree.push(l);i.display(n,k)}}},hide:function(l){var k=$(l),m=k.closest(".popupRef").attr("id");i.chop();if(m){i.preserve(m.match(/\d+$/)[0])}},initReferred:function(l,k){k.click(function(){return false}).data("popupOn",false);if("undefined"===typeof i.referredClone[l]){i.addReferred(l,k)}},addReferred:function(l,k){var n=null,m=$("#comment"+l);refStyle=null;if(0===m.length){$loader=$('<div class="ajaxLoader"></div>').insertAfter(k);$.ajax({url:k.attr("href"),async:false,success:function(p){var o=$(p);n=o.find(".comment");$loader.remove()}});if(null===f){$baseComment=$(".comment:not(.commentNew, .commentOwner):first");if(!$baseComment){$baseComment=$(".commentNew:first");if(!$baseComment){$baseComment=k.parent()}}f=i.getCommentStyle($baseComment)}refStyle=f}else{n=m.clone();$toggle=n.find(".commentToggle");$toggle.prev().css({height:"auto",cursor:"auto"});$toggle.remove();refStyle=i.getCommentStyle(m)}i.referredClone[l]=n;n.hover(function(){i.preserve($(this).data("popupSwitch").attr("name"))},function(){i.chop()});return n.addClass("popupRef").css(refStyle).appendTo("body")},getCommentStyle:function(m){var l=m,k={borderColor:m.css("color")};try{while(l.css("backgroundColor")==="transparent"){l=l.parent()}k.backgroundColor=l.css("backgroundColor")}catch(n){k.backgroundColor="#fff"}return k},display:function(n,k){var m=k.offset();var l=k.closest(".popupRef");if(1===l.length){n.css({"z-index":parseInt(l.css("z-index"))+10})}n.css({display:"block",top:(m.top+k.outerHeight())+"px",left:m.left+"px"}).stop().animate({opacity:1},100)},preserve:function(k){i.preservedNode=k},chop:function(l,k){if("undefined"===typeof l){l=500}if("undefined"===typeof k){k=0}clearTimeout(i.chopper);i.chopper=null;i.preservedNode=k;if(0!==l){i.chopper=setTimeout(i.chopTree,l)}else{i.chopTree()}},chopTree:function(){var k=i.tree.length-1;while(i.tree[k]!==i.preservedNode&&k>=0){var m=i.referredClone[i.tree.pop()];var l=m.data("popupSwitch");if(l){l.data("popupOn",false);m.removeData("popupSwitch").css({display:"none"})}k--}i.preservedNode=0}};window.Ublog.hideRef=i.hide;window.Ublog.showRef=i.show})();