var Mojemiasto={globals:{},start:function(){this.setMeetingState();this.ajax.userOnlineStatus("/json/onlineUsersList");this.load.js("/js/stored-messages.js");this.load.js("/js/popup.js");this.load.js("/js/lightbox2.js");this.load.js("/js/gmlightbox.js")},setMeetingState:function(){var A=$$("p.meetingTime").each(function(C){var B=C.className.split(" ")[1].slice(1);(B>=Mojemiasto.globals.systemTime)?(C.innerHTML="Będzie"):(C.innerHTML="Było")})},setCalendarMonth:function(A){box=A;destination=box.options[box.selectedIndex].value;if(destination){location.href=destination}},changeTab:function(E,D,C){if(D){var A=new Array();A[0]=new Array("tab_m_C2","tab_m_C-n2");A[1]=new Array("tab_menu-Tab-C","tab_menu-Tab");for(var B=0;B<D.length;B++){if(document.getElementById(D[B]+"_content").className.indexOf("default_hidden")==-1){document.getElementById(D[B]+"_content").className="default_hidden";document.getElementById(D[B]+"_left").className+=" default_hidden";document.getElementById(D[B]+"_right").className+=" default_hidden";document.getElementById(D[B]+"_arrow").className+=" default_hidden"}document.getElementById(D[B]).className=A[C][1]}document.getElementById(E.id+"_content").className="";document.getElementById(E.id+"_left").className=document.getElementById(E.id+"_left").className.replace(new RegExp("default_hidden"),"");document.getElementById(E.id+"_right").className=document.getElementById(E.id+"_right").className.replace(new RegExp("default_hidden"),"");document.getElementById(E.id+"_arrow").className=document.getElementById(E.id+"_arrow").className.replace(new RegExp("default_hidden"),"");E.className=A[C][0]}return false},changeTab1:function(G,E,D,F){if(E){var B=new Array();B[0]=new Array("tab_m_C2","tab_m_C-n2");B[1]=new Array("tab_menu-Tab-C","tab_menu-Tab");var A=G.id+"_content";for(var C=0;C<E.length;C++){if(E[C]!=F){if(document.getElementById(E[C]+"_content").className.indexOf("default_hidden")==-1){document.getElementById(E[C]+"_content").className="default_hidden";document.getElementById(E[C]+"_left").className+=" default_hidden";document.getElementById(E[C]+"_right").className+=" default_hidden";document.getElementById(E[C]+"_arrow").className+=" default_hidden"}document.getElementById(E[C]).className=B[D][1]}}if((F=="meetings_center")||(F=="news_center")||(F=="photosTags_center")||(F=="blogs_center")){document.getElementById(F+"_content").className="";document.getElementById(F+"_left").className=document.getElementById(F+"_left").className.replace(new RegExp("default_hidden"),"");document.getElementById(F+"_right").className=document.getElementById(F+"_right").className.replace(new RegExp("default_hidden"),"");document.getElementById(F+"_arrow").className=document.getElementById(F+"_arrow").className.replace(new RegExp("default_hidden"),"")}G.className=B[D][0]}return false},starVoting:function(B,C,D){$(C+"Msg").style.display="";var A=new Date();B=B+"?noCache="+A.getTime();new Ajax.Updater({success:C},B,{method:"get",evalScripts:"true",onComplete:function(){var E=document.getElementById(C+"Msg");E.style.display="";E.innerHTML=document.getElementById(C+"VotedMsg").innerHTML;setTimeout(function(){E.style.display="none";E.innerHTML=document.getElementById(C+"OriginalMsg").innerHTML},2500)}});return false},showLoading:function(){$("loadingBox").style.display="inline"},netSprintResults:function(C,B){var A=document.getElementById("ns_query").value;if(A==null){A=""}document.cookie="ns_query_org="+escape(A);document.cookie="ns_query="+ns_enc(A);document.cookie="rpp="+B;window.location=C},moveAds:function(){if($("adRCnt")&&$("reklama_prawa")){$("adRCnt").innerHTML=$("reklama_prawa").innerHTML}},load:{js:function(C){var B=$$("head")[0];var A=document.createElement("script");A.type="text/javascript";A.src=C;B.appendChild(A)}},ajax:{cutURLHash:function(B){var C=""+B;var A=C.indexOf("#",0);if(A<0){return B}return C.substring(0,A)},link:function(A,B){new Ajax.Updater($(B),Mojemiasto.ajax.cutURLHash(A),{method:"get",evalScripts:"true",parameters:"?&ieSucks="+new Date().getTime()});return false},form:function(B,A,C){if($(C)){new Ajax.Updater($(C),Mojemiasto.ajax.cutURLHash(A),{method:"post",parameters:Form.serialize(B),evalScripts:true});return false}else{return true}},ajaxRequestLink:function(B,A){new Ajax.Request(B.href,{method:"get",onComplete:function(C){if(A.show){$(A.show).style.display=""}if(A.hide){$(A.hide).style.display="none"}}});return false},userOnlineStatus:function(url){new Ajax.Request(url,{method:"get",evalScripts:"true",onComplete:function(data){var data=data.responseText;var classesLength=Mojemiasto.globals.onlineStatusDivs.length;var users=eval("("+data+")");var usersLength=users.length;for(var i=0;i<classesLength;i++){for(var j=0;j<usersLength;j++){var onlineSpan=document.getElementById(Mojemiasto.globals.onlineStatusDivs[i]);if(onlineSpan.id.split("_")[1]==users[j]){var finalClassName=onlineSpan.className;if(onlineSpan.id.split("_")[2]==0){finalClassName="online_icon_on"}else{if(onlineSpan.id.split("_")[2]==1){finalClassName="online_icon_big_on"}else{finalClassName="unknown_error"}}onlineSpan.className=finalClassName}}}}})},hide:function(A){if($(A)){$(A).innerHTML="";return false}else{return true}},googleAnalytics:function(C){var A=C;var B=_gat._getTracker(A);B._initData();B._trackPageview()}},googleMap:{savePosition:function(A,B){loadingState=parseInt($("curloadingState").value);if(!loadingState){$("curloadingState").value="1";$("loader").style.display="block";$("linkSave").style.display="none";$("linkDel").style.display="none";var D=$("zapisz").innerHTML;var C=new Ajax.Updater(A,B,{method:"get",evalScripts:"true",parameters:"&force="+new Date().getTime(),onComplete:function(){var E=document.getElementById(A);E.style.display="";E.innerHTML=document.getElementById(A+"Saved").innerHTML;setTimeout(function(){E.style.display="none";$("linkSave").style.display="";$("linkDel").style.display=""},400);$("loader").style.display="none";$("curloadingState").value="0"},onFailure:function(){},onException:function(){}})}return false},deletePosition:function(A,B){loadingState=parseInt($("curloadingState").value);if(!loadingState){$("curloadingState").value="1";$("loader").style.display="block";$("linkDel").style.display="none";var D=$("zapisz").innerHTML;var C=new Ajax.Updater(A,B,{method:"get",evalScripts:"true",parameters:"&force="+new Date().getTime(),onComplete:function(){var E=document.getElementById(A);E.style.display="";E.innerHTML=document.getElementById(A+"Deleted").innerHTML;setTimeout(function(){E.style.display="none";$("linkDel").style.display=""},400);$("loader").style.display="none";$("curloadingState").value="0"},onFailure:function(){},onException:function(){}})}return false}},movie:{movieInProgress:false,show:function(A,H){if(!this.movieInProgress){this.movieInProgress=true;var C=document.getElementById(A);if(C){C.style.display="none";C.style.position="static";C.innerHTML=""}var F=C;F.innerHTML='<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="408" height="306"><param name="allowScriptAccess" value="sameDomain" /><param name="movie" value="'+H+'" /><param name="quality" value="high" /><param name="wmode" value="transparent" /><embed src="'+H+'" quality="high" wmode="transparent" width="408" height="306" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /></object>';if(self.innerWidth){frameWidth=self.innerWidth;frameHeight=self.innerHeight}else{if(document.documentElement&&document.documentElement.clientWidth){frameWidth=document.documentElement.clientWidth;frameHeight=document.documentElement.clientHeight}else{if(document.body){frameWidth=document.body.clientWidth;frameHeight=document.body.clientHeight}}}C.style.position="absolute";C.style.display="block";C.style.width=408+"px";C.style.height=306+"px";C.style.visibility="hidden";C.style.left=(frameWidth-F.offsetWidth)/2+Element.cumulativeScrollOffset(document.body)[0]+"px";var B=function(){var I;if(self.pageYOffset){I=self.pageYOffset}else{if(document.documentElement&&document.documentElement.scrollTop){I=document.documentElement.scrollTop}else{if(document.body){I=document.body.scrollTop}}}D=new Array("",I);return D};var G=function(){var K,I;if(window.innerHeight&&window.scrollMaxY){K=document.body.scrollWidth;I=window.innerHeight+window.scrollMaxY}else{if(document.body.scrollHeight>document.body.offsetHeight){K=document.body.scrollWidth;I=document.body.scrollHeight}else{K=document.body.offsetWidth;I=document.body.offsetHeight}}var J,L;if(self.innerHeight){J=self.innerWidth;L=self.innerHeight}else{if(document.documentElement&&document.documentElement.clientHeight){J=document.documentElement.clientWidth;L=document.documentElement.clientHeight}else{if(document.body){J=document.body.clientWidth;L=document.body.clientHeight}}}if(I<L){pageHeight=L}else{pageHeight=I}if(K<J){pageWidth=J}else{pageWidth=K}E=new Array(pageWidth,pageHeight,J,L);return E};var E=G();var D=B();C.style.top=D[1]+(E[3]/15)+150+"px";C.style.visibility=""}},close:function(B){this.movieInProgress=false;var A=document.getElementById(B);A.style.display="none";A.style.position="static";A.innerHTML=""},swap:function(D){var C=$(D);var B=document.createElement("img");B.setAttribute("src",C.getAttribute("src"));var A=C.parentNode;A.insertBefore(B,C);A.removeChild(C)}},time:{formatDay:function(B){var A=B+" ";if(B==1){A+="dzień"}else{A+="dni"}A+=" ";return A},formatHour:function(A){var C=new Array(2,3,4,22,23,24);var B=A+" ";if(C.indexOf(A)!=-1){B+="godziny"}else{B+="godzin"}B+=" ";return B},formatMinute:function(C){var B=new Array(2,3,4,22,23,24);var A=C+" ";if(B.indexOf(C)!=-1){A+="minuty"}else{A+="minut"}A+=" ";return A},checkZero:function(A){if(A<10){return"0"+A}else{return A}},timePeriod:function(B,E){var H=(Mojemiasto.globals.systemTime-B)/1000;if(H<0){H=H*(-1)}var I=Math.floor(H/86400);var J=H%86400;var G=Math.floor(J/3600);var C=J%3600;var D=Math.floor(C/60);if(G==0&&D==0){D=1}var F="<strong>";if(I>0){var A=new Date();A.setTime(B);F+=Mojemiasto.time.checkZero(A.getDate())+"-"+Mojemiasto.time.checkZero(1+A.getMonth())+"-"+(A.getFullYear());if(A.getHours()>0||A.getMinutes()>0){F+=" "+Mojemiasto.time.checkZero(A.getHours())+":"+Mojemiasto.time.checkZero(A.getMinutes())}F+="</strong>"}else{if(G>0){F+=Mojemiasto.time.formatHour(G)}if(D>0){F+=Mojemiasto.time.formatMinute(D)}F+="</strong>"+E}document.write(F)}}};document.observe("dom:loaded",function(){Mojemiasto.start();Event.observe(window,"load",function(){Mojemiasto.moveAds()})});function submitSwap(D){var C=$(D);var B=document.createElement("img");B.setAttribute("src",C.getAttribute("src"));var A=C.parentNode;A.insertBefore(B,C);A.removeChild(C)} 