/* SWFObject v2.1 <http://code.google.com/p/swfobject/>
	Copyright (c) 2007-2008 Geoff Stearns, Michael Williams, and Bobby van der Sluis
	This software is released under the MIT License <http://www.opensource.org/licenses/mit-license.php>
*/
var swfobject=function(){var UNDEF="undefined",OBJECT="object",SHOCKWAVE_FLASH="Shockwave Flash",SHOCKWAVE_FLASH_AX="ShockwaveFlash.ShockwaveFlash",FLASH_MIME_TYPE="application/x-shockwave-flash",EXPRESS_INSTALL_ID="SWFObjectExprInst",win=window,doc=document,nav=navigator,domLoadFnArr=[],regObjArr=[],objIdArr=[],listenersArr=[],script,timer=null,storedAltContent=null,storedAltContentId=null,isDomLoaded=false,isExpressInstallActive=false;
var ua=function(){var w3cdom=typeof doc.getElementById!=UNDEF&&typeof doc.getElementsByTagName!=UNDEF&&typeof doc.createElement!=UNDEF,playerVersion=[0,0,0],d=null;if(typeof nav.plugins!=UNDEF&&typeof nav.plugins[SHOCKWAVE_FLASH]==OBJECT){d=nav.plugins[SHOCKWAVE_FLASH].description;if(d&&!(typeof nav.mimeTypes!=UNDEF&&nav.mimeTypes[FLASH_MIME_TYPE]&&!nav.mimeTypes[FLASH_MIME_TYPE].enabledPlugin)){d=d.replace(/^.*\s+(\S+\s+\S+$)/,"$1");
playerVersion[0]=parseInt(d.replace(/^(.*)\..*$/,"$1"),10);playerVersion[1]=parseInt(d.replace(/^.*\.(.*)\s.*$/,"$1"),10);playerVersion[2]=/r/.test(d)?parseInt(d.replace(/^.*r(.*)$/,"$1"),10):0}}else{if(typeof win.ActiveXObject!=UNDEF){var a=null,fp6Crash=false;try{a=new ActiveXObject(SHOCKWAVE_FLASH_AX+".7")}catch(e){try{a=new ActiveXObject(SHOCKWAVE_FLASH_AX+".6");playerVersion=[6,0,21];a.AllowScriptAccess="always"
}catch(e){if(playerVersion[0]==6){fp6Crash=true}}if(!fp6Crash){try{a=new ActiveXObject(SHOCKWAVE_FLASH_AX)}catch(e){}}}if(!fp6Crash&&a){try{d=a.GetVariable("$version");if(d){d=d.split(" ")[1].split(",");playerVersion=[parseInt(d[0],10),parseInt(d[1],10),parseInt(d[2],10)]}}catch(e){}}}}var u=nav.userAgent.toLowerCase(),p=nav.platform.toLowerCase(),webkit=/webkit/.test(u)?parseFloat(u.replace(/^.*webkit\/(\d+(\.\d+)?).*$/,"$1")):false,ie=false,windows=p?/win/.test(p):/win/.test(u),mac=p?/mac/.test(p):/mac/.test(u);
/*@cc_on
			ie = true;
			@if (@_win32)
				windows = true;
			@elif (@_mac)
				mac = true;
			@end
		@*/
return{w3cdom:w3cdom,pv:playerVersion,webkit:webkit,ie:ie,win:windows,mac:mac}}();var onDomLoad=function(){if(!ua.w3cdom){return}addDomLoadEvent(main);if(ua.ie&&ua.win){try{doc.write("<script id=__ie_ondomload defer=true src=//:><\/script>");script=getElementById("__ie_ondomload");if(script){addListener(script,"onreadystatechange",checkReadyState)
}}catch(e){}}if(ua.webkit&&typeof doc.readyState!=UNDEF){timer=setInterval(function(){if(/loaded|complete/.test(doc.readyState)){callDomLoadFunctions()}},10)}if(typeof doc.addEventListener!=UNDEF){doc.addEventListener("DOMContentLoaded",callDomLoadFunctions,null)}addLoadEvent(callDomLoadFunctions)}();function checkReadyState(){if(script.readyState=="complete"){script.parentNode.removeChild(script);
callDomLoadFunctions()}}function callDomLoadFunctions(){if(isDomLoaded){return}if(ua.ie&&ua.win){var s=createElement("span");try{var t=doc.getElementsByTagName("body")[0].appendChild(s);t.parentNode.removeChild(t)}catch(e){return}}isDomLoaded=true;if(timer){clearInterval(timer);timer=null}var dl=domLoadFnArr.length;for(var i=0;i<dl;i++){domLoadFnArr[i]()}}function addDomLoadEvent(fn){if(isDomLoaded){fn()
}else{domLoadFnArr[domLoadFnArr.length]=fn}}function addLoadEvent(fn){if(typeof win.addEventListener!=UNDEF){win.addEventListener("load",fn,false)}else{if(typeof doc.addEventListener!=UNDEF){doc.addEventListener("load",fn,false)}else{if(typeof win.attachEvent!=UNDEF){addListener(win,"onload",fn)}else{if(typeof win.onload=="function"){var fnOld=win.onload;win.onload=function(){fnOld();fn()}}else{win.onload=fn
}}}}}function main(){var rl=regObjArr.length;for(var i=0;i<rl;i++){var id=regObjArr[i].id;if(ua.pv[0]>0){var obj=getElementById(id);if(obj){regObjArr[i].width=obj.getAttribute("width")?obj.getAttribute("width"):"0";regObjArr[i].height=obj.getAttribute("height")?obj.getAttribute("height"):"0";if(hasPlayerVersion(regObjArr[i].swfVersion)){if(ua.webkit&&ua.webkit<312){fixParams(obj)}setVisibility(id,true)
}else{if(regObjArr[i].expressInstall&&!isExpressInstallActive&&hasPlayerVersion("6.0.65")&&(ua.win||ua.mac)){showExpressInstall(regObjArr[i])}else{displayAltContent(obj)}}}}else{setVisibility(id,true)}}}function fixParams(obj){var nestedObj=obj.getElementsByTagName(OBJECT)[0];if(nestedObj){var e=createElement("embed"),a=nestedObj.attributes;if(a){var al=a.length;for(var i=0;i<al;i++){if(a[i].nodeName=="DATA"){e.setAttribute("src",a[i].nodeValue)
}else{e.setAttribute(a[i].nodeName,a[i].nodeValue)}}}var c=nestedObj.childNodes;if(c){var cl=c.length;for(var j=0;j<cl;j++){if(c[j].nodeType==1&&c[j].nodeName=="PARAM"){e.setAttribute(c[j].getAttribute("name"),c[j].getAttribute("value"))}}}obj.parentNode.replaceChild(e,obj)}}function showExpressInstall(regObj){isExpressInstallActive=true;var obj=getElementById(regObj.id);if(obj){if(regObj.altContentId){var ac=getElementById(regObj.altContentId);
if(ac){storedAltContent=ac;storedAltContentId=regObj.altContentId}}else{storedAltContent=abstractAltContent(obj)}if(!(/%$/.test(regObj.width))&&parseInt(regObj.width,10)<310){regObj.width="310"}if(!(/%$/.test(regObj.height))&&parseInt(regObj.height,10)<137){regObj.height="137"}doc.title=doc.title.slice(0,47)+" - Flash Player Installation";var pt=ua.ie&&ua.win?"ActiveX":"PlugIn",dt=doc.title,fv="MMredirectURL="+win.location+"&MMplayerType="+pt+"&MMdoctitle="+dt,replaceId=regObj.id;
if(ua.ie&&ua.win&&obj.readyState!=4){var newObj=createElement("div");replaceId+="SWFObjectNew";newObj.setAttribute("id",replaceId);obj.parentNode.insertBefore(newObj,obj);obj.style.display="none";var fn=function(){obj.parentNode.removeChild(obj)};addListener(win,"onload",fn)}createSWF({data:regObj.expressInstall,id:EXPRESS_INSTALL_ID,width:regObj.width,height:regObj.height},{flashvars:fv},replaceId)
}}function displayAltContent(obj){if(ua.ie&&ua.win&&obj.readyState!=4){var el=createElement("div");obj.parentNode.insertBefore(el,obj);el.parentNode.replaceChild(abstractAltContent(obj),el);obj.style.display="none";var fn=function(){obj.parentNode.removeChild(obj)};addListener(win,"onload",fn)}else{obj.parentNode.replaceChild(abstractAltContent(obj),obj)}}function abstractAltContent(obj){var ac=createElement("div");
if(ua.win&&ua.ie){ac.innerHTML=obj.innerHTML}else{var nestedObj=obj.getElementsByTagName(OBJECT)[0];if(nestedObj){var c=nestedObj.childNodes;if(c){var cl=c.length;for(var i=0;i<cl;i++){if(!(c[i].nodeType==1&&c[i].nodeName=="PARAM")&&!(c[i].nodeType==8)){ac.appendChild(c[i].cloneNode(true))}}}}}return ac}function createSWF(attObj,parObj,id){var r,el=getElementById(id);if(el){if(typeof attObj.id==UNDEF){attObj.id=id
}if(ua.ie&&ua.win){var att="";for(var i in attObj){if(attObj[i]!=Object.prototype[i]){if(i.toLowerCase()=="data"){parObj.movie=attObj[i]}else{if(i.toLowerCase()=="styleclass"){att+=' class="'+attObj[i]+'"'}else{if(i.toLowerCase()!="classid"){att+=" "+i+'="'+attObj[i]+'"'}}}}}var par="";for(var j in parObj){if(parObj[j]!=Object.prototype[j]){par+='<param name="'+j+'" value="'+parObj[j]+'" />'}}el.outerHTML='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'+att+">"+par+"</object>";
objIdArr[objIdArr.length]=attObj.id;r=getElementById(attObj.id)}else{if(ua.webkit&&ua.webkit<312){var e=createElement("embed");e.setAttribute("type",FLASH_MIME_TYPE);for(var k in attObj){if(attObj[k]!=Object.prototype[k]){if(k.toLowerCase()=="data"){e.setAttribute("src",attObj[k])}else{if(k.toLowerCase()=="styleclass"){e.setAttribute("class",attObj[k])}else{if(k.toLowerCase()!="classid"){e.setAttribute(k,attObj[k])
}}}}}for(var l in parObj){if(parObj[l]!=Object.prototype[l]){if(l.toLowerCase()!="movie"){e.setAttribute(l,parObj[l])}}}el.parentNode.replaceChild(e,el);r=e}else{var o=createElement(OBJECT);o.setAttribute("type",FLASH_MIME_TYPE);for(var m in attObj){if(attObj[m]!=Object.prototype[m]){if(m.toLowerCase()=="styleclass"){o.setAttribute("class",attObj[m])}else{if(m.toLowerCase()!="classid"){o.setAttribute(m,attObj[m])
}}}}for(var n in parObj){if(parObj[n]!=Object.prototype[n]&&n.toLowerCase()!="movie"){createObjParam(o,n,parObj[n])}}el.parentNode.replaceChild(o,el);r=o}}}return r}function createObjParam(el,pName,pValue){var p=createElement("param");p.setAttribute("name",pName);p.setAttribute("value",pValue);el.appendChild(p)}function removeSWF(id){var obj=getElementById(id);if(obj&&(obj.nodeName=="OBJECT"||obj.nodeName=="EMBED")){if(ua.ie&&ua.win){if(obj.readyState==4){removeObjectInIE(id)
}else{win.attachEvent("onload",function(){removeObjectInIE(id)})}}else{obj.parentNode.removeChild(obj)}}}function removeObjectInIE(id){var obj=getElementById(id);if(obj){for(var i in obj){if(typeof obj[i]=="function"){obj[i]=null}}obj.parentNode.removeChild(obj)}}function getElementById(id){var el=null;try{el=doc.getElementById(id)}catch(e){}return el}function createElement(el){return doc.createElement(el)
}function addListener(target,eventType,fn){target.attachEvent(eventType,fn);listenersArr[listenersArr.length]=[target,eventType,fn]}function hasPlayerVersion(rv){var pv=ua.pv,v=rv.split(".");v[0]=parseInt(v[0],10);v[1]=parseInt(v[1],10)||0;v[2]=parseInt(v[2],10)||0;return(pv[0]>v[0]||(pv[0]==v[0]&&pv[1]>v[1])||(pv[0]==v[0]&&pv[1]==v[1]&&pv[2]>=v[2]))?true:false}function createCSS(sel,decl){if(ua.ie&&ua.mac){return
}var h=doc.getElementsByTagName("head")[0],s=createElement("style");s.setAttribute("type","text/css");s.setAttribute("media","screen");if(!(ua.ie&&ua.win)&&typeof doc.createTextNode!=UNDEF){s.appendChild(doc.createTextNode(sel+" {"+decl+"}"))}h.appendChild(s);if(ua.ie&&ua.win&&typeof doc.styleSheets!=UNDEF&&doc.styleSheets.length>0){var ls=doc.styleSheets[doc.styleSheets.length-1];if(typeof ls.addRule==OBJECT){ls.addRule(sel,decl)
}}}function setVisibility(id,isVisible){var v=isVisible?"visible":"hidden";if(isDomLoaded&&getElementById(id)){getElementById(id).style.visibility=v}else{createCSS("#"+id,"visibility:"+v)}}function urlEncodeIfNecessary(s){var regex=/[\\\"<>\.;]/;var hasBadChars=regex.exec(s)!=null;return hasBadChars?encodeURIComponent(s):s}var cleanup=function(){if(ua.ie&&ua.win){window.attachEvent("onunload",function(){var ll=listenersArr.length;
for(var i=0;i<ll;i++){listenersArr[i][0].detachEvent(listenersArr[i][1],listenersArr[i][2])}var il=objIdArr.length;for(var j=0;j<il;j++){removeSWF(objIdArr[j])}for(var k in ua){ua[k]=null}ua=null;for(var l in swfobject){swfobject[l]=null}swfobject=null})}}();return{registerObject:function(objectIdStr,swfVersionStr,xiSwfUrlStr){if(!ua.w3cdom||!objectIdStr||!swfVersionStr){return}var regObj={};regObj.id=objectIdStr;
regObj.swfVersion=swfVersionStr;regObj.expressInstall=xiSwfUrlStr?xiSwfUrlStr:false;regObjArr[regObjArr.length]=regObj;setVisibility(objectIdStr,false)},getObjectById:function(objectIdStr){var r=null;if(ua.w3cdom){var o=getElementById(objectIdStr);if(o){var n=o.getElementsByTagName(OBJECT)[0];if(!n||(n&&typeof o.SetVariable!=UNDEF)){r=o}else{if(typeof n.SetVariable!=UNDEF){r=n}}}}return r},embedSWF:function(swfUrlStr,replaceElemIdStr,widthStr,heightStr,swfVersionStr,xiSwfUrlStr,flashvarsObj,parObj,attObj){if(!ua.w3cdom||!swfUrlStr||!replaceElemIdStr||!widthStr||!heightStr||!swfVersionStr){return
}widthStr+="";heightStr+="";if(hasPlayerVersion(swfVersionStr)){setVisibility(replaceElemIdStr,false);var att={};if(attObj&&typeof attObj===OBJECT){for(var i in attObj){if(attObj[i]!=Object.prototype[i]){att[i]=attObj[i]}}}att.data=swfUrlStr;att.width=widthStr;att.height=heightStr;var par={};if(parObj&&typeof parObj===OBJECT){for(var j in parObj){if(parObj[j]!=Object.prototype[j]){par[j]=parObj[j]}}}if(flashvarsObj&&typeof flashvarsObj===OBJECT){for(var k in flashvarsObj){if(flashvarsObj[k]!=Object.prototype[k]){if(typeof par.flashvars!=UNDEF){par.flashvars+="&"+k+"="+flashvarsObj[k]
}else{par.flashvars=k+"="+flashvarsObj[k]}}}}addDomLoadEvent(function(){createSWF(att,par,replaceElemIdStr);if(att.id==replaceElemIdStr){setVisibility(replaceElemIdStr,true)}})}else{if(xiSwfUrlStr&&!isExpressInstallActive&&hasPlayerVersion("6.0.65")&&(ua.win||ua.mac)){isExpressInstallActive=true;setVisibility(replaceElemIdStr,false);addDomLoadEvent(function(){var regObj={};regObj.id=regObj.altContentId=replaceElemIdStr;
regObj.width=widthStr;regObj.height=heightStr;regObj.expressInstall=xiSwfUrlStr;showExpressInstall(regObj)})}}},getFlashPlayerVersion:function(){return{major:ua.pv[0],minor:ua.pv[1],release:ua.pv[2]}},hasFlashPlayerVersion:hasPlayerVersion,createSWF:function(attObj,parObj,replaceElemIdStr){if(ua.w3cdom){return createSWF(attObj,parObj,replaceElemIdStr)}else{return undefined}},removeSWF:function(objElemIdStr){if(ua.w3cdom){removeSWF(objElemIdStr)
}},createCSS:function(sel,decl){if(ua.w3cdom){createCSS(sel,decl)}},addDomLoadEvent:addDomLoadEvent,addLoadEvent:addLoadEvent,getQueryParamValue:function(param){var q=doc.location.search||doc.location.hash;if(param==null){return urlEncodeIfNecessary(q)}if(q){var pairs=q.substring(1).split("&");for(var i=0;i<pairs.length;i++){if(pairs[i].substring(0,pairs[i].indexOf("="))==param){return urlEncodeIfNecessary(pairs[i].substring((pairs[i].indexOf("=")+1)))
}}}return""},expressInstallCallback:function(){if(isExpressInstallActive&&storedAltContent){var obj=getElementById(EXPRESS_INSTALL_ID);if(obj){obj.parentNode.replaceChild(storedAltContent,obj);if(storedAltContentId){setVisibility(storedAltContentId,true);if(ua.ie&&ua.win){storedAltContent.style.display="block"}}storedAltContent=null;storedAltContentId=null;isExpressInstallActive=false}}}}}();document.observe("dom:loaded",initializeShows);
function initializeShows(){initFlashApp()}function initFlashApp(){if($("flashApp")){var d={menu:"false",allowScriptAccess:"always",quality:"high",movie:$("static").value+"/modules/show/swf/player/"+$("movieName").value,wmode:"transparent"};var c=$("flashSize").getWidth();var a=$("flashSize").getHeight();var b={style:$("flashSize").title};swfobject.embedSWF($("static").value+"/modules/show/swf/player/"+$("movieName").value,"flashApp",c,a,"9.0.0","",flashvars,d,b)
}}document.observe("dom:loaded",function(){document.delegate("click",{"a#sendTwitter":recommend,"a#sendEmail":recommend,"a#sendTwitterMessage":sendMessage,"a#sendMailMessage":sendMessage,"a#sendTwitterMessage span":sendMessage,"a#sendMailMessage span":sendMessage,"input#emailFriends":emptyBox})});var boxEmptied=false;function emptyBox(b){var a=b.element();if(!boxEmptied){$(a.identify()).value="";boxEmptied=true
}return false}function recommend(c,b){if(b){var a=$(c)}else{var a=c.element()}var d="/show/index/twitter.ajax";if(a.identify()=="sendEmail"){d="/show/index/send-email.ajax"}else{if(a.identify()=="sendTwitter"){if(typeof(flashvars)!=="undefined"){if(flashvars.show_id){show_id=flashvars.show_id;d="/show/index/twitter.ajax?show_id="+show_id;if(flashvars.record_id){record_id=flashvars.record_id;d+="&record_id="+record_id
}}}}}Dialog.Confirm.ajax(d,{zIndex:6,height:380,width:600,modal:true},{onComplete:function(f){if(f.responseText.indexOf("emailFriends")>1){var e=new Autocompleter.Advanced("emailFriends",$("contacts").innerHTML.evalJSON(),{inputName:"emailFriends",fullSearch:true,frequency:0.1,inputWidth:300,style:"border: 1px solid #DADADA"});e.addTokenizers([188,59,32])}if(!$("msgTw")){return}$("msgTw").observe("keydown",function(g){if($("msgTw").value.length>98){if(g.keyCode==Event.KEY_BACKSPACE||g.keyCode==Event.KEY_DELETE){return
}g.stop()}})}})}function sendMessage(c){var b=c.element();var a=b.up("form");var d="emailForm";if(b.tagName.toLowerCase()=="span"){b.up("a")}if((b.identify()=="sendTwitterMessage")||(b.up("a").identify()=="sendTwitterMessage")){d="twitterForm"}var f=$(d).serialize(true);f.submited=1;if(typeof(flashvars)!=="undefined"){var e=flashvars;f.show_id=e.show_id||e.showid;f.record_id=e.id}myAjax=new Ajax.Request(a.action,{method:"post",parameters:f,onSuccess:function(g){if(g.responseText=="OK"){$("twitter").hide();
$("thanks").show()}}})}document.observe("dom:loaded",initVoting);var initialVoteText=null;function initVoting(){var a={".star":respondToClick};document.delegate("click",a);$$(".rating_container .star").invoke("observe","mouseover",setHover);$$(".rating_container .star").invoke("observe","mouseout",unsetHover)}function respondToClick(d){var e=parseInt(d.element().innerHTML);var c=d.findElement("form");
var a=c.serialize(true);a.handleVoting=1;a.vote_value=e;var b=window.location.pathname+".ajax";new Ajax.Request(b,{method:"post",parameters:a,asynchronous:false,onSuccess:function(k){if(k.headerJSON==0){alert("Ai votat deja");return}try{var h=k.headerJSON.toString().split(".");var n=c.down("input[name='vote_average']");var l=c.down("input[name='vote_count']");var i=c.previous(".rating_info").down(".first");
var f=c.previous(".rating_info").down(".second");var g=c.previous(".rating_info").down(".votesNr").down("span");var j=Math.round(k.headerJSON);n.value=k.headerJSON;l.value=parseInt(l.value)+1;i.update(h[0]);f.update("."+(h[1]||0));g.update(l.value);c.select(".starbar_frontstars")[0].style.width=parseInt(k.headerJSON*10)+"%";initialVoteText=c.select(".starbar"+j)[0].title.split(".")[1]}catch(m){window.console.log(m)
}}})}function setHover(b){var a=b.findElement(".rating_container");initialVoteText=a.down(".calif").innerHTML;a.down(".calif").update(b.element().title)}function unsetHover(a){a.findElement(".rating_container").down(".calif").update(initialVoteText)}Object.extend(Event,(function(){var a={};return{delegate:function(d,c){if(arguments[3]){var g={};g[arguments[2]]=arguments[3]}else{var g=Object.extend({},arguments[2])
}var e=$(d),f=c,h=e.identify?e.identify():"document";if(!a[h]){a[h]={"$observer":function(n){var m=n.element();if(a[h][n.type]){for(var l=0,k=a[h][n.type].length;l<k;l++){for(var j in a[h][n.type][l]){if(a[h][n.type][l][j][1].match(m)){a[h][n.type][l][j][0](n)}}}}}}}if(!a[h][f]){a[h][f]=[];e.observe(f,a[h]["$observer"])}for(var b in g){g[b]=[g[b],new Selector(b)]}a[h][f].push(g);return e},stopDelegating:function(f,h){if(f===undefined){for(var b in a){Event.stopDelegating(b=="$document"?document:b)
}a={};return true}if(Object.isString(arguments[2])){var l={};l[arguments[2]]=true}else{if(arguments[2]){var l=arguments[2]}else{var l=false}}var d=$(f),k=h,b=d.identify?d.identify():"$document";if(a[b]){if(k&&a[b][k]){for(var g=0,j=a[b][k].length;g<j;g++){if(l){for(var e in l){delete a[b][k][g][e]}}if(!l||$H(a[b][k][g]).size()==0){d.stopObserving(k,a[b]["$observer"]);a[b][k][g]="r"}}a[b][k]=a[b][k].without("r")
}else{for(var c in a[b]){if(c!="$observer"){d.stopObserving(c,a[b]["$observer"])}}delete a[b]}}return d}}})());Element.addMethods({delegate:Event.delegate,stopDelegating:Event.stopDelegating});document.delegate=Event.delegate.curry(document);document.stopDelegating=Event.stopDelegating.curry(document);Event.observe(window,"unload",Event.stopDelegating);Comments={TOP_COMMENTS_CONTAINER:"commentsContainer",APPROVED_COMMENTS_CONTAINER:"commentList",UNAPPROVED_COMMENTS_CONTAINER:"unapprovedComments",RESPOND_FORM:"commentRespond",FILTERING_ELEMENT:"voteFilter",REUSABLE_ELEMENTS_CONTAINER:"reusableElements",VOTES_LIMIT:-5,resourceId:null,postingUrl:null,votingUrl:null,commentsManagementUrl:null,params:{},topContainer:null,container:null,replyForm:null,commentReplyRel:null,respond:function(b){b.stop();
var a=null;if(a=this.replyForm.up("li")){a.down(".respond").show()}var c=this.replyForm.down("textarea").value="";b.element().hide();b.element().up("li").down(".content").insert(this.replyForm);this.replyForm.focusFirstElement();this.commentReplyRel=b.element().readAttribute("rel")},vote:function(c){var b=c.element();var a=b.className.replace("vote ","").strip();var d={resourceId:this.resourceId,commentId:b.readAttribute("rel"),type:a};
Object.extend(d,this.params);new Ajax.Request(this.votingUrl,{method:"post",parameters:Object.toQueryString(d),overlayer:{id:this.container},onSuccess:function(f){if(!parseInt(f.responseText)){return}var g=b.adjacent("span").first();var e=parseInt(g.innerHTML);e+=(a=="pozitive"?1:-1);g.update((e>0?"+":"")+e).className=(e<0?"negativs":"pozitivs");if(e<this.VOTES_LIMIT&&!b.up("li").hasClassName("inappropiate")){b.up("li").addClassName("inappropiate")
}}.bind(this)})},sendResponse:function(a){a.stop();if(!this.replyForm.findFirstElement().value.strip().length){return}try{var b=Paginators.get("Comments").getCurrentPage()}catch(c){var b=1}$("infoBox").hide();var d=this.replyForm.serialize(true);d.resourceId=this.resourceId;d.rel=this.commentReplyRel;d.page=b;Object.extend(d,this.params);new Ajax.Request(this.postingUrl,{method:"post",parameters:Object.toQueryString(d),overlayer:{id:this.overlayElement},onSuccess:function(e){$(this.REUSABLE_ELEMENTS_CONTAINER).insert(this.replyForm);
$(this.container).update(e.responseText.evalJSON().results)}.bind(this)})},sendComment:function(b){b.stop();var a=b.element().up("form");if(!a.comment.value.strip().length){return}$("infoBox").hide();var c=a.serialize(true);c.resourceId=this.resourceId;Object.extend(c,this.params);new Ajax.Request(this.postingUrl,{method:"post",parameters:Object.toQueryString(c),overlayer:{id:this.overlayElement},onSuccess:function(e){try{$(this.container).update(e.responseText.evalJSON().results);
a.comment.value="";this._incrementCommentsCount()}catch(d){console.log(d)}}.bind(this)})},cancelCommentResponse:function(a){a.stop();a.element().up("li").down(".respond").show();$(this.REUSABLE_ELEMENTS_CONTAINER).insert(a.element().up("form"));this.commentReplyRel=null},showComment:function(a){a.element().up("li").toggleClassName("inappropiate")},approveComment:function(a){a.stop();var b={resourceId:this.resourceId,commentId:a.findElement("a").readAttribute("rel"),task:"approve"};
Object.extend(b,this.params);new Ajax.Request(this.commentsManagementUrl,{method:"get",parameters:Object.toQueryString(b),overlayer:{id:this.overlayElement},onSuccess:function(d){var c=d.responseText;if(c.length){c=c.evalJSON();if(!Object.isUndefined(c.results)){$(this.container).update(c.results)}}this.removeUnapprovedComment(a,true)}.bind(this)})},deleteComment:function(a){a.stop();var b={resourceId:this.resourceId,commentId:a.findElement("a").readAttribute("rel"),task:"delete"};
Object.extend(b,this.params);new Ajax.Request(this.commentsManagementUrl,{method:"get",parameters:Object.toQueryString(b),overlayer:{id:this.overlayElement},onSuccess:function(c){this.removeUnapprovedComment(a,true)}.bind(this)})},removeUnapprovedComment:function(a,c){a.stop();var b=a.element().up("ul");if(b.childElements().size()==1&&c){b.up("div").hide()}a.element().up("li").remove()},setFilter:function(a){a.stop();
var c=Paginators.get("Comments");var b=c.getParameters();b.set("resourceId",this.resourceId);b.set("properties",this.properties);b.set(this.FILTERING_ELEMENT,a.element().value);c.refresh(b)},attachListeners:function(a,b){this.container=(a||this.APPROVED_COMMENTS_CONTAINER);this.unapprovedContainer=(b||this.UNAPPROVED_COMMENTS_CONTAINER);if(!$(this.container)){return}this.overlayElement=($(this.TOP_COMMENTS_CONTAINER)?this.TOP_COMMENTS_CONTAINER:this.container);
$(document).delegate("click",{".send-comment":this.sendComment.bindAsEventListener(this),".respond":this.respond.bindAsEventListener(this),".vote":this.vote.bindAsEventListener(this),".btnReply":this.sendResponse.bindAsEventListener(this),".btnCancel":this.cancelCommentResponse.bindAsEventListener(this),".btnApprove span":this.approveComment.bindAsEventListener(this),".btnDelete span":this.deleteComment.bindAsEventListener(this),".showComment":this.showComment});
if($(this.FILTERING_ELEMENT)){$(this.FILTERING_ELEMENT).observe("change",this.setFilter.bindAsEventListener(this))}this.replyForm=$(this.RESPOND_FORM)},_incrementCommentsCount:function(){var c=$(this.container).up(".top-container").select(".no-comments-found")[0];var b=$(this.container).up(".top-container").select(".comments-found")[0];if(c.visible()){c.hide();b.show()}var a=parseInt(b.down("span").innerHTML);
b.down("span").innerHTML=++a}};var Paginators={paginators:new Hash(),group:new Hash(),add:function(b,a){this.paginators.set(b,a);if(Object.isUndefined(this.group.get(b))){this.group.set(b,[a])}else{this.group.get(b).push(a)}return a},get:function(a){a=a||"default";return this.paginators.get(a)},getGroup:function(a){a=a||"default";return this.group.get(a)}};var Paginator=Class.create({sliderMinWidth:20,STYLE_THIN:1,STYLE_MODERN:2,initialize:function(b,c,a){this.group=b||"default";
Paginators.add(this.group,this);this.uniqueId=this.group+c;this.handler=a;this.handler.parameters=$H(this.handler.parameters);this.handler.parameters.unset("host");this.handler.parameters.unset("uri");this.handler.parameters.unset("module");this.handler.parameters.unset("controller");this.currentPage=this.handler.config.currentPage;this.page=null;this.totalPages=this.handler.config.totalPages;this.style=this.STYLE_MODERN;
this.navigationBar=$("navigationBar_"+this.uniqueId);this.slider=$("slider_"+this.uniqueId);this.leftArrow=$("left_"+this.uniqueId);this.rightArrow=$("right_"+this.uniqueId);this.pageNumber=$("pageNumber_"+this.uniqueId);this.goTo=$("goTo_"+this.uniqueId);this.refreshPagination=false;this.loading=false;this.mouseXPos=0;this.clickXPos=0;this.startPos=0;if(this.totalPages>1){document.observe("dom:loaded",function(){this._calculateWidths(true);
this.visible=true}.bind(this))}else{this._hide()}},_calculateWidths:function(){this.barWidth=this.navigationBar.getWidth()-(this.style==this.STYLE_THIN?6:0);this.sliderWidth=this.barWidth/this.totalPages;if(this.sliderWidth<this.sliderMinWidth){this.sliderWidth=this.sliderMinWidth;this.stepWidth=(this.barWidth-this.sliderWidth)/this.totalPages}else{this.stepWidth=this.sliderWidth}this.slider.style.width=this.sliderWidth+"px";
this._moveSlider("init",this.currentPage)},addListeners:function(a){if(!a){this.bClickOnBar=this._clickOnBar.bindAsEventListener(this);this.bMoveLeft=this._moveLeft.bindAsEventListener(this);this.bMoveRight=this._moveRight.bindAsEventListener(this);this.bGoToPage=this._goToPage.bindAsEventListener(this);this.bMouseDown=this._mouseDown.bindAsEventListener(this)}Event.observe(this.navigationBar.identify(),"mousedown",this.bClickOnBar);
Event.observe(this.leftArrow.identify(),"click",this.bMoveLeft);Event.observe(this.rightArrow.identify(),"click",this.bMoveRight);Event.observe("lnk_"+this.goTo.identify(),"click",this.bGoToPage);Event.observe(this.slider.identify(),"mousedown",this.bMouseDown)},_findPos:function(a){var b=curtop=0;if(a.offsetParent){b=a.offsetLeft;curtop=a.offsetTop;while(a=a.offsetParent){b+=a.offsetLeft;curtop+=a.offsetTop
}}return[b,curtop]},_getXOffset:function(){var b=this._findPos(this.navigationBar);var a=this.mouseXPos-b[0];if(a<0){a=0}if(a>=this.barWidth){a=this.barWidth}return a},_getTargetPage:function(b){switch(b){case"click":var c=this._getXOffset();var d={page:Math.ceil(this.totalPages*(c/this.barWidth)),xOffset:c};if(d.page>this.currentPage){d.page=this.currentPage+1}if(d.page<this.currentPage){d.page=this.currentPage-1
}return d;break;default:var a;if((a=this.startPos+(this.mouseXPos-this.clickXPos))<=this.barWidth&&a>=(this.style==this.STYLE_THIN?16:18)){a=(a<(this.barWidth/2)?a-(this.style==this.STYLE_THIN?8:9):a+(this.style==this.STYLE_THIN?8:9));return{page:Math.ceil(this.totalPages*((a-(this.style==this.STYLE_THIN?8:9))/this.barWidth))}}else{if(a<(this.style==this.STYLE_THIN?16:18)){return{page:1}}return{page:this.totalPages}
}break}},updateCaption:function(a){this.page=a;$(this.pageNumber).update(a+"/"+this.totalPages)},_moveSlider:function(b,d){var c=(d?{page:parseInt(d)}:this._getTargetPage(b,d));if(!c.page){return null}else{if(b=="click"||d){if(Object.isUndefined(this.stepWidth)){return}this.slider.style.left=((this.style==this.STYLE_THIN?16:18)+(c.page-1)*parseInt(this.stepWidth))+"px"}else{var a;var e=(this.mouseXPos-this.clickXPos);
if((a=this.startPos+e)>(this.style==this.STYLE_THIN?16:18)&&a<(this.barWidth-this.sliderWidth+(this.style==this.STYLE_THIN?16:18))){this.slider.style.left=a+"px"}}}this.currentPage=d;this.updateCaption(c.page)},_clickOnBar:function(a){this.mouseXPos=Event.pointerX(a);this._moveSlider("click");this.go()},_mouseDown:function(a){Event.stop(a);this.clickXPos=Event.pointerX(a);this.startPos=parseInt(this.slider.style.left);
this.bMouseMove=this._mouseMove.bindAsEventListener(this);this.bMouseUp=this._mouseUp.bindAsEventListener(this);Event.observe(document.body,"mousemove",this.bMouseMove);Event.observe(document.body,"mouseup",this.bMouseUp)},_mouseMove:function(a){this.mouseXPos=Event.pointerX(a);this._moveSlider()},_mouseUp:function(a){Event.stopObserving(document.body,"mousemove",this.mouseMoveBinded);if(!this.page){return
}Event.stopObserving(document.body,"mousemove",this.bMouseMove);Event.stopObserving(document.body,"mouseup",this.bMouseUp);this.slider.style.left=(this.style==this.STYLE_THIN?16:18)+(this.page-1)*this.stepWidth+"px";this.go()},_moveLeft:function(a){if(this.currentPage==1){Event.stop(a);return}var b=this.currentPage;this.slider.style.left=(this.style==this.STYLE_THIN?16:18)+(b-2)*this.stepWidth+"px";
this.updateCaption(--b);this.go(b)},_moveRight:function(a){if(this.currentPage==this.totalPages){Event.stop(a);return}var b=this.currentPage;this.slider.style.left=(this.style==this.STYLE_THIN?16:18)+b*this.stepWidth+"px";this.updateCaption(++b);this.go(b)},_updateFriends:function(a){$A(Paginators.getGroup(this.group)).each(function(b){b._moveSlider("goTo",a)})},_hide:function(){$("paginationContainer_"+this.uniqueId).hide();
this.visible=false},_show:function(){if(this.visible==false){$("paginationContainer_"+this.uniqueId).show();this.visible=true}},_rewind:function(a){if(parseInt(a.totalPages)<2){this._hide()}else{this._show();this.totalPages=a.totalPages;this.currentPage=(a.currentPage?a.currentPage:1);this._calculateWidths();this._moveSlider("rewind",(a.currentPage?a.currentPage:1))}},_garbageCollector:function(){Event.stopObserving(this.navigationBar.identify(),"mousedown",this.bClickOnBar);
Event.stopObserving(this.leftArrow.identify(),"click",this.bMoveLeft);Event.stopObserving(this.rightArrow.identify(),"click",this.bMoveRight);Event.stopObserving("lnk_"+this.goTo.identify(),"click",this.bGoToPage);Event.stopObserving(this.slider.identify(),"mousedown",this.bMouseDown)},_goToPage:function(){var a=parseInt(this.goTo.value);if((0<a)&&(a<=this.totalPages)){this._moveSlider("goTo",a);this.go(a)
}else{this.goTo.select()}},go:function(page){if(this.loading){return}this.loading=true;if(!page){page=this.page}this.handler.parameters.unset("isRemove",true);if(this.isRemove){this.handler.parameters.set("isRemove",true);this.isRemove=false}this.handler.parameters.unset("refreshPagination");if(this.refreshPagination){this.handler.parameters.unset("cacheId");this.handler.parameters.set("refreshPagination",this.group)
}this.handler.parameters.set("page",page);this.handler.parameters.set("paginator",this.group);var createHandler=eval(this.handler.onCreate)||Prototype.emptyFunction;var failureHandler=eval(this.handler.onFailure)||Prototype.emptyFunction;createHandler(this);var ajaxParameters={method:"get",parameters:this.handler.parameters,onSuccess:function(tr){var successHandler=!(Object.isFunction(this.handler.onSuccess))?eval(this.handler.onSuccess)||Prototype.emptyFunction:this.handler.onSuccess;
var response=null;try{response=tr.responseText.evalJSON()}catch(ex){window.console.error(ex)}this.loading=false;try{successHandler(tr,response);this._handleUpdate(response)}catch(ex){window.console.log(ex)}}.bind(this),onFailure:function(tr){this.loading=false;failureHandler(tr)}};if(!Object.isUndefined(this.handler.parameters.get("overlayer"))){ajaxParameters.overlayer={id:this.handler.parameters.get("overlayer")}
}else{if(this.handler.update){ajaxParameters.overlayer={id:this.handler.update}}}if(this.handler.message){ajaxParameters.message=this.handler.message}new Ajax.Request(this.handler.url,ajaxParameters);this.currentPage=page;this._updateFriends(page)},_handleUpdate:function(a){if(this.handler.update){if(this.handler.parameters.get("isRemove")){$(this.removeHtmlElement).remove();$(this.handler.update).insert({bottom:a.results})
}else{$(this.handler.update).update(a.results)}}if(this.refreshPagination){Paginators.getGroup(this.group).each(function(b){b._rewind(a.handler.config);b.setParameters(a.handler.parameters)});this.refreshPagination=false}},refresh:function(a){this.refreshPagination=true;if(!Object.isUndefined(a)){if(!Object.isHash(a)){throw ("'newParameters' must be a Hash object!")}this.setParameters(a);this.currentPage=0;
var b=a.get("page");if(Object.isUndefined(b)){this.go(1)}else{this.go(b)}}else{this.go(this.currentPage)}},remove:function(a,b){this.isRemove=true;this.refreshPagination=true;this.removeHtmlElement=a;this.addParameters(b);this.go(this.getCurrentPage())},getHandler:function(){return this.handler},setHandler:function(a){this.handler=a},setParameters:function(a){this.handler.parameters=$H(a)},addParameters:function(a){this.handler.parameters=this.handler.parameters.merge(a)
},getParameters:function(){return this.handler.parameters},getCurrentPage:function(){return this.currentPage}});var Abuse={REQUEST_URL:"/abuse/index/report.ajax",FORM:"abuseForm",context:null,targetUserid:null,targetUsername:null,refference:null,activateInput:function(c){var a=c.element();var b=a.up("p").next().down("textarea");if(a.value){b.disabled=false;b.focus();$("mandatoryReason").setStyle({color:"#000"})
}else{b.disabled=true;a.focus();$("mandatoryReason").setStyle({color:"#f00"});Effect.Pulsate("mandatoryReason")}},send:function(){var a=$(this.FORM);if(!a.findFirstElement().value){$("mandatoryReason").setStyle({color:"#f00"});Effect.Pulsate("mandatoryReason");return false}var b={context:this.context,targetUserid:this.targetUserid,targetUsername:this.targetUsername,refference:this.refference,partner:"Videomax"};
Object.extend(b,a.serialize(true));new Ajax.Request(this.REQUEST_URL,{method:"post",asynchronous:false,overlayer:Dialog.Confirm.instance.getContent().identify(),parameters:Object.toQueryString(b),onSuccess:function(c){this.response=c.responseText.evalJSON()}.bind(this)});return true},cancel:function(){this.context=null;this.targetUserid=null;this.targetUsername=null;this.refference=null;Event.stopObserving("reason","change",this.activateInputBinded)
},displayConfirmation:function(){Dialog.Confirm.show(this.response.content,{title:null,height:200,width:600})},init:function(){this.activateInputBinded=this.activateInput.bindAsEventListener(this);Event.observe("reason","change",this.activateInputBinded)}};document.observe("script:loaded",function(){Abuse.init()});document.observe("dom:loaded",initialize);function initialize(){var a={"#showContest":showContest,"#copyToClipboard":copyToClipboard};
document.delegate("click",a)}function showContest(a){$("contestDisplay").show();Dialog.Confirm.show("contestDisplay",{modal:true,top:50,width:700,height:500,onSuccess:function(){},onFailure:function(){$("contestDisplay").hide()}})}function copyToClipboard(){document.widgetForm.txtArea.focus();document.widgetForm.txtArea.select()};