function openClose(e){document.getElementById(e).style.display=="block"?document.getElementById(e).style.display="none":document.getElementById(e).style.display="block"}function openMenu(e){document.getElementById(e).style.display="block"}function closeMenu(e){document.getElementById(e).style.display="none"}function NavUpdate(){if(!stopped){var e="ping"+(localUser!=0?"?f=&uid="+localUser:"");$.get(e,function(e){$(e).find("result").each(function(){$("nav").trigger("nav-update",this),$("#live-network").length&&(src="network",liveUpdate()),$("#live-profile").length&&(src="profile",liveUpdate()),$("#live-community").length&&(src="community",liveUpdate()),$("#live-notes").length&&(src="notes",liveUpdate()),$("#live-display").length&&liking&&(liking=0,window.location.href=window.location.href),$("#live-photos").length&&liking&&(liking=0,window.location.href=window.location.href)})})}timer=setTimeout(NavUpdate,updateInterval)}function liveUpdate(){if(src==null||stopped||!profile_uid){$(".like-rotator").hide();return}if($(".comment-edit-text-full").length||in_progress){livetime&&clearTimeout(livetime),livetime=setTimeout(liveUpdate,1e4);return}livetime!=null&&(livetime=null),prev="live-"+src,in_progress=!0;var e=netargs.length?"/"+netargs:"",t="update_"+src+e+"&p="+profile_uid+"&page="+profile_page+"&msie="+(msie?1:0);$.get(t,function(e){in_progress=!1,$(".tread-wrapper",e).each(function(){var e=$(this).attr("id");$("#"+e).length==0&&profile_page==1?($("img",this).each(function(){$(this).attr("src",$(this).attr("dst"))}),$("#"+prev).after($(this))):($("img",this).each(function(){$(this).attr("src",$(this).attr("dst"))}),$("#"+e).replaceWith($(this))),prev=e}),$(".like-rotator").hide(),commentBusy&&(commentBusy=!1,$("body").css("cursor","auto")),$(".comment-edit-form textarea").contact_autocomplete(baseurl+"/acl")})}function imgbright(e){$(e).removeClass("drophide").addClass("drop")}function imgdull(e){$(e).removeClass("drop").addClass("drophide")}function dolike(e,t){unpause(),$("#like-rotator-"+e.toString()).show(),$.get("like/"+e.toString()+"?verb="+t,NavUpdate),liking=1}function dostar(e){e=e.toString(),$("#like-rotator-"+e).show(),$.get("starred/"+e,function(t){t.match(/1/)?($("#starred-"+e).addClass("starred"),$("#starred-"+e).removeClass("unstarred"),$("#star-"+e).addClass("hidden"),$("#unstar-"+e).removeClass("hidden")):($("#starred-"+e).addClass("unstarred"),$("#starred-"+e).removeClass("starred"),$("#star-"+e).removeClass("hidden"),$("#unstar-"+e).addClass("hidden")),$("#like-rotator-"+e).hide()})}function getPosition(e){var t={x:0,y:0};if(e.pageX||e.pageY)t.x=e.pageX,t.y=e.pageY;else if(e.clientX||e.clientY)t.x=e.clientX+(document.documentElement.scrollLeft||document.body.scrollLeft)-document.documentElement.clientLeft,t.y=e.clientY+(document.documentElement.scrollTop||document.body.scrollTop)-document.documentElement.clientTop;else if(e.x||e.y)t.x=e.x,t.y=e.y;return t}function lockview(e,t){e=e||window.event,cursor=getPosition(e),lockvisible?lockviewhide():(lockvisible=!0,$.get("lockview/"+t,function(e){$("#panel").html(e),$("#panel").css({left:cursor.x+5,top:cursor.y+5}),$("#panel").show()}))}function lockviewhide(){lockvisible=!1,$("#panel").hide()}function post_comment(e){return unpause(),commentBusy=!0,$("body").css("cursor","wait"),$("#comment-preview-inp-"+e).val("0"),$.post("item",$("#comment-edit-form-"+e).serialize(),function(t){if(t.success){$("#comment-edit-wrapper-"+e).hide(),$("#comment-edit-text-"+e).val("");var n=document.getElementById("comment-edit-text-"+e);n&&commentClose(n,e),timer&&clearTimeout(timer),timer=setTimeout(NavUpdate,10)}t.reload&&(window.location.href=t.reload)},"json"),!1}function preview_comment(e){return $("#comment-preview-inp-"+e).val("1"),$("#comment-edit-preview-"+e).show(),$.post("item",$("#comment-edit-form-"+e).serialize(),function(t){t.preview&&($("#comment-edit-preview-"+e).html(t.preview),$("#comment-edit-preview-"+e+" a").click(function(){return!1}))},"json"),!0}function preview_post(){return $("#jot-preview").val("1"),$("#jot-preview-content").show(),tinyMCE.triggerSave(),$.post("item",$("#profile-jot-form").serialize(),function(e){e.preview&&($("#jot-preview-content").html(e.preview),$("#jot-preview-content a").click(function(){return!1}))},"json"),$("#jot-preview").val("0"),!0}function unpause(){totStopped=!1,stopped=!1,$("#pause").html("")}function bin2hex(e){var t,n,r=0,i=[];e+="",r=e.length;for(n=0;n'+e.desc+'
'+e.version+'
'+e.credits+'
'+theme+'')})}var src=null,prev=null,livetime=null,msie=!1,stopped=!1,totStopped=!1,timer=null,pr=0,liking=0,in_progress=!1,langSelect=!1,commentBusy=!1,last_popup_menu=null,last_popup_button=null;$(function(){function e(){last_popup_menu&&(last_popup_menu.hide(),last_popup_button.removeClass("selected"),last_popup_menu=null,last_popup_button=null)}$.ajaxSetup({cache:!1}),msie=$.browser.msie,$(".onoff input").each(function(){val=$(this).val(),id=$(this).attr("id"),$("#"+id+"_onoff ."+(val==0?"on":"off")).addClass("hidden")}),$(".onoff > a").click(function(e){e.preventDefault();var t=$(this).siblings("input"),n=1-t.val(),r=t.attr("id");$("#"+r+"_onoff ."+(n==0?"on":"off")).addClass("hidden"),$("#"+r+"_onoff ."+(n==1?"on":"off")).removeClass("hidden"),t.val(n)}),setupFieldRichtext(),$("a[rel^=#]").click(function(t){return e(),menu=$($(this).attr("rel")),t.preventDefault(),t.stopPropagation(),menu.attr("popup")=="false"?!1:($(this).parent().toggleClass("selected"),menu.toggle(),menu.css("display")=="none"?(last_popup_menu=null,last_popup_button=null):(last_popup_menu=menu,last_popup_button=$(this).parent()),!1)}),$("html").click(function(){e()}),$("a.popupbox").fancybox({transitionIn:"elastic",transitionOut:"elastic"});var t=unescape($("#nav-notifications-template[rel=template]").html()),n=unescape($("
").append($("#nav-notifications-see-all").clone()).html()),r=unescape($("
").append($("#nav-notifications-mark-all").clone()).html()),i=unescape($("#nav-notifications-menu").html());$("nav").bind("nav-update",function(e,s){var o=$(s).find("invalid").text();o==1&&(window.location.href=window.location.href);var u=$(s).find("net").text();u==0?(u="",$("#net-update").removeClass("show")):$("#net-update").addClass("show"),$("#net-update").html(u);var a=$(s).find("home").text();a==0?(a="",$("#home-update").removeClass("show")):$("#home-update").addClass("show"),$("#home-update").html(a);var f=$(s).find("intro").text();f==0?(f="",$("#intro-update").removeClass("show")):$("#intro-update").addClass("show"),$("#intro-update").html(f);var l=$(s).find("mail").text();l==0?(l="",$("#mail-update").removeClass("show")):$("#mail-update").addClass("show"),$("#mail-update").html(l);var f=$(s).find("intro").text();f==0?(f="",$("#intro-update-li").removeClass("show")):$("#intro-update-li").addClass("show"),$("#intro-update-li").html(f);var l=$(s).find("mail").text();l==0?(l="",$("#mail-update-li").removeClass("show")):$("#mail-update-li").addClass("show"),$("#mail-update-li").html(l);var c=$(s).find("notif");c.children("note").length==0?$("#nav-notifications-menu").html(i):(nnm=$("#nav-notifications-menu"),nnm.html(n+r),c.children("note").each(function(){e=$(this),text=e.text().format(""+e.attr("name")+""),html=t.format(e.attr("href"),e.attr("photo"),text,e.attr("date"),e.attr("seen")),nnm.append(html)})),notif=c.attr("count"),notif>0?$("#nav-notifications-linkmenu").addClass("on"):$("#nav-notifications-linkmenu").removeClass("on"),notif==0?(notif="",$("#notify-update").removeClass("show")):$("#notify-update").addClass("show"),$("#notify-update").html(notif);var h=$(s).find("sysmsgs");h.children("notice").each(function(){text=$(this).text(),$.jGrowl(text,{sticky:!0,theme:"notice"})}),h.children("info").each(function(){text=$(this).text(),$.jGrowl(text,{sticky:!1,theme:"info",life:1e4})})}),NavUpdate(),$(document).keydown(function(e){if(e.keyCode=="8"){var t=e.target||e.srcElement;if(!/input|textarea/i.test(t.nodeName))return!1}e.keyCode=="19"||e.ctrlKey&&e.which=="32"?(e.preventDefault(),stopped==0?(stopped=!0,e.ctrlKey&&(totStopped=!0),$("#pause").html('pause')):unpause()):totStopped||unpause()})});var lockvisible=!1;String.prototype.format=function(){var e=this;for(var t=0;t