var fixPNG;var my={time:[(new Date()).getHours(),(new Date()).getMinutes(),(new Date()).getSeconds(),new Date()],getXY:function(b){var a=0;var c=0;while(b){a+=b.offsetLeft;c+=b.offsetTop;b=b.offsetParent;}if(navigator.userAgent.indexOf("Mac")!=-1&&typeof document.body.leftMargin!="undefined"){a+=document.body.leftMargin;c+=document.body.topMargin;}return{x:a,y:c};},menu:function(){var b=0,h=0,a=0;var g={value:0,element:0,progress:function(i){if(!i){return g.value;}g.value=i;if(g.element){g.element.css("height",i*g.element[0].h);}if(b){if(1-i<=0){b.addClass("hidden");}b.css("height",1-i>0?((1-i)*b[0].h):"0px");}}};var d=function(i){if(b){b.addClass("hidden");}b=0;if(i){b=i;b.css("height","auto").css("overflow","visible");}h=0;};var e=$("#main-menu > li > .f strong");var c=1;if(e.filter(".selected").length>0){c=0;}var f=$("#main-menu > li > ul");e.each(function(i){var j=$(this).addClass("js");f[i].h=f[i].offsetHeight;if(j.hasClass("selected")||(c&&i==0)){b=$(f[i]);}else{$(f[i]).addClass("hidden");}j.click(function(){if(h){return false;}a=j.hasClass("selected");h=1;e.removeClass("selected");if(!a){j.addClass("selected");}g.progress(0);if(!a){g.element=$(f[i]);g.element.css("height",0).css("overflow","hidden").removeClass("hidden");}else{g.element=0;}if(b){b.css("height",b[0].h).css("overflow","hidden");}g.value=0;$t(g).tween({progress:1,onComplete:d,onCompleteParams:[!a?$(f[i]):0]});return false;});});}};var people_loaded=new Array();var people=new (function(){var a=new Array();this.show=function(b){var e;var h=peoples[b],d;var f=0,g,c;while(h.length>0){g=0;f=Math.round(Math.random()*1000)%h.length;c=(new String(h[f][1])).split(" ");for(e=0;e<c.length;e++){if(a[c[e]]){g=1;}}if(h[f][1]!=""&&g){d=new Array();for(e=0;e<h.length;e++){if(e!=f){d.push(h[e]);}}h=d;}else{if(h[f][1]!=""){for(e=0;e<c.length;e++){a[c[e]]=1;}}people_loaded[b]=[b,h[f]];break;}}};});var check_people_loaded_cnt=0;var check_people_loaded=function(){var b=1;for(var a in people_loaded){if(typeof people_loaded[a]!="function"&&people_loaded[a][1][1]=="new_year"){b++;}}if(b!=1&&check_people_loaded_cnt<30){for(var a in people_loaded){if(typeof people_loaded[a]!="function"){people.show(people_loaded[a][0]);}}setTimeout(check_people_loaded,100);}else{for(var a in people_loaded){if(typeof people_loaded[a]!="function"){$("#"+people_loaded[a][0]).show().find("img:first").attr("src",people_loaded[a][1][0]);}}}check_people_loaded_cnt++;return;};var isPopupInit=0,Popup=function(e,g,b){var c=0,a=0,f;var d=function(){if((new Date()).getTime()-f<500){return;}a=0;c=0;Popup.popupElement.addClass("hidden");if(b){b();}};if(!isPopupInit){Popup.popupElement=$("#popup");Popup.isIE=/MSIE/.test(navigator.userAgent);Popup.popupElement.find(".content").click(function(){return false;});isPopupInit=1;}$(window).click(d);$(document.body).click(d);e.mousedown(function(){f=(new Date()).getTime();if(a&&c==this){d();return false;}if(g){g(Popup.popupElement,this);}c=this;if(!a){Popup.popupElement.css("top",my.getXY(this).y+this.clientHeight-10);if(Popup.isIE){Popup.popupElement.removeClass("hidden");}else{Popup.popupElement.css("opacity",0).removeClass("hidden");$t(Popup.popupElement).tween({time:1.5,opacity:1});}a=1;}return false;}).click(function(){return false;});};var Placeholder=function(a){a.blur(this.blur).focus(this.focus).each(this.blur);a.each(function(){var b=this;$(b).parents("form").submit(function(){if(b.value==b.title){b.value="";}});});};Placeholder.prototype={blur:function(){if(this.value==""||this.value==this.title){this.value=this.title;$(this).addClass("placeholder");}},focus:function(){if(this.value==this.title){this.value="";$(this).removeClass("placeholder");}return true;}};$(function(){new Placeholder($("#search"));new Placeholder($("#site-search"));var a=$("#page-body .popupimage");if(a.length){new Popup(a.next("img").css("cursor","pointer"),function(b,d){var e=$(d).prev();var c=parseInt(e.css("width").replace(/px/,""))+180;b.css("width",c).css("margin-right","-"+Math.round(c/2)+"px").find("img").attr("src",e.attr("src"));});}$(document).keydown(function(c){if(c.ctrlKey){var b=false;switch(c.keyCode?c.keyCode:c.which?c.which:null){case 37:b=$("#prevLink").attr("href");break;case 39:b=$("#nextLink").attr("href");break;case 38:b=$("#upLink").attr("href");break;case 40:b=$("#downLink").attr("href");break;case 36:b=$("#homeLink").attr("href");break;}if(b&&!$("input:focus, textarea:focus").length){document.location=b;}}});$("#page-body .mini").each(function(){var c=$(this).removeClass("hidden");var d=c.find(".map");var b=function(){d.hide();};c.find(".open").mousedown(function(){d.show();return false;});$(window).click(b);$(document.body).click(b);});});
