/* WUT? O.o */CORE={ActiveDropDowner:false,eof:1};SortableButtPlug=false;SortableEndDragButtPlug=false;goPrevious=false;goNext=false;DisableKeyNav=false;stamp_15min=false;Rocking=false;badpng=(/MSIE (5\.5|6).+Win/.test(navigator.userAgent));iesucks=(/MSIE (5\.5|6|7).+Win/.test(navigator.userAgent));lang="ru";CrossDomainCookier=false;checked300x250=false;function Check300x250(){if(!checked300x250){if($("atlas_240x400")){var c=0;Element.descendants($("atlas_240x400")).each(function(m){var g=m.tagName;if((g=="IMG")||(g=="OBJECT")||(g=="EMBED")){var j=Element.getWidth(m);c=j>c?j:c}});if(c>=300){if($("content_left")){$("content_left").style.marginRight="320px"}if($("content_right")){$("content_right").style.width="300px"}if((CORE)&&(CORE.LayoutChanged)){CORE.LayoutChanged()}checked300x250=true}}}}CORE.ADV={};CORE.ADV.Polaroid=function(g,c){CORE.ADV.Polaroid.no=0;CORE.ADV.Polaroid.previous=false;CORE.ADV.Polaroid.size=/x400/.test(g)?400:500;CORE.ADV.Polaroid.URL=c;CORE.ADV.Polaroid.settings={};document.write('<div id="'+(CORE.ADV.Polaroid.container=("polaroid_"+g))+'" style="height: '+CORE.ADV.Polaroid.size+'px;"></div>');setTimeout(CORE.ADV.Polaroid.init,1)};CORE.ADV.Polaroid.init=function(){new Ajax.Request("/ajax/polaroid.html?size="+CORE.ADV.Polaroid.size,{asynchronous:true,method:"GET",onSuccess:function(j){try{var g=j.responseText.evalJSON();if((g)&&(g.pool)){g.pool.sort(function(){return 0.5-Math.random()})}CORE.ADV.Polaroid.settings=g;CORE.ADV.Polaroid.fire()}catch(c){}}})};CORE.ADV.Polaroid.fire=function(){if((CORE.ADV.Polaroid.settings)&&(CORE.ADV.Polaroid.settings.pool)){var c=CORE.ADV.Polaroid.settings.pool[CORE.ADV.Polaroid.no];CORE.ADV.Polaroid.no++;if(CORE.ADV.Polaroid.no>=CORE.ADV.Polaroid.settings.pool.length){CORE.ADV.Polaroid.no=0}var g=CORE.ADV.Polaroid.perform(c.image,"<h1>"+c.title+'</h1><img src="http://i.cdn.maases.com/logo/promodj_wb_pixeled.gif" class="polaroid_logo" /><span>'+c.subtitle+"</span>",c.URL,CORE.ADV.Polaroid.previous);CORE.ADV.Polaroid.previous=g}};CORE.ADV.Polaroid.perform=function(n,z,u,t){var w=new Element("div").addClassName("polaroid");if(CORE.ADV.Polaroid.size==500){w.addClassName("polaroid_300x500")}$(CORE.ADV.Polaroid.container).appendChild(w);var q=new Element("img").setOpacity(0);w.appendChild(q);var j=new Element("div").addClassName("polaroid_info").setOpacity(0);w.appendChild(j);j.innerHTML='<div class="polaroid_content"><div style="visibility: hidden;">'+z+"</div></div>";var g=new Element("div").addClassName("polaroid_info_over").setOpacity(0);w.appendChild(g);g.innerHTML='<div class="polaroid_content">'+z+"</div>";var x=new Element("a");x.onclick=function(){(new Image()).src=CORE.ADV.Polaroid.URL;return true};x.setAttribute("href",u);x.setAttribute("target","_blank");x.update('<img src="http://i.cdn.maases.com/0.gif" width="100%" height="100%">');w.appendChild(x);Event.observe(q,"load",function(){new Effect.Opacity(q,{from:0,to:1,duration:0.2});new Effect.Opacity(j,{from:0,to:0.5,duration:0.2});new Effect.Opacity(g,{from:0,to:1,duration:0.2});setTimeout(function(){if(t){t.parentNode.removeChild(t);t.innerHTML=""}if(CORE.ADV.Polaroid.settings.interval){setTimeout(CORE.ADV.Polaroid.fire,CORE.ADV.Polaroid.settings.interval*1000)}},400)});q.src=n;return w};CORE.Alert=function(g){var m=new Element("DIV").addClassName("alert_container").setOpacity(0);var j=new Element("DIV").addClassName("alert_message").update(g);m.appendChild(j);$$("body")[0].appendChild(m);new Effect.Opacity(m,{from:0,to:1,duration:0.1});m._hideAway=function(){new Effect.Opacity(m,{from:m.getOpacity(),to:0,duration:0.1,afterFinish:function(){m.update("").parentNode.removeChild(m)}})};m.observe("click",function(){m._hideAway()});setTimeout(function(){m._hideAway()},4000);return false};CORE.Confirmation=function(){if(CORE.Confirmation.active){return}var n=new Element("DIV").addClassName("alert_container confirmation_container").setOpacity(0);CORE.Confirmation.active=n;n._hideAway=function(){clearTimeout(n._timeout);new Effect.Opacity(n,{from:n.getOpacity(),to:0,duration:0.1,afterFinish:function(){n.update("").parentNode.removeChild(n)}});CORE.Confirmation.active=false};n.observe("click",function(){n._hideAway()});var m=new Element("DIV").addClassName("alert_message confirmation_message");n.appendChild(m);var j=0;while(j<arguments.length){if(arguments[j+1]){var g=new Element("A").update(arguments[j]);g.cb=arguments[j+1];g.href="#";g.onclick=function(c){Event.stop(c);n._hideAway();this.cb();return false};m.appendChild(g)}else{m.appendChild(new Element("SPAN").update(arguments[j]))}m.appendChild(new Element("SPAN").update(" &nbsp; "));j+=2}$$("body")[0].appendChild(n);new Effect.Opacity(n,{from:0,to:1,duration:0.1});n._timeout=setTimeout(function(){n._hideAway()},30000);return false};CORE.API=function(m,j,g,c){j=j||{};j.digest=digest;c=c||CORE.API.GenericFailure;new Ajax.Request("/api/"+m.replace(".","/")+".json",{asynchronous:true,method:"POST",parameters:j,onSuccess:function(q){if(g){var t=false;try{t=q.responseText.evalJSON()}catch(n){}t=t||{};if(t.error){c(m,t,j,q)}else{if(t.warning){CORE.Alert(t.warning)}g(m,t,j,q)}}},onFailure:function(n){if(c){c(m,{},j,n)}}});return false};CORE.API.GenericFailure=function(n,g,m,c){var j=lng.api_failure;if((g)&&(g.error)){j=g.error}CORE.Alert(j);return false};var Autocompleter=Class.create();Autocompleter.prototype={i:false,boundTo:false,cache:true,cachedResults:{},offsetTop:0,offsetLeft:0,offsetWidth:0,delay:200,method:"GET",className:"autocompleter_item",classNameCurrent:"autocompleter_item_current",classNameFirst:"autocompleter_item_first",placeholder:false,placeholderClass:false,passEnter:true,initialize:function(g,c){var j=this;Object.extend(j,c);j.i=$(g);j.i.setAttribute("autocomplete","off");j.the=new Element("div");j.c=j.binder?j.binder(j.the):j.the;j.c.addClassName("autocompleter_container").hide();j.boundTo=j.boundTo?$(j.boundTo):j.i;j.putTo=j.putTo?$(j.putTo):false;if(j.putTo){j.putTo.parentNode.insertBefore(j.c,j.putTo)}else{j.boundTo.parentNode.insertBefore(j.c,j.boundTo)}j.value=j.i.value;Event.observe(j.i,"keydown",function(m){return j.onKeyDown(m)});Event.observe(j.i,"keyup",function(m){return j.onKeyUp(m)});Event.observe(j.i,"keypress",function(m){return j.onKeyPress(m)});Event.observe(j.i,"focus",function(m){j.placeholderCheck(false,true);j.focused=true;if(j.showImmediately){j.onValueChanged(true)}});Event.observe(j.i,"blur",function(m){j.hide();j.placeholderCheck();j.focused=false});Event.observe(j.c,"mouseout",function(){j.setCurrent(-1)});j.placeholderCheck()},placeholderCheck:function(c,g){var j=this;if(j.placeholder){if(((j.i.value=="")||(j.i.value==j.placeholder)||(c))&&(!g)){j.i.value=j.placeholder;if(j.placeholderClass){j.i.addClassName(j.placeholderClass)}return}else{if(j.i.value==j.placeholder){j.i.value=""}if(j.placeholderClass){j.i.removeClassName(j.placeholderClass)}}}},show:function(){var c=this;c.clonePosition(c.c,c.boundTo,{offsetTop:Element.getHeight(c.boundTo)+c.offsetTop,offsetLeft:c.offsetLeft,offsetWidth:c.offsetWidth,setHeight:false});c.c.show();c.visible=true},hide:function(c){var j=this;var g=function(){j.c.hide();j.visible=false;j.currentResult=false};j.delayedHide?setTimeout(g,250):g()},onKeyProcess:function(j,g){var c=this;if(!g){g=j.keyCode}switch(g){case Event.KEY_ESC:c.hide();break;case Event.KEY_TAB:case Event.KEY_RETURN:if(c.currentResult){c.fire(c.currentResult.item);c.hide();break}c.hide();if(j.keyCode===Event.KEY_TAB){return}if(j.keyCode===Event.KEY_RETURN){if(c.passEnter){return}}break;case Event.KEY_UP:c.setCurrent(c.currentResult?(c.currentResult.autocompleterIndex-1):-1);break;case Event.KEY_DOWN:c.setCurrent(c.currentResult?(c.currentResult.autocompleterIndex+1):0);break;default:return}Event.stop(j)},onKeyDown:function(g){var c=this;g=g||window.event;if(Prototype.Browser.Opera){c.keyCode=g.keyCode}else{return c.onKeyProcess(g)}},onKeyUp:function(g){var c=this;g=g||window.event;clearTimeout(c.valueChangeTimeout);c.valueChangeTimeout=setTimeout(function(){if(c.i.value!=c.value){c.value=c.i.value;c.onValueChanged()}},c.delay)},onKeyPress:function(g){var c=this;g=g||window.event;if(Prototype.Browser.Opera){return c.onKeyProcess(g,c.keyCode)}},onValueChanged:function(g){var c=this;c.onCancelRequest();if((!g)&&(((c.value=="")&&(!c.allowEmpty))||((c.placeholder)&&(c.value==c.placeholder)))){c.hide()}else{c.onRequest()}},onCancelRequest:function(){var c=this;if((c.ajax)&&(c.ajax.transport)){c.ajax.transport.abort()}c.ajax=false},onRequest:function(){var g=this;var c=g.value;if(g.cache){if(r=g.cachedResults[c]){g.onResults(r,c);return}}g.ajax=new Ajax.Request(g.onGetURL(),{asynchronous:true,method:g.method,parameters:g.parameters,onSuccess:function(j){var m=false;try{m=j.responseText.evalJSON()}catch(n){}if(m){if(g.cache){g.cachedResults[c]=m}g.onResults(m,c)}else{g.hide()}},onFailure:function(j){g.hide()}})},onResults:function(g,c){var j=this;if(j.value==c){j.clearResults();if(j.processResults){j.procressResults(g)}else{if(g.Results){g.Results.each(function(m){j.processResult(m,j)})}}(j.gotResults&&j.focused)?j.show():j.hide()}},onGetURL:function(){var c=this;return c.URL+encodeURIComponent(c.value)},clearResults:function(){var c=this;c.gotResults=false;c.results=[];c.currentResult=false;c.the.update("")},processResults:false,processResult:function(g,c){alert("please redefine processResult ;)")},addResult:function(g){var c=this;if((!c.gotResults)&&(c.classNameFirst)){g.addClassName(c.classNameFirst)}g.autocompleterIndex=c.results.length;c.results.push(g);c.the.appendChild(g);Event.observe(g,"mouseover",function(){c.setCurrent(g.autocompleterIndex);c.delayedHide=true});Event.observe(g,"mouseout",function(){c.delayedHide=false});Event.observe(g,"click",function(){c.fire(g.item);c.hide()});c.gotResults=true},fire:function(c){alert("please redefine fire ;)")},setCurrent:function(g){var c=this;if(g<-1){g=-1}if(g>=c.results.length){g=c.results.length-1}if(c.currentResult){c.currentResult.removeClassName(c.classNameCurrent)}c.currentResult=g>=0?c.results[g]:false;if(c.currentResult){c.currentResult.addClassName(c.classNameCurrent)}},clonePosition:function(q,m){var c=Object.extend({setLeft:true,setTop:true,setWidth:true,setHeight:true,offsetTop:0,offsetLeft:0,offsetWidth:0,offsetHeight:0},arguments[2]||{});m=$(m);var j=m.viewportOffset();q=$(q);var g=[0,0];var n=null;if(Element.getStyle(q,"position")=="absolute"){n=q.getOffsetParent();g=n.viewportOffset()}if(n==document.body){g[0]-=document.body.offsetLeft;g[1]-=document.body.offsetTop}if(c.setLeft){q.style.left=(j[0]-g[0]+c.offsetLeft)+"px"}if(c.setTop){q.style.top=(j[1]-g[1]+c.offsetTop)+"px"}if(c.setWidth){q.style.width=(m.offsetWidth+c.offsetWidth)+"px"}if(c.setHeight){q.style.height=(m.offsetHeight+c.offsetHeight)+"px"}return q},eof:true};var Chat=Class.create();Chat.prototype={channel:"",input:false,box:false,title:false,path:"/chat/",reconnectInterval:5*1000,fetchInterval:100,polling:false,secret:"",initialize:function(c){Object.extend(this,c);var g=this;if(g.title){setInterval(function(){new Ajax.Updater(g.title,g.path+"chat.html",{asynchronous:true,method:"POST",parameters:"channel="+encodeURIComponent(g.channel)+"&digest="+encodeURIComponent(digest)+"&mode=title&secret="+encodeURIComponent(g.secret),evalScripts:true})},20*1000)}new Ajax.Request(g.path+"chat.html",{asynchronous:true,method:"POST",parameters:"channel="+encodeURIComponent(g.channel)+"&digest="+encodeURIComponent(digest)+"&mode=init",onSuccess:function(n){var j={};try{j=n.responseText.evalJSON()}catch(m){}g.Process(j)},onFailure:function(j){g.Error()}});g.comet=new Comet("/ajax/"+(g.polling?"popl":"pop")+"?channel="+encodeURIComponent(g.channel),"",g.polling);g.comet.reconnectInterval=g.reconnectInterval;g.comet.fetchInterval=g.fetchInterval;g.comet.handlers.flood=function(m,j){g.Process(m)};g.comet.connect();CORE.ChatKill=function(j){if($("cm"+j)){if($("cm"+j).visible()){new Effect.Fade("cm"+j,{duration:0.2})}}return false};CORE.ChatKiller=function(j){new Ajax.Request(g.path+"chat.html",{asynchronous:true,method:"POST",parameters:"channel="+encodeURIComponent(g.channel)+"&digest="+encodeURIComponent(digest)+"&mode=kill&id="+encodeURIComponent(j),onSuccess:function(q){var m={};try{m=q.responseText.evalJSON()}catch(n){}g.Process(m)},onFailure:function(m){g.Error()}});if(s=$("cm"+j)){s.setOpacity(0.5)}return false}},Process:function(g){if(!g){return}var c=this;if(g.items){g.items.each(function(j){if((j.message)&&(!$(j.id))){var m=new Element("DIV").update(j.message).hide().setOpacity(0);if(j.className){m.addClassName(j.className)}m.setAttribute("id",j.id);$(c.box).insertBefore(m,$(c.box).firstChild);new Effect.Appear(m,{duration:0.5})}})}},Error:function(){var c=this;c.Process({items:[{id:"chaterror"+Math.random(),message:"O.o"}],})},Send:function(){var c=this;if($(c.input).value!=""){new Ajax.Request(c.path+"chat.html",{asynchronous:true,method:"POST",parameters:"channel="+encodeURIComponent(c.channel)+"&digest="+encodeURIComponent(digest)+"&mode=message&message="+encodeURIComponent($(c.input).value),onSuccess:function(m){var g={};try{g=m.responseText.evalJSON()}catch(j){}c.Process(g)},onFailure:function(g){c.Error()}})}$(c.input).value=""},eof:1};Popper=false;var Comet=Class.create();Comet.prototype={lastModified:null,eTag:null,URL:"/nonexistent",reconnectInterval:20000,fetchInterval:500,duplicateInterval:5000,cometSequence:-1,duplicate:false,wasError:false,handlers:{},polling:false,initialize:function(c,j,g){this.URL=c;if(j){this.lastModified=j}if(g){this.polling=g}},connect:function(){var c=new Array();if(this.lastModified!=null){c.push("If-Modified-Since");c.push(this.lastModified)}if(this.eTag!=null){c.push("If-None-Match");c.push(this.eTag)}var g=this;new Ajax.Request(this.URL,{method:"get",parameters:{},requestHeaders:c,oversun:g,onSuccess:function(m){var j=m.request.options.oversun;j.lastModified=m.getResponseHeader("Last-Modified")||j.lastModified;j.eTag=m.getResponseHeader("Etag")||j.eTag;j.handleResponse(m);j.wasError=false},onComplete:function(m){var j=m.request.options.oversun;j.wasError=j.wasError||(m.status==0)||(m.status==304);g.next()},onFailure:function(m){var j=m.request.options.oversun;j.wasError=true;g.next()}})},next:function(){var c=this;if(c.duplicate){c.duplicate=false;setTimeout(function(){c.connect()},c.duplicateInterval)}else{if(c.wasError){c.wasError=false;setTimeout(function(){c.connect()},c.reconnectInterval)}else{setTimeout(function(){c.connect()},c.fetchInterval)}}},disconnect:function(){},handleResponse:function(q){var j=this;try{var g=q.responseText.evalJSON();if(g.command){g=[g]}var n=true;var c=false;g.each(function(t){if(t.lastModified){j.lastModified=t.lastModified}if(t.cometSequence){if(parseFloat(t.cometSequence)==j.cometSequence){n=false}else{c=t.cometSequence}}});if(c){j.cometSequence=parseFloat(c)}if(n){g.each(function(t){if(handler=j.handlers[t.command]){handler(t,q)}else{j.unhandled(t,q)}})}else{j.duplicate=true}}catch(m){}},unhandled:function(c,g){}};function LaunchPopper(n,g,j,c){var m="?";if(j!=""){m+="mode="+j+"&"}if(c!=""){m+="submode="+c+"&"}m+="hash="+n+"&v=7&"+Math.round(Math.random()*1000);Popper=new Comet("/ajax/popl?channel="+n,g,false);Popper.reconnectInterval=150;Popper.fetchInterval=50;Popper.handlers.alert=function(t,q){alert(t.value)};Popper.handlers.dbg=function(t,q){$("dbg").update(t.value)};Popper.handlers["session.refresh"]=function(t,q){new Ajax.Request("/ajax/session_refresh.html"+m,{asynchronous:true,method:"GET",evalScripts:true})};Popper.handlers["messages.update.counter"]=function(t,q){if($("messages_count_holder")){setTimeout(function(){new Ajax.Updater("messages_count_holder","/ajax/messages.html"+m,{asynchronous:true,method:"GET",onSuccess:RecalcTooltips,evalScripts:true})},100)}};Popper.connect()}NatashaKapustina=false;NatashaPosting=false;NavigatorLocked=false;CommentsPage="";function CommentReply(j,c){if(!NatashaPosting){var g=$("commentform");if(!g){return false}if(!$("ch"+j)){return false}g.parentNode.removeChild(g);if(NatashaKapustina){NatashaKapustina.style.display="inline"}$("ch"+j).appendChild(g);g.style.display="";(NatashaKapustina=$("ct"+j)).style.display="none";$("replyto").value=j;$("commentpreview").style.display="none";if(!c){setTimeout("$('comment').focus();",1)}}return false}function CommentSubmitSuccess(j){var c=$("commentform");var g=$("commentprogressc");NatashaPosting=false;$("cs1").disabled=false;$("cs2").disabled=false;$("comment").value="";c.style.display="block";g.setAttribute("id","commentprogressd");g.parentNode.removeChild(g);CommentReply(0,true);RecalcTooltips()}function CommentSubmit(){if(!Validated){return PerformValidation()}NatashaPosting=true;var c=$("commentform");if(cp=$("commentprogress")){cp=cp.cloneNode(false);cp.setAttribute("id","commentprogressc");cp.style.display="inline";$("ch"+$("replyto").value).appendChild(cp)}c.style.display="none";$("cs1").disabled=true;$("cs2").disabled=true;$("commentpreview").style.display="none";new Ajax.Updater("cp"+$("replyto").value,"/ajax/comment.html?page="+CommentsPage,{asynchronous:true,method:"POST",onSuccess:CommentSubmitSuccess,evalScripts:true,parameters:"digest="+digest+"&"+Form.serialize($("commentformm"))});return false}function CommentDeleteSuccess(g){var c=$("commentform");NatashaPosting=false;$("cs1").disabled=false;$("cs2").disabled=false;if(!g.request.noclear){if($("comment")){$("comment").value=""}}c.style.display="block";CommentReply(0,true);$(g.request.wtf).innerHTML=g.responseText;if(h=$(g.request.hilight)){setTimeout(function(){new Effect.Highlight(h,{})},1)}g.responseText.evalScripts();RecalcTooltips()}function CommentDelete(m,g,j){CommentReply(m,true);NatashaPosting=true;var c=$("commentform");if(cp=$("commentprogress")){cp=cp.cloneNode(false);cp.setAttribute("id","commentprogressc");cp.style.display="inline";$("ch"+m).appendChild(cp);$("ct"+m).style.display="none"}c.style.display="none";$("cs1").disabled=true;$("cs2").disabled=true;$("commentpreview").style.display="none";(new Ajax.Request("/ajax/comment.html?page="+CommentsPage,{asynchronous:true,method:"POST",onSuccess:CommentDeleteSuccess,parameters:"digest="+digest+"&delete=1&spam="+j+"&"+Form.serialize($("commentformm"))})).wtf="cp"+g;return false}function CommentBest(j,g){CommentReply(j,true);NatashaPosting=true;var c=$("commentform");if(cp=$("commentprogress")){cp=cp.cloneNode(false);cp.setAttribute("id","commentprogressc");cp.style.display="inline";$("ch"+j).appendChild(cp);$("ct"+j).style.display="none"}c.style.display="none";$("cs1").disabled=true;$("cs2").disabled=true;$("commentpreview").style.display="none";(new Ajax.Request("/ajax/comment.html?page="+CommentsPage,{asynchronous:true,method:"POST",onSuccess:CommentDeleteSuccess,parameters:"digest="+digest+"&best=1&"+Form.serialize($("commentformm"))})).wtf="cp"+g;return false}function CommentThread(t,g,q,n){CommentReply(t,true);NatashaPosting=true;var c=$("commentform");var j=(q?("vote_commentID="+q+"&vote="+n+"&"):"");var m=false;if(cp=$("commentprogress")){cp=cp.cloneNode(false);cp.setAttribute("id","commentprogressc");cp.style.display="inline";$("ch"+t).appendChild(cp);$("ct"+t).style.display="none"}if(c){c.style.display="none";$("cs1").disabled=true;$("cs2").disabled=true;$("commentpreview").style.display="none";m=new Ajax.Request("/ajax/comment.html",{asynchronous:true,method:"POST",onSuccess:CommentDeleteSuccess,parameters:(wtf="digest="+digest+"&thread=1&"+j+Form.serialize($("commentformm")))})}else{m=new Ajax.Request("/ajax/comment.html",{asynchronous:true,method:"POST",onSuccess:CommentDeleteSuccess,parameters:(wtf="digest="+digest+"&thread=1&comment[replyto]="+t+"&"+j)})}m.wtf="cp"+g;m.hilight="c"+t;return false}function CommentVote(g,c){$("cvv"+g).innerHTML="";$("cvvv"+g).innerHTML="";$("cvvv"+g).appendChild(CreateRoller());new Ajax.Updater("cv"+g,"/ajax/comment_vote.html",{asynchronous:true,method:"POST",parameters:"digest="+digest+"&commentID="+g+"&vote="+c,evalScripts:true});return false}function CommentPreviewSuccess(c){RecalcTooltips()}function CommentPreview(){$("commentpreview").innerHTML="";$("commentpreview").style.display="block";if(c=$("commentprogress")){var c=c.cloneNode(false);c.setAttribute("id","commentprogressc");c.style.display="inline";var g=document.createElement("div");g.style.textAlign="center";g.style.padding="10px";g.appendChild(c);$("commentpreview").appendChild(g)}new Ajax.Updater("commentpreview","/ajax/comment.html",{asynchronous:true,method:"POST",onSuccess:CommentPreviewSuccess,parameters:"digest="+digest+"&preview=1&"+Form.serialize($("commentformm"))})}function CommentPreviewKeyhandler(c){c=c?c:window.event;if(c){if((c.ctrlKey)&&((c.keyCode==10)||(c.keyCode==13))){CommentSubmit()}}}function CommentSmiles(){var c=$("commentsmiles");c._shown=!c._shown;c.style.display=c._shown?"block":"none";return false}function CommentSubscribeSuccess(c){c.request.wtf.innerHTML=c.responseText;c.responseText.evalScripts();RecalcTooltips()}function CommentSubscribe(g){var c=$("csub"+g);if(tooltipped){tooltip.h()}c.innerHTML="";c.appendChild(CreateRoller());(new Ajax.Request("/ajax/comment_subscribe.html",{asynchronous:true,method:"POST",onSuccess:CommentSubscribeSuccess,parameters:"digest="+digest+"&commentownerID="+g})).wtf=c;return false}function CommentScroll(c){setTimeout(function(){Effect.ScrollToEx("c"+c,{duration:0.2,offset:-200});$("c"+c).parentNode.className="comment comment_hilight"},30)}function FileCommentsNavigatorPaged(c){NavigatorLocked=false;setTimeout(function(){Effect.ScrollToEx("file_comments",{duration:0.2,offset:-200});NatashaKapustina=$("ct0")},10);RecalcTooltips()}function FileCommentsNavigatorPage(g,c){if(NavigatorLocked){return false}NavigatorLocked=true;if(g){g.appendChild(CreateRoller())}CommentsPage=c;new Ajax.Updater("file_comments","/ajax/file_comments.html?page="+c,{asynchronous:true,method:"POST",parameters:"digest="+digest+"&fileID="+fileID,onSuccess:FileCommentsNavigatorPaged});return false}CORE.ApplyCommentsCounters=function(c){c.each(function(m){var g=m[0];var n=m[1];var j=m[2];if(e=document.getElementById("cc"+g)){e.innerHTML=(n>0?n:"")+(j>0?('<span class="newc">+'+j+"</span>"):"")}})};function Selectory(m,n,g,j,c){target=$(n);o=new Option();o.text="...";o.value="0";target.length=0;target.options[target.length]=o;new Ajax.Request("/ajax/selector.html",{method:"get",parameters:"lang="+encodeURIComponent(lang)+"&src="+encodeURIComponent(m)+"&dest="+encodeURIComponent(n)+"&kind="+encodeURIComponent(g)+"&value="+encodeURIComponent($(m).value)+"&any="+encodeURIComponent(j)+"&filter="+encodeURIComponent(c)+"&"+Math.random(),onComplete:GotSelector})}function GotSelector(c){c=c.responseText;c=c.split("\x0D\x0A");if(c.length==0){return}if(!(target=$(c[0]))){return}target.length=0;var j=-1;for(k=1;k<c.length-1;k++){y=c[k].split("<.>");o=new Option();o.text=y[1];o.value=y[0];target.options[target.length]=o;j++}if(target.onchange){target.onchange()}var g=c[0]+"_row";if(g=$(g)){g.style.display=j?"":"none";if(window.RecoverHiddenStuff){window.RecoverHiddenStuff()}}}function getCursor(g){var q={start:0,end:0,fixup:0};if(g.setSelectionRange){q.start=g.selectionStart;q.end=g.selectionEnd}else{if(!document.selection){return 0}else{if(document.selection&&document.selection.createRange){var c=document.selection.createRange();var j=c.duplicate();try{j.moveToElementText(g)}catch(n){}j.setEndPoint("EndToEnd",c);var m=0;for(k=0;k<j.text.length;k++){if(j.text.charCodeAt(k)==13){m++}}q.start=j.text.length-c.text.length;q.end=q.start+c.text.length;q.fixup=m}}}return q}function setCursor(m,j,n,g){if(m.createTextRange){var c=m.createTextRange();c.move("character",j-g);c.select()}else{if(m.selectionStart){m.setSelectionRange(j,n)}}}function InsertPair(w,m,t,z){var n=$(w)?$(w):w;n.focus();var j=n.scrollTop;var c=getCursor(n);var q=0;if(c.start==c.end){if((m)&&(m.tagged=!m.tagged)){n.value=n.value.substring(0,c.start)+t+n.value.substr(c.start);q=c.start+t.length}else{n.value=n.value.substring(0,c.start)+z+n.value.substr(c.start);q=c.start+z.length}setCursor(n,q,q,c.fixup)}else{var x=n.value.substring(0,c.start);var u=n.value.substring(c.start,c.end);var g=n.value.substring(c.end);n.value=x+t+u+z+g;var q=String(x+t+u+z).length;setCursor(n,q,q,c.fixup)}if(j){n.scrollTop=j}return false}function InsertTA(g,c){g.value+=c}function Insert(g,c){return InsertPair(g,false,"",c)}function taTwin(g,c,m,j){return InsertPair(g,c,m,j)}function taPut(c,g){return InsertPair(c,false,"",g)}function taBold(g,c){return taTwin(g,c,"<b>","</b>")}function taItalic(g,c){return taTwin(g,c,"<i>","</i>")}function taUnderline(g,c){return taTwin(g,c,"<u>","</u>")}function taStrike(g,c){return taTwin(g,c,"<s>","</s>")}function taAbbr(g,c){return taTwin(g,c,"<abbr>","</abbr>")}function taCut(g,c){return taPut($(g),"<cut>")}function taURL(c){var c=$(c);var g=prompt("URL","http://");if(g){var j=prompt("Title","Title");if(j){taPut(c,'<a href="'+g+'">'+j+"</a>")}}return false}function taTool(q,n,c){var g=Math.round((document.body.clientWidth-n)/2);var j=Math.round((document.body.clientHeight-c)/2);var m=window.open(q,"pdjedittool","toolbar=no,scrollbars=yes,status=no,height="+c+",width="+n+",top="+j+",left="+g);m.focus();return false}function taInsertToOpener(g,m){var j=window.opener.document;var c=window.opener.document.getElementById(g);window.opener.taPut(c,m);return true}function AfishaAddressChange(j){var g=false,c=false;if(j.id=="afisha_adr_metro"){g="metroID";c="afisha_adr_city"}else{if(j.id=="afisha_adr_city"){g="cityID";c="afisha_adr_region"}else{if(j.id=="afisha_adr_region"){g="regionID";c="afisha_adr_country"}else{g="countryID";c=false}}}if((j.value>0)||(!c)){window.location.replace(AfishaAddressURLPrefix+g+"="+j.value)}else{AfishaAddressChange($(c))}return false}function JoinUnjoinCommunity(c,g){c.appendChild(CreateRoller());new Ajax.Updater(c.id,"/ajax/community_join.html",{asynchronous:true,method:"POST",onSuccess:RecalcTooltips,parameters:"digest="+digest+"&communityID="+g});return false}function ColorPicker(q,t){var c=450;var n=360;var m=Math.round((document.body.clientWidth-c)/2);var j=Math.round((document.body.clientHeight-n)/2);var g=window.open("/ajax/colorpicker.html?color="+encodeURIComponent(q)+"&return_to="+encodeURIComponent(t),"pdjcolorpicker","toolbar=no,scrollbars=no,status=no,height="+n+",width="+c+",top="+j+",left="+m);g.focus()}function SetAdminskyStatus(c){SetOption("adminsky_column",c?1:0);if(c){$("adminsky_column_content").show().setStyle({width:"150px"});$("adminsky_up").hide()}else{$("adminsky_column_content").hide().setStyle({width:"0px"});$("adminsky_up").show()}return false}function AvatarSelector(c,g){$("current_avatar").value=g;var j=0;while(i=$("avasel"+j)){if(i.id!=c.id){i.className="avatar"}j++}c.className="avatar_active"}function Wishlist(g,c,j){$("wisho"+c).innerHTML="";if(tooltipped){tooltip.h()}new Ajax.Updater("wisho"+c,"/ajax/market_wish.html",{asynchronous:true,method:"POST",parameters:"digest="+digest+"&offerID="+c+"&status="+j});return false}function TicketAttach(c){c.style.display="none";$("attach_file").style.display="block";setTimeout("$('attacher').focus();",50)}function TicketInsertTemplate(c){InsertTA($("ta"),$($("template").value).getAttribute("value_"+c))}function SetOption(g,c){new Ajax.Request("/ajax/option_set.html",{method:"post",parameters:"option="+encodeURIComponent(g)+"&value="+encodeURIComponent(c)})}CORE.CreateCropper=function(g){var c=new Element("div");c.o=g;c.iconize=function(q,m,j){var t=new Element("a").setStyle({opacity:0.8});t.href="#";t.onclick=function(){m();return false};t.onmouseover=function(){t.setOpacity(1)};t.onmouseout=function(){t.setOpacity(0.8)};var n=new Element("img");n.src=q;if(j){n.setAttribute("title",j)}t.appendChild(n);clearTimeout(c.iconizeTimeout);c.iconizeTimeout=setTimeout(RecalcTooltips,50);return t};c.pixelize=function(j){return{left:Math.round(j.left*c.o.imageWidth/100),top:Math.round(j.top*c.o.imageHeight/100),width:Math.round(j.width*c.o.imageWidth/100),height:Math.round(j.height*c.o.imageHeight/100)}};c.init=function(){c.visible=!g.hidden;c.dumbOpacity=Prototype.Browser.IE&&(!g.cropping);c.opacity=c.o.opacity==undefined?0.4:c.o.opacity;c.setStyle({position:"absolute",lineHeight:"0px",fontSize:"0px"});if(g.cropping){c.setStyle({cursor:"move"})}var j=new Element("img");j.src=c.o.image?c.o.image:"http://i.cdn.maases.com/0.gif";var m={width:"100%",height:"100%"};m.border="1px dotted #999999";m.backgroundColor="#ffffff";j.setStyle(m);c.appendChild(c.hilighter=j);if(c.dumbOpacity){c.hilighter.style.display=(c.visible&&(c.opacity>0))?"block":"none"}else{c.hilighter.setOpacity(c.visible?c.opacity:0)}c.signature=false;c.coords={left:g.left,top:g.top,width:g.width,height:g.height};c.draggingFix={x:0,y:0};c.smoothOpacity=function(w){if(c.dumbOpacity){c.hilighter.style.display=w>0?"block":"none";return}if(c.smoothEffect){c.smoothEffect.cancel()}c.smoothEffect=new Effect.Opacity(c.hilighter,{from:c.hilighter.getOpacity(),to:w,duration:w==0?0.3:0.1})};c.switchTo=function(w){c.visible=w;c.smoothOpacity(c.visible?c.opacity:0)};c.accept=function(){if(g.onAccept){g.onAccept(c.coords,c)}};c.cancel=function(){if(g.onCancel){g.onCancel(c)}};c.apply=function(){c.style.left=c.coords.left+"%";c.style.top=c.coords.top+"%";c.style.width=c.coords.width+"%";c.style.height=c.coords.height+"%";if(g.onApply){g.onApply(c.coords,c)}};c.bringToFront=function(w){c.style.zIndex=w?"11000":"auto"};if(g.cropping){c.ondblclick=c.accept;c.onmousedown=function(x){x=x||window.event;if(!c.mouseUpHandler){c.mouseUpHandler=function(B){return c.mouseUp(B||window.event)}}if(!c.mouseMoveHandler){c.mouseMoveHandler=function(B){return c.mouseMove(B||window.event)}}Event.observe(document,"mouseup",c.mouseUpHandler);Event.observe(document,"mousemove",c.mouseMoveHandler);var z=Event.pointer(x);var w=Element.cumulativeOffset(c);var A=Element.getDimensions(c.parentNode);c.draggingFix.x=(z.x-w[0])/A.width*100;c.draggingFix.y=(z.y-w[1])/A.height*100;Event.stop(x)};c.mouseUp=function(w){Event.stopObserving(document,"mouseup",c.mouseUpHandler);Event.stopObserving(document,"mousemove",c.mouseMoveHandler);Event.stop(w)};c.mouseMove=function(x){var z=Event.pointer(x);var w=Element.cumulativeOffset(c.parentNode);var A=Element.getDimensions(c.parentNode);c.coords.left=Math.min(Math.max((z.x-w[0])/A.width*100-c.draggingFix.x,0),100-c.coords.width);c.coords.top=Math.min(Math.max((z.y-w[1])/A.height*100-c.draggingFix.y,0),100-c.coords.height);c.apply();Event.stop(x)};var n=new Element("div");n.setStyle({position:"absolute",right:"-3px",bottom:"-3px",width:"6px",height:"6px",border:"1px solid #ffffff",cursor:"se-resize",zIndex:100});n.draggingFix={x:0,y:0};n.onmousedown=function(w){w=w||window.event;if(!n.mouseUpHandler){n.mouseUpHandler=function(C){return n.mouseUp(C||window.event)}}if(!n.mouseMoveHandler){n.mouseMoveHandler=function(C){return n.mouseMove(C||window.event)}}Event.observe(document,"mouseup",n.mouseUpHandler);Event.observe(document,"mousemove",n.mouseMoveHandler);var x=Event.pointer(w);var B=Element.cumulativeOffset(n);var z=Element.getDimensions(c.parentNode);n.draggingFix.x=0;n.draggingFix.y=0;try{n.saved_body_cursor=(b=$$("body")[0]).style.cursor;b.style.cursor=n.style.cursor}catch(A){n.saved_body_cursor="default"}n.saved_image_cursor=c.parentNode.style.cursor;c.parentNode.style.cursor=n.style.cursor;Event.stop(w)};n.mouseUp=function(w){try{$$("body")[0].style.cursor=n.saved_body_cursor}catch(x){}c.parentNode.style.cursor=n.saved_image_cursor;Event.stopObserving(document,"mouseup",n.mouseUpHandler);Event.stopObserving(document,"mousemove",n.mouseMoveHandler);Event.stop(w)};n.mouseMove=function(w){var x=Event.pointer(w);var B=Element.cumulativeOffset(c.parentNode);var z=Element.getDimensions(c.parentNode);c.coords.width=(x.x-B[0]-n.draggingFix.x)/z.width*100-c.coords.left;c.coords.height=(x.y-B[1]-n.draggingFix.y)/z.height*100-c.coords.top;c.coords.width=Math.min(Math.max(c.coords.width,c.o.minWidth?c.o.minWidth:15),100-c.coords.left);c.coords.height=Math.min(Math.max(c.coords.height,c.o.minHeight?c.o.minHeight:15),100-c.coords.top);if(c.o.keepRatio){var A=c.o.minHeight/c.o.minWidth;c.coords.height=c.coords.width*A;if((c.coords.top+c.coords.height)>100){c.coords.height=100-c.coords.top;c.coords.width=c.coords.height/A}}c.apply();Event.stop(w)};c.resizer=n;c.appendChild(c.resizer);if(g.hint){var q=new Element("div").setStyle({position:"absolute",textAlign:"center",lineHeight:"1.3",fontSize:"11px",paddingTop:"4px",opacity:0.8,top:"100%",left:"0%",right:"0%"});var t=new Element("span").setStyle({background:"url(http://i.cdn.maases.com/fv/harder.png)",color:"#ffffff"});t.appendChild(new Element("span").update(g.hint));q.appendChild(t);c.signature=q;var u=c.o.controls?new Element("div").setStyle({textAlign:"center"}):new Element("div").setStyle({textAlign:"center",paddingTop:"4px"});u.appendChild(c.iconize("http://i.cdn.maases.com/fv/decline.png",function(){c.cancel()},lng.fv_decline).setStyle({marginRight:"10px"}));u.appendChild(c.iconize("http://i.cdn.maases.com/fv/accept.png",function(){c.accept()},lng.fv_accept));c.o.controls?c.o.controls.appendChild(u):q.appendChild(u);c.appendChild(c.signature)}}else{if((g.signature)&&(parseFloat(g.width)!=0)){c.forcedOpacity=false;var q=new Element("div").setStyle({position:"absolute",textAlign:"center",lineHeight:"1.3",fontSize:"11px",paddingTop:"4px",opacity:0.8,top:"100%",left:"0%",right:"0%",display:"none"});q.appendChild(new Element("span").setStyle({backgroundColor:"#ffffff",color:"#000000",padding:"1px 4px"}).update(g.signature));c.signature=q;c.appendChild(c.signature);c.showSignature=function(){q.style.display="block"};c.hideSignature=function(){q.style.display="none"};c.setHilighterOpacity=function(w){c.savedOpacity=w;c.opacity=w;if(c.forcedOpacity==false){c.smoothOpacity(c.visible?w:0)}};c.forceOpacity=function(w){if(w==false){c.forcedOpacity=false;c.smoothOpacity(c.visible?c.savedOpacity:0);c.opacity=c.savedOpacity}else{c.forcedOpacity=w;c.savedOpacity=c.opacity;c.smoothOpacity(c.visible?c.forcedOpacity:0);c.opacity=c.forcedOpacity}};c.onmouseover=function(w){if(c.o.onOver){c.o.onOver(w)}};c.onmouseout=function(w){if(c.o.onOut){c.o.onOut(w)}}}}c.apply()};c.init();return c};afterbookmark=false;fileID=false;function SwitchAboutLang(c){$("aabout_ru").className=c=="ru"?"active":"";$("aabout_en").className=c=="en"?"active":"";$("about_ru").style.display=c=="ru"?"block":"none";$("about_en").style.display=c=="en"?"block":"none";return false}function VoteSuccess(c){c.request.wtf.rolling=false;if(r=c.request.roller){r.parentNode.removeChild(r)}}function Vote(x,z,n,g,u){if(n.rolling){return false}if((!Validated)&&(digest)){return PerformValidation()}n.rolling=true;var j=false;if(x=="user"){var w=Element.cumulativeOffset($("rankvoter2"));var q=w[0]+7;var m=w[1]+12;var c=CreateRoller();c.style.position="absolute";c.style.left=q+"px";c.style.top=m+"px";n.appendChild(c)}else{if(u){n.parentNode.appendChild(j=CreateRoller())}else{n.appendChild(CreateRoller())}}var t=new Ajax.Updater(n.id,"/ajax/vote.html",{asynchronous:true,method:"POST",onSuccess:VoteSuccess,evalScripts:true,parameters:"digest="+digest+"&kind="+x+"&kindID="+z+"&id="+n.id+"&hash="+g});t.wtf=n;t.roller=j;return false}function BookmarkSuccess(c){c.responseText.evalScripts();c.request.wtf.rolling=false;if(afterbookmark){afterbookmark()}}function Bookmark(g,c,m,j){if(m.rolling){return false}m.rolling=true;m.className="rolling";(new Ajax.Request("/ajax/bookmark.html",{asynchronous:true,method:"POST",onSuccess:BookmarkSuccess,evalScripts:true,parameters:"digest="+digest+"&kind="+g+"&kindID="+c+"&id="+m.id+"&hash="+j})).wtf=m;return false}function ToggleIdol(g,c){(f=$("idolr")).style.background="url(http://i.cdn.maases.com/roller2.gif)";f.style.backgroundPosition="50% 55%";f.style.backgroundRepeat="no-repeat";new Ajax.Request("/ajax/idol.html",{method:"post",parameters:"digest="+digest+"&idolID="+g+"&hash="+c,onComplete:ExecuteIt});return false}function ToggleFriend(g,c){(f=$("friendr")).style.background="url(http://i.cdn.maases.com/roller2.gif)";f.style.backgroundPosition="50% 55%";f.style.backgroundRepeat="no-repeat";new Ajax.Request("/ajax/friend.html",{method:"post",parameters:"digest="+digest+"&friendID="+g+"&hash="+c,onComplete:ExecuteIt});return false}function ToggleIgnore(g,c){(f=$("ignorer")).style.background="url(http://i.cdn.maases.com/roller2.gif)";f.style.backgroundPosition="50% 55%";f.style.backgroundRepeat="no-repeat";new Ajax.Request("/ajax/ignore.html",{method:"post",parameters:"digest="+digest+"&ignoreID="+g+"&hash="+c,onComplete:ExecuteIt});return false}function Flyer(g,c,q){c+=30;q+=30;var n=Math.round((document.body.clientWidth-c)/2);var m=Math.round((document.body.clientHeight-q)/2);var j=window.open("/ajax/flyer.html?flyerID="+g,"pdjflyer","toolbar=no,scrollbars=no,status=no,height="+q+",width="+c+",top="+m+",left="+n);j.focus();return false}function AfishaGoes(c,g){$("who_goes_button").disabled=true;new Ajax.Updater("who_goes","/ajax/afisha_goes.html",{asynchronous:true,method:"POST",onSuccess:RecalcTooltips,parameters:"digest="+digest+"&afishaID="+c+"&goes_hash="+g});return false}function FotoWho(c,g){$("who_button").disabled=true;new Ajax.Updater("who","/ajax/foto_who.html",{asynchronous:true,method:"POST",onSuccess:RecalcTooltips,parameters:"digest="+digest+"&fotoID="+c+"&who_hash="+g});return false}function SetFileLikeDone(){$("filelike").value=""}function SetFileLike(){var c=$("filelike").value;if(c.length>0){$("filelikes").appendChild(CreateRoller());$("filelike").value="";new Ajax.Updater("filelikes","/ajax/file_likes.html",{asynchronous:true,method:"POST",onSuccess:SetFileLikeDone,parameters:"digest="+digest+"&fileID="+fileID+"&like="+encodeURIComponent(c)})}return false}function FileDownloadFlash(){if(d=$("download_flasher")){d.className=d.className=="flash"?"":"flash";setTimeout(FileDownloadFlash,600)}}function SubmitPollDone(c){RecalcTooltips();setTimeout(function(){Effect.ScrollToEx("postpoll"+c.request.wtf,{duration:0.2,offset:-100})},30)}function SubmitPoll(c,m){c.disabled=true;var j=0,g=Form.serialize("pollform"+m);while(v=$("variant"+m+"_"+j)){v.disabled=true;j++}(new Ajax.Updater("postpoll"+m,"/ajax/poll.html",{asynchronous:true,method:"post",parameters:g+"&postID="+m+"&digest="+digest,onSuccess:SubmitPollDone})).wtf=m;return false}function PollButton(g,j){var c=$("poll_voter_"+j);if(c._locks==undefined){c._locks=0}if(g.checked){c._locks++}else{c._locks--}c.disabled=c._locks>0?false:true}var NextTwinkler="twinkler2";var CurrentTwinkler=0;var twinker=false;function TwinkTwink(){if(!$("twinkler_container")){return}if(twinker){CurrentTwinkler++;if(CurrentTwinkler>=twinker.length){CurrentTwinkler=0}var c=twinker[CurrentTwinkler];$("twinkler_container").setStyle({width:c.width+"px",height:c.height+"px"});$(NextTwinkler).update(c.html).setOpacity(1).show().setStyle({zIndex:100});NextTwinkler=(NextTwinkler=="twinkler2")?"twinkler":"twinkler2";$(NextTwinkler).setStyle({zIndex:101});new Effect.Opacity($(NextTwinkler),{from:1,to:0,duration:0.2,afterFinish:function(){$(NextTwinkler).hide()}})}setTimeout(TwinkTwink,10000)}function fotoslamI(q){var n=$("fotos_slam_hover");if(n){var m=Element.cumulativeOffset(q.parentNode.parentNode);var j=Element.getDimensions(q);var c=m.left+j.width/2-n.width/2-1;var g=m.top+j.height/2-n.height/2-1;n.src=q.src;n.style.left=c+"px";n.style.top=g+"px";n.style.display="block";n._original=q}}function fotoslamO(c){}function fotoslamIH(c){}function fotoslamOH(g){var c=$("fotos_slam_hover");if(c){c.hide()}}function fotoslamC(g){var c=g._original.parentNode;if((c.click)&&(!Prototype.Browser.Gecko)){c.click()}else{if(c.onclick){c.onclick()}else{if(c.href){window.location.replace(c.href)}}}}var FotoViewer=Class.create();FotoViewer.prototype={m:[],ma:[],activeOpacity:1,inactiveOpacity:1,oneListTarget:-1,oneListSavedScroll:-1,oneOverPhase:false,oneOverOpacity:0.2,hilighters:[],slideShowing:false,steve:false,disableAnimation:false,disableScrollBar:false,initialize:function(j){var m=this;m.o=j;m.pool=m.o.pool;m.first=m.pool[0];m.last=m.pool[m.pool.length-1];m.page=$(m.o.page);var x=m.c=m.o.container=$(m.o.container);x.update("");m.steve=m.ua("iPad")||m.ua("iPhone")||m.ua("iPod");m.disableAnimation=m.steve||(m.ua("MSIE")&&(!m.ua("MSIE 9")));m.disableScrollBar=m.steve;x.appendChild(m.topPoint=new Element("div"));if(m.o.title){x.appendChild(new Element("div").addClassName("fotoviewer_title").update(m.o.title))}var u=new Element("div").addClassName("fotoviewer_modes");(m.ma[5]=new Element("a",{href:"#"}).addClassName("fotoviewer_mode5").update("&nbsp;")).onclick=function(){return m.setMode(5)};u.appendChild(m.ma[5]);(m.ma[4]=new Element("a",{href:"#"}).addClassName("fotoviewer_mode4").update("&nbsp;")).onclick=function(){return m.setMode(4)};u.appendChild(m.ma[4]);(m.ma[3]=new Element("a",{href:"#"}).addClassName("fotoviewer_mode3").update("&nbsp;")).onclick=function(){return m.setMode(3)};u.appendChild(m.ma[3]);(m.ma[2]=new Element("a",{href:"#"}).addClassName("fotoviewer_mode2").update("&nbsp;")).onclick=function(){return m.setMode(2)};u.appendChild(m.ma[2]);(m.ma[1]=new Element("a",{href:"#"}).addClassName("fotoviewer_mode1").update("&nbsp;")).onclick=function(){return m.setMode(1)};u.appendChild(m.ma[1]);u.appendChild(new Element("div").addClassName("fotoviewer_modes_intro").update(lng.fv_view));x.appendChild(u);if(m.o.subtitle){x.appendChild(new Element("div").addClassName("fotoviewer_subtitle").update(m.o.subtitle))}x.appendChild(m.midtitle=new Element("div").addClassName("fotoviewer_midtitle"));m.midtitle.appendChild(g=new Element("a").addClassName("fotoviewer_midtitle_go_left").update("&larr;"));g.href="#";g.onclick=function(c){c=c||window.event;Event.stop(c);m.switchTo(m.prev?m.prev:m.last);return false};g.ondblclick=g.onclick;m.midtitle.appendChild(m.status=new Element("span"));m.midtitle.appendChild(g=new Element("a").addClassName("fotoviewer_midtitle_go_right").update("&rarr;"));g.href="#";g.onclick=function(c){c=c||window.event;Event.stop(c);m.switchTo(m.next?m.next:m.first);return false};g.ondblclick=g.onclick;m.status.update("&nbsp;");x.appendChild(m.m[1]=new Element("div").addClassName("fotoviewer_mode1_container"));x.appendChild(m.m[2]=new Element("div").addClassName("fotoviewer_mode2_container"));x.appendChild(m.m[3]=new Element("div").addClassName("fotoviewer_mode3_container"));x.appendChild(m.m[4]=new Element("div").addClassName("fotoviewer_mode4_container"));Event.observe(document,"keydown",function(c){c=c||window.event;if((!DisableKeyNav)&&(c.ctrlKey)){if(c.keyCode==37){if(m.mode>1){m.fs?m.exitFullScreen():m.setMode(m.mode-1)}Event.stop(c)}else{if(c.keyCode==39){if(m.mode<5){m.setMode(m.mode+1)}Event.stop(c)}else{if(c.keyCode==32){if(m.fs){m.exitFullScreen()}else{m.setMode(5)}Event.stop(c)}}}return}if((!DisableKeyNav)&&(m.mode==4)){if(c.keyCode==37){m.switchTo(m.prev?m.prev:m.last);Event.stop(c)}else{if((c.keyCode==39)||((c.keyCode==32)&&(m.fs))){m.switchTo(m.next?m.next:m.first);Event.stop(c)}else{if((c.keyCode==27)&&(m.fs)){m.exitFullScreen();Event.stop(c)}}}}});var w=function(c){if(c.match(/^full[0-9]+$/)){if(f=m.findByID(c.substring(4))){m.lockHash=true;m.setMode(5,true);m.lockHash=false;m.switchTo(f)}else{return}}else{if(c.match(/^foto[0-9]+$/)){if(f=m.findByID(c.substring(4))){m.lockHash=true;m.setMode(4,true);m.lockHash=false;m.switchTo(f)}else{return}}else{if(c=="full"){m.lockHash=true;m.setMode(5);m.lockHash=false}else{if(c=="foto"){m.lockHash=true;m.setMode(4);m.lockHash=false}else{if(c=="list"){m.setMode(1)}else{if(c=="middlelist"){m.setMode(2)}else{if(c=="middle"){m.setMode(2)}else{if(c=="biglist"){m.setMode(3)}else{if(c=="big"){m.setMode(3)}else{return}}}}}}}}}return true};var n=true;if((CORE)&&(CORE.onHashChange)){if(w(CORE.URLHash())){n=false}CORE.onHashChange.push(w)}if(n){if(m.o.boot){if(w(m.o.boot)){n=false}}if(n){m.switchTo(m.pool[0])}}if((m.o.scrollTo)&&(CORE)){var q=CORE.URLHash();if(q!=""){var g=new Element("a");g.name=q;$(m.o.scrollTo).insertBefore(g,$(m.o.scrollTo).firstChild)}}},initMode:function(q){var g=this;var c=g.m[q];if(q==1){c.update("");g.pool.each(function(t){var m=new Element("img");m.src=t.smallURL;m.onclick=function(w){if(!Event.isMiddleClick(w)){g.switchTo(t);return false}};m.onmouseover=function(){g.overSubs(m,t)};m.onmouseout=function(){g.outSubs(m,t)};c.appendChild(m)})}if(q==2){c.update("");g.pool.each(function(w){var t=new Element("img");t.src=w.middleURL;t.onclick=function(z){if(!Event.isMiddleClick(z)){g.switchTo(w);return false}};var m=(215-w.middleY)/2;if(m>0){t.style.marginTop=m+"px"}var x=new Element("div");x.addClassName("fotoviewer_middle");x.appendChild(g.anchorize(t,w.link));g.initSubs(w,x,"fotoviewer_middle_sub",false,"middle");c.appendChild(x)})}if(q==3){c.update("");g.pool.each(function(t){var m=new Element("img");m.src=t.bigURL;m.onclick=function(A){if(!Event.isMiddleClick(A)){g.switchTo(t);return false}};var z=new Element("div").addClassName("fotoviewer_big");if((!t.hideTitle)||(g.o.titleEditable)){var x=new Element("div").addClassName("fotoviewer_big_title");if(!t.ies){t.ies=[]}var w=g.createInplaceEditor(t);t.ies.push(w);x.appendChild(w.element);z.appendChild(x)}z.appendChild(g.anchorize(m,t.link));g.initSubs(t,z,"fotoviewer_big_sub",false,"big");c.appendChild(z)})}if(q==4){c._inited=true;g.oneList=new Element("div").addClassName("fotoviewer_one_list");var n=0;g.pool.each(function(t){var m=new Element("img");m._src=t.smallURL;m._x=n*76;n++;m.src="http://i.cdn.maases.com/0.gif";m.onclick=function(){g.switchTo(t);return false};m.onmouseover=function(){Element.setOpacity(m,g.activeOpacity)};m.onmouseout=function(){var w=(g.active&&(g.active.fotoID==t.fotoID));Element.setOpacity(m,w?g.activeOpacity:g.inactiveOpacity);w?m.addClassName("active"):m.removeClassName("active")};Element.setOpacity(m,g.inactiveOpacity);g.oneList.appendChild(g.anchorize(m,t.link));t.m4i=m});c.appendChild(g.oneList);g.oneScrollBar=new HScrollBar({value:0,min:0,max:0});g.oneScrollBar.onChange=function(m){g.oneListTarget=Math.round(m)};g.oneScrollBar.canChange=function(){return g.cropper?false:true};if(g.disableScrollBar){g.oneScrollBar.element.style.display="none"}c.appendChild(g.oneScrollBar.element);c.appendChild(g.one=new Element("div").addClassName("fotoviewer_one_container"));g.one.appendChild(g.oneTitle=new Element("div").addClassName("fotoviewer_one_title"));g.one.appendChild(g.oneHelper=new Element("div").addClassName("fotoviewer_one_helper"));var u=function(){g.updateHolderSize();g.oneListResize();g.fullScreenResize()};if(CORE){CORE.LayoutChanged=u}Event.observe(document.onresize?document:window,"resize",u);var j=function(m){if(!g.cropper){g.oneListHyper=true;g.oneScrollBar.setValue(Math.round((g.oneScrollBar.value+g.wheel(m)/Math.abs(g.wheel(m))*Element.getWidth(g.oneList))/76)*76);Event.stop(m)}};Event.observe(g.oneList,"mousewheel",j);Event.observe(g.oneList,"DOMMouseScroll",j);setTimeout(function(){g.oneListScroller()},100);setTimeout(function(){g.oneListResize()},1)}},initSubs:function(u,w,x,g,n){var m=this;if(u.comments||u.comments_new||u.people){var j=false;j=new Element("div");j.addClassName(x);w.appendChild(j);if(u.people){j.appendChild(a=new Element("a").addClassName(g?"fotoviewer_peopleb":"fotoviewer_people").update(u.people));a.onclick=function(){if(m.fs){m.exitFullScreen()}m.switchTo(u,true);m.showPeople();return false};a.href="#";if(n=="fullscreen"){a.onmouseover=function(){m.oneOverSwitch(true)};a.onmouseout=function(){m.oneOverSwitch(false)}}}if((u.comments)||(u.comments_new)){var q=u.comments?u.comments:"";if(u.comments_new){q+="+"+u.comments_new}j.appendChild(a=new Element("a").addClassName(g?"fotoviewer_commentsb":"fotoviewer_comments").update(q));a.onclick=function(){if(m.fs){m.exitFullScreen()}m.scrollToComments=true;m.switchTo(u,true);return false};a.href="#";a.setAttribute("amba","fotocomments:"+u.fotoID);if((tooltip)&&(tooltip.ie)){tooltip.ie(a)}if(u.people){a.addClassName("fotoviewer_icons_pre")}}j.style.display="block"}},reinitSubs:function(c){},overSubs:function(g,j){var c=this;if(g.oversubs==undefined){g.oversubs=0}g.oversubs++;if(!g.oversub){g.oversub=new Element("a");g.oversub.addClassName("fotoviewer_oversub");g.oversub.onclick=g.onclick;g.oversub.onmouseover=g.onmouseover;g.oversub.onmouseout=g.onmouseout;g.oversub.setAttribute("href",j.link);c.initSubs(j,g.oversub,"fotoviewer_oversubs",true);c.m[1].appendChild(g.oversub)}if(g.oversubs==1){clearTimeout(g.oversubTimeout);Element.clonePosition(g.oversub,g);g.oversub.style.display="block"}},outSubs:function(c,g){c.oversubs--;if(c.oversubs==0){clearTimeout(c.oversubTimeout);c.oversubTimeout=setTimeout(function(){if(c.oversub){c.oversub.style.display="none"}c.oversub=false},50)}},goFullScreen:function(){var q=this;if(q.fs){return}if(q.mode!=4){q.oneListHyper=true;q.setMode(4,true)}var j=new Element("div").addClassName("fotoviewer_fullscreen");var w=new Element("div").update(q.steve?lng.fv_fs_ihint:lng.fv_fs_hint);w.setStyle({position:"absolute",left:"10%",top:"3%",right:"10%",textAlign:"center",color:"#909090",opacity:0,fontSize:"12px"});new Effect.Appear(w,{duration:0.3});setTimeout(function(){try{new Effect.Puff(w,{duration:0.7})}catch(m){}},4000);setTimeout(function(){try{w.parentNode.removeChild(w)}catch(m){}},10000);j.appendChild(w);var g=new Element("div").setStyle({position:"absolute",left:"0%",top:"0%",width:"50%",height:"100%",cursor:"pointer"});g.onmouseover=function(){if(q.oneOverLeft){q.oneOverLeft.addClassName("fotoviewer_one_over_left_active")}};g.onmouseout=function(){if(q.oneOverLeft){q.oneOverLeft.removeClassName("fotoviewer_one_over_left_active")}};g.onclick=function(){q.switchTo(q.prev?q.prev:q.last)};j.appendChild(q.fsMoveLeft=g);var g=new Element("div").setStyle({position:"absolute",right:"0%",top:"0%",width:"50%",height:"100%",cursor:"pointer"});g.onmouseover=function(){if(q.oneOverRight){q.oneOverRight.addClassName("fotoviewer_one_over_right_active")}};g.onmouseout=function(){if(q.oneOverRight){q.oneOverRight.removeClassName("fotoviewer_one_over_right_active")}};g.onclick=function(){q.switchTo(q.next?q.next:q.first)};j.appendChild(q.fsMoveRight=g);q.fsdoing=new Element("div").addClassName("fotoviewer_fullscreen_progress");q.fsOne=new Element("div");q.fsOne.setStyle({position:"absolute"});var u=function(m){q.wheel(m)>0?q.switchTo(q.next?q.next:q.first):q.switchTo(q.prev?q.prev:q.last);Event.stop(m)};Event.observe(j,"mousewheel",u);Event.observe(j,"DOMMouseScroll",u);var n=new Element("div").setStyle({position:"absolute",top:"3%",right:"3%"});j.appendChild(n);q.fsplay=new Element("a");q.fsplay.update('<img src="http://i.cdn.maases.com/fv/play.png">').setStyle({opacity:0.5,cursor:"hand"});q.fsplay.onmouseover=function(){q.fsplay.setOpacity(1)};q.fsplay.onmouseout=function(){q.fsplay.setOpacity(0.5)};q.fsplay.onclick=function(){q.toggleSlideShow();return false};n.appendChild(q.fsplay);q.fsplayers=[new Element("div").setStyle({position:"absolute",backgroundColor:"#ffffff",left:"-22px",top:"28px",width:"2px",height:"2px",opacity:0.3}),new Element("div").setStyle({position:"absolute",backgroundColor:"#ffffff",left:"-16px",top:"28px",width:"2px",height:"2px",opacity:0.3}),new Element("div").setStyle({position:"absolute",backgroundColor:"#ffffff",left:"-10px",top:"28px",width:"2px",height:"2px",opacity:0.3}),new Element("div").setStyle({position:"absolute",backgroundColor:"#ffffff",left:"-4px",top:"28px",width:"2px",height:"2px",opacity:0.3})];q.fsplayerscontainer=new Element("div").setStyle({position:"relative",display:"none",verticalAlign:"bottom",fontSize:"24px",lineHeight:"24px",height:"24px"}).update("");q.fsplayers.each(function(m){q.fsplayerscontainer.appendChild(m)});n.appendChild(q.fsplayerscontainer);var c=new Element("a");c.update('<img src="http://i.cdn.maases.com/close_white.png">');c.setStyle({opacity:0.5,cursor:"hand",marginLeft:"16px"});c.onmouseover=function(){c.setOpacity(1)};c.onmouseout=function(){c.setOpacity(0.5)};c.onclick=function(){q.exitFullScreen();return false};n.appendChild(c);q.page.parentNode.insertBefore(q.fs=j,q.page);q.page.style.display="none";q.updateHolderSize();q.switchTo(q.active?q.active:q.pool[0],true);setTimeout(function(){if(tooltip){tooltip.black=true}},50)},exitFullScreen:function(){var c=this;clearTimeout(c.slideShowTimeout);c.slideShowing=false;c.lockFullScreenResize=true;if((c.oneOver)&&(c.oneOver.parentNode)){c.oneOver.parentNode.removeChild(c.oneOver)}c.page.style.display="block";if(c.active){c.oneList.scrollLeft=c.oneListScrollLeft(c.active.no)}c.oneScrollBar.setValue(c.oneList.scrollLeft,true);c.fs.style.display="none";c.fs.update("&nbsp;");c.page.parentNode.removeChild(c.fs);c.fs=false;c.fssb=false;c.fssub=false;c.fsOne=false;c.fsplay=false;c.pool.each(function(g){if(g.fsimg){clearInterval(g.fsimg.timeout);if(g.fsimg.parentNode){g.fsimg.parentNode.removeChild(g.fsimg)}g.fsimg.now=false}});c.switchTo(c.active,true);c.lockFullScreenResize=false;if(tooltip){tooltip.black=false}c.oneListResize();c.scrollTo()},toggleSlideShow:function(){var c=this;c.slideShowing=!c.slideShowing;if(c.fsplay){c.fsplay.update(c.slideShowing?'<img src="http://i.cdn.maases.com/fv/stop.png">':'<img src="http://i.cdn.maases.com/fv/play.png">')}if(c.fsplayerscontainer){c.fsplayerscontainer.setStyle({display:c.slideShowing?"inline":"none"})}clearTimeout(c.slideShowTimeout);if(c.slideShowing){c.slideShower()}},slideShowerRestart:function(){var c=this;clearTimeout(c.slideShowTimeout);c.slideShowerPlayer(c.slideShowTick=0);var g=function(){c.slideShowTick++;c.slideShowerPlayer(c.slideShowTick);if(c.slideShowTick==5){c.slideShower()}else{c.slideShowTimeout=setTimeout(g,1000)}};c.slideShowTimeout=setTimeout(g,1000)},slideShowerPlayer:function(j){var g=this;for(var c=0;c<=3;c++){g.fsplayers[c].setOpacity(j<=c?0.3:0.7)}},slideShower:function(){var c=this;c.switchTo(c.next?c.next:c.first);c.slideShowerRestart()},fullScreenResize:function(){var c=this;if((c.fs)&&(!c.switching)&&(!c.lockFullScreenResize)){c.switchTo(c.active,true)}},setMode:function(n,g){var j=this;if(j.cropper){j.shakeCropper();return false}n=parseInt(n);if(n==5){j.goFullScreen();return false}if(j.mode==n){return false}if(j.fs){j.exitFullScreen()}if(n!=2){j.m[2].update("")}if(n!=3){j.m[3].update("")}if(!j.m[n]._inited){j.initMode(n)}if(j.activeInplaceEditor){j.activeInplaceEditor.cancel()}j.activeInplaceEditor=false;for(var c=1;c<=4;c++){if(n!=c){j.m[c].style.display="none";j.ma[c].removeClassName("fotoviewer_mode"+c+"_active")}}j.m[n].style.display="block";j.ma[n].addClassName("fotoviewer_mode"+n+"_active");j.mode=n;if(n==4){j.midtitle.addClassName("fotoviewer_midtitle_goes");if((j.oneListSavedScroll>=0)&&(j.oneList)){j.oneList.scrollLeft=j.oneListSavedScroll}if(!g){j.switchTo(j.active?j.active:j.pool[0],true,true)}}else{j.midtitle.removeClassName("fotoviewer_midtitle_goes");j.status.update(j.pool.length+" "+j.o.count_suffix);if(!g){j.scrollTo()}}if(n==1){j.setHash("list")}else{if(n==2){j.setHash("middlelist")}else{if(n==3){j.setHash("biglist")}}}var m=window.location.toString().replace(/(\#[a-z0-9]+)$/,"");j.ma[1].href=m+"#list";j.ma[2].href=m+"#middlelist";j.ma[3].href=m+"#biglist";j.ma[4].href=m+((j.active||j.pool.length)?("#foto"+(j.active==4?j.active:j.pool[0]).fotoID):"#middlelist");j.ma[5].href=m+((j.active||j.pool.length)?("#full"+(j.active==4?j.active:j.pool[0]).fotoID):"#middlelist");return false},switchTo:function(u,c,B){var E=this;if(E.cropper){E.shakeCropper();return false}if(!u){return}if(E.mode!=4){E.oneListHyper=true;E.setMode(4,true);B=true}if(E.activeInplaceEditor){E.activeInplaceEditor.cancel()}E.activeInplaceEditor=false;var z=[E.prev,E.active,E.next];if(E.active){if((E.active.fotoID==u.fotoID)&&(!c)){return}E.active.container.style.display="none";if(E.active.m4i){Element.setOpacity(E.active.m4i,E.inactiveOpacity);E.active.m4i.removeClassName("active")}E.setCropper(false);E.active.container.parentNode.removeChild(E.active.container);E.active.container=false;if(E.fs){E.fsOne.style.display="none"}if((E.active.m4ie)&&(E.active.m4ie.element.parentNode)){E.active.m4ie.element.parentNode.removeChild(E.active.m4ie.element)}}E.startSwitching();if(E.oneOver){E.oneOver.update("")}else{E.oneOver=new Element("div");E.oneOver.addClassName("fotoviewer_one_over")}var j=new Element("div").setStyle({position:"absolute",left:"0%",top:"0%",width:"50%",height:"100px",cursor:"pointer"}).addClassName("fotoviewer_one_over_padder");j.onmouseover=function(){E.oneOverLeft.addClassName("fotoviewer_one_over_left_active")};j.onmouseout=function(){E.oneOverLeft.removeClassName("fotoviewer_one_over_left_active")};j.onclick=function(){E.switchTo(E.prev?E.prev:E.last)};E.oneOver.appendChild(E.oneMoveLeft=j);var j=new Element("div").setStyle({position:"absolute",right:"0%",top:"0%",width:"50%",height:"100px",cursor:"pointer"}).addClassName("fotoviewer_one_over_padder");j.onmouseover=function(){E.oneOverRight.addClassName("fotoviewer_one_over_right_active")};j.onmouseout=function(){E.oneOverRight.removeClassName("fotoviewer_one_over_right_active")};j.onclick=function(){E.switchTo(E.next?E.next:E.first)};E.oneOver.appendChild(E.oneMoveRight=j);E.oneOver.holder=new Element("div");E.oneOver.holder.addClassName("fotoviewer_one_over_holder");E.oneOver.holder.setAttribute("noamba","1");E.oneOver.appendChild(E.oneOver.holder);E.oneOver.holder.onmouseover=function(){E.oneOverSwitch(true)};E.oneOver.holder.onmouseout=function(){E.oneOverSwitch(false)};E.oneOver.holder.appendChild(A=E.oneOverLeft=new Element("a").addClassName("fotoviewer_one_over_left").update("&nbsp;"));A.onclick=function(){E.switchTo(E.prev?E.prev:E.last)};if(!E.fs){E.oneOver.holder.appendChild(A=new Element("a").addClassName("fotoviewer_one_over_fullscreen").update("&nbsp;"));A.href=window.location.toString().replace(/(\#[a-z0-9]+)$/,"")+"#full"+u.fotoID;A.onclick=function(){return E.setMode(5)};if(E.active||E.pool.length){E.ma[5].href=window.location.toString().replace(/(\#[a-z0-9]+)$/,"")+"#full"+(E.active==4?E.active:E.pool[0]).fotoID}}E.oneOver.holder.appendChild(A=E.oneOverRight=new Element("a").addClassName("fotoviewer_one_over_right").update("&nbsp;"));A.onclick=function(){E.switchTo(E.next?E.next:E.first)};var q=false;var w=false;if(u.container){u.container.style.display="block";q=true}else{u.container=new Element("div");u.container.addClassName("fotoviewer_one_foto");u.container.m4bi=new Element("img");w=function(){u.container.m4bi.onload=function(){E.updateHolderSize(true,u)};u.container.m4bi.src=u.bigURL};u.container.appendChild(u.container.m4bi);var g=new Element("div").addClassName("fotoviewer_one_subfoto");var D=new Element("div").addClassName("fotoviewer_one_subfoto_under");E.subfoto_controls=new Element("div").addClassName("fotoviewer_one_subfoto_controls").setStyle({display:"none"});var A=E.subfoto_face=new Element("a").update(lng.fv_face);E.subfoto_controls.appendChild(A);A.href="#";A.title=lng.fv_face_hint;A.style.display="none";A.onclick=function(){if(E.cropper){E.setCropper(false)}E.setCropper(E.createCropper({left:30,top:10,width:40,height:40,cropping:true,onAccept:function(m){var t=new Popup({rawTitle:'<div id="user_finder_searchfor_target"></div>',width:"890px",height:"250px",maxWidth:"890px",maxHeight:"400px",URL:"/ajax/users_finder.html?handler=fotoViewerUsersFinder&andme=1&jumping_searchfor=1&title="+encodeURIComponent(lng.fv_face_hint)});window.fotoViewerUsersFinder=function(I,G,F,H){if(I=="submit"){t.hide();E.saveFace(E.active,m.left,m.top,m.width,m.height,G);E.setCropper(false)}return false}}}));return false};E.subfoto_controls.appendChild(E.subfoto_face_or_mark=new Element("span").update('&nbsp;&nbsp;<span style="color: #e0e0e0;">|</span>&nbsp;&nbsp;').setStyle({display:"none"}));var A=E.subfoto_mark=new Element("a").update(lng.fv_mark);E.subfoto_controls.appendChild(A);A.href="#";A.title=lng.fv_mark_hint;A.style.display="none";A.onclick=function(){if(E.cropper){E.setCropper(false)}E.setCropper(E.createMarker({left:30,top:10,width:45,height:10,marking:true,opacity:1,onAccept:function(F,G,t,m){if(G==""){alert(lng.fv_empty_mark)}else{E.saveMarker(E.active,F.left,F.top,F.width,F.height,G,t,m);E.setCropper(false)}}}));return false};D.appendChild(E.subfoto_controls);D.appendChild(u.subfoto_whos_there=new Element("div"));D.appendChild(u.subfoto_markers=new Element("div"));g.appendChild(D);g.appendChild(u.subfoto_ajax=new Element("div").addClassName("fotoviewer_one_subfoto_ajax"));g.setOpacity(0);u.container.appendChild(u.subfoto=g);E.one.appendChild(u.container)}if(E.oneOver.parentNode){E.oneOver.parentNode.removeChild(E.oneOver)}if(E.fs){E.fsOne.appendChild(E.oneOver)}else{u.container.insertBefore(E.oneOver,u.container.firstChild)}E.oneOver.style.display="none";Element.setOpacity(E.oneOver,0);E.active=u;if(u.comments_new){if(!u.comments){u.comments=0}u.comments=u.comments+u.comments_new;u.comments_new=0}E.setHash((E.fs?"full":"foto")+u.fotoID);E.subfotoReady1=false;E.subfotoReady2=false;if(w){w()}if(q){E.updateHolderSize(true,u)}if(E.active.m4i){Element.setOpacity(E.active.m4i,E.activeOpacity);E.active.m4i.addClassName("active")}var C=0;E.pool.each(function(m){if(m.fotoID==E.active.fotoID){throw $break}C++});E.active.no=C;E.prev=E.pool[C-1];E.next=E.pool[C+1];E.nextnext=E.pool[C+2];E.preload(E.next);E.preload(E.nextnext);if(E.fssb){if(!E.fssb.dragging){E.fssb.setValue(C,true)}}if(E.oneList){var n=E.oneListScrollLeft(C);E.oneListTarget=n;if((E.oneScrollBar)&&(!E.preventScrollBarUpdate)){setTimeout(function(){E.oneScrollBar.setValue(n,true)},1)}E.preventScrollBarUpdate=false;C++;E.status.update(C+lng.fv_pool_of+E.pool.length+" "+E.o.count_suffix2)}if(!E.fs){if(!u.ies){u.ies=[]}if((!u.hideTitle)||(E.o.titleEditable)){if(!u.m4ie){u.ies.push(u.m4ie=E.createInplaceEditor(u))}E.oneTitle.appendChild(u.m4ie.element);E.oneTitle.style.display="block"}else{E.oneTitle.style.display="none"}}if(E.fs){var x=[E.prev,E.active,E.next];z.each(function(m){if(m){if(!(m in x)){E.setupFullScreen(m)}}});if(!E.fssub){E.fssub=new Element("div").setStyle({position:"absolute"});E.fs.appendChild(E.fssub)}E.fssub.update("");if(E.prev){E.setupFullScreen(E.prev)}if(E.next){E.setupFullScreen(E.next)}E.setupFullScreen(E.active)}if(B){E.scrollTo()}if(E.mode==4){clearTimeout(E.ajaxTimeout);if(E.ajaxRequest){E.ajaxRequest.transport.abort();E.ajaxRequest=false}E.ajaxTimeout=setTimeout(function(){window.fotoViewer=E;E.ajaxRequest=new Ajax.Updater(u.subfoto_ajax,"/ajax/fotoviewer_comments.html",{asynchronous:true,method:"GET",onSuccess:function(){RecalcTooltips();E.ajaxRequest=false;E.subfotoReady2=true;E.subfotoReady()},evalScripts:true,parameters:"digest="+digest+"&fotoID="+u.fotoID+"&fullscreen="+(E.fs?"1":"0")+"&special="+(E.o.commentsSpecial?encodeURIComponent(E.o.commentsSpecial):"")})},50)}if(E.slideShowing){E.slideShowerRestart()}if(tooltipped){tooltip.h()}},startSwitching:function(){var c=this;c.switching=true;if(c.fs){c.fs.insertBefore(c.fsdoing,c.fs.firstChild)}},stopSwitching:function(){var c=this;c.switching=false;if((c.fs)&&(c.fsdoing)){c.fsdoing.parentNode.removeChild(c.fsdoing)}},setupFullScreen:function(u){var D=this;var n=3;var m=3;if(!u.fsimg){var j=Math.max(D.fssize.width-50,300);var g=Math.max(D.fssize.height-100,300);u.fsUseOriginal=((u.originalURL)&&((u.bigX*1.2)<j)&&((u.bigY*1.2)<g));if(u.fsUseOriginal){D.fsUseOriginal=true}u.fsimg=new Element("img");u.fsimg.setStyle({position:"absolute",left:"0px",top:"0px",width:"0px",height:"0px"});u.fsimg.srcs=u.fsUseOriginal?[u.bigURL,u.originalURL]:[u.middleURL,u.bigURL];u.fsimg.srcmode=0;u.fsimg.src=u.fsimg.srcs[u.fsimg.srcmode];u.fsimg.srcpreload=[];u.fsimg.srcs.each(function(E){var t=new Image();t.src=E;u.fsimg.srcpreload.push(t)})}var C=false;var B={};var A=1.3;var q=1.3;var w=false;if(u.fotoID==D.active.fotoID){var z=u.fsUseOriginal?u.originalX:u.bigX;var x=u.fsUseOriginal?u.originalY:u.bigY;var j=Math.max(D.fssize.width-50,300);var g=Math.max(D.fssize.height-100,300);if(z>j){x=Math.round(x/z*(z=j))}if(x>g){z=Math.round(z/x*(x=g))}u.fsimg.aim={left:D.fssize.width/2,top:D.fssize.height/2,width:z,height:x,cleanup:false};if(!u.fsimg.now){u.fsimg.now={left:D.fssize.width/2,top:D.fssize.height/2,width:m,height:m}}A=1.2;q=1.2;w=true}else{if((D.prev)&&(u.fotoID==D.prev.fotoID)){u.fsimg.aim={left:D.fssize.width/15,top:D.fssize.height/2,width:(u.fsUseOriginal?u.originalX:u.bigX)/n,height:(u.fsUseOriginal?u.originalY:u.bigY)/n,cleanup:false};if(!u.fsimg.now){u.fsimg.now={left:-m-(u.fsUseOriginal?u.originalX:u.bigX),top:D.fssize.height/2,width:m,height:m}}C=function(t){t=t||window.event;Event.stop(t);D.switchTo(D.prev);return false}}else{if((D.next)&&(u.fotoID==D.next.fotoID)){u.fsimg.aim={left:D.fssize.width/15*14,top:D.fssize.height/2,width:(u.fsUseOriginal?u.originalX:u.bigX)/n,height:(u.fsUseOriginal?u.originalY:u.bigY)/n,cleanup:false};if(!u.fsimg.now){u.fsimg.now={left:D.fssize.width+(u.fsUseOriginal?u.originalX:u.bigX),top:D.fssize.height/2,width:m,height:m}}C=function(t){t=t||window.event;Event.stop(t);D.switchTo(D.next);return false}}else{if(u.fsimg.now.left>D.fssize.width/2){u.fsimg.aim={left:D.fssize.width+(u.fsUseOriginal?u.originalX:u.bigX),top:D.fssize.height/2,width:m,height:m,cleanup:true}}else{u.fsimg.aim={left:-m-(u.fsUseOriginal?u.originalX:u.bigX),top:D.fssize.height/2,width:m,height:m,cleanup:true}}}}}u.fsimg.onclick=C?C:function(){};B.cursor=C?"crosshair":"";B.left=u.fsimg.now.left+"px";B.top=u.fsimg.now.top+"px";B.width=u.fsimg.now.width+"px";B.height=u.fsimg.now.height+"px";u.fsimg.setStyle(B);clearInterval(u.fsimg.timeout);var c=function(){var F={did:0};try{u.fsimg.style.width=Math.round(u.fsimg.now.width=D.diff(u.fsimg.now.width,u.fsimg.aim.width,A,F))+"px";u.fsimg.style.height=Math.round(u.fsimg.now.height=D.diff(u.fsimg.now.height,u.fsimg.aim.height,q,F))+"px";u.fsimg.style.left=Math.round((u.fsimg.now.left=D.diff(u.fsimg.now.left,u.fsimg.aim.left,A,F))-u.fsimg.now.width/2)+"px";u.fsimg.style.top=Math.round((u.fsimg.now.top=D.diff(u.fsimg.now.top,u.fsimg.aim.top,q,F))-u.fsimg.now.height/2)+"px"}catch(E){}var t=0;if(w){if(u.fsimg.now.width>=(u.fsimg.aim.width-1)){t=1}}if(t!=u.fsimg.srcmode){u.fsimg.srcmode=t;u.fsimg.src=u.fsimg.srcs[u.fsimg.srcmode]}if(F.did==4){if(u.fsimg.aim.cleanup){u.fsimg.parentNode.removeChild(u.fsimg);u.fsimg.now=false}clearInterval(u.fsimg.timeout);if(w){Element.clonePosition(D.fsOne,u.fsimg);D.oneOver.holder.style.width=u.fsimg.style.width;D.oneOver.holder.style.height=u.fsimg.style.height;D.oneOver.setOpacity(0);D.oneOver.style.display="block";D.fsOne.style.display="block";new Effect.Opacity(D.oneOver,{from:0,to:1,duration:0.1});D.fsMoveLeft.setStyle({top:u.fsimg.style.top,height:u.fsimg.style.height});D.fsMoveRight.setStyle({top:u.fsimg.style.top,height:u.fsimg.style.height});D.fssub.setStyle({left:(u.fsimg.aim.left-u.fsimg.aim.width/2)+"px",top:(u.fsimg.aim.top+u.fsimg.aim.height/2)+"px",width:u.fsimg.aim.width+"px",textAlign:"center",padding:"4px",opacity:0});D.initSubs(u,D.fssub,"fotoviewer_fullscreen_sub",true,"fullscreen");new Effect.Appear(D.fssub,{from:0,to:0.5,duration:0.1})}}};u.fsimg.timeout=setInterval(c,25);if(w){D.fs.appendChild(D.fsMoveLeft);D.fs.appendChild(D.fsMoveRight);D.fs.appendChild(u.fsimg);D.fs.appendChild(D.fsOne)}else{D.fs.appendChild(u.fsimg)}c()},diff:function(m,j,g,c){var n=(j-m)/(this.disableAnimation?1.05:g);m+=n;if(Math.round(m)==Math.round(j)){c.did++}return m},preload:function(j){var c=this;if(j){if(!j.preload){j.preload=[];if(c.fs){var g=c.fsUseOriginal?[j.bigURL,j.originalURL]:[j.middleURL,j.bigURL]}else{var g=[j.bigURL]}g.each(function(n){var m=new Image();m.src=n;j.preload.push(m)})}}},oneListResize:function(){if(!this.fs){var c=this.oneScrollBar;c.setMax(this.pool.length*76-Element.getWidth(this.oneScrollBar.element));c.setValue(this.oneList.scrollLeft,true);this.oneListLazy(true)}},oneListScroller:function(){var g=this;if((g.oneListTarget>=0)&&(!g.fs)){var j=g.oneListTarget-g.oneList.scrollLeft;if(j==0){g.oneListTarget=-1;g.oneListLazy(true)}else{if(!g.disableAnimation){j=j/(g.oneListHyper?1.5:2)}if((j<1)&&(j>=0)){j=1}else{if((j>-1)&&(j<=0)){j=-1}}var c=g.oneList.scrollLeft;g.oneList.scrollLeft+=j;g.oneListLazy();g.oneListSavedScroll=g.oneList.scrollLeft;if(g.oneList.scrollLeft==c){g.oneListTarget=-1}}setTimeout(function(){g.oneListScroller()},20);if(g.oneListTarget==-1){g.oneListHyper=false}}else{setTimeout(function(){g.oneListScroller()},100)}},oneListScrollLeft:function(g){var c=Math.round(g*76-Element.getWidth(this.oneList)/2+76/2);if(c<0){c=0}return c},oneListLazy:function(g){var c=this;clearTimeout(c.oneListLazyTimeout);if(g){var m=c.oneList.scrollLeft-76;var j=m+c.oneList.getWidth()+2*76;c.pool.each(function(q){var n=q.m4i;if(n._src){if((n._x>=m)&&(n._x<=j)){n.src=n._src;delete n._src;delete n._x}}})}else{c.oneListLazyTimeout=setTimeout(function(){c.oneListLazy(true)},150)}},updateHolderSize:function(g,j){var c=this;if(c.fs){c.fssize=Element.getDimensions(c.fs)}if((j)&&(c.active)){if(j.fotoID!=c.active.fotoID){return}}clearTimeout(c.updateHolderSizeTimeout);if((c.oneOver)&&(c.active)){var m={width:0,height:0};if(c.fs){if(g){c.stopSwitching()}return}else{if(c.active&&c.active.container&&c.active.container.m4bi){m=Element.getDimensions(c.active.container.m4bi)}}if((m.width<1)||(m.height<1)){c.updateHolderSizeTimeout=setTimeout(function(){c.updateHolderSize(g,j)},200)}else{c.oneOver.holder.style.width=m.width+"px";c.oneOver.holder.style.height=m.height+"px";if(c.oneMoveLeft){c.oneMoveLeft.style.height=m.height+"px"}if(c.oneMoveRight){c.oneMoveRight.style.height=m.height+"px"}if(g){c.oneOver.style.display="block";Element.setOpacity(c.oneOver,0);new Effect.Opacity(c.oneOver,{from:0,to:1,duration:0.1});if(!c.fs){c.subfotoReady1=true;c.subfotoReady()}setTimeout(function(){c.stopSwitching()},100)}}}},setCropper:function(j){var g=this;if(g.cropper){g.cropper.parentNode.removeChild(g.cropper)}if(j){j.bringToFront(true);g.cropper=j;g.oneOver.holder.appendChild(g.cropper);g.c.addClassName("fotoviewer_cropping")}else{g.cropper=false;g.oneHelperPerform(false);if(g.oneScrollBar){g.oneScrollBar.element.setOpacity(1)}g.oneOverForceOpacity(false);g.c.removeClassName("fotoviewer_cropping")}},shakeCropper:function(){var c=this;if(!c.cropperPulsating){c.cropperPulsating=true;new Effect.Pulsate(this.oneHelper,{pulses:2,from:0.6,duration:0.75});setTimeout(function(){c.cropperPulsating=false},750)}},createCropper:function(j){var g=new Element("div");var c=this;g.o=j;g.init=function(){g.visible=!j.hidden;g.dumbOpacity=Prototype.Browser.IE&&(!j.cropping);g.opacity=g.o.opacity==undefined?0.4:g.o.opacity;g.setStyle({position:"absolute",lineHeight:"0px",fontSize:"0px"});if(j.cropping){g.setStyle({cursor:"move"})}var u=new Element("img");u.src="http://i.cdn.maases.com/0.gif";var t={width:"100%",height:"100%"};if(j.bordered){t.border="1px dotted #313131"}else{t.border="1px dotted #999999";t.backgroundColor="#ffffff"}u.setStyle(t);g.appendChild(g.hilighter=u);if(g.dumbOpacity){g.hilighter.style.display=(g.visible&&(g.opacity>0))?"block":"none"}else{g.hilighter.setOpacity(g.visible?g.opacity:0)}g.signature=false;g.coords={left:j.left,top:j.top,width:j.width,height:j.height};g.draggingFix={x:0,y:0};g.smoothOpacity=function(w){if(g.dumbOpacity){g.hilighter.style.display=w>0?"block":"none";return}if(g.smoothEffect){g.smoothEffect.cancel()}g.smoothEffect=new Effect.Opacity(g.hilighter,{from:g.hilighter.getOpacity(),to:w,duration:w==0?0.3:0.1})};g.switchTo=function(w){g.visible=w;g.smoothOpacity(g.visible?g.opacity:0)};g.accept=function(){if(j.onAccept){j.onAccept(g.coords)}};g.apply=function(){g.style.left=g.coords.left+"%";g.style.top=g.coords.top+"%";g.style.width=g.coords.width+"%";g.style.height=g.coords.height+"%"};g.bringToFront=function(w){g.style.zIndex=w?"11000":"auto"};if(j.cropping){g.ondblclick=g.accept;g.onmousedown=function(z){z=z||window.event;if(!g.mouseUpHandler){g.mouseUpHandler=function(B){return g.mouseUp(B||window.event)}}if(!g.mouseMoveHandler){g.mouseMoveHandler=function(B){return g.mouseMove(B||window.event)}}Event.observe(document,"mouseup",g.mouseUpHandler);Event.observe(document,"mousemove",g.mouseMoveHandler);var x=Event.pointer(z);var A=Element.cumulativeOffset(g);var w=Element.getDimensions(g.parentNode);g.draggingFix.x=(x.x-A[0])/w.width*100;g.draggingFix.y=(x.y-A[1])/w.height*100;Event.stop(z)};g.mouseUp=function(w){Event.stopObserving(document,"mouseup",g.mouseUpHandler);Event.stopObserving(document,"mousemove",g.mouseMoveHandler);Event.stop(w)};g.mouseMove=function(z){var x=Event.pointer(z);var A=Element.cumulativeOffset(g.parentNode);var w=Element.getDimensions(g.parentNode);g.coords.left=Math.min(Math.max((x.x-A[0])/w.width*100-g.draggingFix.x,0),100-g.coords.width);g.coords.top=Math.min(Math.max((x.y-A[1])/w.height*100-g.draggingFix.y,0),100-g.coords.height);g.apply();Event.stop(z)};var q=new Element("div");q.setStyle({position:"absolute",right:"-3px",bottom:"-3px",width:"6px",height:"6px",border:"1px solid #ffffff",cursor:"se-resize",zIndex:100});q.draggingFix={x:0,y:0};q.onmousedown=function(A){A=A||window.event;if(!q.mouseUpHandler){q.mouseUpHandler=function(C){return q.mouseUp(C||window.event)}}if(!q.mouseMoveHandler){q.mouseMoveHandler=function(C){return q.mouseMove(C||window.event)}}Event.observe(document,"mouseup",q.mouseUpHandler);Event.observe(document,"mousemove",q.mouseMoveHandler);var z=Event.pointer(A);var B=Element.cumulativeOffset(q);var x=Element.getDimensions(g.parentNode);q.draggingFix.x=0;q.draggingFix.y=0;try{q.saved_body_cursor=(b=$$("body")[0]).style.cursor;b.style.cursor=q.style.cursor}catch(w){q.saved_body_cursor="default"}q.saved_image_cursor=g.parentNode.style.cursor;g.parentNode.style.cursor=q.style.cursor;Event.stop(A)};q.mouseUp=function(x){try{$$("body")[0].style.cursor=q.saved_body_cursor}catch(w){}g.parentNode.style.cursor=q.saved_image_cursor;Event.stopObserving(document,"mouseup",q.mouseUpHandler);Event.stopObserving(document,"mousemove",q.mouseMoveHandler);Event.stop(x)};q.mouseMove=function(z){var x=Event.pointer(z);var A=Element.cumulativeOffset(g.parentNode);var w=Element.getDimensions(g.parentNode);g.coords.width=Math.min(Math.max((x.x-A[0]-q.draggingFix.x)/w.width*100-g.coords.left,15),100-g.coords.left);g.coords.height=Math.min(Math.max((x.y-A[1]-q.draggingFix.y)/w.height*100-g.coords.top,15),100-g.coords.top);g.apply();Event.stop(z)};g.resizer=q;g.appendChild(g.resizer);var n=new Element("div").setStyle({position:"absolute",textAlign:"center",lineHeight:"1.3",fontSize:"11px",paddingTop:"4px",opacity:0.8,top:"100%",left:"0%",right:"0%"});c.oneHelper.update("");c.oneHelper.appendChild(c.iconize("http://i.cdn.maases.com/fv/decline.png",function(){c.setCropper(false)},lng.fv_decline).setStyle({marginRight:"10px"}));c.oneHelper.appendChild(c.iconize("http://i.cdn.maases.com/fv/accept.png",function(){g.accept()},lng.fv_accept));c.oneHelperPerform(true);if(c.oneScrollBar){c.oneScrollBar.element.setOpacity(0.25)}c.oneOverForceOpacity(c.oneOverOpacity);var m=new Element("span").setStyle({background:"url(http://i.cdn.maases.com/fv/harder.png)",color:"#ffffff"});m.appendChild(new Element("span").update(lng.fv_face_subhint));n.appendChild(m);g.signature=n;g.appendChild(g.signature)}else{if((j.signature)&&(parseFloat(j.width)!=0)){g.forcedOpacity=false;var n=new Element("div").setStyle({position:"absolute",textAlign:"center",lineHeight:"1.3",fontSize:"11px",paddingTop:"4px",opacity:0.8,top:"100%",left:"0%",right:"0%",display:"none"});n.appendChild(new Element("span").setStyle({backgroundColor:"#ffffff",color:"#000000",padding:"1px 4px"}).update(j.signature));g.signature=n;g.appendChild(g.signature);g.showSignature=function(){n.style.display="block"};g.hideSignature=function(){n.style.display="none"};g.setHilighterOpacity=function(w){g.savedOpacity=w;g.opacity=w;if(g.forcedOpacity==false){g.smoothOpacity(g.visible?w:0)}};g.forceOpacity=function(w){if(w==false){g.forcedOpacity=false;g.smoothOpacity(g.visible?g.savedOpacity:0);g.opacity=g.savedOpacity}else{g.forcedOpacity=w;g.savedOpacity=g.opacity;g.smoothOpacity(g.visible?g.forcedOpacity:0);g.opacity=g.forcedOpacity}};g.onmouseover=function(w){if(g.o.onOver){g.o.onOver(w)}};g.onmouseout=function(w){if(g.o.onOut){g.o.onOut(w)}}}}g.apply()};g.init();return g},createMarker:function(m){var g=lng.fv_mark_stub;var j=new Element("div");var c=this;j.o=m;j.init=function(){j.dumbOpacity=Prototype.Browser.IE&&(!m.marking);j.opacity=j.dumbOpacity?1:(m.opacity?m.opacity:0.8);j.visible=!j.o.hidden;j.setStyle({position:"absolute",lineHeight:"0px",fontSize:"0px",opacity:j.visible?j.opacity:0,textAlign:"left",cursor:m.marking?"move":"default",display:j.dumbOpacity?(j.visible?"block":"none"):"block"});j.rotation=m.rotation?m.rotation:0;j.rotations={0:"lb",1:"lt",2:"rt",3:"rb"};j.forcedOpacity=false;j.colors=[["ffffff","000000"],["9ed9ff","000000"],["9effa7","000000"],["a7a5ff","000000"],["c0ff51","000000"],["f5cdcd","000000"],["f7f4dd","000000"],["ffc478","000000"],["fff951","000000"],["000000","ffffff"]];j.color=j.colors[0][0];j.textColor=j.colors[0][1];if(m.color){j.colors.each(function(w){if(m.color==w[0]){j.color=w[0];j.textColor=w[1]}})}var u=new Element("img").setStyle({maxWidth:"40px"});j.appendChild(j.noga=u);j.coords={left:m.left,top:m.top,width:m.width,height:m.height};j.draggingFix={x:0,y:0};j.smoothOpacity=function(w){if(j.dumbOpacity){j.style.display=w>0?"block":"none";return}if(j.smoothEffect){j.smoothEffect.cancel()}j.smoothEffect=new Effect.Opacity(j,{from:j.getOpacity(),to:w,duration:w==0?0.3:0.1})};j.switchTo=function(w){j.visible=w;j.smoothOpacity(j.visible?j.opacity:0)};j.accept=function(){if(m.onAccept){m.onAccept(j.coords,j.ta.value==g?"":j.ta.value,j.rotation,j.color)}};j.apply=function(){j.style.left=j.coords.left+"%";j.style.top=j.coords.top+"%";j.style.width=j.coords.width+"%";j.style.height=j.coords.height+"%"};j.bringToFront=function(w){j.style.zIndex=w?"11000":"auto"};j.setMarkerOpacity=function(w){j.savedOpacity=w;j.opacity=w;if(j.forcedOpacity==false){j.smoothOpacity(j.visible?w:0)}};j.forceOpacity=function(w){if(w==false){j.forcedOpacity=false;j.smoothOpacity(j.visible?j.savedOpacity:0);j.opacity=j.savedOpacity}else{j.forcedOpacity=w;j.savedOpacity=j.opacity;j.smoothOpacity(j.visible?j.forcedOpacity:0);j.opacity=j.forcedOpacity}};j.nextColor=function(){var x=0,w=0;j.colors.each(function(z){if(j.color==z[0]){x=w}w++});x++;if(x>=j.colors.length){x=0}j.color=j.colors[x][0];j.textColor=j.colors[x][1];j.setRotation(j.rotation)};j.setRotation=function(w){j.rotation=w;u.src="http://i.cdn.maases.com/fv/noga_"+j.rotations[w]+"_"+j.color+".png";j.box.setStyle({backgroundColor:"#"+j.color,color:"#"+j.textColor});if(j.ta){j.ta.setStyle({backgroundColor:"#"+j.color,color:"#"+j.textColor})}if(j.rotation==0){j.noga.setStyle({position:"absolute",left:"0%",top:"0%",right:"auto",bottom:"auto",width:"38%",height:"100%"});j.box.setStyle({top:"auto",bottom:"99%"});if(j.controls){j.controls.setStyle({left:"auto",right:"0%",top:"auto",bottom:"0%"})}if(j.resizer){j.resizer.setStyle({position:"absolute",left:"-3px",right:"auto",top:"auto",bottom:"-3px",width:"6px",height:"6px",border:"1px solid #"+j.color,cursor:"sw-resize",zIndex:100})}}else{if(j.rotation==1){j.noga.setStyle({position:"absolute",left:"0%",top:"0%",right:"auto",bottom:"auto",width:"38%",height:"100%"});j.box.setStyle({top:"99%",bottom:"auto"});if(j.controls){j.controls.setStyle({left:"auto",right:"0%",top:"0%",bottom:"auto"})}if(j.resizer){j.resizer.setStyle({position:"absolute",left:"-3px",right:"auto",top:"-3px",bottom:"auto",width:"6px",height:"6px",border:"1px solid #"+j.color,cursor:"nw-resize",zIndex:100})}}else{if(j.rotation==2){j.noga.setStyle({position:"absolute",left:"auto",top:"auto",right:"0%",bottom:"0%",width:"38%",height:"100%"});j.box.setStyle({top:"99%",bottom:"auto"});if(j.controls){j.controls.setStyle({left:"0%",right:"auto",top:"0%",bottom:"auto"})}if(j.resizer){j.resizer.setStyle({position:"absolute",left:"auto",right:"-3px",top:"-3px",bottom:"auto",width:"6px",height:"6px",border:"1px solid #"+j.color,cursor:"ne-resize",zIndex:100})}}else{if(j.rotation==3){j.noga.setStyle({position:"absolute",left:"auto",top:"auto",right:"0%",bottom:"0%",width:"38%",height:"100%"});j.box.setStyle({top:"auto",bottom:"99%"});if(j.controls){j.controls.setStyle({left:"auto",left:"0%",top:"auto",bottom:"0%"})}if(j.resizer){j.resizer.setStyle({position:"absolute",left:"auto",right:"-3px",top:"auto",bottom:"-3px",width:"6px",height:"6px",border:"1px solid #"+j.color,cursor:"se-resize",zIndex:100})}}}}}};j.appendChild(j.box=new Element("div").setStyle({position:"absolute",textAlign:"center",lineHeight:"1.3",fontSize:"11px",padding:"5px 10px",bottom:"100%",left:"0%",right:"0%",backgroundColor:"#ffffff",cursor:m.marking?"move":"default"}).addClassName("fotoviewer_rc5"));if(m.marking){j.onmousedown=function(z){z=z||window.event;if(!j.mouseUpHandler){j.mouseUpHandler=function(B){return j.mouseUp(B||window.event)}}if(!j.mouseMoveHandler){j.mouseMoveHandler=function(B){return j.mouseMove(B||window.event)}}Event.observe(document,"mouseup",j.mouseUpHandler);Event.observe(document,"mousemove",j.mouseMoveHandler);var x=Event.pointer(z);var A=Element.cumulativeOffset(j);var w=Element.getDimensions(j.parentNode);j.draggingFix.x=(x.x-A[0])/w.width*100;j.draggingFix.y=(x.y-A[1])/w.height*100;Event.stop(z)};j.mouseUp=function(w){Event.stopObserving(document,"mouseup",j.mouseUpHandler);Event.stopObserving(document,"mousemove",j.mouseMoveHandler);Event.stop(w)};j.mouseMove=function(z){var x=Event.pointer(z);var A=Element.cumulativeOffset(j.parentNode);var w=Element.getDimensions(j.parentNode);j.coords.left=Math.min(Math.max((x.x-A[0])/w.width*100-j.draggingFix.x,0),100-j.coords.width);j.coords.top=Math.min(Math.max((x.y-A[1])/w.height*100-j.draggingFix.y,0),100-j.coords.height);j.apply();Event.stop(z)};var t=new Element("div").setStyle({position:"absolute",border:"1px solid #ffffff",zIndex:100});t.onmousedown=function(A){A=A||window.event;if(!t.mouseUpHandler){t.mouseUpHandler=function(C){return t.mouseUp(C||window.event)}}if(!t.mouseMoveHandler){t.mouseMoveHandler=function(C){return t.mouseMove(C||window.event)}}Event.observe(document,"mouseup",t.mouseUpHandler);Event.observe(document,"mousemove",t.mouseMoveHandler);var z=Event.pointer(A);var B=Element.cumulativeOffset(t);var x=Element.getDimensions(j.parentNode);try{t.saved_body_cursor=(b=$$("body")[0]).style.cursor;b.style.cursor=t.style.cursor}catch(w){t.saved_body_cursor="default"}t.saved_image_cursor=j.parentNode.style.cursor;j.parentNode.style.cursor=t.style.cursor;j.scoords={left:j.coords.left,top:j.coords.top,width:j.coords.width,height:j.coords.height};Event.stop(A)};t.mouseUp=function(x){try{$$("body")[0].style.cursor=t.saved_body_cursor}catch(w){}j.parentNode.style.cursor=t.saved_image_cursor;Event.stopObserving(document,"mouseup",t.mouseUpHandler);Event.stopObserving(document,"mousemove",t.mouseMoveHandler);Event.stop(x)};var q={width:15,height:5};var n={width:50,height:50};t.mouseMoveDo=function(D,E,A,z){if(z=="left"){var w=(D.x-E[0])/A.width*100;j.coords.width=c.minmax(q.width,n.width,(j.scoords.left+j.scoords.width)-w);var C=j.scoords.left+j.scoords.width-j.coords.width;j.coords.left=c.minmax(0,100-j.coords.width,C);j.coords.width-=(j.coords.left-C)}else{if(z=="top"){var F=(D.y-E[1])/A.height*100;j.coords.height=c.minmax(q.height,n.height,(j.scoords.top+j.scoords.height)-F);var B=j.scoords.top+j.scoords.height-j.coords.height;j.coords.top=c.minmax(0,100-j.coords.height,B);j.coords.height-=(j.coords.top-B)}else{if(z=="right"){j.coords.width=c.minmax(q.width,Math.min(n.width,100-j.coords.left),(D.x-E[0])/A.width*100-j.coords.left)}else{if(z=="bottom"){j.coords.height=c.minmax(q.height,Math.min(n.height,100-j.coords.top),(D.y-E[1])/A.height*100-j.coords.top)}}}}};t.mouseMove=function(z){var x=Event.pointer(z);var A=Element.cumulativeOffset(j.parentNode);var w=Element.getDimensions(j.parentNode);if(j.rotation==0){t.mouseMoveDo(x,A,w,"left");t.mouseMoveDo(x,A,w,"bottom")}else{if(j.rotation==1){t.mouseMoveDo(x,A,w,"left");t.mouseMoveDo(x,A,w,"top")}else{if(j.rotation==2){t.mouseMoveDo(x,A,w,"right");t.mouseMoveDo(x,A,w,"top")}else{if(j.rotation==3){t.mouseMoveDo(x,A,w,"right");t.mouseMoveDo(x,A,w,"bottom")}}}}j.apply();Event.stop(z)};j.resizer=t;j.appendChild(j.resizer);j.box.appendChild(j.ta=new Element("textarea").setStyle({border:"0px",backgroundColor:j.color,textAlign:"center",width:"100%",height:"13px",cursor:"default",fontSize:"11px",overflow:"hidden",resize:"none",outline:"none",padding:"0px"}));if((CORE)&&(CORE.TextAreaAutoSize)){while($(taid=("fotoviewer_ta_"+Math.floor(Math.random()*1000)))){}j.ta.id=taid;setTimeout(function(){CORE.TextAreaAutoSize(taid,13*4,true)},1)}j.ta.value=g;j.stub=true;j.ta.onmousedown=j.ta.ondblclick=function(w){w=w||window.event;Event.extend(w);w.stopPropagation()};j.ta.onfocus=function(){if(j.ta.value==g){j.ta.value=""}DisableKeyNav=true};j.ta.onblur=function(){if(j.ta.value==""){j.ta.value=g}DisableKeyNav=false};j.appendChild(j.controls=new Element("div").setStyle({position:"absolute",right:"0%",bottom:"0%",lineHeight:"1.3",fontSize:"11px"}));c.oneHelper.update("");c.oneHelper.appendChild(c.iconize("http://i.cdn.maases.com/fv/rotate.png",function(){j.setRotation(j.rotation>=3?0:(j.rotation+1))},lng.fv_rotate).setStyle({marginRight:"10px"}));c.oneHelper.appendChild(c.iconize("http://i.cdn.maases.com/fv/color.png",function(){j.nextColor()},lng.fv_color).setStyle({marginRight:"10px"}));c.oneHelper.appendChild(c.iconize("http://i.cdn.maases.com/fv/decline.png",function(){c.setCropper(false)},lng.fv_decline).setStyle({marginRight:"10px"}));c.oneHelper.appendChild(c.iconize("http://i.cdn.maases.com/fv/accept.png",function(){j.accept()},lng.fv_accept));c.oneHelperPerform(true);if(c.oneScrollBar){c.oneScrollBar.element.setOpacity(0.25)}c.oneOverForceOpacity(c.oneOverOpacity)}else{j.box.update(m.text)}j.box.onmouseover=function(w){if(j.o.onOver){j.o.onOver(w)}};j.noga.onmouseover=function(w){if(j.o.onOver){j.o.onOver(w)}};j.box.onmouseout=function(w){if(j.o.onOut){j.o.onOut(w)}};j.noga.onmouseout=function(w){if(j.o.onOut){j.o.onOut(w)}};j.setRotation(j.rotation);j.apply()};j.init();return j},createHilighter:function(j,q,g,u,n){var c=this;var m=c.createCropper({left:j,top:q,width:g,height:u,cropping:false,opacity:0.6,signature:n,onOver:function(){m.bringToFront(true);m.setHilighterOpacity(1);if(!c.cropper){m.showSignature()}},onOut:function(){m.bringToFront(false);m.setHilighterOpacity(0.6);if(!c.cropper){m.hideSignature()}},hidden:true,bordered:true});c.hilighters.push(m);return m},createMarkerer:function(c,w,u,m,q,g,n){var x=this;var j=x.createMarker({left:c,top:w,width:u,height:m,marking:false,text:q,rotation:g,color:n,opacity:0.8,hidden:true,onOver:function(){j.bringToFront(true);j.setMarkerOpacity(1)},onOut:function(){j.bringToFront(false);j.setMarkerOpacity(0.8)}});x.hilighters.push(j);return j},createInplaceEditor:function(g){var c=this;var j=new InplaceEditor(g,"title",{editable:c.o.titleEditable,dumb:(g.hideTitle&&(!c.o.titleEditable))?"&nbsp;":false,onAccept:function(n,q,m){n[q]=m;n.ies.each(function(t){if(t!=j){t.apply()}});c.saveTitle(n,m);c.activeInplaceEditor=false},onCancel:function(){c.activeInplaceEditor=false},onStart:function(){if(c.cropper){c.shakeCropper();return false}if(c.activeInplaceEditor){c.activeInplaceEditor.cancel()}c.activeInplaceEditor=j;return true}});return j},applyMeta:function(m,g){var j=this;j.hilighters.each(function(n){if(n.parentNode){n.parentNode.removeChild(n)}});j.hilighters=[];if(g){var c=j.active.subfoto_markers;g.each(function(t){var q=j.createMarkerer(t.l,t.t,t.w,t.h,t.text,t.rotation,t.color);j.oneOver.holder.appendChild(q);if(t.subText){if(!c._started){c._started=c.appendChild(new Element("span").update(lng.fv_marks));c.addClassName("fotoviewer_one_subfoto_markers")}else{c.appendChild(new Element("span").update("&bull;").setStyle({color:"#E0E0E0",marginLeft:"6px"}))}var n=new Element("a").update(t.subText);c.appendChild(n);n.href=t.subURL;n.onmouseover=function(){if(!j.cropper){q.setMarkerOpacity(1);q.bringToFront(true);j.oneOverForceOpacity(j.oneOverOpacity,q);j.oneOverSwitch(true,true)}};n.onmouseout=function(){if(!j.cropper){q.bringToFront(false);j.oneOverForceOpacity(false);j.oneOverSwitch(false,true)}};if(t.deletable){var u=new Element("img").setStyle({cursor:"pointer",verticalAlign:"middle",marginLeft:"4px"});u.src="http://i.cdn.maases.com/fv/remove_marker.gif";u.title=lng.fv_mark_delete;u.onclick=function(){if(confirm(lng.fv_mark_confirm)){j.deleteMarker(j.active,t,"marker")}return false};c.appendChild(u)}}})}if(m){var c=j.active.subfoto_whos_there;m.each(function(q){var u=j.createHilighter(q.l,q.t,q.w,q.h,q.text);j.oneOver.holder.appendChild(u);if(q.subText){if(!c._started){c._started=c.appendChild(new Element("span").update(lng.fv_whos));c.addClassName("fotoviewer_one_subfoto_whos_there")}else{c.appendChild(new Element("span").update("&bull;").setStyle({color:"#E0E0E0",marginLeft:"6px"}))}var n=new Element("a").update(q.subText);c.appendChild(n);n.href=q.subURL;n.onmouseover=function(){if(!j.cropper){u.bringToFront(true);if(u.setHilighterOpacity){u.setHilighterOpacity(1)}if(u.showSignature){u.showSignature()}j.oneOverForceOpacity(j.oneOverOpacity,u);j.oneOverSwitch(true,true)}};n.onmouseout=function(){if(!j.cropper){u.bringToFront(false);if(u.hideSignature){u.hideSignature()}j.oneOverForceOpacity(false);j.oneOverSwitch(false,true)}};if(q.deletable){var t=new Element("img").setStyle({cursor:"pointer",verticalAlign:"middle",marginLeft:"4px"});t.src="http://i.cdn.maases.com/fv/remove_marker.gif";t.title=lng.fv_whos_delete;t.onclick=function(){if(confirm(lng.fv_whos_confirm)){j.deleteMarker(j.active,q,"face")}return false};c.appendChild(t)}}})}if(j.oneOverPhase){j.oneOverPhase=false;j.oneOverSwitch(true,true)}RecalcTooltips()},wheel:function(c){var g=0;if(!c){c=window.event}if(c.wheelDelta){g=c.wheelDelta/120}else{if(c.detail){g=-c.detail/3}}return -Math.round(g)},oneOverSwitch:function(c,j){var g=this;if(!j){clearTimeout(g.oneOverTimeout);g.oneOverTimeout=setTimeout(function(){g.oneOverSwitch(c,true)},10);return}if(c==g.oneOverPhase){return}g.oneOverPhase=c;g.hilighters.each(function(m){m.switchTo(c)})},oneOverForceOpacity:function(g,c){this.hilighters.each(function(j){if((!c)||(j!=c)){if(j.forceOpacity){j.forceOpacity(g)}}})},minmax:function(g,c,j){if(j<g){j=g}if(j>c){j=c}return j},iconize:function(g,n,q){var m=this;var c=new Element("a").setStyle({opacity:0.8});c.href="#";c.onclick=function(){n();return false};c.onmouseover=function(){c.setOpacity(1)};c.onmouseout=function(){c.setOpacity(0.8)};var j=new Element("img");j.src=g;if(q){j.setAttribute("title",q)}c.appendChild(j);clearTimeout(m.iconizeTimeout);m.iconizeTimeout=setTimeout(RecalcTooltips,50);return c},setHash:function(c){if((CORE)&&(CORE.SetHash)){if(!this.lockHash){CORE.SetHash(c)}}},findByID:function(g){g=parseInt(g);var c=false;this.pool.each(function(j){if(j.fotoID==g){c=j;throw $break}});return c},subfotoReady:function(){var c=this;if((c.subfotoReady1)&&(c.subfotoReady2)){if(Prototype.Browser.IE){c.active.subfoto.setOpacity(1)}else{new Effect.Opacity(c.active.subfoto,{from:0,to:1,duration:0.25})}if(c.scrollToComments){c.scrollToComments=false;setTimeout(function(){new Effect.ScrollToEx($(c.active.subfoto_ajax),{duration:0.2,offset:-50})},100)}}},oneProgress:function(c){var g=this;if((g.oneOver)&&(g.oneOver.holder)){c?g.oneOver.holder.addClassName("fotoviewer_one_over_holder_progress"):g.oneOver.holder.removeClassName("fotoviewer_one_over_holder_progress")}},saveTitle:function(g,j){var c=this;c.oneProgress(true);new Ajax.Request("/ajax/fotoviewer.html",{asynchronous:true,method:"POST",onSuccess:function(){c.oneProgress(false)},parameters:"digest="+digest+"&mode=save_title&fotoID="+g.fotoID+"&title="+encodeURIComponent(j)})},saveFace:function(u,q,n,m,c,g){var j=this;j.oneProgress(true);new Ajax.Request("/ajax/fotoviewer.html",{asynchronous:true,method:"POST",onSuccess:function(){j.oneProgress(false);if(j.mode==4){j.switchTo(j.active,true)}},parameters:"digest="+digest+"&mode=save_face&fotoID="+u.fotoID+"&userID="+g+"&left="+q+"&top="+n+"&width="+m+"&height="+c})},saveMarker:function(j,g,n,c,u,q,x,m){var w=this;w.oneProgress(true);new Ajax.Request("/ajax/fotoviewer.html",{asynchronous:true,method:"POST",onSuccess:function(){w.oneProgress(false);if(w.mode==4){w.switchTo(w.active,true)}},parameters:"digest="+digest+"&mode=save_marker&fotoID="+j.fotoID+"&title="+encodeURIComponent(q)+"&rotation="+encodeURIComponent(x)+"&color="+encodeURIComponent(m)+"&left="+g+"&top="+n+"&width="+c+"&height="+u})},deleteMarker:function(m,c,j){var g=this;g.oneProgress(true);new Ajax.Request("/ajax/fotoviewer.html",{asynchronous:true,method:"POST",onSuccess:function(n){g.oneProgress(false);if(g.mode==4){g.switchTo(g.active,true)}},parameters:"digest="+digest+"&mode=delete_"+j+"&fotoID="+m.fotoID+"&markerID="+c.markerID})},showPeople:function(){this.oneOverSwitch(true)},oneHelperPerform:function(g){var c=this;if(g){[c.subfoto_controls,c.active.subfoto_whos_there,c.active.subfoto_markers].each(function(j){if(j){j.setStyle({display:"none"})}});if(c.oneHelper){if(c.subfoto_controls){if(c.oneHelper.parentNode){c.oneHelper.parentNode.removeChild(c.oneHelper)}c.subfoto_controls.parentNode.insertBefore(c.oneHelper,c.subfoto_controls)}c.oneHelper.setStyle({display:"block"})}}else{[c.subfoto_controls,c.active.subfoto_whos_there,c.active.subfoto_markers].each(function(j){if(j){j.setStyle({display:"block"})}});if(c.oneHelper){c.oneHelper.update("").setStyle({display:"none"});if(c.oneHelper.parentNode){c.oneHelper.parentNode.removeChild(c.oneHelper)}}}},scrollTo:function(){var c=this;if((!c.scrollingTo)&&(!c.fs)){if(c.o.scrollTo){setTimeout(function(){c.scrollingTo=true;new Effect.ScrollToEx(c.o.scrollTo,{duration:0,offset:-10,afterFinish:function(){c.scrollingTo=false}})},1)}}},ua:function(c){return navigator.userAgent.indexOf(c)!=-1},anchorize:function(j,g){var c=new Element("a");c.setAttribute("href",g);c.appendChild(j);return c},eof:1};function ShowGodsfinger(n,c){var g=Element.cumulativeOffset(n);var t=$("godsfinger");var m=$("godsfinger_data");var q=$("bottomspot").cumulativeOffset();t.style.width=document.body.clientWidth+"px";t.style.height=q[1]+"px";t.style.display="block";g[0]=g[0]-10;g[1]=g[1]-10;m.style.paddingLeft=g[0]+"px";m.style.paddingTop=g[1]+"px";m.innerHTML="";var j=document.createElement("DIV");j.className="godsfingerer";m.appendChild(j);j.appendChild(CreateRoller());new Ajax.Updater("godsfinger_data","/ajax/godsfinger.html",{asynchronous:true,evalScripts:true,method:"POST",parameters:"digest="+digest+"&wtf="+encodeURIComponent(c)+"&backto="+encodeURIComponent(document.location)});return false}function HideGodsfinger(){$("godsfinger").hide();return false}CORE.URLHash=function(){var c=window.location.hash;return c.substring(0,1)=="#"?c.substring(1):c};CORE.CheckHash=function(){var c=CORE.URLHash();var g=false;if(c!=CORE.lastHash){CORE.lastHash=c;CORE.onHashChange.each(function(j){if(j(c)){g=true;throw $break}})}return g};CORE.onHashChangeComments=function(c){if(c.match(/^c[0-9]+$/)){if(h=$(c)){new Effect.Highlight(h,{});return true}}};CORE.SetHash=function(c){window.location="#"+c;CORE.lastHash=c};CORE.lastHash="";CORE.onHashChange=[CORE.onHashChangeComments];function iroOnMouseOut(c){var c=Event.element(c);while(c){if(c.tagName=="TR"){$(c).removeClassName("over");break}c=c.parentNode}}function iroOnMouseOver(c){var c=Event.element(c);while(c){if(c.tagName=="TR"){$(c).addClassName("over");break}c=c.parentNode}}function iroOnClick(c){var g=isFF();if(!Event.isLeftClick(c)){return}var c=Event.element(c);while(c){if(c.tagName.toUpperCase()=="TR"){$(c).addClassName("over");break}c=c.parentNode}if(!c){return false}if(url=c.getAttribute("gourl")){window.location.href=url;return}c=c.firstChild;while(c){if(c.id=="clickme"){d=g?c.firstChild.nextSibling:c.firstChild;while(d){if(d.id=="clickme"){if(d.href){g?(window.location.href=d.href):d.click()}else{(g||(!d.firstChild.click))?(window.location.href=d.firstChild.href):d.firstChild.click()}return}d=d.nextSibling}}c=c.nextSibling}}function InstallRowsOverTo(g){var c=g.firstChild.firstChild;if(!c){c=g.firstChild.nextSibling.firstChild}while(c){if(c.id!="nohover"){c.onmouseover=iroOnMouseOver;c.onmouseout=iroOnMouseOut;c.onclick=iroOnClick}c=c.nextSibling}}function InstallRowsOver(){var g=1;var c=false;while(c=$("hover"+(g+""))){InstallRowsOverTo(c);g++}}function FOv(c){c=$(c);clearTimeout(c._FOv);c._FOv=setTimeout(function(){c.addClassName("track_hover")},50)}function FOu(c){c=$(c);clearTimeout(c._FOv);c._FOv=setTimeout(function(){c.removeClassName("track_hover")},50)}function POv(c){c=$(c);clearTimeout(c._POv);c._POv=setTimeout(function(){c.addClassName("people_hover")},50)}function POu(c){c=$(c);clearTimeout(c._POv);c._POv=setTimeout(function(){c.removeClassName("people_hover")},50)}function ptOver(c){$(c).addClassName("post_tool_hover")}function ptOut(c){$(c).removeClassName("post_tool_hover")}function ptsOver(c){$(c).addClassName("post_tools_hover")}function ptsOut(c){$(c).removeClassName("post_tools_hover")}function slOver(c){$(c).addClassName("over")}function slOut(c){$(c).removeClassName("over")}function h5waveformplayerInitable(){var g=navigator.userAgent.toLowerCase().indexOf("chrome")>-1;if((!g)&&(!Prototype.Browser.IE)){var c=document.createElement("audio");if(c){if(c.canPlayType){return(("no"!=c.canPlayType("audio/mpeg"))&&(""!=c.canPlayType("audio/mpeg")))}}}return false}var h5waveformplayer=Class.create({initialize:function(q,c,j,g,m){var n=this;this.statusTimeout=false;this.gotStop=false;this.intervalID=0;this.mp3=c;this.repeat=false;this.dragging=false;this.IsiPad=navigator.userAgent.indexOf("iPad")!=-1;this.IsiPhone=navigator.userAgent.indexOf("iPhone")!=-1;this.IsiPod=navigator.userAgent.indexOf("iPod")!=-1;this.html=new Element("div",{id:"h5wfp-holder"});this.wave_wrapper=new Element("div",{id:j?"h5wfp-wave-wrapper":"h5wfp-wave-wrapper-no-wave"});this.wave=new Element("div",{id:"h5wfp-wave",style:j?"-webkit-mask-box-image:url('"+j+"')":""});if(m==undefined){m="#C6190E"}this.wave.style.backgroundColor=m;if(j){this.availableImg(j)}if(this.IsiPad||this.IsiPhone||this.IsiPod){this.iDevice=1;this.wave.ontouchstart=function(){n.sliderDown()};this.wave.ontouchmove=function(){n.sliderMove()};this.wave.ontouchend=function(){n.sliderUp()}}else{this.wave.onmousedown=function(){n.sliderDown()};this.wave.onmousemove=function(){n.sliderMove()};this.wave.onmouseup=function(){n.sliderUp()}}this.gray_wave=new Element("div",{id:"h5wfp-gray-wave"});this.roller=new Element("div",{id:j?"h5wfp-roller":"h5wfp-roller-mini"});this.roller.onmouseup=function(){n.sliderUp()};Element.insert(this.wave,this.gray_wave);Element.insert(this.wave_wrapper,this.wave);Element.insert(this.wave_wrapper,this.roller);this.slider=new Element("div",{id:j?"h5wfp-slider":"h5wfp-slider-no-wave"});this.slider.onmouseup=function(){n.sliderUp()};Element.insert(this.wave_wrapper,this.slider);Element.insert(this.html,this.wave_wrapper);this.controls=new Element("div",{"class":this.IsiPad?"controls-2x":"controls"});this.playbtn=new Element("a",{href:"#",id:this.IsiPad?"h5wfp-play-2x":"h5wfp-play","class":"active"});this.playbtn.onclick=function(){return n.play()};Element.insert(this.controls,this.playbtn);this.pausebtn=new Element("a",{href:"#",id:this.IsiPad?"h5wfp-pause-2x":"h5wfp-pause"});this.pausebtn.onclick=function(){return n.pause()};Element.insert(this.controls,this.pausebtn);this.stopbtn=new Element("a",{href:"#",id:this.IsiPad?"h5wfp-stop-2x":"h5wfp-stop"});this.stopbtn.onclick=function(){return n.stop()};Element.insert(this.controls,this.stopbtn);this.timeDisplay=new Element("div",{id:this.IsiPad?"h5wfp-timeDisplay-2x":"h5wfp-timeDisplay"});this.playedTime=new Element("b",{id:"h5wfp-playedTime"}).update("00:00");Element.insert(this.timeDisplay,this.playedTime);this.fullTime=new Element("b",{id:"h5wfp-fullTime"});Element.insert(this.timeDisplay,this.fullTime);Element.insert(this.controls,this.timeDisplay);this.repeatbtn=new Element("a",{href:"#",id:this.IsiPad?"h5wfp-repeat-2x":"h5wfp-repeat"});this.repeatbtn.onclick=function(){return n.toggleRepeat()};Element.insert(this.controls,this.repeatbtn);this.clearboth=new Element("div",{style:"clear:both;"});Element.insert(this.controls,this.clearboth);Element.insert(this.html,this.controls);if(this.IsiPhone||this.IsiPod){this.createAudio()}Element.insert(q,this.html);if(g){this.play()}},createAudio:function(){var c=this;if(!this.IsiPhone&&!this.IsiPod){this.roller.style.display="block"}this.audio=new Element("audio",{src:this.mp3});this.audio.controls=false;if(this.volume!=undefined){this.audio.volume=this.volume}this.audio.addEventListener("timeupdate",function(){c.updateTime()},false);this.audio.addEventListener("loadedmetadata",function(){c.setFullTime()},false);this.audio.addEventListener("pause",function(){c.pausing()},false);this.audio.addEventListener("ended",function(){c.endingPlay()},false);this.audio.addEventListener("error",function(){c.onErrorRaw()},false);this.audio.addEventListener("seeked",function(){c.waitEnd()},false);this.audio.addEventListener("playing",function(){c.playing()},false);this.audio.addEventListener("waiting",function(){c.waitStart()},false);setInterval(function(){c.updateProgress()},750);this.audio.load();Element.insert(this.html,this.audio);return true},play:function(){if(this.intervalID!=0&&!this.audio.paused){clearInterval(this.intervalID);this.intervalID=0}if(this.audio==undefined){this.createAudio()}if(this.audio.paused){this.audio.play();this.onStatusRaw("play")}return false},pause:function(){if(!this.audio.paused){this.audio.pause();this.onStatusRaw(this.gotStop?"stop":"pause");this.gotStop=false}return false},stop:function(){if(this.audio&&this.audio.played){this.gotStop=true;this.fullTime.innerHTML="";this.audio.currentTime=0;this.audio.pause();this.onStatusRaw("stop")}return false},setFullTime:function(){if(this.audio.duration){this.fullTime.innerHTML=" / "+this.secondsToTime(this.audio.duration).join(":")}},updateTime:function(){var c=this.audio.currentTime/this.audio.duration*100;this.slider.style.left=c+"%";var g=this.secondsToTime(this.audio.currentTime);this.playedTime.innerHTML=g.join(":")},updateProgress:function(){if(this.audio.duration&&this.audio.buffered.length!=0){var c=100-Math.ceil(((this.audio.buffered.end(0)/this.audio.duration)*100));this.gray_wave.style.width=c+"%"}},sliderDown:function(){if(this.audio==undefined){this.createAudio()}this.blinkWave();this.dragging=true;this.pause();this.sliderMove();return false},sliderMove:function(){if(this.dragging&&this.audio.duration){if(this.iDevice==1){event.preventDefault()}var g=0;if(event.target.id=="h5wfp-wave"||(event.targetTouches!=undefined&&event.targetTouches[0].target.id=="h5wfp-wave")){if(this.iDevice==1){var c=event.targetTouches[0].pageX-this.wave_wrapper.cumulativeOffset()[0];g=c/this.wave.offsetWidth*this.audio.duration;var j=this.audio.duration-this.gray_wave.offsetWidth/this.wave.offsetWidth*this.audio.duration;g=j>=g?g:j}else{g=event.layerX/this.wave.offsetWidth*this.audio.duration}}else{g=this.audio.duration*0.99-this.gray_wave.offsetWidth/this.wave.offsetWidth*this.audio.duration}if(!g){g=0}this.slider.style.left=(g/this.audio.duration*100)+"%";this.pos=g}return false},sliderUp:function(){var c=this;if(this.audio.duration){this.audio.currentTime=this.pos}this.dragging=false;if(this.intervalID==0){this.intervalID=setInterval(function(){c.play()},200)}return false},toggleRepeat:function(){if(this.repeat){this.repeat=false;this.repeatbtn.removeClassName("active")}else{this.repeat=true;this.repeatbtn.addClassName("active")}return false},endingPlay:function(){if(this.repeat){this.audio.currentTime=0;this.audio.play()}else{this.stop()}},secondsToTime:function(m){var q=Math.floor(m/(60*60));var j=m%(60*60);var n=Math.floor(j/60);var t=j%60;var g=Math.ceil(t);var c=new Array();if(m>=3600){c.push(q>9?parseInt(q):"0"+parseInt(q))}c.push(n>9?parseInt(n):"0"+parseInt(n));c.push(g>9?parseInt(g):"0"+parseInt(g));return c},onErrorRaw:function(){switch(this.audio.error.code){case this.audio.error.MEDIA_ERR_ABORTED:break;case this.audio.error.MEDIA_ERR_NETWORK:this.onError("network_error");break;case this.audio.error.MEDIA_ERR_DECODE:this.onError("failed_to_decode");break;case this.audio.error.MEDIA_ERR_SRC_NOT_SUPPORTED:this.onError("source_not_supported");break;default:this.onError("unknown_error");break}},onError:function(c){},onStatusRaw:function(g){var c=this;clearTimeout(this.statusTimeout);this.statusTimeout=setTimeout(function(){c.onStatus(g)},250)},onStatus:function(c){},availableImg:function(g){var c=this;this.testimg=new Image();this.testimg.onerror=function(j){c.slider.id="h5wfp-slider-no-wave";c.wave_wrapper.id="h5wfp-wave-wrapper-no-wave";c.roller.id="roller_mini"};this.testimg.src=g},getVolume:function(){return this.audio.volume*100},setVolume:function(c){if(this.audio==undefined){this.volume=c/100}else{this.audio.volume=c/100}},blinkWave:function(){var c=this;this.wave_wrapper.setOpacity(0.4);setTimeout(function(){c.wave_wrapper.setOpacity(1)},100)},dbg:function(c){$("dbg").innerHTML+="dbg: "+c+"<br />"},waitStart:function(){if(!this.IsiPhone&&!this.IsiPod){this.roller.style.display="block"}},waitEnd:function(){this.roller.style.display="none"},playing:function(){if(this.dragging==false){this.setFullTime();this.playbtn.removeClassName("active");this.stopbtn.addClassName("active");this.pausebtn.addClassName("active");this.roller.style.display="none"}},pausing:function(){if(this.dragging==false){this.playbtn.addClassName("active");this.stopbtn.removeClassName("active");this.pausebtn.removeClassName("active")}}});var InplaceEditor=Class.create();InplaceEditor.prototype={object:false,field:false,initialize:function(m,g,c){Object.extend(this,c);var j=this;j.editOutImage="http://i.cdn.maases.com/0.gif";j.editOverImage="http://i.cdn.maases.com/edit.png";j.object=m;j.field=g;j.element=new Element("div").addClassName("inplaceeditor");j.element.InplaceEditor=j;j.element.appendChild(j.text=new Element("div").addClassName("inplaceeditor_text").setStyle({cursor:"text"}));j.apply();Event.observe(j.text,"mouseover",function(){j.text.addClassName("inplaceeditor_text_over");if(j.textImage){j.textImage.setAttribute("src",j.editOverImage)}});Event.observe(j.text,"mouseout",function(){j.text.removeClassName("inplaceeditor_text_over");if(j.textImage){j.textImage.setAttribute("src",j.editOutImage)}});Event.observe(j.text,"click",function(){if(j.editable){j.startEdit();return false}})},apply:function(){var c=this;if(c.dumb){c.text.update(c.dumb)}else{c.text.update((c.object[c.field].length>0)?c.tohtml(c.object[c.field]):"&nbsp;");if(c.editable){c.textImage=new Element("img").setStyle({verticalAlign:"middle",marginLeft:"6px",cursor:"pointer",width:"12px",height:"12px"});c.textImage.src=c.editOutImage;c.textImage.onclick=function(){c.startEdit();return false};c.text.appendChild(c.textImage)}}},go:function(m){if(m){var c=$$("div.inplaceeditor")}else{var c=[];$$("div.inplaceeditor").each(function(q){c.unshift(q)})}var j=this;var g=false;var n=false;c.each(function(q){if(q.InplaceEditor){if(j.element==q){g=true}else{if(g){var u=q;var t=$(u).visible();while((t)&&(u)){if($(u).visible){t=$(u).visible()}u=u.parentNode}if(t){new Effect.ScrollToEx(q,{duration:0.2,offset:-200});q.InplaceEditor.startEdit();n=true;throw $break}}}}});return n},startEdit:function(){var c=this;if(c.onStart){if(!c.onStart(c.object,c.field)){return}}if(!c.editor){c.element.appendChild(c.editor=new Element("div").addClassName("inplaceeditor_editor"));c.editor.appendChild(c.input=new Element("input").addClassName("inplaceeditor_input"));Event.observe(c.input,"keydown",function(j){j=j||window.event;if(j.keyCode==27){if(c.editing){c.cancel()}Event.stop(j)}else{if(j.keyCode==13){if(c.editing){c.accept();c.go(true)}Event.stop(j)}else{if(j.keyCode==9){if(c.go(!j.shiftKey)){Event.stop(j)}}}}});Event.observe(c.input,"blur",function(j){if(c.editing){c.accept()}})}c.text.update("&nbsp;");var g=Math.max(16,Element.getHeight(c.text));c.input.value=c.object[c.field];c.editor.setStyle({height:g+"px",display:"block"});c.input.setStyle({height:g+"px",textAlign:c.text.getStyle("textAlign"),fontFamily:c.text.getStyle("fontFamily"),fontSize:c.text.getStyle("fontSize")});c.text.setStyle({display:"none"});setTimeout(function(){try{c.input.focus();c.input.value=c.input.value;c.input.select()}catch(j){}},1);c.editing=true;DisableKeyNav=true},cancel:function(g){var c=this;c.editing=false;DisableKeyNav=false;c.text.setStyle({display:""});c.editor.setStyle({display:"none"});if(!g){if(c.onCancel){c.onCancel(c.object,c.field,c.input.value)}}c.apply()},accept:function(){var c=this;if(c.onAccept){c.onAccept(c.object,c.field,c.input.value)}else{c.object[c.field]=c.input.value}c.cancel(true)},tohtml:function(c){return c.replace(/&/g,"&").replace(/"/g,"&quot;").replace(/'/g,"&apos;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}};var InputSelector=Class.create();InputSelector.prototype={initialize:function(c,m,g){var j=this;j.offsetX=4;j.offsetY=4;j.marginX=8;j.marginY=4;j.correctionY=2;Object.extend(j,g);j.input=$(c);j.value=$(m);j.baseHeight=j.input.getHeight();j.container=new Element("DIV").setStyle({position:"relative"});j.input.parentNode.insertBefore(j.container,j.input);j.input.parentNode.removeChild(j.input);j.container.appendChild(j.input);j.pool=j.pool||[];j.render()},render:function(){var j=this;Prototype.Selector.select(".inputselector",j.container).each(function(t){t.update("");t.parentNode.removeChild(t)});var c=j.offsetX;var u=j.offsetY;var n=0;var m=j.input.getWidth()-j.offsetX;var g=false;var q=[];j.pool.each(function(z){if(!z){return}q.push(z.value);g=true;var C=new Element("DIV").update("<span>"+z.title+"</span>").addClassName("inputselector").setStyle({position:"absolute",left:"0px",top:"0px"});var x=function(){var w=j.pool.indexOf(z);if(w!=-1){new Effect.Fade(C,{duration:0.1,afterFinish:function(){delete j.pool[w];j.render();j.input.focus()}})}return false};C.onmouseover=function(){C.addClassName("inputselector_hover")};C.onmouseout=function(){C.removeClassName("inputselector_hover")};C.onclick=x;var B=new Element("IMG").addClassName("inputselector_remove");B.src="http://i.cdn.maases.com/list_minus.gif";B.onclick=x;C.appendChild(B);C._item=z;j.container.appendChild(C);var A=C.getHeight();n=n==0?A:n;var t=C.getWidth();C.setStyle({left:c+"px",top:u+"px"});c+=t+j.marginX;if(c>m){c=j.offsetX;u+=n+j.marginY;C.setStyle({left:c+"px",top:u+"px"});c+=t+j.marginX;n=A}});if(g){u-=j.offsetY;u-=j.marginY;u+=j.correctionY;u+=j.baseHeight}else{u=0}if((Prototype.Browser.WebKit)||(Prototype.Browser.IE)){j.input.setStyle({marginTop:u==0?"":((u+6)+"px")})}else{j.input.setStyle({paddingTop:u==0?"":((u+(Prototype.Browser.Gecko?4:0))+"px")})}j.value.value=q.join(",")},eof:1};CORE.Linkager=function(m,g,c){var j=new Popup({rawTitle:'<div id="user_finder_searchfor_target"></div>',width:"764px",height:"200px",maxWidth:"864px",maxHeight:"400px",URL:"/ajax/linkage.html?kind="+m+"&title="+encodeURIComponent(g)+"&linkage="+encodeURIComponent(c)});return false};CORE.linkageSelected=function(c){if(!$("linkage_"+c)){if($("linkage_roller")){$("linkage_roller").appendChild(CreateRoller())}new Ajax.Updater("linkage_target","/ajax/linkage_operation.html",{asynchronous:true,method:"POST",parameters:"mode=add&sGID="+CORE.GID+"&tGID="+c+"&template="+CORE.linkageTemplate+"&digest="+encodeURIComponent(digest),onSuccess:function(){$("linkage_roller").update("");RecalcTooltips()},evalScripts:true})}};CORE.linkageDelete=function(c){if(l=$("linkage_"+c)){if($("linkage_roller")){$("linkage_roller").appendChild(CreateRoller())}new Ajax.Updater("linkage_target","/ajax/linkage_operation.html",{asynchronous:true,method:"POST",parameters:"mode=delete&sGID="+CORE.GID+"&tGID="+c+"&template="+CORE.linkageTemplate+"&digest="+encodeURIComponent(digest),onSuccess:function(){$("linkage_roller").update("");RecalcTooltips()},evalScripts:true})}return false};FlashMessagesCounter=false;LiveMessagesUpdater=false;LiveMessagesUpdaterMode="";function FlashMessagesCount(){if(mc=$("messages_count")){mc.style.color=(mc._flash=!mc._flash)?"":"#ff0000"}FlashMessagesCounter=setTimeout(FlashMessagesCount,400)}function StartFlashMessagesCounter(){clearTimeout(FlashMessagesCounter);FlashMessagesCounter=setTimeout(FlashMessagesCount,400)}function StopFlashMessagesCounter(){clearTimeout(FlashMessagesCounter)}function LiveMessagesUpdaterDone(){RecalcTooltips();StartLiveMessagesUpdater()}function LiveMessagesUpdaterPerform(){clearTimeout(LiveMessagesUpdater);if($("messages_count_holder")){new Ajax.Updater("messages_count_holder","/ajax/messages.html?"+LiveMessagesUpdaterMode,{asynchronous:true,method:"GET",onSuccess:LiveMessagesUpdaterDone,evalScripts:true})}}function StartLiveMessagesUpdater(){clearTimeout(LiveMessagesUpdater);LiveMessagesUpdater=setTimeout(LiveMessagesUpdaterPerform,45000)}function MainPageTop100Flip(c){$("top100_djsa").className=c?"atool_active":"atool";$("top100_musiciansa").className=c?"atool":"atool_active";$("top100_djs").style.display=c?"block":"none";$("top100_musicians").style.display=c?"none":"block";return false}var FeaturedAfishaCurrent=0;function SwitchFeaturedAfisha(c){var g=FeaturedAfishaCurrent+c;if($("featured_afisha_"+g)){$("featured_afisha_"+FeaturedAfishaCurrent).style.display="none";FeaturedAfishaCurrent=g;$("featured_afisha_"+FeaturedAfishaCurrent).style.display="block";var g=FeaturedAfishaCurrent+1;$("afisha_right_container").style.display=$("featured_afisha_"+g)?"block":"none";var g=FeaturedAfishaCurrent-1;$("afisha_left_container").style.display=$("featured_afisha_"+g)?"block":"none"}return false}function msgThread(c){c=c.parentNode.parentNode;c.className="unthreaded";return false}function BringMenu(j,c){if(c){$(j)._bringer=setTimeout("BringMenu('"+j+"');",150)}else{var g=Element.cumulativeOffset($(j));$(j+"_menu").style.left=(g[0]-20)+"px";$(j+"_menu").style.top=(g[1]+16)+"px";$(j+"_menu").style.display="block";if($(j)._bringer){clearTimeout($(j)._bringer)}$(j)._bringer=false;if($(j)._locks==undefined){$(j)._locks=0}}return false}function BringMenuOut(c){if($(c)._bringer){clearTimeout($(c)._bringer)}$(c)._bringer=false;return false}function BringMenuInner(c){if($(c)._locks==undefined){$(c)._locks=0}$(c)._locks++;if($(c)._outer){clearTimeout($(c)._outer);$(c)._outer=false}return false}function BringMenuOuter(c){$(c)._locks--;if($(c)._locks==0){if($(c)._outer){clearTimeout($(c)._outer)}$(c)._outer=setTimeout("BringMenuOff('"+c+"');",250)}return false}function BringMenuOff(c){if($(c)._outer){clearTimeout($(c)._outer)}$(c+"_menu").style.display="none";return false}function Eschoer(){var j=Element.getDimensions($("header_container"));var c=$("header_container").style.paddingRight?$("header_container").style.paddingRight:"0px";var g=j.height-((c=="0px")?4:8);$("escho").style.right=c;$("escho").style.top=g+"px";$("escho").style.display=($("escho").style.display=="none")?"block":"none";$("eschorr").innerHTML=($("escho").style.display=="none")?"&nbsp;&#x25BC;":"&nbsp;&#x25B2;";return false}function HideEschoer(){var c=$("escho");if(c){if(c.style.display=="block"){Eschoer()}}return false}function HideMaindrop(){var c=$("maindrop");if(c){if(c.style.display=="block"){c.style.display="none"}}return false}CORE.DropDownerClick=function(c){if(CORE.ActiveDropDowner){if(dd=$("dropdowner_"+CORE.ActiveDropDowner+"_content")){dd.hide()}}CORE.ActiveDropDowner=false;return false};CORE.DropImagerFixup=function(g){var j=$("dropdowner_"+g+"_switch1").positionedOffset();$("dropdowner_"+g+"_content").setStyle({left:(j[0]-6)+"px",top:(j[1])+"px"}).show();var c=$("dropdowner_"+g+"_fake").getDimensions();$("dropdowner_"+g+"_elements").setStyle({left:"0px",top:(c.height-7)+"px"})};function UT(){return parseInt((new Date).getTime()/1000)}function LZ(c){c=c.toString();if(c.length==1){c="0"+c}return c}function DKN(g,c){DisableKeyNav=c}function PerformDisableOnSubmit(){var c=1;while(d=$("dos"+c)){d.disabled=true;c++}}function DisableOnSubmit(){return true}function ExecuteIt(c){c.responseText.evalScripts()}function CreateRoller(){var c=document.createElement("IMG");c.setAttribute("src","http://i.cdn.maases.com/roller2.gif");c.setAttribute("width",10);c.setAttribute("height",10);c.className="roller";return c}function CreateHiddenInput(g,j){var c=document.createElement("input");c.setAttribute("type","hidden");c.setAttribute("name",g);c.setAttribute("value",j);return c}function CreateA(j,c,g){var m=document.createElement("a");m.innerHTML=j;m.setAttribute("amba",g);m.setAttribute("href",c);if(tooltipped){tooltip.ie(m)}return m}function hc(g,c){g.href=c;return true}function ie6sucks(){var g=document.uniqueID&&document.compatMode&&!window.XMLHttpRequest&&document.execCommand;try{if(!!g){g("BackgroundImageCache",false,true)}}catch(c){}}function isFF(){return/Firefox/.test(navigator.userAgent)}function ReloadCaptcha(c,g){$(c).src=g+"&"+Math.random();if(i=$("captchainput")){i.focus()}return false}function cb(c){c.cancelBubble=true;return true}function FlipFAQ(c){$("faq"+c).style.display=($("faq"+c).style.display=="none")?"block":"none";return false}function NoEnter(g){var c=0;if(window.event){c=window.event.keyCode}else{if(g.which){c=g.which}}return c==13?false:true}function CheckEnter(c,j){var g=0;if(window.event){g=window.event.keyCode}else{if(c.which){g=c.which}}if(g==13){j();return false}else{return true}}function ToggleAll(g){var c=document.getElementsByTagName("INPUT");var j=0;while(i=c[j]){if(i.id==g){i.checked=!i.checked}j++}}function htmlspecialchars(c){return c.replace(/&/g,"&").replace(/"/g,"&quot;").replace(/'/g,"&apos;").replace(/</g,"&lt;").replace(/\>/g,"&gt;")}function fixPNG(c,j){var g;if(/MSIE (5\.5|6).+Win/.test(navigator.userAgent)){if((c.tagName=="IMG")&&(!j)){if(/\.png$/.test(c.src)){g=c.src;c.src="http://i.cdn.maases.com/0.gif"}}else{g=c.currentStyle.backgroundImage.match(/url\("(.+\.png)"\)/i);if(g){g=g[1];c.runtimeStyle.backgroundImage="none"}}if(g){c.runtimeStyle.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+g+"',sizingMethod='scale')"}}return""}function ToggleVisibility(g,c){var j=$(g);j.style.display=j.style.display=="none"?"block":"none";return false}function FormatRusNumber(g,q,t,u,n){var m=g+"";var j=n;n=n?function(w){return w.replace(j,m)}:function(w){return w};g=parseInt(g);if(lang=="en"){return Math.abs(g)=="1"?n(q):n(u)}var c=g;g=(g+"").substr(-1,1);if((c+"").substr(-2,2)=="11"){return n(u)}if(g==1){return n(q)}if((g>=2)&&(g<=4)){return((parseInt((c+"").substr(-2,2))>=10)&&(parseInt((c+"").substr(-2,2))<=20))?n(u):n(t)}return n(u)}function IsMiddleClick(c){var c=c||window.event;if(Event.isMiddleClick(c)){return true}if((c)&&(c.which==2)){return true}return false}var MoodLocked=false;function EditMood(){$("dj_mood").style.display="none";$("dj_mood_editor").style.display="block";setTimeout("$('dj_mood_text').focus();",50);return false}function MoodApplied(c){MoodLocked=false;$("dj_mood")._ied=false;$("dj_mood").style.display="block";$("dj_mood_editor").style.display="none";$("dj_mood_text").disabled=false;setTimeout(RecalcTooltips,10)}function ApplyMood(){if(MoodLocked){return false}MoodLocked=true;$("dj_mood_text").disabled=true;new Ajax.Updater("dj_mood","/ajax/set_mood.html",{asynchronous:true,method:"POST",parameters:"digest="+digest+"&mood="+encodeURIComponent($("dj_mood_text").value),onSuccess:MoodApplied})}prelistenhq=false;autostart=false;CurrentPlaya=false;IntegratedPlaya=false;LastTinyPlayer=false;LastTinyPlayerHilight=false;function Prelisten(q,g,n){if(!GotFlash){return true}StopTracklistListen();g.cancelBubble=true;if(LastTinyPlayer){StopTinyPlayer()}if(!q){return false}var m=q.parentNode.id;if(m==LastTinyPlayer){return false}if(LastTinyPlayerHilight){$(LastTinyPlayerHilight).parentNode.parentNode.parentNode.style.backgroundColor=$(LastTinyPlayerHilight).parentNode.parentNode.parentNode.style._backgroundColor;$(LastTinyPlayerHilight).parentNode.parentNode.parentNode.style.backgroundImage=$(LastTinyPlayerHilight).parentNode.parentNode.parentNode.style._backgroundImage;LastTinyPlayerHilight=false}q.parentNode._savedhtml=q.parentNode.innerHTML;q.parentNode._savedclassName=q.parentNode.className;q.parentNode.className="play_button_playing";LastTinyPlayer=m;LastTinyPlayerHilight=m;var j=$(m);j.parentNode.parentNode.parentNode.style._backgroundImage=j.parentNode.parentNode.parentNode.style.backgroundImage;j.parentNode.parentNode.parentNode.style._backgroundColor=j.parentNode.parentNode.parentNode.style.backgroundColor;j.parentNode.parentNode.parentNode.style.backgroundImage="";j.parentNode.parentNode.parentNode.style.backgroundColor="#f5f4e8";var t="wtf="+Math.random()+"";var c=new SWFObject("http://i.cdn.maases.com/swf/tinyplayer.swf","playa_"+m,"45","9","7","#f5f4e8");c.addParam("swliveconnect",true);c.addParam("allowScriptAccess","always");c.addParam("wmode","transparent");c.addVariable("file",encodeURIComponent(baseurl+"prelisten/"+n+"/bobmarley?"+(prelistenhq?"hq=1&":"")+t));c.addVariable("volumePercent",Volume);c.write(m);if(tooltipped){tooltip.h()}CurrentPlaya="playa_"+m;TitleRollerStart();return false}function StopTinyPlayer(){if(LastTinyPlayer){var c=$(LastTinyPlayer);if(cp=$(CurrentPlaya)){if(cp.ResetMF){cp.ResetMF("YESS")}}c.className=c._savedclassName;c.innerHTML=c._savedhtml;LastTinyPlayer=false;RecalcTooltips();TitleRollerStop()}}function EasyPlay(c,g,j){if(g){if(g.target){if(g.target.toString().match(/mbed/)){return false}}}return GotFlash?Prelisten($("ta"+c),g,j):true}var LastTracklistListener=false;function StopTracklistListen(){if(a=LastTracklistListener){a.innerHTML=a._saved_content;a._locked=false;LastTracklistListener=false;RecalcTooltips();TitleRollerStop()}}function TracklistListen(m,j){if(!GotFlash){return true}if(m._locked){return false}StopTinyPlayer();StopTracklistListen();LastTracklistListener=m;m._saved_content=m.innerHTML;m._locked=true;var c="wtf="+Math.random()+"";var g=new SWFObject("http://i.cdn.maases.com/swf/tinytracklistplayer.swf","playa_"+m.id,"45","9","7","#f5f4e8");g.addParam("wmode","transparent");g.addParam("allowScriptAccess","always");g.addParam("swliveconnect",true);g.addParam("align","absmiddle");g.addVariable("file",encodeURIComponent(baseurl+"tracklist_prelisten/"+j+"/sunisshining?"+c+(prelistenhq?"&hq=1":"")));g.addVariable("volumePercent",Volume);g.write(m.id);if(tooltipped){tooltip.h()}CurrentPlaya="playa_"+m.id;TitleRollerStart();return false}var ExternalPlayerState=false;function ExternalPlayerStatus(c){if(c){if(ExternalPlayerState!=true){TitleRollerStart()}}else{if(ExternalPlayerState!=false){TitleRollerStop()}}ExternalPlayerState=c?true:false}function GeneratePlayer(g,m,u,q,n){if(m=="audio"){var t=new SWFObject("http://i.cdn.maases.com/swf/bigplayer.swf","fp"+g,"481","30","8","");t.addParam("swliveconnect",true);t.addParam("allowScriptAccess","always");t.addParam("wmode","transparent");t.addVariable("link",encodeURIComponent(u));t.addVariable("slowChannel",prelistenhq?0:1);t.addVariable("autostart",0);t.addVariable("volumePercent",85);t.write(g)}else{if(m=="video_temp1"){var j=u.split(",");var c='{"clip":{"autoPlay":false,"provider":"pseudo","url":"http://promodj.ru/preview_h264/'+j[0]+"/"+j[0]+'.mp4","bufferLength":"1"},"key":"$150ab913be48f7facf2","canvas":{"background":"#000000 url(http://promodj.ru/preview_h264_shot/'+j[0]+"/"+j[0]+'.jpg) no-repeat 50pct 50pct","backgroundGradient":"none","backgroundColor":"#000000"},"play":{"replayLabel":"Ещё раз "},"screen":{"height":"400px","top":"0px"},"plugins":{"pseudo":{"url":"flowplayer.pseudostreaming-3.2.6.swf"},"controls":{"borderRadius":"0px","timeColor":"#ffffff","bufferGradient":"none","sliderColor":"rgba(0, 0, 0, 90)","zIndex":1,"backgroundColor":"rgb(0, 0, 0, 0)","scrubberHeightRatio":0.6,"volumeSliderGradient":"none","tooltipTextColor":"#ffffff","sliderGradient":"none","spacing":{"time":6,"volume":8,"all":2},"timeBorderRadius":20,"timeBgHeightRatio":0.8,"volumeSliderHeightRatio":0.6,"progressGradient":"none","height":26,"volumeColor":"rgba(198, 26, 14, 1)","timeSeparator":" ","name":"controls","tooltips":{"marginTop":"400px","buttons":false},"opacity":1,"volumeBarHeightRatio":0.2,"timeFontSize":12,"left":"50pct","tooltipColor":"rgba(0, 0, 0, 0)","border":"0px","volumeSliderColor":"rgba(255, 255, 255, 1)","bufferColor":"#a3a3a3","buttonColor":"#ffffff","durationColor":"rgba(49, 49, 49, 1)","autoHide":{"enabled":true,"hideDelay":1500,"mouseOutDelay":1500,"hideStyle":"move","hideDuration":500,"fullscreenOnly":false},"backgroundGradient":"none","width":"79pct","sliderBorder":"1px solid rgba(128, 128, 128, 0.7)","display":"block","buttonOverColor":"#ffffff","url":"flowplayer.controls-3.2.4.swf","timeBorder":"0px solid rgba(0, 0, 0, 0.3)","progressColor":"rgba(198, 26, 14, 1)","timeBgColor":"rgb(0, 0, 0, 0)","scrubberBarHeightRatio":0.2,"bottom":"7.5pct","builtIn":false,"volumeBorder":"1px solid rgba(128, 128, 128, 0.7)","margins":[2,12,2,12]}}}';var t=new SWFObject("http://promodj.ru/i/swf/flowplayer.commercial-3.2.6.swf","plaaya",j[1],j[2],"10","#000000");t.addParam("swliveconnect",true);t.addParam("allowScriptAccess","always");t.addParam("allowFullScreen","true");t.addParam("wmode","opaque");t.addVariable("config",encodeURIComponent(c));t.write(g)}}}CORE.RegisterPlayer=function(g,c){setTimeout(function(){if(g=$(g)){g.Mogilevsky=function(j){if(g.PlayerSetVolume){g.PlayerSetVolume(j/99)}};if(g.PlayerRegisterVolumeCallback){g.PlayerRegisterVolumeCallback("CORE.OnPlayerVolume")}if(/(^|,)resize_ratio(,|$)/.test(c)){setTimeout(function(){if(g.PlayerRegisterResizeCallback){g.PlayerRegisterResizeCallback("CORE.OnPlayerResize")}if(g.PlayerGetDimensions){CORE.OnPlayerResize(g.id,c,g.PlayerGetDimensions()+"")}},1)}if(CORE.OnPlayerInits){if(CORE.OnPlayerInits[g]){CORE.OnPlayerInits[g](g,c)}}}},1)};CORE.OnPlayerVolume=function(j,c,g){setTimeout(function(){UpdateVolume(g*100)},1)};CORE.OnPlayerResizePerform=function(n,q,g){n=$(n);var t=$(n.id+"c");var j=n.getWidth();var g=g.split(",");if((!n._width)||(n._width!=j)){n._width=j;var c=Math.floor(j/parseInt(g[2])*parseInt(g[3]));try{n.setStyle({height:c+"px"})}catch(m){}try{t.setStyle({height:c+"px"})}catch(m){}}};CORE.OnPlayerResize=function(j,c,g){setTimeout(function(){CORE.OnPlayerResizePerform(j,c,g)},1)};CORE.OnPlayerInit=function(c,g){CORE.OnPlayerInits=CORE.OnPlayerInits||{};CORE.OnPlayerInits[c]=g};CurrentPopup=false;var Popup=Class.create();Popup.prototype={instance:0,options:false,attachedElement:false,onShow:false,onLoaded:false,onHide:false,onError:false,onEsc:false,initialize:function(c){CORE.popupInstance=CORE.popupInstance||0;CORE.popupInstance++;this.instance=CORE.popupInstance;if(CORE.popupInstances==undefined){CORE.popupInstances=new Array()}CORE.popupInstances[CORE.popupInstance]=this;c.width=c.width||"600px";c.height=c.height||"400px";c.maxWidth=c.maxWidth||"90%";c.maxHeight=c.maxHeight||"90%";this.onShow=c.onShow;this.onLoaded=c.onLoaded;this.onHide=c.onHide;this.onError=c.onError;this.onEsc=c.onEsc;this.popup=document.createElement("DIV");this.popup.className="popup";var j='<div style="position: relative; height: 100%;"><img src="http://i.cdn.maases.com/0.gif" style="position: absolute; left: 0px; top: 0px; width: 100%; height: 100%;"><div style="position: absolute; left: 0px; top: 0px; width: 100%; height: 100%;" align="center"><div style="height: 100%;"><table id="popup_'+CORE.popupInstance+'_table" class="popup_holder" style="max-width: '+c.maxWidth+';"><td class="popup_holder"><div class="popup_holder">';j+='<div id="popup_'+CORE.popupInstance+'_title" class="popup_title" align="center"><div class="popup_title_content">'+(c.rawTitle?c.rawTitle:('<div style="float: left; font-size: 1.6em; padding-top: 1px;">'+c.title+'</div><img src="http://i.cdn.maases.com/0.gif" width="1" height="22" style="vertical-align: middle;"> <a class="popup_close" href="#" onClick="return CORE.popupInstances['+CORE.popupInstance+'].hide();">x</a>'))+"</div></div>";j+='<div class="popup_content'+(c.epilog?(" popup_content_with_epilog"):"")+'" style="min-height: '+c.height+"; min-width: "+c.width+"; max-width: "+c.maxWidth+"; max-height: "+c.maxHeight+';"><div id="popup_'+CORE.popupInstance+'_content" style="min-height: '+c.height+"; min-width: "+c.width+'; background: url(http://i.cdn.maases.com/roller2.gif) 50% 50% no-repeat;"></div></div>';if(c.epilog){j+='<div class="popup_epilog"><table><td>'+c.epilog+"</td></table></div>"}j+="</div></td></table></div></div></div>";this.popup.innerHTML=j;$("popups").appendChild(this.popup);this.options=c;var g=this;if(c.element){setTimeout(function(){g.attachElement($(c.element))},1)}else{if(c.URL){setTimeout(function(){g.attachURL(c.URL)},1)}}if(!c.noShow){setTimeout(function(){g.show()},1)}setTimeout(function(){new Draggable($("popup_"+CORE.popupInstance+"_table"),{handle:"popup_"+CORE.popupInstance+"_title",starteffect:function(){},endeffect:function(){}})},1);g.keyHandler=function(m){m=m||window.event;if((m.keyCode==27)&&(g==CurrentPopup)){if(g.onEsc){if(!g.onEsc()){g.hide();Event.stop(m)}}else{g.hide();Event.stop(m)}}}},loaded:function(g){$("popup_"+this.instance+"_content").style.background="";if(this.onLoaded){this.onLoaded(this,g)}var c=function(j){var m=function(n){var q=function(u){var t=0;if(!u){u=window.event}if(u.wheelDelta){t=u.wheelDelta/120}else{if(u.detail){t=-u.detail/3}}return -Math.round(t)};j.scrollTop+=q(n)*50;Event.stop(n)};Event.observe(j,"mousewheel",m);Event.observe(j,"DOMMouseScroll",m)};setTimeout(function(){$$(".popup_scrollable").each(c)},1);if(!this.options.safeScroller){$$(".popup_content").each(c)}},attachElement:function(c){c._saved_popup_parent=c.parentNode;c._saved_style_display=c.style.display;if(c.parentNode){c.parentNode.removeChild(c)}$("popup_"+this.instance+"_content").appendChild(c);this.attachedElement=c;c.style.display="block";this.loaded()},attachURL:function(c){var g=this;new Ajax.Updater("popup_"+g.instance+"_content",c,{asynchronous:true,method:"GET",onSuccess:function(j){g.loaded(j)},onFailure:function(j){$("popup_"+g.instance+"_content").innerHTML='<div style="text-align: center; padding: 1em;">'+lng.popup_error+"</div>";if(g.onError){g.onError(g,j)}},evalScripts:true})},deattach:function(){if(this.attachedElement){var c=this.attachedElement;$("popup_"+this.instance+"_content").removeChild(c);if(c._saved_popup_parent){c._saved_popup_parent.appendChild(c)}c.style.display=c._saved_style_display;this.attachedElement=false}else{$("popup_"+this.instance+"_content").update("")}this.popup.update("")},show:function(){if(CORE.activePopups==undefined){CORE.activePopups=new Array()}if(CORE.activePopups.length>0){var g=CORE.activePopups.pop();g.fadeOut();CORE.activePopups.push(g)}CORE.activePopups.push(this);CORE.popupsShown=CORE.popupsShown||0;CORE.popupsShown++;if(CORE.popupsShown==1){var c=$("bottomspot").cumulativeOffset();$("popup_background").style.height=c[1]+"px";$("popup_background").style.display="block";Event.observe($("popup_background"),"click",function(j){Event.stop(j)})}this.popup.style.display="block";if(tooltipped){tooltip.h()}CurrentPopup=this;if(this.onShow){this.onShow(this)}Event.observe(document,"keydown",this.keyHandler);return false},hide:function(){var c=this;var g=function(){CORE.popupsShown--;if(CORE.popupsShown==0){$("popup_background").hide()}$(c.popup).hide().setOpacity(1);c.deattach();CORE.activePopups.pop();var j=false;if(CORE.activePopups.length>0){j=CORE.activePopups.pop();j.fadeIn();CORE.activePopups.push(j)}CurrentPopup=j;if(c.onHide){c.onHide(c)}Event.stopObserving(document,"keydown",c.keyHandler);if(tooltipped){tooltip.h()}};new Effect.Opacity(c.popup,{duration:0.2,from:1,to:0,afterFinish:g});return false},fadeOut:function(){new Effect.Opacity(this.popup,{duration:0.2,from:1,to:0.3})},fadeIn:function(){new Effect.Opacity(this.popup,{duration:0.2,from:0.3,to:1})}};var HScrollBar=Class.create();HScrollBar.prototype={element:false,a:false,p:false,value:0,min:0,max:100,lastValue:-1,dragging:false,observed:false,onChange:false,canChange:false,lockChange:false,initialize:function(c){Object.extend(this,c);if(this.max<this.min){this.max=this.min}var j=this;this.element=new Element("div");this.element.addClassName("hscrollbar");Event.observe(this.element,"mousedown",function(m){return j.mouseDown(m||window.event)});this.a=new Element("div");this.a.addClassName("a");this.element.appendChild(this.a);this.p=new Element("div");this.p.addClassName("p");var g=new Element("div");g.addClassName("c");this.p.appendChild(g);this.element.appendChild(this.p);this.update()},update:function(){var g=(this.value-this.min)/(this.max-this.min)*100;g=Math.round(g*100)/100;try{this.a.style.width=g+"%";this.p.style.display="none";this.p.style.display="block"}catch(c){}if(this.lastValue!=this.value){this.lastValue=this.value;if((this.onChange)&&(!this.lockChange)){this.onChange(this.value)}}},focus:function(j){var m=Event.pointer(j);var g=Element.cumulativeOffset(this.element);var c=Element.getWidth(this.element);var n=(m.x-g[0])/c*100;if(n<0){n=0}if(n>100){n=100}this.value=this.min+(this.max-this.min)*n/100;this.update()},mouseDown:function(g){var c=this;if(this.canChange){if(!this.canChange(g)){return}}if(!this.observed){this.observed=true;Event.observe(document,"mouseup",function(j){return c.mouseUp(j||window.event)});Event.observe(document,"mousemove",function(j){return c.mouseMove(j||window.event)})}this.dragging=true;this.focus(g);Event.stop(g)},mouseUp:function(c){if(this.dragging){this.dragging=false;this.focus(c)}},mouseMove:function(c){if(this.dragging){this.focus(c)}},setMax:function(c){if(c<this.min){c=this.min}this.max=c;if(this.value>this.max){this.value=this.max}this.update()},setValue:function(g,c){if(g<this.min){g=this.min}if(g>this.max){g=this.max}this.value=g;if(c){this.lockChange=true}this.update();if(c){this.lockChange=false}}};function Share(u,m,t){var n=700;var c=360;if(u=="tw"){n=560;c=280}if(u=="lj"){n=900;c=500}if(u=="ya"){n=900;c=500}if(u=="my"){n=550;c=360}if(u=="ms"){n=450;c=430}var g=Math.round((document.body.clientWidth-n)/2);var j=Math.round((document.body.clientHeight-c)/2);var q=window.open("/ajax/share.html?service="+encodeURIComponent(u)+"&kind="+encodeURIComponent(m)+"&kindID="+encodeURIComponent(t),"pdjshare","toolbar=no,"+(u=="lj"?"scrollbars=yes,":"scrollbars=no,")+"status=no,width="+n+",height="+c+",top="+g+",left="+j);q.focus();return false}Object.extend(Event,{_domReady:function(){if(arguments.callee.done){return}arguments.callee.done=true;if(this._timer){clearInterval(this._timer)}this._readyCallbacks.each(function(c){c()});this._readyCallbacks=null},onDOMReady:function(c){if(!this._readyCallbacks){var g=this._domReady.bind(this);if(document.addEventListener){document.addEventListener("DOMContentLoaded",g,false)}if(/WebKit/i.test(navigator.userAgent)){this._timer=setInterval(function(){if(/loaded|complete/.test(document.readyState)){g()}},10)}Event.observe(window,"load",g);Event._readyCallbacks=[]}Event._readyCallbacks.push(c)}});Array.prototype.in_array=function(g){var j=this.length;for(var c=0;c<j;c++){if(this[c]===g){return true}}return false};CORE.TextAreaAutoSize=function(j,n,t){var q=$(j);if((!q)||(!q.getHeight)){return}var c=-1;var g=false;var m=new Element("div");m.id=q.id+"_hidden";q.insert({after:m});q.AutoSizeMinHeight=q.getHeight();q.style.resize="none";Element.setStyle(m,{fontFamily:Element.getStyle(q,"fontFamily"),fontSize:Element.getStyle(q,"fontSize"),lineHeight:Element.getStyle(q,"lineHeight"),paddingTop:Element.getStyle(q,"paddingTop"),paddingLeft:Element.getStyle(q,"paddingLeft"),paddingRight:Element.getStyle(q,"paddingRight"),paddingBottom:Element.getStyle(q,"paddingBottom"),marginTop:Element.getStyle(q,"marginTop"),marginLeft:Element.getStyle(q,"marginLeft"),marginRight:Element.getStyle(q,"marginRight"),marginBottom:Element.getStyle(q,"marginBottom"),borderTop:Element.getStyle(q,"borderTop"),borderLeft:Element.getStyle(q,"borderLeft"),borderRight:Element.getStyle(q,"borderRight"),borderBottom:Element.getStyle(q,"borderBottom"),display:"none",whiteSpace:"pre-wrap"});var u=function(){if(q.value!=q.AutoSizeValue){q.AutoSizeValue=q.value;var A=q.AutoSizeMinHeight;var x=$F(q).replace(/&/g,"&amp;").replace(/</g,"&lt;");if(Prototype.Browser.IE){x=x.replace(/\x0A/g,"<br />&nbsp;")+"<br />"}m.setStyle({width:q.getWidth()+"px"});m.innerHTML=x+"z";var z=Math.max(A,m.getHeight()-1);if(n){z=Math.min(z,n)}if((z!=c)&&(z!=0)){q.setStyle({height:z+"px"});c=z}}};var w=function(x){clearTimeout(g);g=setTimeout(u,1)};q.observe("change",w);q.observe("keyup",w);q.AutoSizeInterval=setInterval(w,250);q.AutoSizeValue=-1;u()};epileptic=false;titlerollerOldTitle=false;titlerollerTimer=false;titlerollerStep=false;titlerollerPhase=false;titlerollerLocks=0;function TitleRollerStart(){if(epileptic){return}titlerollerLocks++;if(titlerollerLocks==1){if(titlerollerOldTitle===false){titlerollerOldTitle=document.title}if(titlerollerTimer){clearTimeout(titlerollerTimer)}titlerollerTimer=setTimeout(TitleRollerRoll,230);titlerollerStep=0;titlerollerPhase=false}}function TitleRollerStop(){if(epileptic){return}titlerollerLocks--;if(titlerollerLocks==0){if(titlerollerTimer){clearTimeout(titlerollerTimer)}document.title=titlerollerOldTitle}}function TitleRollerRoll(){titlerollerStep++;if(titlerollerStep>8){titlerollerStep=1}var c=">";var g=String.fromCharCode(8211);if(titlerollerStep==1){document.title="["+c+g+g+g+"] "+titlerollerOldTitle}else{if(titlerollerStep==2){document.title="["+c+c+g+g+"] "+titlerollerOldTitle}else{if(titlerollerStep==3){document.title="["+c+c+c+g+"] "+titlerollerOldTitle}else{if(titlerollerStep==4){document.title="["+c+c+c+c+"] "+titlerollerOldTitle}else{if(titlerollerStep==5){document.title="["+g+c+c+c+"] "+titlerollerOldTitle}else{if(titlerollerStep==6){document.title="["+g+g+c+c+"] "+titlerollerOldTitle}else{if(titlerollerStep==7){document.title="["+g+g+g+c+"] "+titlerollerOldTitle}else{if(titlerollerStep==8){document.title="["+g+g+g+g+"] "+titlerollerOldTitle}}}}}}}}titlerollerTimer=setTimeout(TitleRollerRoll,230)}tooltipped=false;var tooltip={options:{attr_name:"tooltip",blank_text:"",newline_entity:"<br>",max_width:0,delay:400,skip_tags:["link","style"]},no:0,t:null,c:null,aj:null,sex:null,g:false,canvas:document.getElementsByTagName(document.compatMode&&document.compatMode=="CSS1Compat"?"HTML":"BODY")[0],cache:new Array(),safari:/Konqueror|Safari|KHTML/.test(navigator.userAgent),black:false,effect:false,effectTimeout:false,mouseTimeout:false,ie:function(c){if(!c||tooltip.options.skip_tags.in_array(c.tagName.toLowerCase())){return}if(c._ied){return}c._ied=true;var g=c.getAttribute("title");if(g&&typeof g!="string"){g=""}if(c.getAttribute("amba")){c.removeAttribute("alt");c.removeAttribute("title");tooltip.l(c,"mouseover",tooltip.sd);tooltip.l(c,"mouseout",tooltip.hd)}else{var j=c.getAttribute("alt");if(g){c.setAttribute(tooltip.options.attr_name,g);if(c.getAttribute(tooltip.options.attr_name)){c.removeAttribute("title");if(j&&c.complete){c.removeAttribute("alt")}tooltip.l(c,"mouseover",tooltip.sd);tooltip.l(c,"mouseout",tooltip.hd)}}else{if(j&&c.complete){c.setAttribute(tooltip.options.attr_name,j);if(c.getAttribute(tooltip.options.attr_name)){c.removeAttribute("alt");tooltip.l(c,"mouseover",tooltip.sd);tooltip.l(c,"mouseout",tooltip.hd)}}}}},ieall:function(){var c=document.all&&!window.opera?document.all:document.getElementsByTagName("*");var j=c.length;for(var g=0;g<j;g++){tooltip.ie(c[g])}},d:function(){if(!(tooltip.t=$("tooltip"))){return false}tooltipped=true;tooltip.ieall();tooltip._lastx=0;tooltip._lasty=0;window.onscroll=tooltip.h;tooltip.a(-99,-99);document.onmousemove=tooltip.inheaven},_:function(c){return c.replace(/\&/g,"&").replace(/\</g,"<").replace(/\>/g,">")},sx:function(){tooltip.t.style.left=tooltip._lastx+"px";tooltip.t.style.top=tooltip._lasty+"px";tooltip.g=true;if(tooltip.cache[tooltip.sxe]){tooltip.t.innerHTML=tooltip.cache[tooltip.sxe];tooltip.appear();tooltip.fwtf()}else{(tooltip.aj=new Ajax.Request("/ajax/tooltip.html?wtf="+tooltip.sxe,{asynchronous:true,method:"get",onSuccess:tooltip.ldd}))._no=tooltip.no}},ldd:function(c){if(c.request._no==tooltip.no){c.responseText.evalScripts();$("tooltip").innerHTML=c.responseText;tooltip.appear();tooltip.fwtf()}},fwtfr:function(){if(tooltip.t){var g=Element.getDimensions(tooltip.t);var j=document.viewport.getDimensions();var c=Element.cumulativeOffset(tooltip.t);if(g.width+32+c.left>j.width){var m=j.width-g.width-32;Element.setStyle(tooltip.t,{left:m+"px"})}}},fwtf:function(){tooltip.fwtfr();setTimeout(tooltip.fwtfr,1);if(tooltip.t){tooltip.black?tooltip.t.addClassName("tooltip_black"):tooltip.t.removeClassName("tooltip_black")}},sd:function(c){clearTimeout(tooltip.mouseTimeout);c=window.event?window.event.srcElement:c.target;tooltip.mouseTimeout=setTimeout(function(){tooltip.h(false,true);tooltip.s(false,c)},50)},hd:function(c){clearTimeout(tooltip.mouseTimeout);tooltip.mouseTimeout=setTimeout(tooltip.h,50)},s:function(e,fe){if(tooltip){var d=fe?fe:(window.event?window.event.srcElement:e.target);if(!d){return}var p=d;while(p){p=$(p);if((p.getAttribute)&&(p.getAttribute("noamba"))){return}if((p.hasClassName)&&(p.hasClassName("mceEditor"))){return}p=p.parentNode}tooltip.no++;var di=Element.getDimensions(d);var po=Element.cumulativeOffset(d);var promenade=d.getAttribute("promenade");if(promenade){tooltip._lasty=po.top+di.height-6;tooltip._lastx=po.left-2-8;tooltip.t.style.width=(di.width+2)+"px";tooltip.t.style.padding="8px 8px";tooltip.t.style.textAlign="center"}else{tooltip.t.style.width="auto";tooltip.t.style.padding="8px 12px";tooltip.t.style.textAlign="left";tooltip._lastx=po.left}if(tooltip.sxe=d.getAttribute("amba")){clearTimeout(tooltip.c);tooltip.c=setTimeout(tooltip.sx,tooltip.options.delay)}else{if(!d.getAttribute(tooltip.options.attr_name)){return}var s=d.getAttribute(tooltip.options.attr_name);var s=tooltip._(s);s=s.replace(eval("/"+tooltip._(tooltip.options.newline_entity)+"/g"),"<br />");tooltip.t.innerHTML=s;tooltip.t.style.left=tooltip._lastx+"px";tooltip.t.style.top=tooltip._lasty+"px";clearTimeout(tooltip.c);tooltip.c=setTimeout(function(){tooltip.appear();if(!promenade){tooltip.t.style.top=tooltip._lasty+"px"}tooltip.fwtf()},tooltip.options.delay);tooltip.g=true}}},h:function(j,g){if(tooltip){tooltip.no++;var c=function(){if(!tooltip.options.newline_entity&&tooltip.t.firstChild){tooltip.t.removeChild(tooltip.t.firstChild)}tooltip.g=false;tooltip.a(-1024,-1024);tooltip.no++};clearTimeout(tooltip.c);if(tooltip.effect){tooltip.effect.cancel()}clearTimeout(tooltip.effectTimeout);clearTimeout(tooltip.mouseTimeout);if((Effect.Opacity)&&(!g)){tooltip.effect=new Effect.Opacity(tooltip.t,{from:1,to:0,duration:0.1});tooltip.effectTimeout=setTimeout(c,200)}else{tooltip.t.style.display="none";c()}}},l:function(g,c,j){if(g.addEventListener){g.addEventListener(c,j,false)}else{if(g.attachEvent){g.attachEvent("on"+c,j)}else{return null}}},a:function(q,n){var j=tooltip.canvas.clientWidth?tooltip.canvas.clientWidth+tooltip.canvas.scrollLeft:window.innerWidth+window.pageXOffset;var g=window.innerHeight?window.innerHeight+window.pageYOffset:tooltip.canvas.clientHeight+tooltip.canvas.scrollTop;tooltip.t.style.width=tooltip.options.max_width&&tooltip.t.offsetWidth>tooltip.options.max_width?tooltip.options.max_width+"px":"auto";var m=tooltip.t.offsetWidth;var c=tooltip.t.offsetHeight;tooltip.t.style.left=q+8+"px";tooltip.t.style.top=n+8+"px"},inheaven:function(c){var g=Event.pointer(c?c:window.event);tooltip._lasty=g.y+16},appear:function(){if(tooltip.effect){tooltip.effect.cancel()}clearTimeout(tooltip.effectTimeout);if(Effect.Opacity){tooltip.t.style.display="block";tooltip.t.setOpacity(0);tooltip.effect=new Effect.Opacity(tooltip.t,{from:0,to:1,duration:0.1})}else{tooltip.t.style.display="block"}}};function RecalcTooltips(){if(tooltipped){setTimeout(tooltip.ieall,1)}}Validated=false;onValidated=false;function PerformValidation(){new Popup({title:lng.vld_title,width:"750px",height:"100px",maxWidth:"800px",maxHeight:"500px",URL:"/ajax/validator.html"});return false}UpdateVolumeTimeout=false;FlushVolumeTimeout=false;SetVolumeTimeout=false;GotFlash=false;Volume=100;function UpdateVolume(c){Volume=c;if(UpdateVolumeTimeout){clearTimeout(UpdateVolumeTimeout)}UpdateVolumeTimeout=setTimeout(function(){UpdateVolumePerform(Volume)},25)}function UpdateVolumePerform(c){if(cp=$(CurrentPlaya)){if(cp.Mogilevsky){cp.Mogilevsky(c)}}if(IntegratedPlaya){if(ip=$(IntegratedPlaya)){if(ip.Mogilevsky){ip.Mogilevsky(c)}}}UpdateVolumeTimeout=false;if(FlushVolumeTimeout){clearTimeout(FlushVolumeTimeout)}FlushVolumeTimeout=setTimeout(FlushVolumePerform,500)}function FlushVolumePerform(){FlushVolumeTimeout=false;new Ajax.Request("/ajax/set_volume.html",{method:"post",parameters:"volume="+Volume+"&digest="+digest})}function SetVolume(c){Volume=c;if(SetVolumeTimeout){clearTimeout(SetVolumeTimeout)}SetVolumeTimeout=setTimeout(SetVolumePerform,25)}function SetVolumePerform(){SetVolumeTimeout=false;if(vc=$("volumeChanger")){if(vc.Mogilevsky){vc.Mogilevsky(Volume)}}if(FlushVolumeTimeout){clearTimeout(FlushVolumeTimeout)}FlushVolumeTimeout=setTimeout(FlushVolumePerform,500)}function InitVolumer(){if($("volumer")){var c=new SWFObject("http://i.cdn.maases.com/swf/volumer.swf","volumeChanger","80","16","7","");c.addParam("allowscriptaccess","always");c.addParam("swliveconnect",true);c.addParam("wmode","opaque");c.addVariable("volumePercent",Volume);c.write("volumer");GotFlash=$("volumer").innerHTML==""?false:true}else{GotFlash=true}}var debugConsole={height:"100px",startedAt:new Date(),whole:"",got:0,pool:[],eof:1};debugConsole.init=function(){Event.observe(window,"keydown",function(g){g=g||window.event;if((g.ctrlKey)&&(g.keyCode==192)&&(debugConsole.got)){debugConsole.consoleBack.toggle();debugConsole.console.toggle()}});var c=$$("body")[0];c.appendChild(debugConsole.consoleBack=new Element("DIV").setStyle({padding:"5px",position:"fixed",bottom:"0px",left:"0px",width:"100%",height:debugConsole.height,backgroundColor:"#000000",opacity:0.9,display:"none",zIndex:100000}));c.appendChild(debugConsole.console=new Element("DIV").setStyle({padding:"5px",fontSize:"0.85em",position:"fixed",bottom:"0px",left:"0px",width:"100%",height:debugConsole.height,overflow:"auto",fontFamily:"Consolas, Courier New",fontSize:"11px",color:"#00ff00",lineHeight:"14px",display:"none",zIndex:100001}));if(console){console.log=console.debug=console.info=console.warn=console.error=function(g){debugConsole.log((arguments)&&(arguments.join)?arguments.join(" "):g)}}debugConsole.pool.each(function(j,g){debugConsole.perform(j,g)});debugConsole.init=function(){}};debugConsole.log=function(c){var g=Math.round((new Date().getTime()-debugConsole.startedAt.getTime())/10)/100;if(debugConsole.console){debugConsole.perform(g,c)}else{debugConsole.pool.push({since:g,s:c})}};debugConsole.perform=function(g,c){debugConsole.got=true;debugConsole.console.insertBefore(new Element("DIV").update(g+"s "+c),debugConsole.console.firstChild);debugConsole.whole+=g+"s "+c.stripTags()+"\n"};if(!console){console={};console.log=console.debug=console.info=console.warn=console.error=function(){}}var DropLoader=Class.create();DropLoader.prototype={initialize:function(j,m,c){var g=this;Object.extend(g,c);if(g.supported()){if(j){$(j).hide()}if(m){(g.droppable=$(m)).show()}if(g.droppable){g.droppable.observe("dragover",function(n){n.stopPropagation();n.preventDefault();g.debug("over");g.onOver()});g.droppable.observe("dragenter",function(n){n.stopPropagation();n.preventDefault();if(n.dataTransfer){n.dataTransfer.dropEffect="copy"}g.debug("enter");g.onEnter()});g.droppable.observe("dragleave",function(n){g.debug("leave");g.onLeave()});g.droppable.observe("drop",function(x){x.stopPropagation();x.preventDefault();g.debug("drop");g.onDrop();var w={};for(var n=0;n<x.dataTransfer.files.length;n++){var t=x.dataTransfer.files[n];if(!g.allowDuplicates){if(w[t.name]){g.debug("won't load \""+t.name+'"');continue}w[t.name]=true}var q=g.onProgress?g.onProgress:function(A){if(g.progress){if(p=$(g.progress)){p.show()}}if(g.percent){if(p=$(g.percent)){p.show().update(Math.round(A.loaded/A.total*100))}}};var u=new XMLHttpRequest();u.file=t;u.upload.request=u;u.upload.file=t;u.upload.addEventListener("progress",function(C){var B=this.request;var A=this.file;q(C,B,A.name,g)},false);u.onreadystatechange=function(E){var B=this.file;var D=this;if(E.target.readyState==4){if(E.target.status==200){if(g.onSuccess){g.onSuccess(D,B.name,g)}else{try{var A=D.responseText.evalJSON(true);if((A.rc=="OK")&&(A.hash)){g.addHash(A.hash)}}catch(C){if(g.onFailure){g.onFailure(D,B.name,g)}}}}else{if(g.onFailure){g.onFailure(D,B.name,g)}}if(g.progress){if(p=$(g.progress)){p.hide()}}if(g.percent){if(p=$(g.percent)){p.hide()}}}};if(g.onStart){g.onStart(u,t.name,g)}u.open("POST",g.target,true);var z=new FormData();z.append("f",t);u.send(z);q({loaded:0,total:1},u,t.name,g);g.debug('uploading "'+t.name+'": target="'+g.target+'"')}})}}else{if(j){$(j).show()}if(m){$(m).hide()}}},supported:function(){if(typeof(window.FileReader)=="undefined"){return false}if(/Opera[\/\s](\d+\.\d+)/.test(navigator.userAgent)){if(parseInt(RegExp.$1)<=12){return false}}return true},addHash:function(g){var c=this;if((form=$(c.form))&&(c.hashes)){form.appendChild(new Element("INPUT",{type:"hidden",name:c.hashes,value:g}))}},debug:function(c){},onOver:function(){var c=this;if(c.droppable){c.droppable.addClassName("droploader_hover")}},onEnter:function(){var c=this;if(c.droppable){c.droppable.addClassName("droploader_hover")}},onLeave:function(){var c=this;if(c.droppable){c.droppable.removeClassName("droploader_hover")}},onDrop:function(){var c=this;if(c.droppable){c.droppable.removeClassName("droploader_hover")}},eof:1};Event.onDOMReady(function(){if(!window.FireStarted){if(window.FireStarter){window.FireStarter()}window.FireStarted=true}});Event.observe(document,"keydown",function(c){c=c?c:window.event;if(!DisableKeyNav){if(c.ctrlKey){if(c.keyCode==37){if(a=$("previous_page")){location.href=a.href}if(goPrevious){goPrevious()}}else{if(c.keyCode==39){if(a=$("next_page")){location.href=a.href}if(goNext){goNext()}}}}}});function OhGod(){if(!window.FireStarted){if(window.FireStarter){setTimeout(window.FireStarter,1)}window.FireStarted=true}setTimeout(InitFeeler,1)}function InitFeeler(){if(bf=$("bottomfeeler")){bf.appendChild(a=document.createElement("IMG"));a.width=1;a.height=1;a.src="http://counter.maases.com/cnt"+(stamp_15min?("?"+stamp_15min):"");if(CrossDomainCookier){bf.appendChild(a=document.createElement("IMG"));a.width=1;a.height=1;a.src=CrossDomainCookier}}};
