var UserMain=Class.create();Object.extend(UserMain.prototype,AppFramework.prototype);Object.extend(UserMain.prototype,{appid:"UserMain",surveyReadyToSave:false,surveyVote:function(C){this.surveyReadyToSave=true;var A=Form.getElements("survey-form-"+C);A.each(function(D){if(D.value==0){this.surveyReadyToSave=false}}.bind(this));if(!this.surveyReadyToSave){this.showLightBoxStatic("surveyAlert",Lang.surveyNotFilled+this.getWinCloseButton("surveyAlert"),{width:340,height:110});return false}var B=Form.serialize("survey-form-"+C,true);this.sendRequest("surveyVote",B,function(D){if(D.result==this.RESPONSE_RESULT_OK){if(D.html){Element.update($("surveyBox"+D.surveyId),D.html)}if(D.msg){this.showLightBoxStatic("surveyAlert",D.msg+this.getWinCloseButton("surveyAlert"),{width:340,height:110})}}else{if(D.errorMsg){this.showLightBoxStatic("surveyAlert",'<div class="alert">'+D.errorMsg+"</div>"+this.getWinCloseButton("surveyAlert"),{width:340,height:110});return false}}}.bind(this));return false},surveyDisabled:function(A){this.showLightBoxStatic("surveyAlert",'<div class="alert">'+A+"</div>"+this.getWinCloseButton("surveyAlert"),{width:340,height:110});return false},surveyChoose:function(G,B,F){var E=$("survey"+G+"question"+B+"option"+F);var A="survey"+G+"Question"+B;var C=$(A);if(C.value!=0){var D=$("survey"+G+"question"+B+"option"+C.value);if(D){D.removeClassName("surveyRadioChecked")}}C.value=F;E.addClassName("surveyRadioChecked");return false},addSurveyProfileToFriendlist:function(C){var B=Element.getElementsByClassName($("UserMain-actions"),"profile-action add-to-list");var A=friendlist.addToVisitor(C);if(!A){this.sendRequest("survey",{},function(D){if(typeof D.error=="undefined"){Element.remove(B[0]);Element.update($("surveyBox"),D.html)}}.bind(this))}return A},lastvisits:function(A){this.showLightBox("last-visited-profiles","lastvisits",{visitorUIN:A},{width:600,height:520,closable:true});return false},checkForAdultBlog:function(){var G=$("content");var A=$("Blog");var E=A?A.childElements():new Array();var B=E.length>1?E[1]:null;var D=B!==null?(B.id).replace(/Forum_/,""):null;var F="acceptAdult_"+D;if(G&&G.hasClassName("adultContent")&&A&&document.cookie.indexOf(F)===-1){var C='<div id="adultInfo">    <div class="msg"><span class="highlight">'+Lang.adultInfoTitle+"</span>: "+Lang.adultInfoMsg1+"</sp.<br />"+Lang.adultInfoMsg3+'</div>    <label for="adultRemember"><input type="checkbox" id="adultRemember" name="adultRemember" value="1" />'+Lang.adultInfoCheckbox+'</label>    <div class="buttons">        <a class="button button-green-big button-big" id="BlogAddPostButton_" onclick="usermain.acceptAdult(\''+D+"', ''); return false\" href=\"#\"><span>"+Lang.adultInfoIs18+'</span></a>        <a class="button button-green-big button-big" id="BlogAddPostButton_" href="/"><span>'+Lang.adultInfoNot18+"</span></a>    </div></div>";this.showLightBoxStatic("adultInfoMessage",C,{width:300,height:180},function(){$("overlay_modal").addClassName("coverPage")})}return false},acceptAdult:function(B){var A=$("adultRemember");if(A&&A.checked){var C=new Date();C.setTime(C.getTime()+(7*24*3600*1000));document.cookie="acceptAdult_"+B+"=1; path=/; expires="+C.toGMTString()}$("overlay_modal").removeClassName("coverPage");AppFramework.hideLightBox("adultInfoMessage")}});Event.onDOMReady(function(){usermain=new UserMain();usermain.checkForAdultBlog()});function setCookiePanel(A,C,D){var B=new Date();B.setTime(B.getTime()+(D*24*3600*1000));document.cookie=A+"="+escape(C)+"; path=/"+((D==null)?";":"; expires="+B.toGMTString())}function hidePanelAndSaveCookie(C,A,D,B){document.getElementById(C).style.display="none";setCookiePanel(A,D,B)}var iLeftPos=0;function moveHelpPanelElements(A,C,B,H){var E=document.getElementById(C).style;if(A=="left"){var G=0;if(self.screen){G=screen.width}else{if(self.java){var F=java.awt.Toolkit.getDefaultToolkit();var I=javakit.getScreenSize();G=I.width}}G-=100;var D=parseInt((G/B));var J=(0-((H-D)*B));if(iLeftPos>J){var K=(iLeftPos-B);E.left=K+"px";iLeftPos=K}}else{if(A=="right"){if(iLeftPos<0){var K=(iLeftPos+B);E.left=K+"px";iLeftPos=K}}}}var comicsBlog=Class.create();Object.extend(comicsBlog.prototype,AppFramework.prototype);Object.extend(comicsBlog.prototype,{rollComicsLeft:function(C,B,A){if(!$(A).hasClassName("disabled")){this.lockArrows($(A));comics=this.getComicsImg(C);comics_left=parseInt(comics.getStyle("margin-left").replace("px",""));new_left=comics_left-Math.floor(comics.getWidth()/3);if(new_left>=-(comics.getWidth()+B)){comics.setStyle({"marginLeft":new_left+"px"})}this.unlockArrows(A)}return false},rollComicsRight:function(C,B,A){if(!$(A).hasClassName("disabled")){this.lockArrows($(A));comics=this.getComicsImg(C);comics_left=parseInt(comics.getStyle("margin-left").replace("px",""));new_left=comics_left+Math.floor(comics.getWidth()/3);if(new_left<=B){comics.setStyle({"marginLeft":new_left+"px"})}this.unlockArrows(A)}return false},lockArrows:function(A){A.ancestors()[1].childElements()[1].childElements()[0].addClassName("disabled");A.ancestors()[1].childElements()[0].childElements()[0].addClassName("disabled")},unlockArrows:function(A){A.ancestors()[1].childElements()[1].childElements()[0].removeClassName("disabled");A.ancestors()[1].childElements()[0].childElements()[0].removeClassName("disabled")},getComicsImg:function(A){return $("Comics_"+A)}});Event.onDOMReady(function(){comicsblog=new comicsBlog()});var ForumFramework=Class.create();Object.extend(ForumFramework.prototype,AppFramework.prototype);Object.extend(ForumFramework.prototype,{isEditorOpened:false,savePost:function(C,A,F,B){Editor.populate("body_content");Editor.disable("body_content",true);Form.disable(C);this.prePost();var E=Form.getArray(C);var D=new Wait(C);D.show();Object.extend(E,{threadId:F,forumId:A,postId:B});this.sendRequest("savePost",E,function(H){D.hide();this.updateChildCount(F,H.count);if(H.updated){if(H.added){Element.replace("Post_"+B,H.html);$("Post_"+B).show();Element.show("Post_"+B,H.html);var G=$("Post_edit_"+B);if(G){Element.remove(G)}}else{$("Post_edit_"+B).update(H.html)}}else{if(H.added){F?this.effectNewPost(A,F,H):this.effectNewThread(A,F,H)}else{C.remove();var J=F?F:A;$(this.appid+"AddPost_"+J).update('<div id="Post_edit_'+H.id+'"> '+H.html+"</div>");var I=document.getElementsByClassName("error","Form_"+H.id);if(I.length>0){Field.select(I[0])}}}}.bind(this),function(){C.remove();D.hide();this.cancelPost(F?F:A)}.bind(this));this.isEditorOpened=false;return false},prePost:function(){},effectNewThread:function(A,C,B){new Insertion.Top($("Forum_"+A),B.html);new Effect.BlindDown($("Post_"+B.id));this.cancelPost(C?C:A,A)},effectNewPost:function(A,C,B){new Insertion.Bottom($("Forum_"+A),B.html);new Effect.BlindDown($("Post_"+B.id));this.cancelPost(C?C:A,A)},effectDelPost:function(A){new Effect.BlindUp($("Post_"+A),{afterFinish:function(){Element.replace($("Post_"+A),"")}})},addPost:function(A,B){if(!this.isEditorOpened){this.sendRequest("addNewPost",{threadId:B,forumId:A},function(C){this.addPostAction(A);var D=B?B:A;if(C.updated){Element.replace($("Post_"+C.id),C.html)}else{Element.update($(this.appid+"AddPost_"+D),'<div id="Post_edit_'+C.id+'"> '+C.html+"</div>")}Field.select(B?$("Form_"+C.id).body:$("Form_"+C.id).subject);this.isEditorOpened=true}.bind(this),function(){this.isEditorOpened=false})}else{this.alertBlockedEditor()}return false},alertBlockedEditor:function(){this.showLightBoxStatic("multieditor_alert",'<div style="margin-top : 20px; text-align : center;">'+Lang.multieditorAlert+"</div>");return false},editPost:function(A,C,B){if(!this.isEditorOpened){this.sendRequest("editPost",{threadId:C,forumId:A,postId:B},function(D){var E=C?C:A;Element.hide($("Post_"+B));new Insertion.After($("Post_"+B),'<div id="Post_edit_'+B+'"> '+D.html+"</div>");this.isEditorOpened=true}.bind(this),function(){this.isEditorOpened=false})}else{this.alertBlockedEditor()}return false},addPostAction:function(A){if($(this.appid+"AddPostButton_")){$(this.appid+"AddPostButton_").hide()}},cancelPost:function(D,A){var C=$(this.appid+"AddPost_"+D);if(C){C.update("").show();Effect.BlindUp(C,{duration:0.2,afterFinish:function(){C.update("").show()}})}var B=$("Post_edit_"+D);if(B){Element.remove(B);if($("Post_"+D)){Element.show($("Post_"+D))}}if($(this.appid+"AddPostButton_")){$(this.appid+"AddPostButton_").show()}Editor.cancel();this.isEditorOpened=false;return false},delPost:function(B,A){this.sendRequest("deletePost",{postId:B,jump:A},function(C){if(typeof C.location!="undefined"){window.location=C.location;return }this.updateChildCount(C.threadId,C.count);if(C.postDelated){this.effectDelPost(B)}}.bind(this),null,true);return false},updateChildCount:function(B,A){if(typeof A!="undefined"&&$(this.appid+"Comments_"+B)){Element.update($(this.appid+"Comments_"+B),A)}}});var Blog=Class.create();Object.extend(Blog.prototype,AppFramework.prototype);Object.extend(Blog.prototype,{appid:"Blog",isEditorOpened:false,players:new Array(),playersId:new Array(),effectNewThread:function(A,C,B){if($("BlogCounterPosts")!==null){$("BlogCounterPosts").innerHTML++}new Insertion.After($("BlogAddPost_"+A),B.html);new Effect.BlindDown($("Post_"+B.id));this.cancelPost(C?C:A)},effectNewPost:function(A,C,B){new Insertion.Before($(this.appid+"AddPost_"+C),B.html);new Effect.BlindDown($("Post_"+B.id));this.cancelPost(C?C:A)},effectDelPost:function(A){if($("BlogCounterPosts")!==null){$("BlogCounterPosts").innerHTML--}new Effect.BlindUp($("Post_"+A),{afterFinish:function(){Element.replace($("Post_"+A),"")}})},prePost:function(){Editor.populate("body_content")},videoCommercialCloudPosition:function(){var B=$("videoCommercialCloud");var A=$$("button.video")[0];var C=Position.positionedOffset(A);B.style.left=(C[0]-30)+"px";B.style.top=(C[1]-110)+"px";B.style.display="block";B.focus()},spy:function(B,A){if(A==true){this.sendRequest("spyBlog",{"spied_id":B},function(C){if(C.status==1){$("blog-spy").hide();$("blog-unspy").show()}})}else{this.sendRequest("unspyBlog",{"spied_id":B},function(C){if(C.status==1){$("blog-unspy").hide();$("blog-spy").show()}})}},savePost:function(C,A,F,B){Editor.populate("body_content");Editor.disable("body_content",true);Form.disable(C);this.prePost();var E=Form.getArray(C);var D=new Wait(C);D.show();Object.extend(E,{threadId:F,forumId:A,postId:B});this.sendRequest("savePost",E,function(H){D.hide();this.updateChildCount(F,H.count);if(H.updated){if(H.added){Element.replace("Post_"+B,H.html);$("Post_"+B).show();Element.show("Post_"+B,H.html);var G=$("Post_edit_"+B);if(G){Element.remove(G)}}else{$("Post_edit_"+B).update(H.html)}}else{if(H.added){F?this.effectNewPost(A,F,H):this.effectNewThread(A,F,H)}else{C.remove();var J=F?F:A;$(this.appid+"AddPost_"+J).update('<div id="Post_edit_'+H.id+'"> '+H.html+"</div>");var I=document.getElementsByClassName("error","Form_"+H.id);if(I.length>0){Field.select(I[0])}}}}.bind(this),function(){C.remove();D.hide();this.cancelPost(F?F:A)}.bind(this));this.isEditorOpened=false;return false},addPost:function(A,B){if(!this.isEditorOpened){this.sendRequest("addNewPost",{threadId:B,forumId:A},function(C){this.addPostAction(A);var D=B?B:A;if(C.updated){Element.replace($("Post_"+C.id),C.html)}else{Element.update($(this.appid+"AddPost_"+D),'<div id="Post_edit_'+C.id+'"> '+C.html+"</div>")}Field.select(B?$("Form_"+C.id).body:$("Form_"+C.id).subject);this.isEditorOpened=true}.bind(this),function(){this.isEditorOpened=false})}else{this.alertBlockedEditor()}return false},alertBlockedEditor:function(){this.showLightBoxStatic("multieditor_alert",'<div style="margin-top : 20px; text-align : center;">'+Lang.multieditorAlert+"</div>");return false},editPost:function(A,C,B){if(!this.isEditorOpened){this.sendRequest("editPost",{threadId:C,forumId:A,postId:B},function(D){var E=C?C:A;Element.hide($("Post_"+B));new Insertion.After($("Post_"+B),'<div id="Post_edit_'+B+'"> '+D.html+"</div>");this.isEditorOpened=true}.bind(this),function(){this.isEditorOpened=false})}else{this.alertBlockedEditor()}return false},addPostAction:function(A){if($(this.appid+"AddPostButton_")){$(this.appid+"AddPostButton_").hide()}},cancelPost:function(D,A){var C=$(this.appid+"AddPost_"+D);if(C){C.update("").show();Effect.BlindUp(C,{duration:0.2,afterFinish:function(){C.update("").show()}})}var B=$("Post_edit_"+D);if(B){Element.remove(B);if($("Post_"+D)){Element.show($("Post_"+D))}}if($(this.appid+"AddPostButton_")){$(this.appid+"AddPostButton_").show()}Editor.cancel();this.isEditorOpened=false;return false},delPost:function(B,A){this.sendRequest("deletePost",{postId:B,jump:A},function(C){if(typeof C.location!="undefined"){window.location=C.location;return }this.updateChildCount(C.threadId,C.count);if(C.postDelated){this.effectDelPost(B)}}.bind(this),null,true);return false},updateChildCount:function(B,A){if(typeof A!="undefined"&&$(this.appid+"Comments_"+B)){Element.update($(this.appid+"Comments_"+B),A)}},startPlayer:function(J,E,A,I,H,G,D){if(!$(H)){return }requiredFlashVersion="7";var F=new SWFObject(J,"mediaplayer_"+H,A,I,requiredFlashVersion);F.addVariable("enablejs","true");F.addVariable("displayheight",0);F.addVariable("width",A);F.addVariable("height",I);F.addVariable("file",E);F.addVariable("lightcolor",D);F.addVariable("frontcolor",G);F.addParam("menu","false");F.addParam("wmode","transparent");F.addParam("allowfullscreen","false");var C="return blog.stopOtherPlayers('"+H+"');";F.addParam("onclick",C);F.write(H);var B=this.playersId.length;this.playersId[B]="mediaplayer_"+H;return false},stopOtherPlayers:function(C){var A="mediaplayer_"+C;var B=this.playersId.length;if(B>0){for(var E=0;E<B;E++){if(this.playersId[E]!=A){var D=$(this.playersId[E]);if(D&&typeof D.sendEvent=="function"){D.sendEvent("stop")}}}}var G=$("mediaplayer_naglosPlayer");if(G&&typeof G.sendEvent=="function"){G.sendEvent("stop")}var F=$("mediaplayer_mPlayer");if(F&&typeof F.sendEvent=="function"){F.sendEvent("stop")}return false},generateMap:function(H,F,G,K,J,A,E,I){var B=document.getElementById(H);var L=new GMap2(B);L.addControl(new GLargeMapControl());L.addControl(new GMapTypeControl());L.addControl(new GScaleControl());L.enableScrollWheelZoom();L.enableContinuousZoom();L.setCenter(new GLatLng(F,G));L.setZoom(K);if(J>0){L.addControl(new GOverviewMapControl())}if(A==0){L.setMapType(G_NORMAL_MAP)}else{if(A==1){L.setMapType(G_SATELLITE_MAP)}else{if(A==2){L.setMapType(G_HYBRID_MAP)}else{if(A==3){L.setMapType(G_PHYSICAL_MAP)}}}}var D=new GIcon(G_DEFAULT_ICON);D.image=E;var C=new GMarker(new GLatLng(F,G),{icon:D});C.bindInfoWindowHtml('<iframe src="'+I+' " border="0" style="width: 300px;height:100px;border: none;" ></iframe>');L.addOverlay(C)},showMap:function(B,A){this.showLightBox("map"+B,"viewMap",{threadId:B,serviceId:A},{width:526,height:454},blog.generateMapCallback);return false},generateMapCallback:function(A){blog.generateMap(A.divId,A.lat,A.lng,A.zoom,A.overview,A.mapType,A.iconURL,A.textURL)},settings:function(A){this.showLightBox("blogSettings"+A,"getSettings",{blogId:A},{width:300,height:220},null,null)},saveSettings:function(B){var C=$("blogType");var A=$("showImages");var D=A?A.checked:true;var E=C?C.checked:false;this.sendRequest("saveSettings",{blogId:B,adultContent:E,showImages:D},function(F){AppFramework.hideLightBox("blogSettings"+B)}.bind(this),function(){})},cancelSave:function(A){AppFramework.hideLightBox(A);return false}});blog=new Blog();var Cloud=Class.create();Object.extend(Cloud.prototype,AppFramework.prototype);Object.extend(Cloud.prototype,{appid:"Cloud",save:function(){$("Cloud_editForm").disable();var A=$("Cloud_content2").value;this.sendRequest("set",{"content":A},function(B){if(typeof $("Cloud_content").textContent!=="undefined"){$("Cloud_content").textContent=B.value||""}else{$("Cloud_content").innerText=B.value||""}this.edit();if(typeof B.msg=="undefined"){new Effect.Highlight($("Cloud_view"),{duration:1})}if(B.value.length>50){$("Cloud_content").addClassName("small")}else{$("Cloud_content").removeClassName("small")}$("Cloud_editForm").enable()}.bind(this),function(B){this.cancel();$("Cloud_editForm").enable()}.bind(this));return false},edit:function(B){B=B||true;B&&($("Cloud_content2").value=$("Cloud_content").innerText||$("Cloud_content").textContent);$("Cloud_view").toggle();$("Cloud_edit").toggle();$("Cloud_buttons").toggle();$("Cloud_visibityLayer").hide();try{$("Cloud_content2").focus()}catch(A){}return false},cancel:function(){return this.edit(false);$("Cloud_view").show();$("Cloud_buttons").show()},currentVisibility:null,setVisibility:function(){var A=$("Cloud_visibility");this.sendRequest("setVisibility",{"visibility":A.options[A.selectedIndex].value},function(B){this.toggleVisibilityEdit();new Effect.Highlight($("Cloud_view"),{duration:1})}.bind(this),function(B){A.selectedIndex=this.currentVisibility;this.toggleVisibilityEdit()}.bind(this));return false},showVisibilityEdit:function(){var A=$("Cloud_visibility");this.currentVisibility=A.selectedIndex;this.toggleVisibilityEdit()},toggleVisibilityEdit:function(){Element.toggle($("Cloud_visibityLayer"));Element.toggle($("Cloud_editBtn"));Element.toggle($("Cloud_visibilityBtn"));$("Cloud_buttons").toggle();return false}});Event.onDOMReady(function(){cloud=new Cloud()});var Calendar=Class.create();Object.extend(Calendar.prototype,AppFramework.prototype);Object.extend(Calendar.prototype,{appid:"Calendar",startAutoSuggest:function(){new AutoSuggest("place","placeSuggest",{appid:"Calendar",action:"getPlacesForPrefix",minChars:2})},input:function(A){},jump:function(D,A){var B="calW"+D;var C=$(D);if(C){C.value=A;if(C.id=="start"){this.updateHour()}if($(B).hasClassName("calWhidden")){this.hide("calW"+D)}else{this.showMyEvents(A)}}},initializeCalWidget:function(A){},showMyEvents:function(A){this.sendRequest("showMyEvents",{date:A},function(B){Element.update($("CalendarData"),B.html)});return false},spy:function(B,A){if(A==true){this.sendRequest("spyEvent",{"spied_id":B},function(C){if(C.status==1){$("calendar-spy").hide();$("calendar-unspy").show()}})}else{this.sendRequest("unspyEvent",{"spied_id":B},function(C){if(C.status==1){$("calendar-unspy").hide();$("calendar-spy").show()}})}}});Event.onDOMReady(function(){calendar=new Calendar()});var Countdown=Class.create();Object.extend(Countdown.prototype,AppFramework.prototype);Object.extend(Countdown.prototype,{appid:"Countdown",countdownIssueDialog:null,initialize:function(){},addIssue:function(B){var E=$("issueDescriptionId").value;var A=document.forms["addIssueForm"].elements["IssueDateDay"].value;var F=document.forms["addIssueForm"].elements["IssueDateMonth"].value;var C=document.forms["addIssueForm"].elements["IssueDateYear"].value;var D=document.forms["addIssueForm"].elements["isPublic"];var H=document.forms["addIssueForm"].elements["myGen"].value;if(H==1){D=D[0].checked}else{D=true}var G=C+"-"+F+"-"+A;this.sendRequest("addIssue",{"issueDescription":E,"issueDate":G,"isPublic":D,"myGen":H},function(I){$("issueDescriptionId").removeClassName("error");if(I.result==true){Element.update("issueListBox",I.html);new Effect.Highlight("countdownList",{duration:1});$("issueDescriptionId").value="";if(H==1){this.hideAddIssueDialog_MyGen(B)}else{this.hideAddIssueDialog()}}else{if(I.errors!="undefined"){I.errors.each(function(J){$(J+"Id").addClassName("error");$(J+"Error").style.display="block"})}}}.bind(this));return false},remove:function(B,A){this.sendRequest("remove",{"link":B,"mygen":A},function(C){if(C.result==true){Element.update("issueListBox",C.html);new Effect.Highlight("countdownList",{duration:1})}else{alert("blad usuwania")}}.bind(this),null,true);return false},showAddIssueDialog:function(A){if(this.editmode){return }this.sendRequest("showAddIssueDialog",{"MyGen":A},function(B){this.editmode=true;Element.update("IssuesList_add",B.html);$("CountDownIssueAddButtonId").hide()}.bind(this));return false},hideAddIssueDialog_MyGen:function(A){this.editmode=false;mygen.config(A);return false},hideAddIssueDialog:function(){this.editmode=false;$("CountDownIssueAddButtonId").show();Element.update($("IssuesList_add"),"");return false}});countdown=new Countdown();var FriendList=Class.create();Object.extend(FriendList.prototype,AppFramework.prototype);Object.extend(FriendList.prototype,{appid:"FriendList",showingAll:false,scrollSpeed:240,currentVisibility:null,showBig:function(){$("FriendList").addClassName("friendlist-big")},showAdd:function(){this.showLightBox("FriendList_showAdd","showAdd",{},{width:230,height:100});return false},toggleAddInput:function(A,B){this.currentVisibility=$("FriendList_visibility").selectedIndex;var E=$(A);var D=$(B);E.style.display=E.style.display=="block"?"none":"block";D.style.display=D.style.display=="none"?"block":"none";try{$("FriendList_uin").focus()}catch(C){}return false},cancelAddingNewFriend:function(C,A,B){var B=$(B);$("FriendList_visibility").selectedIndex=this.currentVisibility;this.toggleAddInput(C,A);B.value="";Element.hide($("FriendList_error"));$("FriendList_uin").removeClassName("error")},add:function(B,A,D){var C=$("FriendList_uin").value;Form.disable(D);this.sendRequest("add",{"uin":C,"showingAll":(FriendList.showingAll?1:0)},function(F){Form.enable(D);if(typeof F.error=="undefined"){var E=$("FriendList_list");Element.update($("FriendList_count"),F.result);(F.result>0)&&Element.removeClassName($("FriendList_viewAll"),"hidden");$("FriendList_list_scroll").update(F.html).style.top="0px";Element.hide($("FriendList_error"));$("FriendList_uin").removeClassName("error");this.toggleAddInput(B,A);$("FriendList_uin").value="";$("FriendList_error").style.display="none";new Effect.Highlight($("FriendList_list"),{duration:1});return }$("FriendList_error").innerHTML=F.error;Element.show($("FriendList_error"));$("FriendList_uin").addClassName("error");$("FriendList_uin").focus()}.bind(this),function(){Form.enable(D);this.cancelAddingNewFriend(B,A,"FriendList_uin")}.bind(this));return false},addLite:function(B,A){this.sendRequest("addToVisitor",{"userUin":A},function(C){if(C.result==1){Element.removeClassName(B.parentNode,"tuser-menu-02");Element.addClassName(B.parentNode,"tuser-menu-02-inactive");this.showLightBoxStatic("FriendList_lightbox",C.msg+this.getWinCloseButton("FriendList_lightbox"));return }this.showLightBoxStatic("FriendList_lightbox",C.msg+this.getWinCloseButton("FriendList_lightbox"))}.bind(this));return false},addToVisitor:function(A){this.sendRequest("addToVisitor",{},function(B){if(typeof B.result!="undefined"&&B.result==1){Element.remove(A);this.showLightBoxStatic("FriendList_lightbox",B.msg+this.getWinCloseButton("FriendList_lightbox"));return }if(typeof B.msg!="undefined"){this.showLightBoxStatic("FriendList_lightbox",B.msg+this.getWinCloseButton("FriendList_lightbox"))}}.bind(this));return false},cancel:function(){AppFramework.hideLightBox("FriendList_showAdd");return false},setVisibility:function(D,B,E){var A=$("FriendList_visibility"),C=A.value;Form.disable(E);this.sendRequest("setVisibility",{"visibility":C,"showingAll":(FriendList.showingAll?1:0)},function(F){Form.enable(E);this.toggleAddInput(D,B)}.bind(this),function(F){Form.enable(E);A.selectedIndex=this.currentVisibility;this.toggleAddInput(D,B)}.bind(this));return false},remove:function(C,B,A){this.sendRequest("remove",{"uin":B,"showingAll":(FriendList.showingAll?1:0),"type":A},function(D){if(D.html!=-1){if(FriendList.showingAll){Element.update($("FriendList_count"),D.html);(D.html==0)&&Element.addClassName($("FriendList_viewAll"),"hidden");while(C){C=C.parentNode;if(C.tagName.toLowerCase()=="div"){break}}Element.remove(C);new Effect.Highlight($("FriendList_list"),{duration:1});return }Element.update($("FriendList"),D.html);new Effect.Highlight($("FriendList_list"),{duration:1})}}.bind(this));return false},setSimpleScroller:function(){this.createScroller(false,"top");this.scroller.options.action="viewPacketSimple";return false}});friendlist=new FriendList();"";var Favorites=Class.create();Object.extend(Favorites.prototype,AppFramework.prototype);Object.extend(Favorites.prototype,{appid:"Favorites",editmode:false,initialize:function(){},showNewCategoryField:function(D){var A=$("categoryId");var B=$("newCategoryNameId");var C=A.options[A.selectedIndex].value;if(C==-1){$(D).style.display="block";B.focus()}else{$(D).style.display="none";B.value=""}},removeCategory:function(B){var A=new Wait($("FavoriteList_list"));A.show();this.sendRequest("removeCategory",{"catLink":B},function(C){if(C.result==true){Element.update("FavoriteList_list",C.html);new Effect.Highlight("FavouriteList")}else{alert("blad usuwania")}A.hide()}.bind(this),function(){A.hide()},true);return false},remove:function(B,A){this.sendRequest("remove",{"link":A},function(C){if(C.result==true){Element.update($("FavoriteList_list"),C.html);new Effect.Highlight("FavouriteList",{duration:1})}else{alert("removal error")}}.bind(this),null,true);return false},addURL:function(){var B=$("urlId").value;var E=$("titleId").value;var A=$("categoryId");var D=A.options[A.selectedIndex].value;var C=$("newCategoryNameId").value;this.sendRequest("add",{"url":B,"title":E,"categoryId":D,"newCategory":C},function(F){$("urlId").removeClassName("error");$("titleId").removeClassName("error");$("urlError").style.display="none";$("titleError").style.display="none";$("categoryError").style.display="none";if(F.result==true){Element.update("FavoriteList_list",F.html);new Effect.Highlight("FavouriteList",{duration:1});this.hideURLDialog()}else{if(F.errors!="undefined"){F.errors.each(function(G){$(G+"Id").addClassName("error");$(G+"Error").style.display=""})}}}.bind(this));return false},showURLDialog:function(){if(this.editmode){return }this.sendRequest("showUrlDialog",{},function(A){this.editmode=true;Element.update($("FavouriteList_add"),A.html);$("addFavoriteButtonId").hide()}.bind(this));return false},hideURLDialog:function(){this.editmode=false;$("addFavoriteButtonId").show();Element.update($("FavouriteList_add"),"");return false}});favorites=new Favorites();if(typeof deconcept=="undefined"){var deconcept=new Object()}if(typeof deconcept.util=="undefined"){deconcept.util=new Object()}if(typeof deconcept.SWFObjectUtil=="undefined"){deconcept.SWFObjectUtil=new Object()}deconcept.SWFObject=function(K,B,L,D,H,I,F,E,C,J){if(!document.getElementById){return }this.DETECT_KEY=J?J:"detectflash";this.skipDetect=deconcept.util.getRequestParameter(this.DETECT_KEY);this.params=new Object();this.variables=new Object();this.attributes=new Array();if(K){this.setAttribute("swf",K)}if(B){this.setAttribute("id",B)}if(L){this.setAttribute("width",L)}if(D){this.setAttribute("height",D)}if(H){this.setAttribute("version",new deconcept.PlayerVersion(H.toString().split(".")))}this.installedVer=deconcept.SWFObjectUtil.getPlayerVersion();if(!window.opera&&document.all&&this.installedVer.major>7){deconcept.SWFObject.doPrepUnload=true}if(I){this.addParam("bgcolor",I)}var A=F?F:"high";this.addParam("quality",A);this.setAttribute("useExpressInstall",false);this.setAttribute("doExpressInstall",false);var G=(E)?E:window.location;this.setAttribute("xiRedirectUrl",G);this.setAttribute("redirectUrl","");if(C){this.setAttribute("redirectUrl",C)}};deconcept.SWFObject.prototype={useExpressInstall:function(A){this.xiSWFPath=!A?"expressinstall.swf":A;this.setAttribute("useExpressInstall",true)},setAttribute:function(A,B){this.attributes[A]=B},getAttribute:function(A){return this.attributes[A]},addParam:function(B,A){this.params[B]=A},getParams:function(){return this.params},addVariable:function(B,A){this.variables[B]=A},getVariable:function(A){return this.variables[A]},getVariables:function(){return this.variables},getVariablePairs:function(){var C=new Array();var B;var A=this.getVariables();for(B in A){C[C.length]=B+"="+A[B]}return C},getSWFHTML:function(){var B="";if(navigator.plugins&&navigator.mimeTypes&&navigator.mimeTypes.length){if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","PlugIn");this.setAttribute("swf",this.xiSWFPath)}B='<embed type="application/x-shockwave-flash" src="'+this.getAttribute("swf")+'" width="'+this.getAttribute("width")+'" height="'+this.getAttribute("height")+'" style="'+this.getAttribute("style")+'"';B+=' id="'+this.getAttribute("id")+'" name="'+this.getAttribute("id")+'" ';var F=this.getParams();for(var E in F){B+=[E]+'="'+F[E]+'" '}var D=this.getVariablePairs().join("&");if(D.length>0){B+='flashvars="'+D+'"'}B+="/>"}else{if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","ActiveX");this.setAttribute("swf",this.xiSWFPath)}B='<object id="'+this.getAttribute("id")+'" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="'+this.getAttribute("width")+'" height="'+this.getAttribute("height")+'" style="'+this.getAttribute("style")+'">';B+='<param name="movie" value="'+this.getAttribute("swf")+'" />';var C=this.getParams();for(var E in C){B+='<param name="'+E+'" value="'+C[E]+'" />'}var A=this.getVariablePairs().join("&");if(A.length>0){B+='<param name="flashvars" value="'+A+'" />'}B+="</object>"}return B},write:function(B){if(this.getAttribute("useExpressInstall")){var A=new deconcept.PlayerVersion([6,0,65]);if(this.installedVer.versionIsValid(A)&&!this.installedVer.versionIsValid(this.getAttribute("version"))){this.setAttribute("doExpressInstall",true);this.addVariable("MMredirectURL",escape(this.getAttribute("xiRedirectUrl")));document.title=document.title.slice(0,47)+" - Flash Player Installation";this.addVariable("MMdoctitle",document.title)}}if(this.skipDetect||this.getAttribute("doExpressInstall")||this.installedVer.versionIsValid(this.getAttribute("version"))){var C=(typeof B=="string")?document.getElementById(B):B;C.innerHTML=this.getSWFHTML();return true}else{if(this.getAttribute("redirectUrl")!=""){document.location.replace(this.getAttribute("redirectUrl"))}}return false}};deconcept.SWFObjectUtil.getPlayerVersion=function(){var E=new deconcept.PlayerVersion([0,0,0]);if(navigator.plugins&&navigator.mimeTypes.length){var A=navigator.plugins["Shockwave Flash"];if(A&&A.description){E=new deconcept.PlayerVersion(A.description.replace(/([a-zA-Z]|\s)+/,"").replace(/(\s+r|\s+b[0-9]+)/,".").split("."))}}else{if(navigator.userAgent&&navigator.userAgent.indexOf("Windows CE")>=0){var B=1;var C=3;while(B){try{C++;B=new ActiveXObject("ShockwaveFlash.ShockwaveFlash."+C);E=new deconcept.PlayerVersion([C,0,0])}catch(D){B=null}}}else{try{var B=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7")}catch(D){try{var B=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");E=new deconcept.PlayerVersion([6,0,21]);B.AllowScriptAccess="always"}catch(D){if(E.major==6){return E}}try{B=new ActiveXObject("ShockwaveFlash.ShockwaveFlash")}catch(D){}}if(B!=null){E=new deconcept.PlayerVersion(B.GetVariable("$version").split(" ")[1].split(","))}}}return E};deconcept.PlayerVersion=function(A){this.major=A[0]!=null?parseInt(A[0]):0;this.minor=A[1]!=null?parseInt(A[1]):0;this.rev=A[2]!=null?parseInt(A[2]):0};deconcept.PlayerVersion.prototype.versionIsValid=function(A){if(this.major<A.major){return false}if(this.major>A.major){return true}if(this.minor<A.minor){return false}if(this.minor>A.minor){return true}if(this.rev<A.rev){return false}return true};deconcept.util={getRequestParameter:function(C){var D=document.location.search||document.location.hash;if(C==null){return D}if(D){var B=D.substring(1).split("&");for(var A=0;A<B.length;A++){if(B[A].substring(0,B[A].indexOf("="))==C){return B[A].substring((B[A].indexOf("=")+1))}}}return""}};deconcept.SWFObjectUtil.cleanupSWFs=function(){var B=document.getElementsByTagName("OBJECT");for(var C=B.length-1;C>=0;C--){B[C].style.display="none";for(var A in B[C]){if(typeof B[C][A]=="function"){B[C][A]=function(){}}}}};if(deconcept.SWFObject.doPrepUnload){if(!deconcept.unloadSet){deconcept.SWFObjectUtil.prepUnload=function(){__flash_unloadHandler=function(){};__flash_savedUnloadHandler=function(){};window.attachEvent("onunload",deconcept.SWFObjectUtil.cleanupSWFs)};window.attachEvent("onbeforeunload",deconcept.SWFObjectUtil.prepUnload);deconcept.unloadSet=true}}if(!document.getElementById&&document.all){document.getElementById=function(A){return document.all[A]}}var getQueryParamValue=deconcept.util.getRequestParameter;var FlashObject=deconcept.SWFObject;var SWFObject=deconcept.SWFObject;var GaduMusic=Class.create();Object.extend(GaduMusic.prototype,AppFramework.prototype);Object.extend(GaduMusic.prototype,{appid:"GaduMusic",formHTML:"",mediaPlayer:null,defaultPlayerDiv:"mPlayer",defaultPlayerDivTtitle:"mPlayer-title",defaultPlayerDivContainer:"mPlayer-container",defaultWidth:240,defaultHeight:19,defaultDisplayHeight:0,playerJustLoaded:false,playerInProfile:false,beforeShowLightBox:function(){if(this.mediaPlayer!=null){var A=$(this.defaultPlayerDiv);if(!this.playerJustLoaded){this.playerStop()}A.hide()}},afterHideLightBox:function(){if(this.mediaPlayer!=null){var A=$(this.defaultPlayerDiv);A.show()}},startPlayer:function(B,G,F,C,E,A){E=E?E:this.defaultWidth;if(!$(A)){return }requiredFlashVersion="7";var D=new SWFObject(B,"mediaplayer_"+A,this.defaultWidth,this.defaultHeight,requiredFlashVersion);D.addVariable("enablejs","true");D.addVariable("displayheight",this.defaultDisplayHeight);D.addVariable("width",E);D.addVariable("file",G);D.addVariable("height",this.defaultHeight);D.addVariable("lightcolor","0xff9600");D.addVariable("frontcolor","0xfeef00");D.addVariable("title",F);D.addParam("bgcolor","");D.addParam("menu","false");D.addParam("wmode","transparent");D.addParam("allowfullscreen","false");if(C==1){D.addVariable("autostart","true")}if(F!="null"){this.playerSetTitle(F)}else{this.playerJustLoaded=true}this.playerInProfile=false;D.write(A);this.mediaPlayer=$("mediaplayer_"+A);return false},startProfilePlayer:function(G,H,D,B,C,A,F){if(!$(B)){return }F=F?F:this.defaultWidth;requiredFlashVersion="7";var E=new SWFObject(G,"mediaplayer_"+B,240,this.defaultHeight,requiredFlashVersion);E.addVariable("height",this.defaultHeight);E.addVariable("width",F);E.addVariable("enablejs","true");E.addVariable("lightcolor",A);E.addVariable("frontcolor",C);E.addVariable("displayheight",this.defaultDisplayHeight);E.addVariable("file",H);E.addVariable("javascriptid","mediaplayer_"+B);E.addParam("menu","false");E.addParam("wmode","transparent");E.addParam("allowfullscreen","false");if(D==1){E.addVariable("autostart","true")}this.playerInProfile=true;E.write(B);this.mediaPlayer=$("mediaplayer_"+B);return false},showinfo:function(){return this.mediaPlayer;return false},playerPlayPause:function(){if(this.mediaPlayer==null){return false}this.mediaPlayer.sendEvent("playpause");return false},playerStop:function(){if(this.mediaPlayer==null){return false}this.mediaPlayer.sendEvent("stop");return false},playerNextItem:function(){if(this.mediaPlayer==null){return false}this.mediaPlayer.sendEvent("next");return false},playerPlayItem:function(A){if(this.mediaPlayer==null){return false}this.mediaPlayer.sendEvent("playitem",(A-1));return false},playerPreviousItem:function(){if(this.mediaPlayer==null){return false}this.mediaPlayer.sendEvent("prev");return false},playerLoadItem:function(A,B){if(this.mediaPlayer==null){return false}this.mediaPlayer.loadFile({file:A,title:B});if(!this.playerInProfile){this.playerSetTitle(B)}this.playerJustLoaded=false;this.mediaPlayer.sendEvent("playpause");return false},playerSetTitle:function(A){$(this.defaultPlayerDivTtitle).update(A);return false},playerAddItem:function(A,B){if(this.mediaPlayer==null){return false}this.mediaPlayer.addItem({file:A,title:B});return false},playerRemoveItem:function(A){if(this.mediaPlayer==null){return false}this.mediaPlayer.removeItem(A-1);return false}});Event.onDOMReady(function(){gadumusic=new GaduMusic()});var Groups20=Class.create();Object.extend(Groups20.prototype,AppFramework.prototype);Object.extend(Groups20.prototype,{appid:"Groups20"});var groups20=new Groups20();var Shoutbox=Class.create();Object.extend(Shoutbox.prototype,AppFramework.prototype);Object.extend(Shoutbox.prototype,{appid:"Shoutbox",editmode:false,add:function(){Editor.populate("Shoutbox_content");Editor.disable("Shoutbox_content",true);var A=$("Shoutbox_content").value;this.sendRequest("add",{"content":A},function(B){if(typeof B.error=="undefined"){this.editmode=false;Editor.populate("Shoutbox_content",true);Element.remove($("Shoutbox_content").form);if(ownerUIN!=112){B.count++}Element.update($("Shoutbox_count"),B.count);new Insertion.Top($("shoutbox-list-content"),B.html);new Effect.Highlight($("shoutbox-list-content").getElementsByTagName("div")[0],{duration:1})}else{Element.update($("Shoutbox_error"),B.errorMsg);Element.show($("Shoutbox_error"));Editor.disable("Shoutbox_content",false);return false}}.bind(this));return false},showAdd:function(){if(this.editmode){return false}this.sendRequest("showAdd",{},function(A){new Insertion.Top($("shoutbox-list-content"),A.html);this.editmode=true}.bind(this));return false},cancel:function(){Element.remove($("shoutbox-list-content").getElementsByTagName("form")[0]);this.editmode=false;return false},viewAll:function(A){this.sendRequest("viewAll",{},function(C){var B=$("Shoutbox_list");Element.addClassName(B,"scroll");window.setTimeout(function(){Element.update(B,C.html)},0);Element.remove($("Shoutbox_viewAll"));Shoutbox.showingAll=true}.bind(this));return false},remove:function(A,B){this.sendRequest("remove",{"id":B},function(C){if(C.result!=0){if(ownerUIN!=112){C.count++}Element.update($("Shoutbox_count"),C.count);Element.update($("Shoutbox_list"),C.html);new Effect.Highlight($("shoutbox-list-content"),{duration:1})}}.bind(this),null,true);return false}});shoutbox=new Shoutbox();var Profile=Class.create();Object.extend(Profile.prototype,AppFramework.prototype);Object.extend(Profile.prototype,{appid:"Profile",editMode:false,uin:0,lastPicture:null,wait:null,forceAvatarReload:false,selectedAvatarNum:null,initialize:function(){this.initializeGroups()},initializeGroups:function(){if(!$("ProfileForm")){return }var A=document.getElementsByName("priv_group");for(var B=0;B<A.length;B++){Event.observe(A[B],"change",function(E){var D=this.parentNode.parentNode.getElementsByTagName("input");for(var C=0;C<D.length;C++){if(D[C].name.match(/_priv/)){D[C].value=this.options[this.selectedIndex].value}}})}},avatarUploadStart:function(A){setTimeout(function(){try{Form.disable(A)}catch(B){}},10);$("busyIndicator").show();this.wait=new Wait("avatarUploadWindow");this.wait.show();return true},avatarUploadFinished:function(B){var A;this.getIFramePage(B,function(C){$("busyIndicator").hide();this.wait.hide();if(C.result==this.RESPONSE_RESULT_OK){AppFramework.hideLightBox("avatarDialog");Element.update($("uploadAvatarField"),"");Element.update($("avatarGallery"),C.html)}else{Element.update($("avatarDialog_content"),C.html)}}.bind(this),function(){this.wait.hide();AppFramework.hideLightBox("avatarDialog");$("busyIndicator").hide()}.bind(this))},avatarDelete:function(A){this.sendRequest("deleteAvatar",{avatarNumber:A},function(B){if(B.src){this.forceAvatarReload=true;$("upload-avatar-"+A).getElementsBySelector("img")[0]["src"]=B.src;$("delete-avatar-"+A).addClassName("inactive-delete")}}.bind(this));return false},avatarUploadField:function(){this.forceAvatarReload=false;this.showLightBox("avatarDialog","viewAvatarUpload",{},{width:540,height:375})},startAutoSuggest:function(){new AutoSuggest("bandTags","tagsSuggest",{appid:"Profile",action:"viewGenreList",minChars:2,tokens:" "})},changeType:function(B){var A;if(B){A={isArtist:1}}else{A={isArtist:0}}this.sendRequest("editOnRun",A,function(C){Element.update($("editProfile_content"),C.html)})},editButton:function(B){if(!B){var A=new Wait($("profile_data"));A.show();this.showLightBox("editProfile","edit",{},{width:580,height:475,overflow:"hidden"},function(D){this.startAutoSuggest();A.hide()}.bind(this),function(){A.hide()}.bind(this))}else{var A=new Wait($("editProfile_content"));A.show();var C=Form.getArray($("ProfileForm"));Form.disable($("ProfileForm"));this.sendRequest("save",C,function(D){if(D.location){window.location=D.location;return false}A.hide();if(D.editMode){Element.update($("editProfile_content"),D.html)}else{Element.update($("MainProfile"),D.html);AppFramework.hideLightBox("editProfile")}}.bind(this))}},cancelButton:function(){AppFramework.hideLightBox("editProfile")},addFieldButton:function(){this.sendRequest("addFieldOther",{},function(A){var B=document.createElement("div");$("ProfileOther").appendChild(B);Element.update(B,A.html)})},delField:function(A){Element.hide($("other_field_"+A));$("other_del["+A+"]").value=1},cancelAvatarUpload:function(){if(this.forceAvatarReload){var A=$("avatarUploadForm");A.reset();this.avatarUploadStart(A);A.submit()}else{AppFramework.hideLightBox("avatarDialog")}return false},changeImage:function(C,A){for(var B=0;B<3;B++){Element.removeClassName($("small-avatar-"+B),"active-avatar")}Element.addClassName($(A),"active-avatar");Element.replace($("mainProfileImage"),C);return false},requireUpdate:function(){this.showLightBox("requireUpdate","viewRequireUpdate",{},{width:550,height:395,closable:false},function(){$("nickId").focus()})},noProfile:function(){this.showLightBox("noProfileInfo","showNoProfileInfo",{},{width:400,height:120})},closeNoDataWin:function(){AppFramework.hideLightBox("noProfileInfo")},submitUpdate:function(A){Form.disable(A);var B=Form.getArray(A);this.sendRequest("submitRequireUpdate",B,function(C){if(C.result==true){location.reload(true)}else{Element.update("requireUpdate_content",C.html)}}.bind(this));return false},firstAvatarUploadStart:function(){this.requireUpdateWaitShow();$("avatarUploadForm").submit()},firstAvatarUploadFinished:function(A){this.getIFramePage(A,function(B){this.requireUpdateWaitHide();if(B&&B.result==this.RESPONSE_ALL_OK){$("avatarImg0").src=B.avarat_1_src}}.bind(this),function(){this.requireUpdateWaitHide()}.bind(this))},changePriv:function(A){var B=$(A.name).getElementsByTagName("INPUT");var C=Form.Element.getValue(A);$A(B).each(function(D){if(D.type=="hidden"){D.value=C}})},requireUpdateWait:null,requireUpdateWaitShow:function(){this.requireUpdateWait=new Wait($("requireUpdate"));this.requireUpdateWait.show()},requireUpdateWaitHide:function(){if(this.requireUpdateWait){this.requireUpdateWait.hide()}this.requireUpdateWait=null},fold_down:function(A){$(A).show();$(A+"_down").hide();$(A+"_up").show()},fold_up:function(A){$(A).hide();$(A+"_up").hide();$(A+"_down").show()},searchByTag:function(){var A=$("profile-search-by-tag");A.submit()},spyBand:function(B,A){if(A==true){this.sendRequest("spyBand",{"spied_id":B},function(C){if(C.status==1){$("profile-spy").hide();$("profile-unspy").show()}})}else{this.sendRequest("unspyBand",{"spied_id":B},function(C){if(C.status==1){$("profile-unspy").hide();$("profile-spy").show()}})}},showAlert:function(C,B,A){this.showLightBoxStatic("alert",'<div class="alert">'+C+"</div>"+this.getWinCloseButton("alert"),{width:B,height:A})},showSystemAvatars:function(A){if(this.selectedAvatarNum!=null){this.cancelSelectSystemAvatar(this.selectedAvatarNum)}$("systemAvatarsBox"+A).show();this.selectedAvatarNum=A},cancelSelectSystemAvatar:function(A){$("systemAvatarsBox"+A).hide()},selectSystemAvatar:function(A){$("sysAvatarImage"+this.selectedAvatarNum).value=A;$("systemAvatarsBox"+this.selectedAvatarNum).hide();$("avatarImage"+this.selectedAvatarNum).disabled="disabled";$("upload-avatar-"+this.selectedAvatarNum).getElementsByTagName("img")[0].src=$("ava"+this.selectedAvatarNum+"sys"+A).src}});Event.onDOMReady(function(){user_profile=new Profile()});if(window.ActiveXObject){window.ie=window[window.XMLHttpRequest?"ie7":"ie6"]=true}var UploaderBase=Class.create();UploaderBase.uploaders=[];UploaderBase.fixed=false;UploaderBase.register=function(A){UploaderBase.uploaders.push(A);A.myIndex=UploaderBase.uploaders.length-1};UploaderBase.fixIe=function(){UploaderBase.fixed=true;Event.observe(window,"beforeunload",function(){__flash_unloadHandler=__flash_savedUnloadHandler=Prototype.emptyFunction});if(!window.ie){return }Event.observe(window,"unload",function(){var C=document.getElementsByTagName("object");for(var A=0,D=C.length;A<D;A++){C[A].style.display="none";for(var B in C[A]){if(typeof C[A][B]=="function"){C[A][B]=Prototype.emtyFunction}}}})};Object.extend(UploaderBase.prototype,{MAXFILESCOUNT:10,flashPath:"/img/SWFUpload.swf",options:{postActionURL:"",allowedFileSize:30720,allowedFileTypes:"*.*",allowedFileTypesDescription:"All files..."},formDiv:"",onUploadStart:Prototype.emptyFunction,onUploadCompleted:Prototype.emptyFunction,onUploadCanceled:Prototype.emptyFunction,onUploadError:Prototype.emptyFunction,initialize:function(D){for(var B in D){this.options[B]=D[B]}if(window.ie){try{document.execCommand("BackgroundImageCache",false,true)}catch(E){}}this.loaded=false;var C=navigator.userAgent.toLowerCase();if(C.indexOf("linux")!=-1){return false}this.flashMovieName="SWFUpload_"+(UploaderBase.uploaders.length);UploaderBase.register(this);this.totalBytes=0;this.totalFiles=0;this.tempAllBytes=0;this.fileCompleted=1;this.isUploading=false;var A="UploaderBase.uploaders["+this.myIndex+"].";this.flash_options={uploadScript:this.options.postActionURL,allowedFiletypesDescription:this.options.allowedFileTypesDescription,flashLoadedCallback:A+"flashLoaded",uploadFileQueuedCallback:A+"swfFileQueued",uploadFileStartCallback:A+"swfFileStart",uploadProgressCallback:A+"swfProgress",uploadFileCompleteCallback:A+"swfFileComplete",uploadQueueCompleteCallback:A+"swfQueueComplete",uploadDialogCancelCallback:A+"swfDialogCancel",uploadFileErrorCallback:A+"swfUploadFileError",uploadFileCancelCallback:A+"swfFileCancel",autoUpload:false,allowedFiletypes:this.options.allowedFileTypes,maximumFilesize:this.options.allowedFileSize};this.loadFlash()},loadFlash:function(){if(navigator.plugins&&navigator.mimeTypes&&navigator.mimeTypes.length){var B='<embed type="application/x-shockwave-flash" src="'+this.flashPath+'" width="1px" height="1px" id="'+this.flashMovieName+'" name="'+this.flashMovieName+'" bgcolor="#000000" quality="high" wmode="transparent" menu="false" flashvars="'+this.optionsToString(this.flash_options)+'" />'}else{var B='<object id="'+this.flashMovieName+'" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="1px" height="1px"><param name="movie" value="'+this.flashPath+'" /><param name="bgcolor" value="#000000" /><param name="quality" value="high" /><param name="wmode" value="transparent" /><param name="menu" value="false" /><param name="flashvars" value="'+this.optionsToString(this.flash_options)+'" /></object>'}var D=document.createElement("div");D.innerHTML='<div style="width:0px;height:0px;position:absolute;top:0px;left:0px"></div>';var A=D.firstChild;var C=document.getElementsByTagName("body")[0];if(typeof (C)=="undefined"||C==null){return false}C.appendChild(A);A.innerHTML=B},optionsToString:function(A){var C=new Array();for(var B in A){C.push(B+"="+A[B])}return C.join("&")},upload:function(){this.flashElement.upload();return false},browse:function(){this.flashElement.browse();return false},cancelUpload:function(){this.flashElement.cancelQueue();this.renderUploadCancel();this.onUploadCanceled();return false},cancelFile:function(A){this.flashElement.cancelFile(A)},flashLoaded:function(){if(this.loaded){return false}if(!UploaderBase.fixed){UploaderBase.fixIe()}this.flashElement=$(this.flashMovieName);this.loaded=true;this.mainDiv=$(this.formDiv);this.renderCreateStructure(this.mainDiv);$("flashUploader"+this.myIndex+"AddBtn").onclick=this.browse.bind(this);$("flashUploader"+this.myIndex+"SendBtn").onclick=this.upload.bind(this);$("flashUploader"+this.myIndex+"CancelQueueBtn").onclick=this.cancelUpload.bind(this);this.fileListBox=$("flashUploader"+this.myIndex+"FileList");this.queueInfo=$("flashUploader"+this.myIndex+"QueueInfo");this.progressBox=$("flashUploader"+this.myIndex+"ProgressBox");this.progressBoxText=$("flashUploader"+this.myIndex+"progressBoxText")},swfFileQueued:function(B,A){if(!this.fileListBox.getElementsByTagName("ul")[0]){this.renderCreateFileListBox(this.fileListBox)}$("flashUploader"+this.myIndex+"InfoBox").show();this.totalBytes=this.totalBytes+B.size;this.totalFiles++;if(this.totalFiles>this.MAXFILESCOUNT){this.cancelFile(B.id);return false}if(!this.isUploading){$("flashUploader"+this.myIndex+"SendBtn").show()}var C=this.fileListBox.getElementsByTagName("ul")[0];this.renderAddFile(C,B);$(B.id+"CancelFileBtn").onclick=function(){this.cancelFile(B.id)}.bind(this);this.renderQueueInfo(A);if(this.totalFiles==this.MAXFILESCOUNT){$("flashUploader"+this.myIndex+"AddBtn").hide()}},swfFileStart:function(C,B,A){if(!this.isUploading){this.renderStartUpload(this.mainDiv);this.isUploading=true;this.onUploadStart()}this.filesCompleted=B;this.fileBytesLoaded=0;this.renderFileUploadStart(C)},swfProgress:function(A,B){this.totalBytesLoaded=this.tempAllBytes+B;this.fileBytesLoaded=B;this.renderProgress(A)},swfFileComplete:function(A){this.filesCompleted++;this.totalBytesLoaded=this.tempAllBytes+A.size;this.tempAllBytes=this.totalBytesLoaded;this.renderFileUploadEnd(A)},swfFileCancel:function(B,A){this.totalBytes=this.totalBytes-B.size;this.totalFiles--;this.renderRemoveFile(B);this.renderQueueInfo(A);if(this.totalFiles==0){$("flashUploader"+this.myIndex+"InfoBox").hide()}if(this.totalFiles<this.MAXFILESCOUNT&&!this.isUploading){$("flashUploader"+this.myIndex+"AddBtn").show()}},swfQueueComplete:function(){this.renderUploadComplete();this.onUploadCompleted(this);$("flashUploader"+this.myIndex+"CancelQueueBtn").hide()},swfUploadFileError:function(B,A,C){switch(B){case -10:this.renderServerError(C,A);this.onUploadError(B,A);break;case -20:alert("Error Code: No upload script, File name: "+A.name+", Message: "+C);break;case -30:this.renderIOError(C,A);this.onUploadError(B,A);break;case -40:alert("B????d: Security Error, File name: "+A.name+", Message: "+C);break;case -50:this.renderFileSizeExceeded(A);break}},swfDialogCancel:function(){return true}});var Galleries=Class.create();Object.extend(Galleries.prototype,AppFramework.prototype);Object.extend(Galleries.prototype,{appid:"Galleries"});Event.onDOMReady(function(){galleries=new Galleries()});var GALLERIES_DISABLE_UPLOADER=true;Object.extend(Galleries.prototype,{flashUploader2:null,addPhotoForm:function(A){this.initUploader(function(){window.location.reload()},A);return false},cancelAddPhotoForm:function(){AppFramework.hideLightBox("add_photo_form");return false},initUploader:function(B,A){this.uploaderCompleteCallback=B;this.uploaderAlbumId=A;this.showLightBox("add_photo_form","viewPhotoForm",{albumId:A},{width:508,height:450},function(C){this.initFlashUploader()}.bind(this))},initFlashUploader:function(){if(typeof GALLERIES_DISABLE_UPLOADER=="undefined"){this.flashUploader2=new GalleriesUploader({postActionURL:$("photoAddForm").action+"_"+Cookie.get("sessionId")+Cookie.get("sessionIdChecksum")+"_"+this.uploaderAlbumId});this.errorOccuredDuringUpload=false;this.flashUploader2.onUploadStart=this.flashUploadStart.bind(this);this.flashUploader2.onUploadCompleted=this.flashUploadCompleted.bind(this);this.flashUploader2.onUploadCanceled=this.flashUploadEnd.bind(this);this.flashUploader2.onUploadError=this.flashUploadError.bind(this)}return false},flashUploadStart:function(){$("busyIndicator").show()},flashUploadCompleted:function(){$("busyIndicator").hide();this.uploadCompleted()},flashUploadError:function(){this.errorOccuredDuringUpload=true},flashUploadEnd:function(){AppFramework.hideLightBox("add_photo_form");return true},simpleUploadStart:function(A){A.submit();$("busyIndicator").show();return true},simpleUploadEnd:function(A){this.getIFramePage(A,function(B){$("busyIndicator").hide();if(B.result!=this.RESPONSE_RESULT_OK){galleries.showLightBoxStatic("alert",'<div class="alert">'+B.html+"</div>"+galleries.getWinCloseButton("alert"),{width:250,height:120})}else{this.uploadCompleted()}}.bind(this),function(){$("busyIndicator").hide()})},uploadCompleted:function(){if(this.errorOccuredDuringUpload){return false}this.uploaderCompleteCallback()}});var GalleriesUploader=Class.create();Object.extend(GalleriesUploader.prototype,UploaderBase.prototype);Object.extend(GalleriesUploader.prototype,{MAXFILESCOUNT:6,formDiv:"gal-uploader-form",previousRenderTime:null,previousBytesLoaded:0,options:{allowedFileTypes:"*.jpg",allowedFileTypesDescription:Lang.allowedFileTypesDescription,allowedFileSize:6144},now:function(){var A=new Date;return A.getTime()},renderQueueInfo:function(A){$("flashUploader"+this.myIndex+"QueueInfo").innerHTML='<span class="queueTitle">'+Lang.queueInfoTitle+"</span><br />"+Lang.photosCount+': <span class="queueInfoValue">'+A+"</span>"+Lang.photosSize+': <span class="queueInfoValue" title="'+this.totalBytes+' byte">'+Math.ceil(this.totalBytes/1024)+" kB</span>"},renderCreateStructure:function(A){var B='<div class="uploader"><div class="topBox"><div class="queueInfo" id="flashUploader'+this.myIndex+'QueueInfo"></div><a href="#" id="flashUploader'+this.myIndex+'AddBtn" class="button button-blue2"><span>'+Lang.choosePhotos+'</span></a></div><div class="uploadInfoBox" id="flashUploader'+this.myIndex+'InfoBox" style="display: none"><div style="float: right"><a href="#" class="button button-lightblue" id="flashUploader'+this.myIndex+'CancelQueueBtn" style="display:none;"><span>'+Lang.cancel+'</span></a></div><div style="display: none" id="flashUploader'+this.myIndex+'progressBoxText" class="progressBoxText"></div><div style="margin: 0pt auto; width: 130px;"><a href="#" id="flashUploader'+this.myIndex+'SendBtn" class="button button-gal-orange" style="display:none"><span>'+Lang.uploadPhotos+'</span></a></div></div><div class="fileListBox" id="flashUploader'+this.myIndex+'FileList"></div><div class="progressBox" id="flashUploader'+this.myIndex+'ProgressBox" style="display:none"></div></div>';A.update(B);this.renderQueueInfo(0)},renderCreateFileListBox:function(A){$("flashUploader"+this.myIndex+"InfoBox").show();A.update("<ul></ul>")},renumerateFileList:function(){var B;var A=$("flashUploader"+this.myIndex+"FileList").getElementsByTagName("ul")[0].getElementsByTagName("li");for(var C=0,D=A.length;C<D;C++){B=(C%2)?"fileItemOdd":"fileItemEven";$(A[C]).removeClassName("fileItemOdd").removeClassName("fileItemEven").addClassName(B);$(A[C]).firstChild.firstChild.innerHTML=C+1+(".")}},renderAddFile:function(C,B){var A='<li class="fileItem" id="'+B.id+'"><p><span class="itemIndex"></span><span>'+B.name.truncate(21)+'</span></p><a href="#" id="'+B.id+'CancelFileBtn"></a><p style="clear: left"><span class="file-size">'+Lang.size+':</span><span class="file-size value" title="'+B.size+' byte">'+Math.ceil(B.size/1024)+' kB</span></p><div id="'+B.id+'ProgressBarHolder" class="progressBarHolder"><div class="progressBar"><div class="slider"></div><div class="percentText">0%</div></div><div class="processingText">'+Lang.processing+"</div></div></li>";var D=document.createElement("div");D.innerHTML=A;C.appendChild(D.firstChild);this.renumerateFileList()},renderRemoveFile:function(B){var A=document.getElementById(B.id);A.parentNode.removeChild(A);this.renumerateFileList()},renderStartUpload:function(A){$("flashUploader"+this.myIndex+"SendBtn").hide();$("flashUploader"+this.myIndex+"AddBtn").hide();$("flashUploader"+this.myIndex+"progressBoxText").show();$("flashUploader"+this.myIndex+"ProgressBox").show();$("flashUploader"+this.myIndex+"CancelQueueBtn").show();this.previousRenderTime=this.now()},renderFileUploadStart:function(A){$(A.id).addClassName("uploading");$(A.id+"CancelFileBtn").hide()},renderFileUploadEnd:function(A){$(A.id+"CancelFileBtn").hide();$(A.id).removeClassName("uploading").addClassName("uploaded");var B=$(A.id+"ProgressBarHolder");B.firstChild.style.width=(B.getWidth()-3)+"px";$(B.firstChild).getElementsByClassName("percentText")[0].innerHTML="100%";$($(A.id+"ProgressBarHolder").getElementsByClassName("processingText")[0]).style.display="none"},renderProgress:function(B){var F=1;var A,C;A=this.now()-this.previousRenderTime;this.previousRenderTime=this.now();C=Math.round(10*(1000*(this.totalBytesLoaded-this.previousBytesLoaded)/(1024*A)))/10;this.previousBytesLoaded=this.totalBytesLoaded;$("flashUploader"+this.myIndex+"progressBoxText").innerHTML=Lang.uploading+" <b>"+this.filesCompleted+"/"+this.totalFiles+"</b> &nbsp;//&nbsp; "+Lang.transfer+": <b>"+C+"</b> kB/s";var D=Math.ceil(this.fileBytesLoaded/B.size*100);var E=$(B.id+"ProgressBarHolder");var F=Math.ceil(this.fileBytesLoaded/B.size*E.getWidth())-3;pb=$(E.firstChild);if(F<9){F=9}if(D>98){$(E.getElementsByClassName("processingText")[0]).style.display="block"}if(D==100){pb.style.width=(F-1)+"px";pb.getElementsByClassName("percentText")[0].innerHTML="99%"}else{pb.style.width=F+"px";pb.getElementsByClassName("percentText")[0].innerHTML=D+"%"}},renderUploadError:function(){window.clearInterval(this.uploadSpeedIntervalID);this.mainDiv.update("Wyst??pi?? b????d")},renderUploadComplete:function(){window.clearInterval(this.uploadSpeedIntervalID)},renderUploadCancel:function(){window.clearInterval(this.uploadSpeedIntervalID);this.mainDiv.update(Lang.uploadCanceled)},renderServerError:function(B,A){if(B==407||B==406){if(B==406){var D=Lang.uploadPhotoQuotaExceedTotal}else{if(B==407){var D=Lang.uploadPhotoQuotaExceedDaily}}this.onUploadError(B,A,D);this.cancelUpload();setTimeout(function(){galleries.showLightBoxStatic("alert",'<div class="alert">'+D+"</div>"+galleries.getWinCloseButton("alert"),{width:250,height:160})},50);return true}else{if(B==415){var D=Lang.uploadPhotoFailed}else{var D="["+Lang.uploadPhotoFailed+"]"}}var C=$(A.id+"ProgressBarHolder");$(A.id).removeClassName("uploading").addClassName("error");$(C.getElementsByClassName("processingText")[0]).style.display="block";$(C.getElementsByClassName("processingText")[0]).style.display="block";$(C.getElementsByClassName("processingText")[0]).innerHTML=D},renderIOError:function(B,A){var C=$(A.id+"ProgressBarHolder");$(A.id).removeClassName("uploading").addClassName("error");$(C.getElementsByClassName("processingText")[0]).style.display="block";$(C.getElementsByClassName("processingText")[0]).style.display="block";$(C.getElementsByClassName("processingText")[0]).innerHTML=Lang.transferError},renderFileSizeExceeded:function(A){var B=Lang.uploadPhotoFileSizeExceeded;alert(B)}});var MyAlbumsWidget=Class.create();MyAlbumsWidget.widgets=new Array();MyAlbumsWidget.register=function(A){A.myIndex=MyAlbumsWidget.widgets.length;MyAlbumsWidget.widgets.push(A)};Object.extend(MyAlbumsWidget.prototype,{onSelectPhoto:Prototype.emptyFunction,initialize:function(C,A,B){MyAlbumsWidget.register(this);this.holderId=$(C);this.page=0;this.withCloseButton=A?1:0;if(typeof B=="undefined"){galleries.sendRequest("viewWidgetMyAlbums",{widgetId:this.myIndex,renderCloseButton:this.withCloseButton,holderId:this.holderId.id},function(D){$(C).update(D.widget);this.activeAlbum=D.activeAlbumId;$(C).getElementsByClassName("roll-up")[0].onclick=this.RollUpAlbums.bind(this);$(C).getElementsByClassName("roll-down")[0].onclick=this.RollDownAlbums.bind(this)}.bind(this))}else{galleries.sendRequest("viewWidgetFriendAlbums",{widgetId:this.myIndex,renderCloseButton:this.withCloseButton,holderId:this.holderId.id,userUID:B},function(E){$(C).update(E.widget);this.activeAlbum=E.activeAlbumId;$(C).getElementsByClassName("roll-up")[0].onclick=this.RollUpAlbums.bind(this);$(C).getElementsByClassName("roll-down")[0].onclick=this.RollDownAlbums.bind(this);var D=$("gal-myAlbums-widget").getElementsByClassName("button-holder");D[0].remove()}.bind(this))}},_AlbumClick:function(A){var B=this;galleries.sendRequest("viewWidgetMyAlbumsPhotos",{albumId:A,widgetId:this.myIndex,renderCloseButton:B.withCloseButton,holderId:B.holderId.id},function(D){var C="";var E=this.holderId.getElementsByClassName("photos-holder")[0];E.update(D.html);this.activeAlbumId="widgetAlbum"+this.myIndex+this.activeAlbum;if(C=$(this.activeAlbumId)){$(C.parentNode).removeClassName("activeAlbum")}this.activeAlbum=A;this.activeAlbumId="widgetAlbum"+this.myIndex+A;if(C=$(this.activeAlbumId)){$(C.parentNode).addClassName("activeAlbum")}}.bind(this));return false},_PhotoClick:function(A){this.onSelectPhoto(A);return false},_RollClick:function(A){galleries.sendRequest("viewWidgetMyAlbumsAlbums",{page:A,albumId:this.activeAlbum,widgetId:this.myIndex},function(B){if(B.outOfRange){return false}this.page=A;$(this.holderId).getElementsByClassName("albums-list")[0].update(B.albums)}.bind(this))},_initUploader:function(A){Editor.tempCancelFunction=Editor.cancel;Editor.cancel=Prototype.emptyFunction;galleries.initUploader(this._uploadCompleted.bind(this),A);Editor.cancel=function(){Editor.cancel=Editor.tempCancelFunction};return false},_uploadCompleted:function(){this._AlbumClick(this.activeAlbum)},RollUpAlbums:function(){if(this.page==0){return false}this._RollClick(this.page-1);return false},RollDownAlbums:function(){this._RollClick(this.page+1);return false}});Editor._plugins.push("MyAlbums");Object.extend(Editor.prototype,{initializeMyAlbums:function(G,A){if(Editor.TOOLBAR[A].indexOf("image")==-1){return true}var C=$("editorImagePanel");if(C.getElementsByClassName("edt-tabs").length>0){return true}var F=document.createElement("div");var D=$$("#editorImagePanel .content")[0];D.update();F.innerHTML='<ul class="edt-tabs"><li><div>'+Lang.myAlbumsInsertURL+"</div></li><li><div>"+Lang.myAlbumsInsertPhoto+'</div></li><li class="edt-xbtn"><div>&nbsp;</div></li></ul>';D.appendChild(F.firstChild);var E=this;var B=D.getElementsByClassName("edt-tabs")[0].childNodes;this.urlTab=B[0];B[0].firstChild.onclick=function(){E.tabClick("url");this.blur();return false};this.myAlbumsTab=B[1];B[1].firstChild.onclick=function(){E.tabClick("myAlbums");this.blur();return false};B[2].firstChild.onclick=function(){Editor.getActive().triggerEvent("image_click",null,"")};F.innerHTML='<div class="myAlbumsHolder">'+Lang.myAlbumsLoading+"</div>";this.myAlbumsHolder=$(F.firstChild);D.appendChild(this.myAlbumsHolder);F.innerHTML='<div class="urlHolder"></div>';this.urlHolder=$(F.firstChild);D.appendChild(this.urlHolder);this.createImagePanel(this.urlHolder);this.tabClick("url");this.widget=null},selectPhoto:function(C){var F=C.width>265?265:C.width;var A=Math.ceil(F*C.height/C.width);var E='<img _src="'+C.mediumUrl+'" width="'+F+'px" height="'+A+'px" />';Editor.getActive().triggerEvent("insert_html",null,E);var H=Editor.getActive().iframe.contentWindow.document.body.getElementsByTagName("img");for(var D=0;D<H.length;D++){var B=$(H[D]);var G=Element.readAttribute(B,"_src");if(G){B.src=G;B.removeAttribute("_src")}}$("editorImagePanel").style.display="none";return false},tabClick:function(A){switch(A){case"myAlbums":if(this.widget==null){this.widget=new MyAlbumsWidget(this.myAlbumsHolder);this.widget.onSelectPhoto=this.selectPhoto.bind(this)}this.myAlbumsTab.className="active";this.urlTab.className="";this.myAlbumsHolder.show();this.urlHolder.hide();break;case"url":this.myAlbumsTab.className="";this.urlTab.className="active";this.myAlbumsHolder.hide();this.urlHolder.show();break}setTimeout(function(){this.iframe.contentWindow.focus()}.bind(this),10)}});Object.extend(Galleries.prototype,{userAlbumsScroller:null,createUserAlbumsScroller:function(A,B){this.userAlbumsScroller=new Scroller({listHolder:"albums-scroller-holder",listScrollHolder:"albums-scroller",params:{},app:this,scrollSpeed:126,direction:"left",rangeEnd:A-1,startPage:B})},userAlbumsScrollLeft:function(A,B){if(!this.userAlbumsScroller){this.createUserAlbumsScroller(A,B)}this.userAlbumsScroller.scrollDecrease();return false},userAlbumsScrollRight:function(A,B){if(!this.userAlbumsScroller){this.createUserAlbumsScroller(A,B)}this.userAlbumsScroller.scrollIncrease();return false}});var Naglos=Class.create();Object.extend(Naglos.prototype,AppFramework.prototype);Object.extend(Naglos.prototype,{appid:"Naglos",listContainer:"naglos-list-content",lastState:0,commentUrl:false,activateTimeout:false,lastActiveComment:false,activeCommentParent:false,delayedFunc:null,activeCommentIsReply:false,activeCommentType:false,activeCommentHasReply:false,ALLOWED_REPLY_TYPE:1,ALLOWED_MODERATE_TYPE:1,STATE_PAUSE:0,STATE_BUFFER:1,STATE_PLAY:2,STATE_FINISHED:3,initialize:function(){this.defaultWidth=230;this.defaultPlayerDiv="naglosPlayer";this.defaultPlayerDivTtitle="naglosPlayer-title";this.defaultPlayerDivContainer="naglosPlayer-container";this.hookLightBox()},hookLightBox:function(){AppFramework.afterHideLightBox=function(){this.delayedActivateComment(this.activeComment,this.activeCommentType,this.commentUrl,this.activeCommentIsReply,this.activeCommentParent)}.bind(this)},removeComment:function(){if(this.activeComment){naglosPlayer.playerStop();if(confirm(Lang.naglosCommentDelete)){if(this.activeCommentIsReply){return this.remove(this.activeCommentParent,true)}else{return this.remove(this.activeComment,false)}}}else{this.showLightBoxStatic("naglos",'<div style="text-align : center; line-height : 100px; font-weight : bold">'+Lang.naglosNoCommentSelected+"</div>")}return false},remove:function(C,B){if(!B){B=false}var A=this.getPaginatorCurrentPage("naglos-list");if(this.getScopeCommentsCount()==1){A=A>0?A-1:0}this.sendRequest("remove",{"id":C,"page":A,"delReply":B},function(D){if(D.result!=0){this.activeComment=false;this.lastActiveComment=false;this.activeCommentParent=false;Element.update($("Naglos_count"),D.count);if(D.count==0){$("naglos-mediaplayer").hide()}Element.update($("naglos-list"),D.html);new Effect.Highlight($("naglos-list-content"),{duration:1})}}.bind(this),null,true);return false},playSong:function(){if(naglosPlayer.mediaPlayer!==null){if(this.activeComment==this.lastActiveComment){naglosPlayer.playerPlayPause()}else{this.lastActiveComment=this.activeComment;naglosPlayer.playerLoadItem(this.commentUrl,this.commentUrl)}}return false},showVisibilitySettings:function(){$("naglos-visibility-settings-layer").show();$("naglos-show-visibility-settings").hide();return false},hideVisibilitySettings:function(){$("naglos-visibility-settings-layer").hide();$("naglos-show-visibility-settings").show();return false},saveVisibilitySettings:function(){this.sendRequest("saveVisibility",{visibility:$("naglos_visibility").value},function(A){if(A.result!=0){this.hideVisibilitySettings()}}.bind(this),null,true);return false},limitExceededLightbox:function(A){if(A==1){this.showLightBoxStatic("alert",'<div class="alert">'+Lang.naglosHourLimitExceeded+"</div>"+this.getWinCloseButton("alert"),{width:250,height:120})}else{if(A==2){this.showLightBoxStatic("alert",'<div class="alert">'+Lang.naglosDayLimitExceeded+"</div>"+this.getWinCloseButton("alert"),{width:250,height:120})}}},elementHover:function(B,A){switch(A){case 1:if(!$(B).hasClassName("hover")&&!$(B).hasClassName("active")){$(B).addClassName("hover")}break;case 0:if($(B).hasClassName("hover")){$(B).removeClassName("hover")}break}return false},delayedActivateComment:function(E,B,A,C,D){this.delayedFunc=function(){this.delayedFunc=false;this.activateTimeout=setTimeout(function(){if(naglosPlayer.mediaPlayer&&typeof naglosPlayer.mediaPlayer.loadFile=="function"){naglosPlayer.mediaPlayer.loadFile({file:A,title:A})}clearTimeout(this.activateTimeout)}.bind(this),500)}.bind(this);this.activateComment(E,B,A,C,D);return false},activateComment:function(F,C,A,D,E,B){this.commentUrl=A;this.lastActiveComment=this.activeComment;this.activeCommentParent=E;this.activeComment=F;this.activeCommentIsReply=D;this.activeCommentHasReply=B;this.activeCommentType=C;if(naglosPlayer.mediaPlayer&&typeof naglosPlayer.mediaPlayer.loadFile=="function"){naglosPlayer.mediaPlayer.loadFile({file:A,title:A});naglosPlayer.mediaPlayer.sendEvent("playpause")}if(this.isIdInScope(this.lastActiveComment)){if($("comment-"+this.lastActiveComment).hasClassName("active")){$("comment-"+this.lastActiveComment).removeClassName("active")}}if($("button-reply")){if(this.activeCommentIsReply||this.activeCommentType!=this.ALLOWED_REPLY_TYPE){$("button-reply").className="naglos-inactive-reply-button";$("command-button-reply").href="#"}else{$("button-reply").className="naglos-reply-button";$("command-button-reply").href="gadunaglos:telefon/"+Lang.naglosCallNo+"*"+this.activeComment}}if(this.isIdInScope(F)&&!$("comment-"+F).hasClassName("active")){$("comment-"+F).addClassName("active")}return false},isIdInScope:function(A){if(!A||"undefied"==typeof A){return false}this.isInScope=false;$$("#naglos div.comment").each(function(B){if($(B).id=="comment-"+A){this.isInScope=true}}.bind(this));if(!this.isInScope){$$("#naglos div.comment-reply").each(function(B){if($(B).id=="comment-"+A){this.isInScope=true}}.bind(this))}return this.isInScope},getScopeCommentsCount:function(){return $$("#naglos div.comment").length},moderate:function(){if(this.activeCommentType!=this.ALLOWED_MODERATE_TYPE){this.showLightBoxStatic("naglos",'<div style="text-align : center; line-height : 100px; font-weight : bold">'+Lang.naglosNoModeration+"</div>")}else{if(this.isIdInScope(this.activeComment)){cenzor.showModerationDialog(7,this.activeComment+"_"+(this.activeCommentParent?this.activeCommentParent:""))}else{this.showLightBoxStatic("naglos",'<div style="text-align : center; line-height : 100px; font-weight : bold">'+Lang.naglosNoCommentSelected+"</div>")}}return false},stopEvent:function(A){if(typeof A.stopPropagation=="function"){A.stopPropagation()}else{window.event.cancelBubble=true}},reply:function(){if(!this.isIdInScope(this.activeComment)){this.showLightBoxStatic("naglos",'<div style="text-align : center; line-height : 100px; font-weight : bold">'+Lang.naglosNoCommentSelected+"</div>");return false}else{if(this.activeCommentType!=this.ALLOWED_REPLY_TYPE||this.activeCommentIsReply){this.showLightBoxStatic("naglos",'<div style="text-align : center; line-height : 100px; font-weight : bold">'+Lang.naglosForbiddenReply+"</div>");return false}else{if(this.activeCommentHasReply){this.showLightBoxStatic("naglos",'<div style="text-align : center; line-height : 100px; font-weight : bold">'+Lang.naglosReplyExists+"</div>");return false}else{return true}}}},getAjaxPage:function(B,C,A){this.activeComment=false;this.lastActiveComment=false;this.activeCommentType=false;this.activeCommentIsReply=false;this.sendRequest(B,C,function(D){if(D.html){Element.update(A,D.html)}if(D.page){this.setPaginatorCurrentPage(A,D.page)}}.bind(this))}});var NaglosPlayer=Class.create();Object.extend(NaglosPlayer.prototype,GaduMusic.prototype);naglosPlayer=new NaglosPlayer();naglos=new Naglos();Object.extend(Gift.prototype,{openSendPanel:function(){this.sendRequest("viewSendBox",{},function(A){if(A.status==this.RESPONSE_RESULT_OK){if(A.html){this.showLightBoxStatic("sendBox",A.html,{width:625,height:410})}}else{this.showLightBoxStatic("alert",'<div class="alert">'+Lang.ajaxError+"</div>"+this.getWinCloseButton("alert"),{width:250,height:120})}}.bind(this));return false},showVisibilitySettings:function(){$("gift-visibility-settings-layer").show();$("gift-show-visibility-settings").hide();return false},hideVisibilitySettings:function(){$("gift-visibility-settings-layer").hide();$("gift-show-visibility-settings").show();return false},saveVisibilitySettings:function(){this.sendRequest("saveVisibility",{visibility:$("gift_visibility").value},function(A){if(A.result!=0){this.hideVisibilitySettings()}}.bind(this),null,true);return false},chooseGift:function(){params=$("giftSelectionForm").serialize(true);if(!params["classId"]){this.notifyMsg(Lang.chooseGift);return false}this.sendRequest("viewSendingClass",params,function(A){if(A.status==this.RESPONSE_RESULT_OK){if(A.html){$("gift-send-panel").innerHTML=A.html}}else{this.showLightBoxStatic("alert",'<div class="alert">'+Lang.ajaxError+"</div>"+this.getWinCloseButton("alert"),{width:250,height:120})}}.bind(this),null,true);return false},buyGift:function(){var A=$("send-gift-form").serialize(true);if(!A["visibility"]){this.notifyMsg(Lang.chooseVisibility);return false}this.sendRequest("giveGift",A,function(B){if(B.status==this.RESPONSE_RESULT_OK){if(B.html){$("gift-send-panel").innerHTML=B.html}}else{this.showLightBoxStatic("alert",'<div class="alert">'+Lang.ajaxError+"</div>"+this.getWinCloseButton("alert"),{width:250,height:120})}}.bind(this));return false},closeSendLightbox:function(){AppFramework.hideLightBox("sendBox");return false},abortBuying:function(){this.sendRequest("viewSendBox",{},function(A){if(A.status==this.RESPONSE_RESULT_OK){if(A.html){$("gift-send-panel").innerHTML=A.html}}else{this.showLightBoxStatic("alert",'<div class="alert">'+Lang.ajaxError+"</div>"+this.getWinCloseButton("alert"),{width:250,height:120})}}.bind(this));return false},prevGiftsPage:function(){if(this.currentPage==0){return false}this.currentPage--;gift.getAjaxPage("viewReceivedBoxContent",{"page":this.currentPage,"perPage":this.GIFTS_PER_PAGE},"gifts-list");return false},nextGiftsPage:function(){this.currentPage++;gift.getAjaxPage("viewReceivedBoxContent",{"page":this.currentPage,"perPage":this.GIFTS_PER_PAGE},"gifts-list");return false}});Position.GetWindowSize=function(C){C=C?C:window;var D=C.innerWidth||(C.document.documentElement.clientWidth||C.document.body.clientWidth);var A=C.innerHeight||(C.document.documentElement.clientHeight||C.document.body.clientHeight);var B=new Array();B.width=D;B.height=A;return B};var ThreeBit=Class.create();Object.extend(ThreeBit.prototype,AppFramework.prototype);Object.extend(ThreeBit.prototype,{appid:"ThreeBit",submitAd:function(){var A=Form.serialize("new-ad-form",true);this.sendRequest("newAd",A,function(B){if(typeof B.error=="undefined"){this.showLightBoxStatic("ad-saved",'<div class="alert">'+B.msg+"</div>"+this.getWinCloseButton("ad-saved"),{width:340,height:110})}else{this.showLightBoxStatic("new-ad-err",'<div class="alert">'+B.errorMsg+"</div>"+this.getWinCloseButton("new-ad-err"),{width:340,height:110});return false}}.bind(this))},getAppealedProfiles:function(A){this.sendRequest("getAppealedProfiles",{baseUID:A},function(B){if(typeof B.error=="undefined"){Element.update("tb2stg",B.html)}else{this.showLightBoxStatic("appealed-profiles-err",'<div class="alert">'+B.errorMsg+"</div>"+this.getWinCloseButton("appealed-profiles-err"),{width:340,height:110});return false}}.bind(this))},setUserFeatures:function(){var A=Form.serialize("features-survey",true);this.sendRequest("setUserFeatures",A,function(B){if(typeof B.error=="undefined"){this.showLightBoxStatic("features-saved",'<div class="notice">'+B.msg+"</div>"+this.getWinCloseButton("features-saved"),{width:340,height:110});Element.update("user-features-content",B.html);this.initSliders()}else{this.showLightBoxStatic("features-err",'<div class="alert">'+B.errorMsg+"</div>"+this.getWinCloseButton("features-err"),{width:340,height:110})}return false}.bind(this));return false},compareFeatures:function(){this.sendRequest("compareFeatures",{},function(A){if(typeof A.error=="undefined"){Element.update("comp-value","Pasujecie do siebie w: <h3>"+A.result+"%</h3>")}}.bind(this));return false},initSliders:function(){new Control.Slider($("handle_0"),$("slider_0"),{range:$R(0,9),values:[0,1,2,3,4,5,6,7,8,9],sliderValue:$("feature_base_0").value,onSlide:function(A){$("feature_0").value=A;if($("compare-f-btn").visible()){$("compare-f-btn").hide()}if(!($("save-f-btn").visible())){$("save-f-btn").show()}},onChange:function(A){$("feature_0").value=A;if($("compare-f-btn").visible()){$("compare-f-btn").hide()}if(!($("save-f-btn").visible())){$("save-f-btn").show()}}});new Control.Slider($("handle_1"),$("slider_1"),{range:$R(0,9),values:[0,1,2,3,4,5,6,7,8,9],sliderValue:$("feature_base_1").value,onSlide:function(A){$("feature_1").value=A;if($("compare-f-btn").visible()){$("compare-f-btn").hide()}if(!($("save-f-btn").visible())){$("save-f-btn").show()}},onChange:function(A){$("feature_1").value=A;if($("compare-f-btn").visible()){$("compare-f-btn").hide()}if(!($("save-f-btn").visible())){$("save-f-btn").show()}}});new Control.Slider($("handle_2"),$("slider_2"),{range:$R(0,9),values:[0,1,2,3,4,5,6,7,8,9],sliderValue:$("feature_base_2").value,onSlide:function(A){$("feature_2").value=A;if($("compare-f-btn").visible()){$("compare-f-btn").hide()}if(!($("save-f-btn").visible())){$("save-f-btn").show()}},onChange:function(A){$("feature_2").value=A;if($("compare-f-btn").visible()){$("compare-f-btn").hide()}if(!($("save-f-btn").visible())){$("save-f-btn").show()}}});new Control.Slider($("handle_3"),$("slider_3"),{range:$R(0,9),values:[0,1,2,3,4,5,6,7,8,9],sliderValue:$("feature_base_3").value,onSlide:function(A){$("feature_3").value=A;if($("compare-f-btn").visible()){$("compare-f-btn").hide()}if(!($("save-f-btn").visible())){$("save-f-btn").show()}},onChange:function(A){$("feature_3").value=A;if($("compare-f-btn").visible()){$("compare-f-btn").hide()}if(!($("save-f-btn").visible())){$("save-f-btn").show()}}});new Control.Slider($("handle_4"),$("slider_4"),{range:$R(0,9),values:[0,1,2,3,4,5,6,7,8,9],sliderValue:$("feature_base_4").value,onSlide:function(A){$("feature_4").value=A;if($("compare-f-btn").visible()){$("compare-f-btn").hide()}if(!($("save-f-btn").visible())){$("save-f-btn").show()}},onChange:function(A){$("feature_4").value=A;if($("compare-f-btn").visible()){$("compare-f-btn").hide()}if(!($("save-f-btn").visible())){$("save-f-btn").show()}}})},adCreatedInfoBox:function(A,B){this.showLightBox("new_ad_info","viewCreatedInfoBox",{adId:A,adOwnerUIN:B},{width:470,height:310},function(C){Element.update("threebit-editor","");$("new_ad_info_close").hide()}.bind(this))},sendNoticeToUsers:function(){var A=Form.serialize("notice-to-users",true);this.sendRequest("sendNoticeToUsers",A,function(B){if(typeof B.error=="undefined"){Element.update($("notice-to-users-box"),B.html)}else{Element.update($("notice-to-users-box"),'<div class="alert">'+B.errorMsg+"</div>");return false}}.bind(this))},paginateCurrentWeekTop:function(D,C,A){var B=C+D;if(B>A||B<0){return false}this.sendRequest("viewCurrentWeekTopRated",{page:B},function(E){if(typeof E.error=="undefined"){Element.replace("current-week-top-rated",E.html)}else{this.showLightBoxStatic("current-week-top-err",'<div class="alert">'+E.errorMsg+"</div>"+this.getWinCloseButton("current-week-top-err"),{width:340,height:110})}return false}.bind(this));return false},paginateNewest:function(D,C,A){var B=C+D;if(B>A||B<0){return false}this.sendRequest("viewRecentlyAdded",{page:B},function(E){if(typeof E.error=="undefined"){Element.replace("newest-ads",E.html)}else{this.showLightBoxStatic("newest-ads-err",'<div class="alert">'+E.errorMsg+"</div>"+this.getWinCloseButton("newest-ads-err"),{width:340,height:110})}return false}.bind(this));return false},paginateUserAds:function(D,C,A){var B=C+D;if(B>A||B<0){return false}this.sendRequest("viewAdsList",{page:B},function(E){if(typeof E.error=="undefined"){Element.replace("ads-list",E.html)}else{this.showLightBoxStatic("ads-list-err",'<div class="alert">'+E.errorMsg+"</div>"+this.getWinCloseButton("ads-list-err"),{width:340,height:110})}return false}.bind(this));return false},viewArchiveRanking:function(){this.sendRequest("viewArchiveTopRated",{},function(A){if(typeof A.error=="undefined"){Element.replace("main-ranking",A.html);Element.addClassName("newest-ads-box","archive-small-box");$("archive-ranking-link").hide()}return false}.bind(this));return false},getScrollY:function(){var A=0;if(typeof (window.pageYOffset)=="number"){A=window.pageYOffset}else{if(document.body&&document.body.scrollTop){A=document.body.scrollTop}else{if(document.documentElement&&document.documentElement.scrollTop){A=document.documentElement.scrollTop}}}return A},showBigExpandCorner:function(){$("threebit-expand-corner").hide();$("big-expand-corner").show();var C=this.getScrollY();var A=Position.GetWindowSize();var B=A.height-600+C;if(B>($("footer").offsetTop-600)){B=($("footer").offsetTop-600)}$("big-expand-corner").setStyle({"top":B+"px"});if(Prototype.Browser.IE){$("big-expand-corner").innerHTML=$("big-expand-corner").innerHTML}},showSmallExpandCorner:function(){$("big-expand-corner").hide();$("threebit-expand-corner").show();var C=this.getScrollY();var A=Position.GetWindowSize();var B=A.height-75+C;if(B>($("footer").offsetTop-75)){B=($("footer").offsetTop-75)}$("threebit-expand-corner").setStyle({"top":B+"px"});if(Prototype.Browser.IE){$("threebit-expand-corner").innerHTML=$("threebit-expand-corner").innerHTML}},positionBoxes:function(){if($("threebit-expand-corner").visible()){threebit.showSmallExpandCorner()}if($("big-expand-corner").visible()){threebit.showBigExpandCorner()}return false}});Event.onDOMReady(function(){threebit=new ThreeBit()});if(!Control){var Control={}}Control.Slider=Class.create();Control.Slider.prototype={initialize:function(D,A,B){var C=this;if(D instanceof Array){this.handles=D.collect(function(E){return $(E)})}else{this.handles=[$(D)]}this.track=$(A);this.options=B||{};this.axis=this.options.axis||"horizontal";this.increment=this.options.increment||1;this.step=parseInt(this.options.step||"1");this.range=this.options.range||$R(0,1);this.value=0;this.values=this.handles.map(function(){return 0});this.spans=this.options.spans?this.options.spans.map(function(E){return $(E)}):false;this.options.startSpan=$(this.options.startSpan||null);this.options.endSpan=$(this.options.endSpan||null);this.restricted=this.options.restricted||false;this.maximum=this.options.maximum||this.range.end;this.minimum=this.options.minimum||this.range.start;this.alignX=parseInt(this.options.alignX||"0");this.alignY=parseInt(this.options.alignY||"0");this.trackLength=this.maximumOffset()-this.minimumOffset();this.handleLength=this.isVertical()?(this.handles[0].offsetHeight!=0?this.handles[0].offsetHeight:this.handles[0].style.height.replace(/px$/,"")):(this.handles[0].offsetWidth!=0?this.handles[0].offsetWidth:this.handles[0].style.width.replace(/px$/,""));this.active=false;this.dragging=false;this.disabled=false;if(this.options.disabled){this.setDisabled()}this.allowedValues=this.options.values?this.options.values.sortBy(Prototype.K):false;if(this.allowedValues){this.minimum=this.allowedValues.min();this.maximum=this.allowedValues.max()}this.eventMouseDown=this.startDrag.bindAsEventListener(this);this.eventMouseUp=this.endDrag.bindAsEventListener(this);this.eventMouseMove=this.update.bindAsEventListener(this);this.handles.each(function(F,E){E=C.handles.length-1-E;C.setValue(parseFloat((C.options.sliderValue instanceof Array?C.options.sliderValue[E]:C.options.sliderValue)||C.range.start),E);Element.makePositioned(F);Event.observe(F,"mousedown",C.eventMouseDown)});Event.observe(this.track,"mousedown",this.eventMouseDown);Event.observe(document,"mouseup",this.eventMouseUp);Event.observe(document,"mousemove",this.eventMouseMove);this.initialized=true},dispose:function(){var A=this;Event.stopObserving(this.track,"mousedown",this.eventMouseDown);Event.stopObserving(document,"mouseup",this.eventMouseUp);Event.stopObserving(document,"mousemove",this.eventMouseMove);this.handles.each(function(B){Event.stopObserving(B,"mousedown",A.eventMouseDown)})},setDisabled:function(){this.disabled=true},setEnabled:function(){this.disabled=false},getNearestValue:function(A){if(this.allowedValues){if(A>=this.allowedValues.max()){return(this.allowedValues.max())}if(A<=this.allowedValues.min()){return(this.allowedValues.min())}var C=Math.abs(this.allowedValues[0]-A);var B=this.allowedValues[0];this.allowedValues.each(function(D){var E=Math.abs(D-A);if(E<=C){B=D;C=E}});return B}if(A>this.range.end){return this.range.end}if(A<this.range.start){return this.range.start}return A},setValue:function(B,A){if(!this.active){this.activeHandleIdx=A||0;this.activeHandle=this.handles[this.activeHandleIdx];this.updateStyles()}A=A||this.activeHandleIdx||0;if(this.initialized&&this.restricted){if((A>0)&&(B<this.values[A-1])){B=this.values[A-1]}if((A<(this.handles.length-1))&&(B>this.values[A+1])){B=this.values[A+1]}}B=this.getNearestValue(B);this.values[A]=B;this.value=this.values[0];this.handles[A].style[this.isVertical()?"top":"left"]=this.translateToPx(B);this.drawSpans();if(!this.dragging||!this.event){this.updateFinished()}},setValueBy:function(B,A){this.setValue(this.values[A||this.activeHandleIdx||0]+B,A||this.activeHandleIdx||0)},translateToPx:function(A){return Math.round(((this.trackLength-this.handleLength)/(this.range.end-this.range.start))*(A-this.range.start))+"px"},translateToValue:function(A){return((A/(this.trackLength-this.handleLength)*(this.range.end-this.range.start))+this.range.start)},getRange:function(B){var A=this.values.sortBy(Prototype.K);B=B||0;return $R(A[B],A[B+1])},minimumOffset:function(){return(this.isVertical()?this.alignY:this.alignX)},maximumOffset:function(){return(this.isVertical()?(this.track.offsetHeight!=0?this.track.offsetHeight:this.track.style.height.replace(/px$/,""))-this.alignY:(this.track.offsetWidth!=0?this.track.offsetWidth:this.track.style.width.replace(/px$/,""))-this.alignY)},isVertical:function(){return(this.axis=="vertical")},drawSpans:function(){var A=this;if(this.spans){$R(0,this.spans.length-1).each(function(B){A.setSpan(A.spans[B],A.getRange(B))})}if(this.options.startSpan){this.setSpan(this.options.startSpan,$R(0,this.values.length>1?this.getRange(0).min():this.value))}if(this.options.endSpan){this.setSpan(this.options.endSpan,$R(this.values.length>1?this.getRange(this.spans.length-1).max():this.value,this.maximum))}},setSpan:function(B,A){if(this.isVertical()){B.style.top=this.translateToPx(A.start);B.style.height=this.translateToPx(A.end-A.start+this.range.start)}else{B.style.left=this.translateToPx(A.start);B.style.width=this.translateToPx(A.end-A.start+this.range.start)}},updateStyles:function(){this.handles.each(function(A){Element.removeClassName(A,"selected")});Element.addClassName(this.activeHandle,"selected")},startDrag:function(C){if(Event.isLeftClick(C)){if(!this.disabled){this.active=true;var D=Event.element(C);var E=[Event.pointerX(C),Event.pointerY(C)];var A=D;if(A==this.track){var B=Position.cumulativeOffset(this.track);this.event=C;this.setValue(this.translateToValue((this.isVertical()?E[1]-B[1]:E[0]-B[0])-(this.handleLength/2)));var B=Position.cumulativeOffset(this.activeHandle);this.offsetX=(E[0]-B[0]);this.offsetY=(E[1]-B[1])}else{while((this.handles.indexOf(D)==-1)&&D.parentNode){D=D.parentNode}if(this.handles.indexOf(D)!=-1){this.activeHandle=D;this.activeHandleIdx=this.handles.indexOf(this.activeHandle);this.updateStyles();var B=Position.cumulativeOffset(this.activeHandle);this.offsetX=(E[0]-B[0]);this.offsetY=(E[1]-B[1])}}}Event.stop(C)}},update:function(A){if(this.active){if(!this.dragging){this.dragging=true}this.draw(A);if(Prototype.Browser.WebKit){window.scrollBy(0,0)}Event.stop(A)}},draw:function(B){var C=[Event.pointerX(B),Event.pointerY(B)];var A=Position.cumulativeOffset(this.track);C[0]-=this.offsetX+A[0];C[1]-=this.offsetY+A[1];this.event=B;this.setValue(this.translateToValue(this.isVertical()?C[1]:C[0]));if(this.initialized&&this.options.onSlide){this.options.onSlide(this.values.length>1?this.values:this.value,this)}},endDrag:function(A){if(this.active&&this.dragging){this.finishDrag(A,true);Event.stop(A)}this.active=false;this.dragging=false},finishDrag:function(A,B){this.active=false;this.dragging=false;this.updateFinished()},updateFinished:function(){if(this.initialized&&this.options.onChange){this.options.onChange(this.values.length>1?this.values:this.value,this)}this.event=null}};var Garnier=Class.create();Object.extend(Garnier.prototype,AppFramework.prototype);Object.extend(Garnier.prototype,{appid:"Garnier",addBlogToContest:function(A){this.sendRequest("addBlogToContest",{"blogPostId":A},function(B){if(B.status==1){Effect.Fade("garnier-addToContestButton-"+A,{"afterFinish":function(){$("garnier-addToContestButton-"+A).addClassName("garnier-post-added");Element.remove("garnier-addedToContest-"+A);Effect.Appear("garnier-addToContestButton-"+A)}});Effect.Fade("Blog_markField_"+A,{"afterFinish":function(){Element.remove("Blog_markField_"+A)}})}}.bind(this));return false},addPhotoToContest:function(A){this.sendRequest("addPhotoToContest",{"photoId":A},function(B){if(B.status==1){Effect.Fade("garnier-addToContestButton-"+A,{"afterFinish":function(){$("garnier-addToContestButton-"+A).addClassName("garnier-photoInContest");Element.remove("garnier-addedToContest-"+A);Effect.Appear("garnier-addToContestButton-"+A)}})}}.bind(this));return false},addMark:function(A){this.sendRequest("addMark",{"photoBlogId":A},function(B){if(B.status==1){if($("garnier-addMark-"+A)){Effect.Fade("garnier-addMark-"+A,{"afterFinish":function(){if($("garnier-markSum-"+A)){Element.update("garnier-markSum-"+A,B.newMarkSum)}}})}if($("garnier-markSum-"+A)){Element.update("garnier-markSum-"+A,B.newMarkSum);Element.update("garnier-markButton-"+A,'<span class="addMark">GLOSUJ</span>')}if($("garnier-markButton-video-"+A)){Element.update("garnier-markButton-video-"+A,'<span class="addMark">GLOSUJ</span>')}}}.bind(this));return false},deleteConfirm:function(A,B){this.sendRequest("deleteConfirmCheck",{"objId":A,"objType":B},function(C){if(C.status==1){this.showLightBoxStatic("garnier-deleteConfirm-lightbox",C.html)}}.bind(this));return false},getTopProfilesPage:function(A){this.sendRequest("getRankPacket",{"rank":"GarnierRank_Top_Profiles","page":A},function(B){if(B.status==1){Element.update("garnier-topProfilesRank",B.html)}}.bind(this));return false},getTopPhotosPage:function(A){this.sendRequest("getRankPacket",{"rank":"GarnierRank_Top_Photos","page":A},function(B){if(B.status==1){Element.update("garnier-lastPhotos",B.html)}}.bind(this));return false},getTopVideosPage:function(A){this.sendRequest("getRankPacket",{"rank":"GarnierRank_Top_Videos","page":A},function(B){if(B.status==1){Element.update("garnier-topVideos",B.html)}}.bind(this));return false},getLastPhotosPage:function(A){this.sendRequest("getRankPacket",{"rank":"GarnierFifo_Last_Photos","page":A},function(B){if(B.status==1){Element.update("garnier-lastPhotos",B.html)}}.bind(this));return false},getLastVideosPage:function(A){this.sendRequest("getRankPacket",{"rank":"GarnierFifo_Last_Videos","page":A},function(B){if(B.status==1){Element.update("garnier-lastVideos",B.html)}}.bind(this));return false},addVideoToContestBox:function(){this.showLightBox("garnierAddVideoToContestBox","viewAddVideoToContestBox",{},{"width":420,"height":120});return false},addVideoToContest:function(){var A=Form.serialize("addVideoToContestForm",true);this.sendRequest("addVideoToContest",A,function(B){if(B.status==1){Element.hide("addVideoToContestForm");Element.update("addVideoToContestMsg",B.msg);Element.show("addVideoToContestMsg");window.location.reload()}else{if(B.status==2){Element.update("addVideoToContestMsg",B.msg);Element.show("addVideoToContestMsg")}}}.bind(this));return false},showJoinToContestBox:function(){this.showLightBox("garnierViewJoinLightbox","viewJoinLightbox",{},{"width":400,"height":210});return false},joinToContest:function(){this.sendRequest("joinToContest",{},function(A){if(A.status==1){AppFramework.hideLightBox("garnierViewJoinLightbox");Element.update("garnier-joinBox",'<div class="profileInContest"><a href="http://mojageneracja.pl/garnierkonkurs"></a><p>0</p></div>')}else{if(A.status==2){Element.update("garnierJoinToContestMsg",A.msg)}}}.bind(this));return false},showRegisterHelp:function(A){if(A!=true){A=false}this.showLightBox("garnierViewRegisterHelp","viewRegisterHelpLightbox",{"isSection":A},{"width":650,"height":500});return false}});var garnier=new Garnier();var SimpleSection=Class.create();Object.extend(SimpleSection.prototype,AppFramework.prototype);Object.extend(SimpleSection.prototype,{appid:"SimpleSection",selectedUinsCount:0,selectedUinsMax:10,fantaGetWaitingPage:function(A){this.sendRequest("fantaGetWaintingForPresentPacket",{"page":A},function(B){if(B.status==1){$("left-container").update(B.html)}}.bind(this));return false},fantaGetRecentPage:function(A){this.sendRequest("fantaGetRecentPresentsPacket",{"page":A},function(B){if(B.status==1){$("recent-contaioner").update(B.html)}}.bind(this));return false},showOrangeUserbarLB:function(A){this.showLightBox("orange-userbar-lb","showOrangeUserbarLB",{"showOnly":A},{width:550,height:450});return false},showOrangeHappyDay:function(){this.showLightBox("orange-happyday-lb","showOrangeHappyDay",{},{width:550,height:400});return false},setUserbar:function(A){$("userbarId").value=A;$("userbar-choosed-name").update($("userbar-id-"+A).innerHTML);AppFramework.hideLightBox("orange-userbar-lb");return false},processUserbarRequest:function(){var A=Form.serialize("userbar-request",true);this.sendRequest("setUserbar",A,function(B){this.showLightBoxStatic("orange-form-validation-msg","<span>"+B.errorMsg+"</span>",{width:350,height:40})}.bind(this));return false},setInfoLabel:function(A){$("info-label").update($("info-label").innerHTML+"<p>"+A+"</p>")},showFullMsg:function(A){if(A==null){return false}Element.hide($(A+"-short"));Element.show($(A+"-full"));return false},hideFullMsg:function(A){if(A==null){return false}Element.show($(A+"-short"));Element.hide($(A+"-full"));return false},showOrangeRules:function(){this.showLightBox("orange-rules-lb","showOrangeRulesBox",{},{width:550,height:300});return false},getFriendsList:function(){this.showLightBox("orange-friendsList-lb","showOrangeFriendsListBox",{},{width:500,height:400});return false},selectUins:function(){var B=0;var A=Form.getInputs($("friendsList-uins"),"checkbox");A.each(function(C){if(C.checked){$("friendsuin_"+B).value=C.value;B++}});this.selectedUinsCount=0;AppFramework.hideLightBox("orange-friendsList-lb")},setUinAsSelected:function(A){if($(A).checked){if(this.selectedUinsCount<this.selectedUinsMax){this.selectedUinsCount++;Element.setStyle($("uins-"+A),{"backgroundColor":"#FF6501"});$("currentSelectedUins").update(this.selectedUinsCount.toString())}else{$(A).checked=false}}else{if(this.selectedUinsCount>0){this.selectedUinsCount--;Element.setStyle($("uins-"+A),{"backgroundColor":"#EFEFEF"});$("currentSelectedUins").update(this.selectedUinsCount.toString())}else{$(A).checked=true}}},maestroFutrzakiSetLightbox:function(){this.showLightBox("maestroFutrzaki-setLightbox","maestroFutrzakiSetElementLightbox",{},{width:600,height:520,closable:false});return false},maestroFutrzakiSetElement:function(A){this.sendRequest("maestroFutrzakiSetElement",{"elementId":A},function(C){if(C.status==1){if(C.currElement==null){$("maestroFutrzaki-element").removeClassName("futrzak__owner");$("maestroFutrzaki-element").addClassName("futrzak_"+A+"_owner");Effect.Fade("maestroFutrzaki-aboveAvatarsBox",{duration:1.5,"afterFinish":function(){Effect.Appear("maestroFutrzaki-avatarsBox",{duration:1.5})}})}else{$("maestroFutrzaki-element").removeClassName("futrzak_"+C.currElement+"_owner");$("maestroFutrzaki-element").addClassName("futrzak_"+A+"_owner")}AppFramework.hideLightBox("maestroFutrzaki-setLightbox");var B='<a href="http://gg.hit.gemius.pl/hitredir/id=.AiVfXRzLb24cSFl0vi2bacUfUpglGNijqoscpAqL3f.z7/stparam=qmjidxmpnq/url=http://www.maestrocard.pl/" target="_blank" class="maestroLink"></a><a href="#" onclick="AppFramework.hideLightBox(\'maestroFutrzaki-elementSetLightbox\');" class="closeButton"></a><img src="http://ad.hit.gemius.pl/redot.gif?l=8/tstamp=1234567890/id=..swQrSQZyp4UtmlBp4ndbdMPziYbK9hNBSx0sdwXd7.97/stparam=zimfiijiyx/fastid=1224979098645117476" style="position:absolute;" /><img src="http://gg.hit.gemius.pl/_1234567890/redot.gif?id=.AiVfXRzLb24cSFl0vi2bacUfUpglGNijqoscpAqL3f.z7/stparam=tlcspjdldv" style="position:absolute;" /><img src="http://gg.hit.gemius.pl/_1234567890/redot.gif?id=.AiVfXRzLb24cSFl0vi2bacUfUpglGNijqoscpAqL3f.z7/stparam=pigicvliul" style="position:absolute;" />';this.showLightBoxStatic("maestroFutrzaki-elementSetLightbox",B,{width:450,height:200,closable:false})}}.bind(this));return false},maestroFutrzakiGetPage:function(A){this.sendRequest("maestroFutrzakiLatestBoxPacket",{page:A},function(B){if(B.status==1){$("maestroFutrzaki-latestBox-buttons").update(B.html)}}.bind(this));return false}});var simplesection=new SimpleSection();var Samsung=Class.create();Object.extend(Samsung.prototype,AppFramework.prototype);Object.extend(Samsung.prototype,{appid:"Samsung",showSkinLightbox:function(A){this.showLightBoxStatic("samsung-set-skin",A+this.getWinCloseButton("samsung-set-skin"),{width:300,height:320});return false}});var samsung=new Samsung()