var l10n;var timerNav;$(function(){$("#asideloginform").uniform({callback:function(a,b){if(a.success){setTimeout(function(){if(a.cmd=="redirect"){window.location.href=a.data}else{window.location.reload()}},800)}}});$("#comment-form").uniform({callback:function(a,b){if(a.success){var c=$("#comment-form textarea").val();$(".total_comments").text(parseInt($(".total_comments:first").text())+1);if($("#facebookcomment").attr("checked")){facebook_feed.message=c;FB.ui(facebook_feed)}$("#comment-form textarea").val("");$("#comment-form #submit").removeClass("disable");getComments()}}});$("#navigation li, #navigation li a, .tags-cloud li, .tags-cloud li a").hover(function(){$(this).css("z-index",10)},function(){$(this).css("z-index",9)});$(window).resize(function(){scaleImages()});$("a.external").attr("target","_blank");$("a[rel*='external']").attr("target","_blank");$("form").uniform();$(".node-header").addClass("visible");Shadowbox.init({handleOversize:"resize",overlayColor:"transaprent",overlayOpacity:0.95,animate:false,onOpen:function(){if((navigator.userAgent.match(/iPhone/i))||(navigator.userAgent.match(/iPad/i))){clearInterval(timerNav);$("#sb-container").css("top",$(window).scrollTop());setTimeout(function(){$(".site-name").css("top",$(window).scrollTop()-90)},500);$(window).bind("scroll",function(){$("#sb-container").css("top",$(window).scrollTop());$(".site-name").css("top",$(window).scrollTop())})}},onFinish:function(){$("#sb-body").addClass("visible");$(".site-name").addClass("watermark")},onChange:function(){},onClose:function(){$("#sb-body").removeClass("visible");$(".site-name").removeClass("watermark");if((navigator.userAgent.match(/iPhone/i))||(navigator.userAgent.match(/iPad/i))){$(".site-name").css("top","0px");$(window).unbind("scroll");timerNav=setInterval(function(){showNavigation(0)},10000)}}});showNavigation2();setTimeout(function(){scaleImages();nodeMutlilangContent();showTagsCloud(0)},400)});function shake(b){var e=Math.ceil(Math.random()*b.length);var a=Math.ceil(Math.random()*10);var d=(a%2==0)?"+":"-";var c=d+Math.floor(Math.random()*10+1)+"deg";$(b[e]).css("-moz-transform","rotate("+c+")");$(b[e]).css("-webkit-transform","rotate("+c+")");$(b[e]).css("-o-transform","rotate("+c+")")}function showNavigation2(){$("#navigation nav li").each(function(a,c){var d=$(c);for(var a=1;a<10;a++){d.removeClass("style"+a)}var b="style"+Math.floor(Math.random()*9+1);d.addClass(b).removeClass("visible").addClass("visible")});window.setTimeout(function(){showNavigation2()},20000)}function showNavigation(a){var c=Math.floor(Math.random()*2+1);var d=(c==1)?1:-1;var c=Math.floor(Math.random()*5+0)*d;var b=$($("#navigation nav li")[a]);if(b.length){window.setTimeout(function(){showNavigation(++a)},100);b.css("-moz-transform","rotate("+c+"deg)");b.css("-webkit-transform","rotate("+c+"deg)");b.css("-o-transform","rotate("+c+"deg)");b.addClass("visible")}else{window.setTimeout(function(){showNavigation(0)},20000)}}function showTagsCloud(a){var c=Math.floor(Math.random()*2+1);var d=(c==1)?1:-1;var c=Math.floor(Math.random()*6+0)*d;var b=$($(".tags-cloud li")[a]);if(b.length){window.setTimeout(function(){showTagsCloud(++a)},100);b.css("-moz-transform","rotate("+c+"deg)");b.css("-webkit-transform","rotate("+c+"deg)");b.css("-o-transform","rotate("+c+"deg)");b.addClass("visible")}else{}}function featuredSlideshow(a){if(a>=$("#featured .slide-thumbs img").length){a=0}$("#featured .slide:visible").removeClass("visible");$("#featured .slide-thumbs img:visible").removeClass("visible");$("#featured .slide[rel="+a+"]").addClass("visible");$("#featured .slide-thumbs img[rel="+a+"]").addClass("visible");window.clearTimeout(featuredSlideshowTimer);featuredSlideshowTimer=window.setTimeout(function(){featuredSlideshow(parseInt(a)+1)},5000)}$.urlParam=function(a){var b=new RegExp("[\\?&]"+a+"=([^&#]*)").exec(window.location.href);if(b){return b[1]||0}return 0};function coloration(a){a.each(function(b,c){var d=$(c).attr("lang");$.post("/geshi.php",{lang:d,linenumber:1,source:$(c).html()},function(e){if(e){$(c).hide();$("<div></div>").addClass("coloration").html(e).insertAfter($(c))}})})}function redirect(){window.location="/user/?redirect="+window.location.href}function nl2br(b){var a="<br />";return(b+"").replace(/([^>]?)\n/g,"$1"+a+"\n")}function addslashes(a){return(a+"").replace(/([\\"'])/g,"\\$1").replace(/\u0000/g,"\\0")}function validForm(a){$(a+" :text,:password").each(function(){var c=$.trim($(this).val());$(this).val(c);if(c==$(this).attr("rel")){$(this).val("").removeClass("uniform-placeholder")}});var b=true;$(a+" .require").each(function(){$(this).removeClass("uniform-form-invalid");if($(this).val()==""){$(this).addClass("uniform-form-invalid");b=false}});if(!b){$(a).uniform()}return b}function t(b){if(l10n){var a=b.toLowerCase();b=l10n[a]?l10n[a]:b}return b}function mouseenter(a){$(this).addClass("hover")}function mouseleave(a){$(this).removeClass("hover")}function mouseclick(a){$(this).toggleClass("active")}function scaleImages(a){if(a){a.css("width","auto");a.find("img").css("width","100%")}else{$("div.img").css("width","auto");$("div.img img").css("width","100%")}}function loadGalleryThumb(f,d,b,e){var c=$("div.img[rel="+f+"]");var a=new Image();d.thumb="/thumb.php?w="+b+"&zc=0&src="+d.path;$(a).load(function(){var g=$("<img>").attr("src",d.thumb).attr("alt",d.name);var h=$("<a></a>").attr("href",d.path).attr("title",d.name).attr("rel","shadowbox["+e+"]");h.wrapInner(g);c.prepend(h)}).attr("src",d.thumb)}function intval(a){a=parseInt(a,10);if(/\D/.test(a)){return 0}return a}function replyComment(a){$("#comment-form [name='comment_id']").val(a);$("#comment-form textarea").focus()}function getComments(a){a=(a)?a:1;$("#comments-box").fadeOut("fast").load("/node/comment/"+nid+"/?page="+a,function(){$("#comments-box").fadeIn("fast")})}function nodeMutlilangContent(){var a=$.urlParam("lang");$(".content-ml-block").each(function(c,d){var b=$('<a href="javascript:void(0);"></a>').attr("rel",$(this).attr("rel")).text(t("lang-"+$(this).attr("rel"))).click(function(){$(".content-ml-block").hide();$(".content-ml-block[rel='"+$(this).attr("rel")+"']").fadeIn();return false});if(c>0){$(".entry-translation").append(", ")}$(".entry-translation").append(b);$(".entry-translation").show()});if(a&&$(".content-ml-block[rel='"+a+"']").length){$(".content-ml-block").hide();$(".content-ml-block[rel='"+a+"']").show()}};
