var Prototype={Version:"1.5.0_rc1",Browser:{IE:!!(window.attachEvent&&!window.opera),Opera:!!window.opera,WebKit:navigator.userAgent.indexOf("AppleWebKit/")>-1,Gecko:navigator.userAgent.indexOf("Gecko")>-1&&navigator.userAgent.indexOf("KHTML")==-1},ScriptFragment:"<script[^>]*>([\\S\\s]*?)<\/script>",emptyFunction:function(){},K:function(a){return a}};var Class={create:function(){return function(){this.initialize.apply(this,arguments)}}};var Abstract=new Object();Object.extend=function(a,c){for(var b in c){a[b]=c[b]}return a};Object.extend(Object,{inspect:function(a){try{if(a==undefined){return"undefined"}if(a==null){return"null"}return a.inspect?a.inspect():a.toString()}catch(b){if(b instanceof RangeError){return"..."}throw b}},keys:function(a){var b=[];for(var c in a){b.push(c)}return b},values:function(b){var a=[];for(var c in b){a.push(b[c])}return a},clone:function(a){return Object.extend({},a)}});Function.prototype.bind=function(){var a=this,c=$A(arguments),b=c.shift();return function(){return a.apply(b,c.concat($A(arguments)))}};Function.prototype.bindAsEventListener=function(c){var a=this,b=$A(arguments),c=b.shift();return function(d){return a.apply(c,[(d||window.event)].concat(b).concat($A(arguments)))}};Object.extend(Number.prototype,{toColorPart:function(){var a=this.toString(16);if(this<16){return"0"+a}return a},succ:function(){return this+1},times:function(a){$R(0,this,true).each(a);return this}});var Try={these:function(){var c;for(var b=0;b<arguments.length;b++){var a=arguments[b];try{c=a();break}catch(d){}}return c}};var PeriodicalExecuter=Class.create();PeriodicalExecuter.prototype={initialize:function(b,a){this.callback=b;this.frequency=a;this.currentlyExecuting=false;this.registerCallback()},registerCallback:function(){this.timer=setInterval(this.onTimerEvent.bind(this),this.frequency*1000)},stop:function(){if(!this.timer){return}clearInterval(this.timer);this.timer=null},onTimerEvent:function(){if(!this.currentlyExecuting){try{this.currentlyExecuting=true;this.callback(this)}finally{this.currentlyExecuting=false}}}};Object.extend(String.prototype,{gsub:function(e,c){var a="",d=this,b;c=arguments.callee.prepareReplacement(c);while(d.length>0){if(b=d.match(e)){a+=d.slice(0,b.index);a+=(c(b)||"").toString();d=d.slice(b.index+b[0].length)}else{a+=d,d=""}}return a},sub:function(c,a,b){a=this.gsub.prepareReplacement(a);b=b===undefined?1:b;return this.gsub(c,function(d){if(--b<0){return d[0]}return a(d)})},scan:function(b,a){this.gsub(b,a);return this},truncate:function(b,a){b=b||30;a=a===undefined?"...":a;return this.length>b?this.slice(0,b-a.length)+a:this},strip:function(){return this.replace(/^\s+/,"").replace(/\s+$/,"")},stripTags:function(){return this.replace(/<\/?[^>]+>/gi,"")},stripScripts:function(){return this.replace(new RegExp(Prototype.ScriptFragment,"img"),"")},extractScripts:function(){var b=new RegExp(Prototype.ScriptFragment,"img");var a=new RegExp(Prototype.ScriptFragment,"im");return(this.match(b)||[]).map(function(c){return(c.match(a)||["",""])[1]})},evalScripts:function(){return this.extractScripts().map(function(script){return eval(script.replace(/(^\s*<!--|-->\s*$)/gi,""))})},escapeHTML:function(){var b=document.createElement("div");var a=document.createTextNode(this);b.appendChild(a);return b.innerHTML},unescapeHTML:function(){var a=document.createElement("div");a.innerHTML=this.stripTags();return a.childNodes[0]?a.childNodes[0].nodeValue:""},toQueryParams:function(){var a=this.match(/^\??(.*)$/)[1].split("&");return a.inject({},function(e,b){var d=b.split("=");var c=d[1]?decodeURIComponent(d[1]):undefined;e[decodeURIComponent(d[0])]=c;return e})},toArray:function(){return this.split("")},camelize:function(){var d=this.split("-");if(d.length==1){return d[0]}var b=this.indexOf("-")==0?d[0].charAt(0).toUpperCase()+d[0].substring(1):d[0];for(var c=1,a=d.length;c<a;c++){var e=d[c];b+=e.charAt(0).toUpperCase()+e.substring(1)}return b},inspect:function(b){var a=this.replace(/\\/g,"\\\\");if(b){return'"'+a.replace(/"/g,'\\"')+'"'}else{return"'"+a.replace(/'/g,"\\'")+"'"}}});String.prototype.gsub.prepareReplacement=function(b){if(typeof b=="function"){return b}var a=new Template(b);return function(c){return a.evaluate(c)}};String.prototype.parseQuery=String.prototype.toQueryParams;var Template=Class.create();Template.Pattern=/(^|.|\r|\n)(#\{(.*?)\})/;Template.prototype={initialize:function(a,b){this.template=a.toString();this.pattern=b||Template.Pattern},evaluate:function(a){return this.template.gsub(this.pattern,function(b){var c=b[1];if(c=="\\"){return b[2]}return c+(a[b[3]]||"").toString()})}};var $break=new Object();var $continue=new Object();var Enumerable={each:function(b){var a=0;try{this._each(function(d){try{b(d,a++)}catch(f){if(f!=$continue){throw f}}})}catch(c){if(c!=$break){throw c}}},all:function(b){var a=true;this.each(function(d,c){a=a&&!!(b||Prototype.K)(d,c);if(!a){throw $break}});return a},any:function(b){var a=false;this.each(function(d,c){if(a=!!(b||Prototype.K)(d,c)){throw $break}});return a},collect:function(b){var a=[];this.each(function(d,c){a.push(b(d,c))});return a},detect:function(b){var a;this.each(function(d,c){if(b(d,c)){a=d;throw $break}});return a},findAll:function(b){var a=[];this.each(function(d,c){if(b(d,c)){a.push(d)}});return a},grep:function(c,b){var a=[];this.each(function(f,e){var d=f.toString();if(d.match(c)){a.push((b||Prototype.K)(f,e))}});return a},include:function(a){var b=false;this.each(function(c){if(c==a){b=true;throw $break}});return b},inject:function(a,b){this.each(function(d,c){a=b(a,d,c)});return a},invoke:function(b){var a=$A(arguments).slice(1);return this.collect(function(c){return c[b].apply(c,a)})},max:function(b){var a;this.each(function(d,c){d=(b||Prototype.K)(d,c);if(a==undefined||d>=a){a=d}});return a},min:function(b){var a;this.each(function(d,c){d=(b||Prototype.K)(d,c);if(a==undefined||d<a){a=d}});return a},partition:function(c){var b=[],a=[];this.each(function(e,d){((c||Prototype.K)(e,d)?b:a).push(e)});return[b,a]},pluck:function(b){var a=[];this.each(function(d,c){a.push(d[b])});return a},reject:function(b){var a=[];this.each(function(d,c){if(!b(d,c)){a.push(d)}});return a},sortBy:function(a){return this.collect(function(c,b){return{value:c,criteria:a(c,b)}}).sort(function(f,e){var d=f.criteria,c=e.criteria;return d<c?-1:d>c?1:0}).pluck("value")},toArray:function(){return this.collect(Prototype.K)},zip:function(){var b=Prototype.K,a=$A(arguments);if(typeof a.last()=="function"){b=a.pop()}var c=[this].concat(a).map($A);return this.map(function(e,d){return b(c.pluck(d))})},inspect:function(){return"#<Enumerable:"+this.toArray().inspect()+">"}};Object.extend(Enumerable,{map:Enumerable.collect,find:Enumerable.detect,select:Enumerable.findAll,member:Enumerable.include,entries:Enumerable.toArray});var $A=Array.from=function(c){if(!c){return[]}if(c.toArray){return c.toArray()}else{var b=[];for(var a=0;a<c.length;a++){b.push(c[a])}return b}};Object.extend(Array.prototype,Enumerable);if(!Array.prototype._reverse){Array.prototype._reverse=Array.prototype.reverse}Object.extend(Array.prototype,{_each:function(b){for(var a=0;a<this.length;a++){b(this[a])}},clear:function(){this.length=0;return this},first:function(){return this[0]},last:function(){return this[this.length-1]},compact:function(){return this.select(function(a){return a!=undefined||a!=null})},flatten:function(){return this.inject([],function(b,a){return b.concat(a&&a.constructor==Array?a.flatten():[a])})},without:function(){var a=$A(arguments);return this.select(function(b){return !a.include(b)})},indexOf:function(a){for(var b=0;b<this.length;b++){if(this[b]==a){return b}}return -1},reverse:function(a){return(a!==false?this:this.toArray())._reverse()},reduce:function(){return this.length>1?this:this[0]},uniq:function(){return this.inject([],function(b,a){return b.include(a)?b:b.concat([a])})},inspect:function(){return"["+this.map(Object.inspect).join(", ")+"]"}});var Hash={_each:function(b){for(var a in this){var c=this[a];if(typeof c=="function"){continue}var d=[a,c];d.key=a;d.value=c;b(d)}},keys:function(){return this.pluck("key")},values:function(){return this.pluck("value")},merge:function(a){return $H(a).inject($H(this),function(b,c){b[c.key]=c.value;return b})},toQueryString:function(){return this.map(function(a){return a.map(encodeURIComponent).join("=")}).join("&")},inspect:function(){return"#<Hash:{"+this.map(function(a){return a.map(Object.inspect).join(": ")}).join(", ")+"}>"}};function $H(a){var b=Object.extend({},a||{});Object.extend(b,Enumerable);Object.extend(b,Hash);return b}ObjectRange=Class.create();Object.extend(ObjectRange.prototype,Enumerable);Object.extend(ObjectRange.prototype,{initialize:function(c,a,b){this.start=c;this.end=a;this.exclusive=b},_each:function(a){var b=this.start;while(this.include(b)){a(b);b=b.succ()}},include:function(a){if(a<this.start){return false}if(this.exclusive){return a<this.end}return a<=this.end}});var $R=function(c,a,b){return new ObjectRange(c,a,b)};var Ajax={getTransport:function(){return Try.these(function(){return new XMLHttpRequest()},function(){return new ActiveXObject("Msxml2.XMLHTTP")},function(){return new ActiveXObject("Microsoft.XMLHTTP")})||false},activeRequestParams:null,activeRequestCount:0};Ajax.Responders={responders:[],_each:function(a){this.responders._each(a)},register:function(a){if(!this.include(a)){this.responders.push(a)}},unregister:function(a){this.responders=this.responders.without(a)},dispatch:function(d,b,c,a){this.each(function(e){if(e[d]&&typeof e[d]=="function"){e[d].apply(e,[b,c,a])}})}};Object.extend(Ajax.Responders,Enumerable);Ajax.Responders.register({onCreate:function(){Ajax.activeRequestCount++},onComplete:function(){Ajax.activeRequestCount--}});Ajax.Base=function(){};Ajax.Base.prototype={setOptions:function(a){this.options={method:"post",asynchronous:true,contentType:"application/x-www-form-urlencoded",parameters:""};Object.extend(this.options,a||{})},responseIsSuccess:function(){return this.transport.status==undefined||this.transport.status==0||(this.transport.status>=200&&this.transport.status<300)},responseIsFailure:function(){return !this.responseIsSuccess()}};Ajax.Request=Class.create();Ajax.Request.Events=["Uninitialized","Loading","Loaded","Interactive","Complete"];Ajax.Request.prototype=Object.extend(new Ajax.Base(),{initialize:function(b,a){Ajax.activeRequestParams={request:this,url:b,options:a};this.transport=Ajax.getTransport();this.setOptions(a);this.request(b)},request:function(b){var c=this.options.parameters||"";if(c.length>0){c+="&_="}if(this.options.method!="get"&&this.options.method!="post"){c+=(c.length>0?"&":"")+"_method="+this.options.method;this.options.method="post"}try{this.url=b;if(this.options.method=="get"&&c.length>0){this.url+=(this.url.match(/\?/)?"&":"?")+c}Ajax.Responders.dispatch("onCreate",this,this.transport);this.transport.open(this.options.method,this.url,this.options.asynchronous);if(this.options.asynchronous){setTimeout(function(){this.respondToReadyState(1)}.bind(this),10)}this.transport.onreadystatechange=this.onStateChange.bind(this);this.setRequestHeaders();var a=this.options.postBody?this.options.postBody:c;this.transport.send(this.options.method=="post"?a:null);if(!this.options.asynchronous&&this.transport.overrideMimeType){this.onStateChange()}}catch(d){this.dispatchException(d)}},setRequestHeaders:function(){var b=["X-Requested-With","XMLHttpRequest","Accept","text/javascript, text/html, application/xml, text/xml, */*"];if(this.options.method=="post"){b.push("Content-type",this.options.contentType)}if(this.options.requestHeaders){b.push.apply(b,this.options.requestHeaders)}for(var a=0;a<b.length;a+=2){this.transport.setRequestHeader(b[a],b[a+1])}},onStateChange:function(){var a=this.transport.readyState;if(a!=1){this.respondToReadyState(this.transport.readyState)}},header:function(a){try{return this.transport.getResponseHeader(a)}catch(b){}},evalJSON:function(){try{return eval("("+this.header("X-JSON")+")")}catch(e){}},evalResponse:function(){return eval(this.transport.responseText)},respondToReadyState:function(a){var c=Ajax.Request.Events[a];var d=this.transport,b=this.evalJSON();if(c=="Complete"){(this.options["on"+this.transport.status]||this.options["on"+(this.responseIsSuccess()?"Success":"Failure")]||Prototype.emptyFunction)(d,b);if((this.header("Content-type")||"").match(/^text\/javascript/i)){this.evalResponse()}}(this.options["on"+c]||Prototype.emptyFunction)(d,b);Ajax.Responders.dispatch("on"+c,this,d,b);if(c=="Complete"){this.transport.onreadystatechange=Prototype.emptyFunction}},dispatchException:function(a){(this.options.onException||Prototype.emptyFunction)(this,a);Ajax.Responders.dispatch("onException",this,a)}});Ajax.Updater=Class.create();Object.extend(Object.extend(Ajax.Updater.prototype,Ajax.Request.prototype),{initialize:function(a,c,b){this.containers={success:a.success?$(a.success):$(a),failure:a.failure?$(a.failure):(a.success?null:$(a))};this.transport=Ajax.getTransport();this.setOptions(b);var d=this.options.onComplete||Prototype.emptyFunction;this.options.onComplete=(function(f,e){this.updateContent();d(f,e)}).bind(this);this.request(c)},updateContent:function(){var b=this.responseIsSuccess()?this.containers.success:this.containers.failure;var a=this.transport.responseText;if(!this.options.evalScripts){a=a.stripScripts()}if(b){if(this.options.insertion){new this.options.insertion(b,a)}else{Element.update(b,a)}}if(this.responseIsSuccess()){if(this.onComplete){setTimeout(this.onComplete.bind(this),10)}}}});Ajax.PeriodicalUpdater=Class.create();Ajax.PeriodicalUpdater.prototype=Object.extend(new Ajax.Base(),{initialize:function(a,c,b){this.setOptions(b);this.onComplete=this.options.onComplete;this.frequency=(this.options.frequency||2);this.decay=(this.options.decay||1);this.updater={};this.container=a;this.url=c;this.start()},start:function(){this.options.onComplete=this.updateComplete.bind(this);this.onTimerEvent()},stop:function(){this.updater.options.onComplete=undefined;clearTimeout(this.timer);(this.onComplete||Prototype.emptyFunction).apply(this,arguments)},updateComplete:function(a){if(this.options.decay){this.decay=(a.responseText==this.lastText?this.decay*this.options.decay:1);this.lastText=a.responseText}this.timer=setTimeout(this.onTimerEvent.bind(this),this.decay*this.frequency*1000)},onTimerEvent:function(){this.updater=new Ajax.Updater(this.container,this.url,this.options)}});function $(){var c=[],b;for(var a=0;a<arguments.length;a++){b=arguments[a];if(typeof b=="string"){b=document.getElementById(b)}c.push(Element.extend(b))}return c.reduce()}document.getElementsByClassName=function(g,j){var d=($(j)||document.body).getElementsByTagName("*");var a=[],b,f=new RegExp("(^|\\s)"+g+"(\\s|$)");for(var e=0,c=d.length;e<c;e++){b=d[e];var h=b.className;if(h.length==0){continue}if(h==g||h.match(f)){a.push(Element.extend(b))}}return a};if(!window.Element){var Element=new Object()}Element.extend=function(c){if(!c){return}try{if(_nativeExtensions||c.nodeType==3){return c}}catch(g){return c}if(!c._extended&&c.tagName&&c!=window){var b=Object.clone(Element.Methods),a=Element.extend.cache;if(c.tagName=="FORM"){Object.extend(b,Form.Methods)}if(["INPUT","TEXTAREA","SELECT"].include(c.tagName)){Object.extend(b,Form.Element.Methods)}for(var f in b){var d=b[f];if(typeof d=="function"){c[f]=a.findOrStore(d)}}}c._extended=true;return c};Element.extend.cache={findOrStore:function(a){return this[a]=this[a]||function(){return a.apply(null,[this].concat($A(arguments)))}}};Element.Methods={visible:function(a){return $(a).style.display!="none"},toggle:function(a){a=$(a);Element[Element.visible(a)?"hide":"show"](a);return a},hide:function(a){$(a).style.display="none";return a},show:function(a){$(a).style.display="";return a},remove:function(a){a=$(a);a.parentNode.removeChild(a);return a},update:function(b,a){$(b).innerHTML=a.stripScripts();setTimeout(function(){a.evalScripts()},10);return b},replace:function(c,b){c=$(c);if(c.outerHTML){c.outerHTML=b.stripScripts()}else{var a=c.ownerDocument.createRange();a.selectNodeContents(c);c.parentNode.replaceChild(a.createContextualFragment(b.stripScripts()),c)}setTimeout(function(){b.evalScripts()},10);return c},inspect:function(b){b=$(b);var a="<"+b.tagName.toLowerCase();$H({id:"id",className:"class"}).each(function(f){var e=f.first(),c=f.last();var d=(b[e]||"").toString();if(d){a+=" "+c+"="+d.inspect(true)}});return a+">"},recursivelyCollect:function(a,c){a=$(a);var b=[];while(a=a[c]){if(a.nodeType==1){b.push(Element.extend(a))}}return b},ancestors:function(a){return $(a).recursivelyCollect("parentNode")},descendants:function(a){a=$(a);return $A(a.getElementsByTagName("*"))},firstDescendant:function(a){a=$(a).firstChild;while(a&&a.nodeType!=1){a=a.nextSibling}return $(a)},previousSiblings:function(a){return $(a).recursivelyCollect("previousSibling")},nextSiblings:function(a){return $(a).recursivelyCollect("nextSibling")},siblings:function(a){a=$(a);return a.previousSiblings().reverse().concat(a.nextSiblings())},match:function(b,a){b=$(b);if(typeof a=="string"){a=new Selector(a)}return a.match(b)},up:function(b,c,a){return Selector.findElement($(b).ancestors(),c,a)},down:function(b,c,a){return Selector.findElement($(b).descendants(),c,a)},previous:function(b,c,a){return Selector.findElement($(b).previousSiblings(),c,a)},next:function(b,c,a){return Selector.findElement($(b).nextSiblings(),c,a)},getElementsBySelector:function(){var a=$A(arguments),b=$(a.shift());return Selector.findChildElements(b,a)},getElementsByClassName:function(a,b){a=$(a);return document.getElementsByClassName(b,a)},getHeight:function(a){a=$(a);return a.offsetHeight},classNames:function(a){return new Element.ClassNames(a)},hasClassName:function(a,b){if(!(a=$(a))){return}var c=a.className;return(c.length>0&&(c==b||new RegExp("(^|\\s)"+b+"(\\s|$)").test(c)))},addClassName:function(a,b){if(!(a=$(a))){return}Element.classNames(a).add(b);return a},removeClassName:function(a,b){if(!(a=$(a))){return}Element.classNames(a).remove(b);return a},observe:function(){Event.observe.apply(Event,arguments);return $A(arguments).first()},stopObserving:function(){Event.stopObserving.apply(Event,arguments);return $A(arguments).first()},cleanWhitespace:function(b){b=$(b);var c=b.firstChild;while(c){var a=c.nextSibling;if(c.nodeType==3&&!/\S/.test(c.nodeValue)){b.removeChild(c)}c=a}return b},empty:function(a){return $(a).innerHTML.match(/^\s*$/)},childOf:function(b,a){b=$(b),a=$(a);while(b=b.parentNode){if(b==a){return true}}return false},scrollTo:function(b){b=$(b);var a=b.x?b.x:b.offsetLeft,c=b.y?b.y:b.offsetTop;window.scrollTo(a,c);return b},getStyle:function(b,c){b=$(b);var d=b.style[c.camelize()];if(!d){if(document.defaultView&&document.defaultView.getComputedStyle){var a=document.defaultView.getComputedStyle(b,null);d=a?a.getPropertyValue(c):null}else{if(b.currentStyle){d=b.currentStyle[c.camelize()]}}}if(window.opera&&["left","top","right","bottom"].include(c)){if(Element.getStyle(b,"position")=="static"){d="auto"}}return d=="auto"?null:d},setStyle:function(b,c){b=$(b);for(var a in c){b.style[a.camelize()]=c[a]}return b},getDimensions:function(c){c=$(c);var g=$(c).getStyle("display");if(g!="none"&&g!=null){return{width:c.offsetWidth,height:c.offsetHeight}}var b=c.style;var f=b.visibility;var d=b.position;var a=b.display;b.visibility="hidden";b.position="absolute";b.display="block";var h=c.clientWidth;var e=c.clientHeight;b.display=a;b.position=d;b.visibility=f;return{width:h,height:e}},makePositioned:function(a){a=$(a);var b=Element.getStyle(a,"position");if(b=="static"||!b){a._madePositioned=true;a.style.position="relative";if(window.opera){a.style.top=0;a.style.left=0}}return a},undoPositioned:function(a){a=$(a);if(a._madePositioned){a._madePositioned=undefined;a.style.position=a.style.top=a.style.left=a.style.bottom=a.style.right=""}return a},makeClipping:function(a){a=$(a);if(a._overflow){return}a._overflow=a.style.overflow||"auto";if((Element.getStyle(a,"overflow")||"visible")!="hidden"){a.style.overflow="hidden"}return a},undoClipping:function(a){a=$(a);if(!a._overflow){return}a.style.overflow=a._overflow=="auto"?"":a._overflow;a._overflow=null;return a}};if(document.all){Element.Methods.update=function(c,b){c=$(c);var a=c.tagName.toUpperCase();if(["THEAD","TBODY","TR","TD"].indexOf(a)>-1){var d=document.createElement("div");switch(a){case"THEAD":case"TBODY":d.innerHTML="<table><tbody>"+b.stripScripts()+"</tbody></table>";depth=2;break;case"TR":d.innerHTML="<table><tbody><tr>"+b.stripScripts()+"</tr></tbody></table>";depth=3;break;case"TD":d.innerHTML="<table><tbody><tr><td>"+b.stripScripts()+"</td></tr></tbody></table>";depth=4}$A(c.childNodes).each(function(e){c.removeChild(e)});depth.times(function(){d=d.firstChild});$A(d.childNodes).each(function(e){c.appendChild(e)})}else{c.innerHTML=b.stripScripts()}setTimeout(function(){b.evalScripts()},10);return c}}Object.extend(Element,Element.Methods);var _nativeExtensions=false;if(!window.HTMLElement&&/Konqueror|Safari|KHTML/.test(navigator.userAgent)){["","Form","Input","TextArea","Select"].each(function(b){var a=window["HTML"+b+"Element"]={};a.prototype=document.createElement(b?b.toLowerCase():"div").__proto__})}Element.addMethods=function(a){Object.extend(Element.Methods,a||{});function b(e,c){var d=Element.extend.cache;for(var g in e){var f=e[g];c[g]=d.findOrStore(f)}}if(typeof HTMLElement!="undefined"){b(Element.Methods,HTMLElement.prototype);b(Form.Methods,HTMLFormElement.prototype);[HTMLInputElement,HTMLTextAreaElement,HTMLSelectElement].each(function(c){b(Form.Element.Methods,c.prototype)});_nativeExtensions=true}};var Toggle=new Object();Toggle.display=Element.toggle;Abstract.Insertion=function(a){this.adjacency=a};Abstract.Insertion.prototype={initialize:function(b,c){this.element=$(b);this.content=c.stripScripts();if(this.adjacency&&this.element.insertAdjacentHTML){try{this.element.insertAdjacentHTML(this.adjacency,this.content)}catch(d){var a=this.element.tagName.toLowerCase();if(a=="tbody"||a=="tr"){this.insertContent(this.contentFromAnonymousTable())}else{throw d}}}else{this.range=this.element.ownerDocument.createRange();if(this.initializeRange){this.initializeRange()}this.insertContent([this.range.createContextualFragment(this.content)])}setTimeout(function(){c.evalScripts()},10)},contentFromAnonymousTable:function(){var a=document.createElement("div");a.innerHTML="<table><tbody>"+this.content+"</tbody></table>";return $A(a.childNodes[0].childNodes[0].childNodes)}};var Insertion=new Object();Insertion.Before=Class.create();Insertion.Before.prototype=Object.extend(new Abstract.Insertion("beforeBegin"),{initializeRange:function(){this.range.setStartBefore(this.element)},insertContent:function(a){a.each((function(b){this.element.parentNode.insertBefore(b,this.element)}).bind(this))}});Insertion.Top=Class.create();Insertion.Top.prototype=Object.extend(new Abstract.Insertion("afterBegin"),{initializeRange:function(){this.range.selectNodeContents(this.element);this.range.collapse(true)},insertContent:function(a){a.reverse(false).each((function(b){this.element.insertBefore(b,this.element.firstChild)}).bind(this))}});Insertion.Bottom=Class.create();Insertion.Bottom.prototype=Object.extend(new Abstract.Insertion("beforeEnd"),{initializeRange:function(){this.range.selectNodeContents(this.element);this.range.collapse(this.element)},insertContent:function(a){a.each((function(b){this.element.appendChild(b)}).bind(this))}});Insertion.After=Class.create();Insertion.After.prototype=Object.extend(new Abstract.Insertion("afterEnd"),{initializeRange:function(){this.range.setStartAfter(this.element)},insertContent:function(a){a.each((function(b){this.element.parentNode.insertBefore(b,this.element.nextSibling)}).bind(this))}});Element.ClassNames=Class.create();Element.ClassNames.prototype={initialize:function(a){this.element=$(a)},_each:function(a){this.element.className.split(/\s+/).select(function(b){return b.length>0})._each(a)},set:function(a){this.element.className=a},add:function(a){if(this.include(a)){return}this.set(this.toArray().concat(a).join(" "))},remove:function(a){if(!this.include(a)){return}this.set(this.select(function(b){return b!=a}).join(" "))},toString:function(){return this.toArray().join(" ")}};Object.extend(Element.ClassNames.prototype,Enumerable);var Selector=Class.create();Selector.prototype={initialize:function(a){this.params={classNames:[]};this.expression=a.toString().strip();this.parseExpression();this.compileMatcher()},parseExpression:function(){function g(h){throw"Parse error in selector: "+h}if(this.expression==""){g("empty expression")}var f=this.params,e=this.expression,b,a,d,c;while(b=e.match(/^(.*)\[([a-z0-9_:-]+?)(?:([~\|!]?=)(?:"([^"]*)"|([^\]\s]*)))?\]$/i)){f.attributes=f.attributes||[];f.attributes.push({name:b[2],operator:b[3],value:b[4]||b[5]||""});e=b[1]}if(e=="*"){return this.params.wildcard=true}while(b=e.match(/^([^a-z0-9_-])?([a-z0-9_-]+)(.*)/i)){a=b[1],d=b[2],c=b[3];switch(a){case"#":f.id=d;break;case".":f.classNames.push(d);break;case"":case undefined:f.tagName=d.toUpperCase();break;default:g(e.inspect())}e=c}if(e.length>0){g(e.inspect())}},buildMatchExpression:function(){var d=this.params,c=[],b;if(d.wildcard){c.push("true")}if(b=d.id){c.push("element.id == "+b.inspect())}if(b=d.tagName){c.push("element.tagName.toUpperCase() == "+b.inspect())}if((b=d.classNames).length>0){for(var a=0;a<b.length;a++){c.push("Element.hasClassName(element, "+b[a].inspect()+")")}}if(b=d.attributes){b.each(function(f){var g="element.getAttribute("+f.name.inspect()+")";var e=function(h){return g+" && "+g+".split("+h.inspect()+")"};switch(f.operator){case"=":c.push(g+" == "+f.value.inspect());break;case"~=":c.push(e(" ")+".include("+f.value.inspect()+")");break;case"|=":c.push(e("-")+".first().toUpperCase() == "+f.value.toUpperCase().inspect());break;case"!=":c.push(g+" != "+f.value.inspect());break;case"":case undefined:c.push(g+" != null");break;default:throw"Unknown operator "+f.operator+" in selector"}})}return c.join(" && ")},compileMatcher:function(){this.match=new Function("element","if (!element.tagName) return false;       return "+this.buildMatchExpression())},findElements:function(d){var c;if(c=$(this.params.id)){if(this.match(c)){if(!d||Element.childOf(c,d)){return[c]}}}d=(d||document).getElementsByTagName(this.params.tagName||"*");var b=[];for(var a=0;a<d.length;a++){if(this.match(c=d[a])){b.push(Element.extend(c))}}return b},toString:function(){return this.expression}};Object.extend(Selector,{matchElements:function(b,c){var a=new Selector(c);return b.select(a.match.bind(a))},findElement:function(b,c,a){if(typeof c=="number"){a=c,c=false}return Selector.matchElements(b,c||"*")[a||0]},findChildElements:function(a,b){return b.map(function(c){return c.strip().split(/\s+/).inject([null],function(e,f){var d=new Selector(f);return e.inject([],function(h,g){return h.concat(d.findElements(g||a))})})}).flatten()}});function $$(){return Selector.findChildElements(document,$A(arguments))}var Form={reset:function(a){$(a).reset();return a}};Form.Methods={serialize:function(d){var e=Form.getElements($(d));var c=new Array();for(var b=0;b<e.length;b++){var a=Form.Element.serialize(e[b]);if(a){c.push(a)}}return c.join("&")},getElements:function(c){c=$(c);var d=new Array();for(var b in Form.Element.Serializers){var e=c.getElementsByTagName(b);for(var a=0;a<e.length;a++){d.push(e[a])}}return d},getInputs:function(f,c,d){f=$(f);var a=f.getElementsByTagName("input");if(!c&&!d){return a}var g=new Array();for(var e=0;e<a.length;e++){var b=a[e];if((c&&b.type!=c)||(d&&b.name!=d)){continue}g.push(b)}return g},disable:function(c){c=$(c);var d=Form.getElements(c);for(var b=0;b<d.length;b++){var a=d[b];a.blur();a.disabled="true"}return c},enable:function(c){c=$(c);var d=Form.getElements(c);for(var b=0;b<d.length;b++){var a=d[b];a.disabled=""}return c},findFirstElement:function(a){return Form.getElements(a).find(function(b){return b.type!="hidden"&&!b.disabled&&["input","select","textarea"].include(b.tagName.toLowerCase())})},focusFirstElement:function(a){a=$(a);Field.activate(Form.findFirstElement(a));return a}};Object.extend(Form,Form.Methods);Form.Element={focus:function(a){try{$(a).focus()}catch(b){}return a},select:function(a){$(a).select();return a}};Form.Element.Methods={serialize:function(b){b=$(b);var d=b.tagName.toLowerCase();var c=Form.Element.Serializers[d](b);if(c){var a=encodeURIComponent(c[0]);if(a.length==0){return}if(c[1].constructor!=Array){c[1]=[c[1]]}return c[1].map(function(e){return a+"="+encodeURIComponent(e)}).join("&")}},getValue:function(a){a=$(a);var c=a.tagName.toLowerCase();var b=Form.Element.Serializers[c](a);if(b){return b[1]}},clear:function(a){$(a).value="";return a},present:function(a){return $(a).value!=""},activate:function(a){a=$(a);try{a.focus();if(a.select){a.select()}}catch(b){}return a},disable:function(a){a=$(a);a.disabled="";return a},enable:function(a){a=$(a);a.blur();a.disabled="true";return a}};Object.extend(Form.Element,Form.Element.Methods);var Field=Form.Element;Form.Element.Serializers={input:function(a){switch(a.type.toLowerCase()){case"checkbox":case"radio":return Form.Element.Serializers.inputSelector(a);default:return Form.Element.Serializers.textarea(a)}return false},inputSelector:function(a){if(a.checked){return[a.name,a.value]}},textarea:function(a){return[a.name,a.value]},select:function(a){return Form.Element.Serializers[a.type=="select-one"?"selectOne":"selectMany"](a)},selectOne:function(c){var d="",b,a=c.selectedIndex;if(a>=0){b=c.options[a];d=b.value||b.text}return[c.name,d]},selectMany:function(c){var d=[];for(var b=0;b<c.length;b++){var a=c.options[b];if(a.selected){d.push(a.value||a.text)}}return[c.name,d]}};var $F=Form.Element.getValue;Abstract.TimedObserver=function(){};Abstract.TimedObserver.prototype={initialize:function(a,b,c){this.frequency=b;this.element=$(a);this.callback=c;this.lastValue=this.getValue();this.registerCallback()},registerCallback:function(){setInterval(this.onTimerEvent.bind(this),this.frequency*1000)},onTimerEvent:function(){var a=this.getValue();if(this.lastValue!=a){this.callback(this.element,a);this.lastValue=a}}};Form.Element.Observer=Class.create();Form.Element.Observer.prototype=Object.extend(new Abstract.TimedObserver(),{getValue:function(){return Form.Element.getValue(this.element)}});Form.Observer=Class.create();Form.Observer.prototype=Object.extend(new Abstract.TimedObserver(),{getValue:function(){return Form.serialize(this.element)}});Abstract.EventObserver=function(){};Abstract.EventObserver.prototype={initialize:function(a,b){this.element=$(a);this.callback=b;this.lastValue=this.getValue();if(this.element.tagName.toLowerCase()=="form"){this.registerFormCallbacks()}else{this.registerCallback(this.element)}},onElementEvent:function(){var a=this.getValue();if(this.lastValue!=a){this.callback(this.element,a);this.lastValue=a}},registerFormCallbacks:function(){var b=Form.getElements(this.element);for(var a=0;a<b.length;a++){this.registerCallback(b[a])}},registerCallback:function(a){if(a.type){switch(a.type.toLowerCase()){case"checkbox":case"radio":Event.observe(a,"click",this.onElementEvent.bind(this));break;default:Event.observe(a,"change",this.onElementEvent.bind(this));break}}}};Form.Element.EventObserver=Class.create();Form.Element.EventObserver.prototype=Object.extend(new Abstract.EventObserver(),{getValue:function(){return Form.Element.getValue(this.element)}});Form.EventObserver=Class.create();Form.EventObserver.prototype=Object.extend(new Abstract.EventObserver(),{getValue:function(){return Form.serialize(this.element)}});if(!window.Event){var Event=new Object()}Object.extend(Event,{KEY_BACKSPACE:8,KEY_TAB:9,KEY_RETURN:13,KEY_ESC:27,KEY_LEFT:37,KEY_UP:38,KEY_RIGHT:39,KEY_DOWN:40,KEY_DELETE:46,KEY_HOME:36,KEY_END:35,KEY_PAGEUP:33,KEY_PAGEDOWN:34,element:function(a){return a.target||a.srcElement},isLeftClick:function(a){return(((a.which)&&(a.which==1))||((a.button)&&(a.button==1)))},pointerX:function(a){return a.pageX||(a.clientX+(document.documentElement.scrollLeft||document.body.scrollLeft))},pointerY:function(a){return a.pageY||(a.clientY+(document.documentElement.scrollTop||document.body.scrollTop))},stop:function(a){if(a.preventDefault){a.preventDefault();a.stopPropagation()}else{a.returnValue=false;a.cancelBubble=true}},findElement:function(c,b){var a=Event.element(c);while(a.parentNode&&(!a.tagName||(a.tagName.toUpperCase()!=b.toUpperCase()))){a=a.parentNode}return a},observers:false,_observeAndCache:function(d,c,b,a){if(!this.observers){this.observers=[]}if(d.addEventListener){this.observers.push([d,c,b,a]);d.addEventListener(c,b,a)}else{if(d.attachEvent){this.observers.push([d,c,b,a]);d.attachEvent("on"+c,b)}}},unloadCache:function(){if(!Event.observers){return}try{for(var a=0;a<Event.observers.length;a++){Event.stopObserving.apply(this,Event.observers[a]);Event.observers[a][0]=null}}catch(b){}Event.observers=false},observe:function(d,c,b,a){d=$(d);a=a||false;if(c=="keypress"&&(navigator.appVersion.match(/Konqueror|Safari|KHTML/)||d.attachEvent)){c="keydown"}Event._observeAndCache(d,c,b,a)},stopObserving:function(d,c,b,a){d=$(d);a=a||false;if(c=="keypress"&&(navigator.appVersion.match(/Konqueror|Safari|KHTML/)||d.detachEvent)){c="keydown"}if(d.removeEventListener){d.removeEventListener(c,b,a)}else{if(d.detachEvent){try{d.detachEvent("on"+c,b)}catch(f){}}}}});if(navigator.appVersion.match(/\bMSIE\b/)){Event.observe(window,"unload",Event.unloadCache,false)}var Position={includeScrollOffsets:false,prepare:function(){this.deltaX=window.pageXOffset||document.documentElement.scrollLeft||document.body.scrollLeft||0;this.deltaY=window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0},realOffset:function(b){var a=0,c=0;do{a+=b.scrollTop||0;c+=b.scrollLeft||0;b=b.parentNode}while(b);return[c,a]},cumulativeOffset:function(b){var a=0,c=0;do{a+=b.offsetTop||0;c+=b.offsetLeft||0;b=b.offsetParent}while(b);return[c,a]},positionedOffset:function(b){var a=0,c=0;do{a+=b.offsetTop||0;c+=b.offsetLeft||0;b=b.offsetParent;if(b){p=Element.getStyle(b,"position");if(p=="relative"||p=="absolute"){break}}}while(b);return[c,a]},offsetParent:function(a){try{if(a.offsetParent){return a.offsetParent}}catch(b){}if(a==document.body){return a}while((a=a.parentNode)&&a!=document.body){if(Element.getStyle(a,"position")!="static"){return a}}return document.body},within:function(b,a,c){if(this.includeScrollOffsets){return this.withinIncludingScrolloffsets(b,a,c)}this.xcomp=a;this.ycomp=c;this.offset=this.cumulativeOffset(b);return(c>=this.offset[1]&&c<this.offset[1]+b.offsetHeight&&a>=this.offset[0]&&a<this.offset[0]+b.offsetWidth)},withinIncludingScrolloffsets:function(b,a,d){var c=this.realOffset(b);this.xcomp=a+c[0]-this.deltaX;this.ycomp=d+c[1]-this.deltaY;this.offset=this.cumulativeOffset(b);return(this.ycomp>=this.offset[1]&&this.ycomp<this.offset[1]+b.offsetHeight&&this.xcomp>=this.offset[0]&&this.xcomp<this.offset[0]+b.offsetWidth)},overlap:function(b,a){if(!b){return 0}if(b=="vertical"){return((this.offset[1]+a.offsetHeight)-this.ycomp)/a.offsetHeight}if(b=="horizontal"){return((this.offset[0]+a.offsetWidth)-this.xcomp)/a.offsetWidth}},page:function(d){var a=0,c=0;var b=d;do{a+=b.offsetTop||0;c+=b.offsetLeft||0;if(b.offsetParent==document.body){if(Element.getStyle(b,"position")=="absolute"){break}}}while(b=b.offsetParent);b=d;do{if(!window.opera||b.tagName=="BODY"){a-=b.scrollTop||0;c-=b.scrollLeft||0}}while(b=b.parentNode);return[c,a]},clone:function(c,e){var a=Object.extend({setLeft:true,setTop:true,setWidth:true,setHeight:true,offsetTop:0,offsetLeft:0},arguments[2]||{});c=$(c);var d=Position.page(c);e=$(e);var f=[0,0];var b=null;if(Element.getStyle(e,"position")=="absolute"){b=Position.offsetParent(e);f=Position.page(b)}if(b==document.body){f[0]-=document.body.offsetLeft;f[1]-=document.body.offsetTop}if(a.setLeft){e.style.left=(d[0]-f[0]+a.offsetLeft)+"px"}if(a.setTop){e.style.top=(d[1]-f[1]+a.offsetTop)+"px"}if(a.setWidth){e.style.width=c.offsetWidth+"px"}if(a.setHeight){e.style.height=c.offsetHeight+"px"}},absolutize:function(b){b=$(b);if(b.style.position=="absolute"){return}Position.prepare();var d=Position.positionedOffset(b);var f=d[1];var e=d[0];var c=b.clientWidth;var a=b.clientHeight;b._originalLeft=e-parseFloat(b.style.left||0);b._originalTop=f-parseFloat(b.style.top||0);b._originalWidth=b.style.width;b._originalHeight=b.style.height;b.style.position="absolute";b.style.top=f+"px";b.style.left=e+"px";b.style.width=c+"px";b.style.height=a+"px"},relativize:function(b){b=$(b);if(b.style.position=="relative"){return}Position.prepare();if(b._originalLeft==undefined){var d=Position.positionedOffset(b);var f=d[1];var e=d[0];var c=b.clientWidth;var a=b.clientHeight;b._originalLeft=e-parseFloat(b.style.left||0);b._originalTop=f-parseFloat(b.style.top||0);b._originalWidth=b.style.width;b._originalHeight=b.style.height}b.style.position="relative";var f=parseFloat(b.style.top||0)-(b._originalTop||0);var e=parseFloat(b.style.left||0)-(b._originalLeft||0);b.style.top=f+"px";b.style.left=e+"px";b.style.height=b._originalHeight;b.style.width=b._originalWidth}};if(/Konqueror|Safari|KHTML/.test(navigator.userAgent)){Position.cumulativeOffset=function(b){var a=0,c=0;do{a+=b.offsetTop||0;c+=b.offsetLeft||0;if(b.offsetParent==document.body){if(Element.getStyle(b,"position")=="absolute"){break}}b=b.offsetParent}while(b);return[c,a]}}Element.addMethods();var RubicusFrontend=Class.create();RubicusFrontend.prototype={pollHandler:null,faqs:null,photoDetailHandler:null,discussionServer:null,observers:new Array(),absoluteHeaderBlockIds:new Array(),eshopHandler:null,location:null,initialize:function(){this.observers=new Array();this.pollHandler=new RubicusFrontendPoll();this.faqs=new Array();this.photoDetailHandler=new RubicusFrontendPhotogallery();this.preloader=new RubicusFrontendPreloader();this.eshopHandler=new RubicusFrontendEshop();this.location={href:document.location.href,hash:document.location.hash,host:document.location.host,hostname:document.location.hostname,pathname:document.location.pathname,port:document.location.port,protocol:document.location.protocol,search:document.location.search,assign:function(a){},replace:function(a){},reload:function(){}};Event.observe(window,"load",this.initOnLoad.bind(this))},initOnLoad:function(){this.photoDetailHandler.onload();this.preloader.loadFiles();this.emailWrap();this.focusElements();this.prepareCopyPaste()},addObserver:function(a){this.removeObserver(a);this.observers.push(a)},removeObserver:function(a){this.observers=this.observers.reject(function(b){return b==a})},notify:function(a,b){var c=false;this.observers.each(function(f){if(f[a]){try{c=f[a](a,b)}catch(d){Rubicus.alert("Error> RubicusFrontend::notify: "+a)}}});return c},focusElements:function(){var a=$("postUserName");if(a&&"postUserNameInput"!=a.id){if(!a.value){$("postUserName").focus()}else{$("postPasswd").focus()}}},isAdminMode:function(){var a=document.location.href;if(a.indexOf(document.location.protocol+"//cms.")>-1){return true}else{return false}},addAbsoluteHeaderBlockId:function(a){this.absoluteHeaderBlockIds.push(a)},getAbsoluteHeaderBlockList:function(){return this.absoluteHeaderBlockIds},hasBlockAbsoluteHeader:function(a){return(this.absoluteHeaderBlockIds.indexOf(a)>=0)},pollVote:function(c,b,d,a){this.pollHandler.init();this.pollHandler.setElement(c);this.pollHandler.setLink(b);this.pollHandler.setTempArea(d);this.pollHandler.setTempAreaCode(a);this.pollHandler.vote(b)},faqInit:function(d,b){var c=document.getElementsByClassName(d);if(c){for(var a=0;a<c.length;a++){this.addFaqBlock(c[a],b);this.onResize(c[a])}}},addFaqBlock:function(b,a){var b=$(b);if(b){b.RFFAQ=new RubicusFrontendFaq(b,a)}},showFaqItem:function(b,a){var b=$(b);if(b.RFFAQ){b.RFFAQ.showItem(a);this.onResize(b)}},onResize:function(d){if(this.isAdminMode()){var b=Rubicus.util.getElementParentWithClassName(d,"rbcContentBlock");if(b){var a=b.id;Rubicus.util.setBlockRowMenu(a);var c=Rubicus.cZones.getBlockZone(a);if(c){Rubicus.skin.setZoneBorderStyle(c.element)}}}RubicusFrontendIns.notify("onResize")},addPhotogalleryZone:function(b,c,a){return this.photoDetailHandler.addZone(b,c,a)},setPhotogalleryInit:function(b,a,c){this.photoDetailHandler.setWaitingArea(b);this.photoDetailHandler.setServerLink(a);this.photoDetailHandler.addGalleryType(c)},showPhotogalleryImage:function(a,b){if(b){this.photoDetailHandler.setPostData(b)}this.photoDetailHandler.showImageFromLinkWithHash(a)},setNextPhotogalleryImage:function(a){this.photoDetailHandler.setNextPhotogalleryImage(a)},setPreviousPhotogalleryImage:function(a){this.photoDetailHandler.setPreviousPhotogalleryImage(a)},showPhotogalleryDetailPhoto:function(a){this.photoDetailHandler.showImageFromLink(a)},setDiscussionServer:function(a){this.discussionServer=a},getDiscussionServer:function(){return this.discussionServer},sendDiscussionForm:function(c,a){if(!this.isPhotoDetail()){a.submit(true);return true}var b=new RubicusFrontendDiscussion();b.setDiscussionElement(c);b.setFormElement(a);b.setServerLink(this.getDiscussionServer());b.sendForm();a.hide()},isPhotoDetail:function(){if(this.photoDetailHandler&&this.photoDetailHandler.masterZone){return true}else{return false}},addFileToPreload:function(a){this.preloader.addFile(a)},startSlideshow:function(){this.photoDetailHandler.startSlideshow();this.notify("onStartSlideshow")},stopSlideshow:function(){this.photoDetailHandler.stopSlideshow();this.notify("onStopSlideshow")},isSlideshowMode:function(){return this.photoDetailHandler.isSlideshowMode()},isPhotogalleryAjaxMode:function(){if(this.photoDetailHandler.getPhotoIdentifier()){return true}else{return false}},setSlideshowInterval:function(a){return this.photoDetailHandler.setSlideshowInterval(a)},startSlideshowInterval:function(){return this.photoDetailHandler.setNextTimeout()},emailWrap:function(){var f=$("rbcContactEmail");var d=8;if(f){emailText=f.innerHTML;emailLength=emailText.length;if(emailLength<d||emailText.search("<WBR>")>-1||emailText.search("<wbr>")>-1){return}cycle=parseInt(emailLength/d,10);var c="";var a="";for(var b=0;b<cycle;b++){var e=(b?(b*d):0);c+=a+emailText.substr(e,d);a="<wbr>"}if(e<emailLength){c+=a+emailText.substr((b*d))}f.innerHTML=c}},signatureCorrection:function(){try{var a=document.getElementsByClassName("rbcSignatureText");if(a&&a[0]){var c=a[0].innerHTML;var d=a[0].getElementsByTagName("a");if(!d||!d[0]||!d[0].href){return false}else{var b=d[0].href}c='<a href="'+b+'" target="_blank">'+c.stripTags()+"</a>";a[0].innerHTML=c;return true}}catch(f){return false}},getPageSize:function(){var e,a;if(window.innerHeight&&window.scrollMaxY){e=document.body.scrollWidth;a=window.innerHeight+window.scrollMaxY}else{if(document.body.scrollHeight>document.body.offsetHeight){e=document.body.scrollWidth;a=document.body.scrollHeight}else{e=document.body.offsetWidth;a=document.body.offsetHeight}}var c,f;if(self.innerHeight){c=self.innerWidth;f=self.innerHeight}else{if(document.documentElement&&document.documentElement.clientHeight){c=document.documentElement.clientWidth;f=document.documentElement.clientHeight}else{if(document.body){c=document.body.clientWidth;f=document.body.clientHeight}}}var d,b;if(a<f){d=f}else{d=a}if(e<c){b=c}else{b=e}return{pageWidth:b,pageHeight:d,windowWidth:c,windowHeight:f}},eshopFormInit:function(){this.eshopHandler.createStyle();this.eshopHandler.prepareObservers()},eshopNotRegisteredInit:function(){this.eshopHandler.createNotRegisteredStyle();this.eshopHandler.prepareNotRegistered()},prepareCopyPaste:function(){if(this.isAdminMode()||RS_CFG.systemName!="Webnode"){return}Event.observe(document.body,"copy",this.copyPaste.bind(this))},copyProcessing:false,copyLink:null,copyPaste:function(a){if(this.copyProcessing){return false}this.copyProcessing=true;var i=0;var d=this.trim(window.getSelection?window.getSelection().toString():document.selection.createRange().text);if(d.split(/\s+/i).length<i){return}var h=document.location.href;var n="?utm_source=copy&utm_medium=paste&utm_campaign=copypaste&utm_content="+encodeURIComponent(h);var k="<br/>"+RS_CFG.labels["copyPasteSource"]+' <a href="'+h+n+'">'+h+"</a>";if(this.copyLink){k+="<br/>"+RS_CFG.labels["copyPasteBackLink"]+' <a href="'+this.copyLink+"/"+n+'">'+this.copyLink+"</a>"}var b=document.createElement("div");b.style.color="#000000";b.style.backgroundColor="transparent";b.style.textAlign="left";b.style.textDecoration="none";b.style.border="none";if(window.getSelection){var j=window.getSelection();if(j.setBaseAndExtent){var g=j.getRangeAt(0);var f=document.createElement("span");f.innerHTML="<br/>"+k;b.appendChild(g.cloneContents());b.appendChild(f);this.removeScripts(b);b.style.width=0.1;b.style.height=0.1;b.style.position="absolute";b.style.top="-10000px";b.style.left="-10000px";document.body.insertBefore(b,document.body.firstChild);j.selectAllChildren(b);setTimeout(function(){b.parentNode.removeChild(b);j.setBaseAndExtent(g.startContainer,g.startOffset,g.endContainer,g.endOffset);this.copyProcessing=false}.bind(this),0)}else{var m=document.createElement("div");document.body.appendChild(m);b.innerHTML=k;m.appendChild(b);var g=document.createRange();g.selectNode(b);j.addRange(g);setTimeout(function(){m.parentNode.removeChild(m);this.copyProcessing=false}.bind(this))}}else{if(document.selection&&document.selection.createRange){var e=document.documentElement.scrollLeft||document.body.scrollLeft;var c=document.documentElement.scrollTop||document.body.scrollTop;var m=document.createElement("div");m.style.overflow="hidden";m.style.position="absolute";m.style.left=parseInt(e+20)+"px";m.style.top=parseInt(c+20)+"px";m.style.width="1px";m.style.height="1px";document.body.insertBefore(m,document.body.firstChild);var g=document.selection.createRange();b.innerHTML=g.htmlText+"<br/>"+k;this.removeScripts(b);m.appendChild(b);var l=document.body.createTextRange();l.moveToElementText(b);l.select();setTimeout(function(){document.body.removeChild(m);if(g.text!=""){g.select();document.documentElement.scrollLeft=e;document.body.scrollLeft=e;document.documentElement.scrollTop=c;document.body.scrollTop=c}this.copyProcessing=false}.bind(this),0)}}return true},trim:function(a){return a.replace(/^\s+|\s+$/g,"")},removeScripts:function(d){var a=d.getElementsByTagName("script");for(var c=0;c<a.length;c++){var b=a[c];b.parentNode.removeChild(b)}}};RubicusFrontendObserver=Class.create();RubicusFrontendObserver.prototype={initialize:function(){},onContentChange:function(){},onStartSlideshow:function(){},onStopSlideshow:function(){},onShowImage:function(){}};RubicusFrontendPoll=Class.create();RubicusFrontendPoll.prototype={element:false,link:false,tempElement:false,tempElementCode:false,initialize:function(){},init:function(){this.element=false;this.link=false},setElement:function(a){a=$(a);if(a){this.element=a}},setLink:function(a){this.link=a+"&ajax_mode=1"},setTempArea:function(a){this.tempElement=$(a)},setTempAreaCode:function(a){this.tempElementCode=a},vote:function(){if(this.link&&this.element){this.showTempContent();new Ajax.Request(this.link,{method:"get",onSuccess:this.onSuccess.bind(this)})}},showTempContent:function(){if(this.tempElement){var b=this.tempElement}else{var b=this.element}if(this.tempElementCode){var a=this.tempElementCode}else{var a=false}if(a){b.style.height=b.offsetHeight+"px";b.innerHTML=a}},onSuccess:function(a){this.element.replace(a.responseText)}};RubicusFrontendFaq=Class.create();RubicusFrontendFaq.prototype={topElement:false,answersCssClass:false,activeItem:false,initialize:function(b,a){this.topElement=$(b);this.answersCssClass=a;this.initBlock()},initBlock:function(){var b=this.topElement.getElementsByClassName(this.answersCssClass);if(b.length){for(var a=0;a<b.length;a++){b[a].hide()}}},showItem:function(a){a=$(a);a.toggle()}};RubicusFrontendDiscussion=Class.create();RubicusFrontendDiscussion.prototype={discussionElement:null,formElement:null,serverLink:null,initialize:function(){this.discussionBlock=null;this.formElement=null},setDiscussionElement:function(a){this.discussionElement=$(a)},setFormElement:function(a){this.formElement=$(a)},setServerLink:function(a){this.serverLink=a},sendForm:function(){RubicusFrontendIns.showPhotogalleryImage(document.location.href,"&"+this.getSerializeFormData())},getSerializeFormData:function(){var a=Form.serialize(this.formElement);return a}};RubicusFrontendPreloader=Class.create();RubicusFrontendPreloader.prototype={files:null,completeFiles:null,initialize:function(){this.files=new Array();this.completeFiles=new Array()},addFile:function(a){this.files.push(a)},loadFiles:function(){for(var b=0;b<this.files.length;b++){var a=new Image();a.src=this.files[b];this.completeFiles.push(a)}}};RubicusFrontendEshop=Class.create();RubicusFrontendEshop.prototype={initialize:function(){},createStyle:function(){var b=document.createElement("style");var a=".startup { display: none; }";b.setAttribute("type","text/css");if(b.styleSheet){b.styleSheet.cssText=a}else{b.appendChild(document.createTextNode(a))}$("eshopOrderStep1Title").parentNode.insertBefore(b,$("eshopOrderStep1Title"))},createNotRegisteredStyle:function(){var b=document.createElement("style");var a="#eshopFormNewUser { display: none; }";b.setAttribute("id","eshopFormNewUserHidden");b.setAttribute("type","text/css");if(b.styleSheet){b.styleSheet.cssText=a}else{b.appendChild(document.createTextNode(a))}$("eshopRadioRegisteredUser").parentNode.insertBefore(b,$("eshopRadioRegisteredUser"))},observerFormToggle:function(b){var a=Event.element(b);if(a.id=="eshopRadioRegisteredUser"){$("eshopFormRegisteredUser").show();$("eshopFormNewUser").hide()}else{$("eshopFormRegisteredUser").hide();$("eshopFormNewUser").show()}a.blur();RubicusFrontendIns.onResize(a)},observerFormCompany:function(c){var b=$("eshopFormNewUser").getElementsByClassName("eshopCompanyField");for(var a=0;a<b.length;a++){if($("eshopCustomerIsCompany").checked==true){b[a].show()}else{b[a].hide()}}RubicusFrontendIns.onResize($("eshopFormNewUser"))},observerOnLoad:function(a){Event.observe($("eshopCustomerDeliveryIsBilling"),"click",function(b){$("eshopCustomerDeliveryBlock").toggle()});if($("eshopCustomerDeliveryIsBilling").checked==false){$("eshopCustomerDeliveryBlock").hide()}$("eshopCustomerDeliveryBlock").removeClassName("startup");Event.observe($("eshopCustomerIsPerson"),"click",this.observerFormCompany.bind(this));Event.observe($("eshopCustomerIsCompany"),"click",this.observerFormCompany.bind(this));$("eshopFormNewUser").removeClassName("startup");this.observerFormCompany()},observerNotRegisteredOnLoad:function(a){Event.observe($("eshopRadioNewUser"),"click",this.observerFormToggle.bind(this));Event.observe($("eshopRadioRegisteredUser"),"click",this.observerFormToggle.bind(this));if($("eshopRadioRegisteredUser").checked==true){$("eshopFormNewUser").hide()}else{$("eshopFormRegisteredUser").hide()}$("eshopFormNewUserHidden").remove()},prepareNotRegistered:function(){Event.observe(window,"load",this.observerNotRegisteredOnLoad.bind(this))},prepareObservers:function(){Event.observe(window,"load",this.observerOnLoad.bind(this))}};RubicusFrontendPhotogallery=Class.create();Object.extend(RubicusFrontendPhotogallery.prototype,{zones:new Array(),zoneMap:new Array(),waitingArea:"",masterZone:null,serverLink:null,postData:"",previousPhotoLink:"",nextPhotoLink:"",slideshowFirstTimeout:500,slideshowTimeout:4000,slideshowState:false,slideshowHandler:null,data:new Array(),galleryTypes:new Array(),isLbInit:false,createLbCss:true,lbElements:new Array(),lbPreviewCount:0,lbPreviewDim:69,lbMinDim:400,adminMode:false,refreshFm:false,refreshFileManager:null,lightboxZIndex:0,settingsChanged:false,memLink:null,isBackendLightBox:false,initialize:function(){this.zones=new Array();this.masterZone=null;this.waitingArea=null;this.serverLink=null;this.postData="";this.adminMode=(-1<document.location.href.indexOf("cms."))},addZone:function(b,d,a){var c=$(b);c._identifier=d;c._isMaster=(a?true:false);this.zones.push(c);this.zoneMap[c._identifier]=this.zones[this.zones.length-1];if(c._isMaster){this.masterZone=this.zones[this.zones.length-1];$("rbcFrontendRedirectArea").hide();this.showTempArea()}},onload:function(){this.showImage(this.getPhotoIdentifier())},showTempArea:function(){if(this.masterZone){this.masterZone.innerHTML=this.waitingArea}},setWaitingArea:function(a){this.waitingArea=a},setServerLink:function(a){this.serverLink=a},addGalleryType:function(a){if("undefined"==typeof a){return}if(a[0]){this.galleryTypes[a[0]]=a[1];if(Prototype.Browser.IE&&/MSIE 6\.0/.test(navigator.userAgent)){this.galleryTypes[a[0]]="CLASSIC"}this.data[a[0]]=new Array();this.data[a[0]]["totalItems"]=a[2]}this.data.labels=new Array();this.data.labels["lbCounterFrom"]=a[3];this.data.labels["lbClose"]=a[4];this.data.labels["lbPrev"]=a[5];this.data.labels["lbNext"]=a[6];this.data.labels["lbPlay"]=a[7];this.data.labels["lbPause"]=a[8];if("undefined"!=typeof a[9]){this.blockId=a[9]}},setPostData:function(a){if(!a){a=""}this.postData=a},getPhotoIdentifier:function(){var a=document.location.hash;if(a&&a.indexOf("#")==0){a=a.substr(1)}return a},showImage:function(c,g,e){if(!c||"!"==c){return}if(true==e){this.isBackendLightBox=true}if(true==this.adminMode&&true==this.settingsChanged){delete this.galleryTypes[g];this.settingsChanged=false}var h=null;if("undefined"!=typeof g&&this._getGalleryType(g)){h=this._getGalleryType(g)}if("LIGHTBOX"==h){this._lightBoxInit()}var a=this._getItemData(c);if(null!=a&&true==this.adminMode){a=null}if(null!=a){this._lightBoxShow(a,false);var b=this.data[a.gallery].order.indexOf(a.identifier);if(0<b){for(var d=b-1;d>=0;d--){this.data.detailOrder+=1;this._lightBoxAddImage(this.data.items[this.data[a.gallery].order[d]],"prev",false)}}if(this.data[a.gallery].totalItems-1>b){for(var d=b+1;d<this.data[a.gallery].totalItems;d++){this._lightBoxAddImage(this.data.items[this.data[a.gallery].order[d]],"next",false)}}return}var f="mode=photogallery&identifier="+c+(null!=h?"&type="+h:"")+(true==this.adminMode?"&admin=1":"")+"&zones="+this.getSerializeZones()+this.postData;new Ajax.Request(this.serverLink,{method:"post",postBody:f,onSuccess:this.onSuccess.bind(this)});this.postData=""},getSerializeZones:function(){var b="";var c="";for(var a=0;a<this.zones.length;a++){b+=c+this.zones[a]._identifier;c=";"}return b},showImageFromLinkWithHash:function(b){this.setWaitingArea();var a=b.indexOf("#");if(a==-1){document.location.href=b;return true}var c=b.substr(a+1);document.location.hash="#"+c;this.showImage(c)},showImageFromLink:function(d){this.memLink=d;var c=d.match(/(.*\/album\/([^\/]+)\/)([^\/]+)\//);if(!c){return false}var b=c[1];var a=c[2];var e=c[3];if(true==this.adminMode&&true==this.settingsChanged){delete this.galleryTypes[a];this.settingsChanged=false;this.showImage(e,a);return}if("undefined"==typeof this.galleryTypes[a]||""==this.galleryTypes[a]||"CLASSIC"==this.galleryTypes[a]){if(true==this.adminMode){document.location.href=d;return}document.location.href=b+"#"+e;return}document.location.hash=e;this.showImage(e,a);return false},onSuccess:function(transport){if("application/x-javascript"==transport.getResponseHeader("Content-type")){var o=eval("("+transport.responseText+")");if("detail"==o.type){if("CLASSIC"==o.gallery&&false==this.isBackendLightBox){document.location.hash="!";document.location.href=this.memLink;return}if(null==o.data){return}if(false==this.isLbInit){this._lightBoxInit()}this.data.detail=o.data;this.data.detailOrder=0;if("undefined"!=typeof this.data[o.data.gallery]&&"undefined"!=typeof this.data[o.data.gallery].order){delete this.data[o.data.gallery].order;this.data[o.data.gallery].totalItems=o.data.order+1}this._saveData(o.data,null,o.gallery,o.type);if("undefined"==typeof this.galleryTypes[o.data.gallery]){this.galleryTypes[o.data.gallery]=o.gallery}if("LIGHTBOX"==this._getGalleryType(o.data.gallery)){this._lightBoxShow(o.data,false)}this._loadStream(o.data.prev,o.data.next)}else{if("update"==o.type){o.data.link+=Rubicus.util.getFileHash();o.data.preview.link+=Rubicus.util.getFileHash();this.data.detail=o.data;this._saveData(o.data,null,null,o.type);if("LIGHTBOX"==this._getGalleryType(o.data.gallery)){this._lightBoxShow(o.data,true);if(true==this.adminMode){Rubicus.util.reloadImage(o.data.link)}}}else{var prevIdentifier=nextIdentifier="";if(null!=o.prev){var prevLength=o.prev.length;for(var p=0;p<prevLength;p++){this._saveData(o.prev[p],"prev");this.data.detailOrder+=1;if("LIGHTBOX"==this._getGalleryType(o.prev[p].gallery)){this._lightBoxAddImage(o.prev[p],"prev")}prevIdentifier=o.prev[p].prev}}if(null!=o.next){var nextLength=o.next.length;for(var n=0;n<nextLength;n++){this._saveData(o.next[n],"next");if("LIGHTBOX"==this._getGalleryType(o.next[n].gallery)){this._lightBoxAddImage(o.next[n],"next")}nextIdentifier=o.next[n].next}}this._loadStream(prevIdentifier,nextIdentifier)}}return}else{if(null!=transport.responseXML){var zones=transport.responseXML.getElementsByTagName("zone");for(var i=0;i<zones.length;i++){if(zones[i].firstChild&&zones[i].firstChild.nodeType==4){var value=zones[i].firstChild.nodeValue}else{var value=zones[i].text}if(!value){var value=""}this.zoneMap[zones[i].getAttribute("id")].innerHTML=value;value.evalScripts()}this.modifyDetailLinks();RubicusFrontendIns.onResize();RubicusFrontendIns.notify("onShowImage")}}},modifyDetailLinks:function(){var c=document.getElementsByTagName("a");for(var b=0;b<c.length;b++){var a=c[b].href;if(a&&a.match(/.*\/(products|news)\/[^\/]+\//)){c[b].onclick=function(e){var d=this.href+"?redirsuffix="+escape("#")+RubicusFrontendIns.photoDetailHandler.getPhotoIdentifier();this.href=d}}}},setNextPhotogalleryImage:function(a){this.nextPhotoLink=a},setPreviousPhotogalleryImage:function(a){this.previousPhotoLink=a},showNextPhoto:function(){if(this.nextPhotoLink){this.showImageFromLinkWithHash(this.nextPhotoLink)}},showPreviousPhoto:function(){if(this.previousPhotoLink){this.showImageFromLinkWithHash(this.previousPhotoLink)}},startSlideshow:function(){this.slideshowState=true;this.setNextTimeout(this.slideshowFirstTimeout)},stopSlideshow:function(){this.slideshowState=false;clearTimeout(this.slideshowHandler)},setNextTimeout:function(a){if(this.slideshowHandler){clearTimeout(this.slideshowHandler)}if(!this.nextPhotoLink){setTimeout(RubicusFrontendIns.stopSlideshow.bind(RubicusFrontendIns),20);return true}if(this.slideshowState){if(!a){var a=this.slideshowTimeout}this.slideshowHandler=setTimeout(this.checkSlideshow.bind(this),a)}},checkSlideshow:function(){if(this.slideshowState){this.showNextPhoto();this.setNextTimeout()}},isSlideshowMode:function(){return this.slideshowState},setSlideshowInterval:function(a){return this.photoDetailHandler.slideshowTimeout=a},_getGalleryType:function(a){if(true==this.isBackendLightBox){return"LIGHTBOX"}if("undefined"!=this.galleryTypes[a]){return this.galleryTypes[a]}return null},_getItemData:function(a){if("undefined"!=typeof this.data.items&&"undefined"!=typeof this.data.items[a]){return this.data.items[a]}return null},_lightBoxShow:function(a,b){this._lightBoxInit();this._lightBoxCorrectPlayArea();this._lightBoxShowMainPhoto(a,b);this._lightBoxAddImage(a,null,true);this._lightBoxCorrectStrip();this._lightBoxCorrectArrow()},_lightBoxShowMainPhoto:function(d,c){var g=null,a=null;if(null!=this.data.detail){g=$("wndLbMP"+this.data.detail.identifier);a=$("wndLbP"+this.data.detail.identifier)}if(null!=g&&d.identifier==this.data.detail.identifier&&false==c){return}if(null!=g){g.parentNode.removeChild(g);Event.stopObserving(this.lbElements.mainImg,"click",this.lbnFx);if("undefined"!=typeof this.lbElements.desc||null!=this.lbElements.desc){this.lbElements.desc.parentNode.removeChild(this.lbElements.desc)}}if(null!=a){Element.removeClassName(a,"active");this.data.detailOrder=this.data[d.gallery].order.indexOf(d.identifier);if(true==c){var i=a.childNodes[0];var e=i.childNodes[0];var f=this.getPreviewDim(d);var b=f.width;var h=f.height;e.src=d.preview.link;e.width=b;e.height=h;e.style.left=0;e.style.top=0;if(b>i.offsetWidth){e.style.left=-(parseInt((b-i.offsetWidth)/2,10))+"px"}if(h>i.offsetHeight){e.style.top=-(parseInt((h-i.offsetHeight)/2,10))+"px"}}}this.lbElements.mainImg=document.createElement("img");this.lbElements.mainImg.id="wndLbMP"+d.identifier;this.lbElements.mainImg.src=d.link;this.lbElements.mainArea.appendChild(this.lbElements.mainImg);Event.observe(this.lbElements.mainImg,"click",this.lbnFx);if(true==this.adminMode){Rubicus.util.editLightBox.getTools(this,d);Rubicus.util.editLightBox.removeToolsMenu(this);Event.observe($("wndLbT"),"click",function(k){Rubicus.util.editLightBox._getToolsMenu(k)})}else{this.lbElements.desc=document.createElement("div");this.lbElements.desc.id="wndLbD";this.lbElements.desc.style.width=d.width+"px";this.lbElements.desc.innerHTML=d.desc;this.lbElements.mainArea.appendChild(this.lbElements.desc)}var j=$("wndLbP"+d.identifier);if(null!=j){Element.addClassName(j,"active")}document.location.hash=d.identifier;this.data.detail=d;this._lightBoxUpdateFrom();this._lightBoxCorrectMainPhoto()},_lightBoxUpdateFrom:function(){if("undefined"!=typeof this.lbElements.counter&&"undefined"!=typeof this.data.labels.lbCounterFrom){try{this.lbElements.counter.innerHTML=this.data.labels.lbCounterFrom.replace("{PHOTO}",this.data.detail.order+1).replace("{TOTAL}",this.data[this.data.detail.gallery].totalItems)}catch(a){}}},_lightBoxAddImage:function(f,h,c){if(null!=$("wndLbP"+f.identifier)){return}this.lbPreviewCount++;this.lbElements.strip.style.width=(this.lbPreviewCount*this.lbPreviewDim)+"px";var i=document.createElement("div");i.id="wndLbP"+f.identifier;i.className="wndLbP"+(true==c?" active":"");var k=document.createElement("div");k.className="wndLbPC";i.appendChild(k);var e=this;Event.observe(i,"click",function(l){e._lightBoxShow(f,false);if(null!=e.slideshowHandler){clearTimeout(e.slideshowHandler);e.slideshowHandler=setTimeout(e._lightBoxSlideshowHandler.bind(e),e.slideshowTimeout)}Event.stop(l)});var g=this.getPreviewDim(f);var b=g.width;var j=g.height;var d=document.createElement("img");d.src=f.preview.link;d.width=b;d.height=j;k.appendChild(d);var a=null;if("prev"==h){a=$("wndLbP"+f.next);if(null!=a){this.lbElements.strip.insertBefore(i,a)}}else{this.lbElements.strip.appendChild(i)}if(b>k.offsetWidth){d.style.left=-(parseInt((b-k.offsetWidth)/2,10))+"px"}if(j>k.offsetHeight){d.style.top=-(parseInt((j-k.offsetHeight)/2,10))+"px"}this._lightBoxCorrectStrip()},getPreviewDim:function(c){var a=c.preview.width;var b=c.preview.height;if(a<(this.lbPreviewDim-4)){a=(this.lbPreviewDim-4);b=parseInt(b*(a/c.preview.width),10)}else{if(b<(this.lbPreviewDim-4)){b=(this.lbPreviewDim-4);a=parseInt(a*(b/c.preview.height),10)}}return{width:a,height:b}},_lightBoxCorrectMainPhoto:function(){if("undefined"==typeof this.data.detail||null==this.data.detail){return}var d=(this.lbElements.base.offsetWidth-14);var b=maxHeight=(this.lbElements.stripArea.offsetTop-this.lbElements.counter.offsetHeight-14);this.lbElements.mainArea.style.width=d+"px";this.lbElements.mainArea.style.height=maxHeight+"px";var c=this.data.detail.width;var a=this.data.detail.height;if("undefined"!=typeof this.lbElements.desc||null!=this.lbElements.desc){maxHeight-=this.lbElements.desc.offsetHeight}if(maxHeight<this.lbMinDim||d<this.lbMinDim){return}if(this.data.detail.width>d){c=d;a=parseInt(a*(c/this.data.detail.width),10);if(a>maxHeight){a=maxHeight;c=parseInt(this.data.detail.width*(a/this.data.detail.height),10)}}else{if(this.data.detail.height>maxHeight){a=maxHeight;c=parseInt(c*(a/this.data.detail.height),10);if(c>d){c=d;a=parseInt(this.data.detail.height*(c/this.data.detail.width),10)}}}if("undefined"!=typeof this.lbElements.desc||null!=this.lbElements.desc){this.lbElements.desc.style.width=c+"px";maxHeight=b-this.lbElements.desc.offsetHeight}if(a>maxHeight){a=maxHeight;c=parseInt(this.data.detail.width*(a/this.data.detail.height),10);if("undefined"!=typeof this.lbElements.desc||null!=this.lbElements.desc){this.lbElements.desc.style.width=c+"px"}}if(null!=this.lbElements.mainImg){this.lbElements.mainImg.width=c;this.lbElements.mainImg.height=a;if(a<maxHeight){this.lbElements.mainImg.style.marginTop=parseInt((maxHeight/2)-(a/2),10)+"px"}else{this.lbElements.mainImg.style.marginTop=0}}if(true==this.adminMode){Rubicus.util.editLightBox.correctPhotoDescEdit()}},_lightBoxCorrectPlayArea:function(){var a=this.lbElements.playAreaPrev.offsetWidth;var b=this.lbElements.playAreaNext.offsetWidth;if(a>b){this.lbElements.playAreaNext.style.width=(a-33)+"px"}else{if(b>a){this.lbElements.playAreaNext.style.width=(b-33)+"px"}}this.lbElements.playArea.style.left=parseInt((this.lbElements.base.offsetWidth/2)-(this.lbElements.playArea.offsetWidth/2),10)+"px"},_lightBoxCorrectStrip:function(){var a=(this.lbElements.stripArea.offsetWidth/2)-(this.lbPreviewDim/2);if(this.data.detailOrder){a-=this.data.detailOrder*this.lbPreviewDim}this.lbElements.strip.style.left=a+"px"},_lightBoxCorrectArrow:function(){var c=this.lbElements.mainArea.offsetHeight;var b=this.lbElements.arrowPrev.offsetHeight;var a=parseInt((c/2)-(b/2),10);this.lbElements.arrowPrev.style.top=a+"px";this.lbElements.arrowNext.style.top=a+"px"},_lightBoxClose:function(a){if(true==this.adminMode){if(true==Rubicus.util.editLightBox.isEditDesc){Rubicus.util.editLightBox._saveDesc();return}if(null!=$("cropper_window")){return}if(true==this.adminMode&&true==this.refreshFm&&null!=this.refreshFileManager){this.refreshFileManager(true)}else{if(true==Rubicus.util.editLightBox.isChanged&&"undefined"!=typeof this.blockId){var b=new axRequestCollection();b.requests.push($(this.blockId)._getUsotCollection());Rubicus.usots.send(b);Rubicus.util.showPageActualizationWaitingWindow()}}}if(true==this.adminMode){if(0<Rubicus.util.editLightBox.memWindowZIndex){Windows.maxZIndex=Rubicus.util.editLightBox.memWindowZIndex}Rubicus.util.editLightBox.isInit=false}this.lbElements.base.parentNode.removeChild(this.lbElements.base);this.lbElements.overlay.parentNode.removeChild(this.lbElements.overlay);this._unsetEvents();this.isLbInit=false;this.lbPreviewCount=0;if(null!=this.data.detail&&"undefined"!=typeof this.data.detail.gallery){this.data[this.data.detail.gallery].loadedItems=0}this.data.detail=null;this.data.detailOrder=0;this.isBackendLightBox=false;clearTimeout(this.slideshowHandler);this.slideshowHandler=null;document.location.hash="!";if(false==this.adminMode){document.getElementsByTagName("html")[0].style.overflow="auto"}if("undefined"!=typeof a){Event.stop(a)}},_lightBoxCloseMouseover:function(a){switch(a.type){case"mouseover":Element.addClassName(this.lbElements.close,"active");break;case"mouseout":Element.removeClassName(this.lbElements.close,"active");break}},_lightBoxPrev:function(c){var d=this.data.detailOrder-1;if(0>=this.data.detailOrder){d=this.data[this.data.detail.gallery].totalItems-1}var b=this.data[this.data.detail.gallery].order[d];var a=this.data.items[b];if("undefined"!=typeof a){this._lightBoxShow(a,false)}if("undefined"!=typeof c){if(null!=this.slideshowHandler){clearTimeout(this.slideshowHandler);this.slideshowHandler=setTimeout(this._lightBoxSlideshowHandler.bind(this),this.slideshowTimeout)}Event.stop(c)}},_lightBoxNext:function(c){var b=this.data.detailOrder+1;if(this.data[this.data.detail.gallery].totalItems<=this.data.detailOrder+1){b=0}var d=this.data[this.data.detail.gallery].order[b];var a=this.data.items[d];if("undefined"!=typeof a){this._lightBoxShow(a,false)}if("undefined"!=typeof c){if(null!=this.slideshowHandler){clearTimeout(this.slideshowHandler);this.slideshowHandler=setTimeout(this._lightBoxSlideshowHandler.bind(this),this.slideshowTimeout)}Event.stop(c)}},_lightBoxStartStopSlideshow:function(b){var a=Event.element(b);if(true==Element.hasClassName(a,"pause")){clearTimeout(this.slideshowHandler);this.slideshowHandler=null;Element.removeClassName(a,"pause");a.title=this.data.labels.lbPlay;return}Element.addClassName(a,"pause");a.title=this.data.labels.lbPause;this.slideshowHandler=setTimeout(this._lightBoxSlideshowHandler.bind(this),this.slideshowFirstTimeout);Event.stop(b)},_lightBoxSlideshowHandler:function(){this._lightBoxNext();this.slideshowHandler=setTimeout(this._lightBoxSlideshowHandler.bind(this),this.slideshowTimeout)},_lightBoxEventHandler:function(a){switch(a.keyCode){case Event.KEY_ESC:this._lightBoxClose(a);break;case Event.KEY_LEFT:this._lightBoxPrev(a);Event.stop(a);break;case Event.KEY_RIGHT:this._lightBoxNext(a);Event.stop(a);break}switch(Event.wheel(a)){case 1:this._lightBoxPrev(a);Event.stop(a);break;case -1:this._lightBoxNext(a);Event.stop(a);break}},_lightBoxResizeHandler:function(a){try{if(true==this.adminMode){Rubicus.util.editLightBox.removeToolsMenu(this);Rubicus.util.editLightBox.correctPhotoDescEdit()}this._lightBoxCorrectPlayArea();this._lightBoxCorrectStrip();this._lightBoxCorrectMainPhoto();this._lightBoxCorrectArrow()}catch(a){}},_lightBoxInit:function(){if(true==this.isLbInit){return}this.lbElements.overlay=document.createElement("div");this.lbElements.overlay.id="wndLbO";document.body.appendChild(this.lbElements.overlay);this.lbElements.base=document.createElement("div");this.lbElements.base.id="wndLbB";document.body.appendChild(this.lbElements.base);this.lbElements.mainArea=document.createElement("div");this.lbElements.mainArea.id="wndLbM";this.lbElements.base.appendChild(this.lbElements.mainArea);this.lbElements.arrowPrev=document.createElement("a");this.lbElements.arrowPrev.id="wndLbAp";this.lbElements.mainArea.appendChild(this.lbElements.arrowPrev);this.lbElements.arrowNext=document.createElement("a");this.lbElements.arrowNext.id="wndLbAn";this.lbElements.mainArea.appendChild(this.lbElements.arrowNext);this.lbElements.counter=document.createElement("div");this.lbElements.counter.id="wndLbSC";this.lbElements.base.appendChild(this.lbElements.counter);this.lbElements.stripArea=document.createElement("div");this.lbElements.stripArea.id="wndLbSA";this.lbElements.base.appendChild(this.lbElements.stripArea);this.lbElements.strip=document.createElement("div");this.lbElements.strip.id="wndLbS";this.lbElements.stripArea.appendChild(this.lbElements.strip);this.lbElements.close=document.createElement("div");this.lbElements.close.id="wndLbC";this.lbElements.base.appendChild(this.lbElements.close);this.lbElements.closeText=document.createElement("div");this.lbElements.closeText.id="wndLbCt";if("undefined"!=typeof this.data.labels.lbClose){this.lbElements.closeText.appendChild(document.createTextNode(this.data.labels.lbClose))}this.lbElements.close.appendChild(this.lbElements.closeText);this.lbElements.close.appendChild(document.createElement("i"));this.lbElements.playArea=document.createElement("div");this.lbElements.playArea.id="wndLbPa";this.lbElements.base.appendChild(this.lbElements.playArea);this.lbElements.playAreaPrev=document.createElement("a");this.lbElements.playAreaPrev.id="wndLbPaP";if("undefined"!=typeof this.data.labels.lbPrev){this.lbElements.playAreaPrev.appendChild(document.createTextNode(this.data.labels.lbPrev));this.lbElements.playAreaPrev.onselectstart=function(){return false}}this.lbElements.playArea.appendChild(this.lbElements.playAreaPrev);this.lbElements.playAreaPlay=document.createElement("a");this.lbElements.playAreaPlay.id="wndLbPaPl";if("undefined"!=typeof this.data.labels.lbPlay){this.lbElements.playAreaPlay.title=this.data.labels.lbPlay}this.lbElements.playArea.appendChild(this.lbElements.playAreaPlay);this.lbElements.playAreaNext=document.createElement("a");this.lbElements.playAreaNext.id="wndLbPaN";if("undefined"!=typeof this.data.labels.lbNext){this.lbElements.playAreaNext.appendChild(document.createTextNode(this.data.labels.lbNext));this.lbElements.playAreaNext.onselectstart=function(){return false}}this.lbElements.playArea.appendChild(this.lbElements.playAreaNext);this._setEvents();this.lightboxZIndex=(true==this.adminMode?200:2147483647);if(true==this.createLbCss){var a=document.createStyleSheet();a.addRule("#wndLbO","position:fixed;width:100%;height:100%;top:0;left:0;background:#000;opacity:.9;filter:alpha(opacity=90);z-index:"+this.lightboxZIndex+";");a.addRule("#wndLbB","position:fixed;min-width:"+this.lbMinDim+"px;width:100%;height:100%;min-height:"+this.lbMinDim+"px;top:0;left:0;font:12px sans-serif;z-index:"+(this.lightboxZIndex+5)+";");a.addRule("#wndLbB a","font:normal 12px sans-serif;color:#ccc !important;text-decoration:none !important;cursor:pointer !important;");a.addRule("#wndLbB a:hover","font:normal 12px sans-serif;color:#ccc !important;text-decoration:none !important;cursor:pointer !important;");a.addRule("#wndLbM","position:relative;margin:7px;text-align:center;overflow:hidden;");a.addRule("#wndLbD","position:relative;margin:0 auto;padding: 5px 0 0;text-align:center;color:#fff;font-size:14px;max-height:34px;min-width:350px;overflow:hidden;");a.addRule("#wndLbSC","position:relative;width:100%;text-align:center;color:#fff;");a.addRule("#wndLbSA","position:absolute;width:100%;height:74px;bottom:0;left:0;background:#000;");a.addRule("#wndLbS","position:absolute;top:3px;white-space:nowrap;");a.addRule(".wndLbP","float:left;position:relative;margin:1px 1px 0;padding:1px;overflow:hidden;cursor:pointer;");a.addRule(".wndLbPC","position:relative;width:65px;height:65px;margin:0;overflow:hidden;");a.addRule(".wndLbP img","position:relative;opacity:.5;filter:alpha(opacity=50)");a.addRule(".wndLbP.active","margin:0;border:1px solid #fff;");a.addRule(".wndLbP.active img","opacity:1;filter:alpha(opacity=100);");a.addRule("#wndLbAp","position:absolute;left:0;display:block;width:51px;height:128px;padding:61px 0 61px 49px;background:url("+RubicusStaticServers.getClientServer()+"skins/2011/frontend/img/iconPhotoGalleryArrows.png) 0 0 no-repeat;cursor:pointer;opacity:.5;filter:alpha(opacity=50);");a.addRule("#wndLbAn","position:absolute;right:0;display:block;width:51px;height:128px;padding:61px 0 61px 49px;background:url("+RubicusStaticServers.getClientServer()+"skins/2011/frontend/img/iconPhotoGalleryArrows.png) -100px 0 no-repeat;cursor:pointer;opacity:.5;filter:alpha(opacity=50);");a.addRule("#wndLbAp:hover","opacity:1;filter:alpha(opacity=100);");a.addRule("#wndLbAn:hover","opacity:1;filter:alpha(opacity=100);");a.addRule("#wndLbC","position:absolute;top:5px;right:5px;height:25px;background:url("+RubicusStaticServers.getClientServer()+"skins/2011/frontend/img/iconPhotoGalleryClose.png) right top no-repeat;color:#ccc;opacity:.7;filter:alpha(opacity=70);z-index:10;cursor:pointer;");a.addRule("#wndLbC.active","opacity:1;filter:alpha(opacity=100);");a.addRule("#wndLbCt","padding:4px 36px 0 9px;");a.addRule("#wndLbC i","position:absolute;top:0;left:-4px;display:block;width:4px;height:25px;background:url("+RubicusStaticServers.getClientServer()+"skins/2011/frontend/img/iconPhotoGalleryClose.png) 0 0 no-repeat;");a.addRule("#wndLbPa","position:absolute;top:5px;left:50%;height:25px;");a.addRule("#wndLbPaP","position:relative;float:left;height:21px;padding:4px 5px 0 28px;color:#ccc;background:url("+RubicusStaticServers.getClientServer()+"skins/2011/frontend/img/iconPhotoGalleryPlay.png) 0 0 no-repeat;opacity:.7;filter:alpha(opacity=70);cursor:pointer;text-decoration:none;-moz-user-select:none;-khtml-user-select:none;-webkit-user-select:none;user-select: none;");a.addRule("#wndLbPaP:hover","opacity:1;filter:alpha(opacity=100);");a.addRule("#wndLbPaPl","position:relative;float:left;height:25px;width:34px;background:url("+RubicusStaticServers.getClientServer()+"skins/2011/frontend/img/iconPhotoGalleryPlay.png) -233px 0 no-repeat;opacity:.7;filter:alpha(opacity=70);cursor:pointer;");a.addRule("#wndLbPaPl:hover","opacity:1;filter:alpha(opacity=100);");a.addRule("#wndLbPaPl.pause","background-position: -265px 0;");a.addRule("#wndLbPaN","position:relative;float:left;height:21px;padding:4px 28px 0 5px;color:#ccc;background:url("+RubicusStaticServers.getClientServer()+"skins/2011/frontend/img/iconPhotoGalleryPlay.png) right top no-repeat;opacity:.7;filter:alpha(opacity=70);cursor:pointer;text-decoration:none;-moz-user-select:none;-khtml-user-select:none;-webkit-user-select:none;user-select: none;");a.addRule("#wndLbPaN:hover","opacity:1;filter:alpha(opacity=100);");if(true==this.adminMode){Rubicus.util.editLightBox.getStyles(a)}this.createLbCss=false}if(true==this.adminMode){if(Windows.maxZIndex>this.lightboxZIndex){this.lightboxZIndex=Windows.maxZIndex+100;$("wndLbO").style.zIndex=this.lightboxZIndex;$("wndLbB").style.zIndex=this.lightboxZIndex+5}}document.getElementsByTagName("html")[0].style.overflow="hidden";this.isLbInit=true},_setEvents:function(){this.lbcFx=this._lightBoxClose.bindAsEventListener(this);this.lbmFx=this._lightBoxCloseMouseover.bindAsEventListener(this);this.lbeFx=this._lightBoxEventHandler.bindAsEventListener(this);this.lbrFx=this._lightBoxResizeHandler.bindAsEventListener(this);this.lbpFx=this._lightBoxPrev.bindAsEventListener(this);this.lbnFx=this._lightBoxNext.bindAsEventListener(this);this.lbsFx=this._lightBoxStartStopSlideshow.bindAsEventListener(this);Event.observe(this.lbElements.close,"click",this.lbcFx);Event.observe(this.lbElements.close,"mouseover",this.lbmFx);Event.observe(this.lbElements.close,"mouseout",this.lbmFx);Event.observe(document,"keydown",this.lbeFx);Event.observe(document,"mousewheel",this.lbeFx);Event.observe(document,"DOMMouseScroll",this.lbeFx);Event.observe(window,"resize",this.lbrFx);Event.observe(this.lbElements.arrowPrev,"click",this.lbpFx);Event.observe(this.lbElements.playAreaPrev,"click",this.lbpFx);Event.observe(this.lbElements.arrowNext,"click",this.lbnFx);Event.observe(this.lbElements.playAreaNext,"click",this.lbnFx);Event.observe(this.lbElements.playAreaPlay,"click",this.lbsFx);if(true==this.adminMode){this.lbctmFx=Rubicus.util.editLightBox.removeToolsMenu.bindAsEventListener(this,this);Event.observe(this.lbElements.base,"click",this.lbctmFx)}},_unsetEvents:function(){Event.stopObserving(this.lbElements.close,"click",this.lbcFx);Event.stopObserving(this.lbElements.close,"mouseover",this.lbmFx);Event.stopObserving(this.lbElements.close,"mouseout",this.lbmFx);Event.stopObserving(document,"keydown",this.lbeFx);Event.stopObserving(document,"mousewheel",this.lbeFx);Event.stopObserving(document,"DOMMouseScroll",this.lbeFx);Event.stopObserving(window,"resize",this.lbrFx);Event.stopObserving(this.lbElements.arrowPrev,"click",this.lbpFx);Event.stopObserving(this.lbElements.playAreaPrev,"click",this.lbpFx);Event.stopObserving(this.lbElements.arrowNext,"click",this.lbnFx);Event.stopObserving(this.lbElements.playAreaNext,"click",this.lbnFx);Event.stopObserving(this.lbElements.playAreaPlay,"click",this.lbsFx);if(true==this.adminMode){Event.stopObserving(this.lbElements.base,"click",this.lbctmFx)}},_loadStream:function(b,a){if(""==b&&""==a){return}var c="mode=photogallery&prev="+encodeURIComponent(b)+"&next="+encodeURIComponent(a)+(true==this.adminMode?"&admin=1":"")+"&stream=1";new Ajax.Request(this.serverLink,{method:"post",postBody:c,onSuccess:this.onSuccess.bind(this)})},_updateMainPhoto:function(a){var b="mode=photogallery&identifier="+this.data.detail.identifier+"&type="+this.galleryTypes[this.data.detail.gallery]+(true==this.adminMode?"&admin=1":"")+(false==a?"&update=1":"");if(true==a){this.data[this.data.detail.gallery].totalItems=0;this.data[this.data.detail.gallery].loadedItems=0}new Ajax.Request(this.serverLink,{method:"post",postBody:b,onSuccess:this.onSuccess.bind(this)});this.refreshFm=true},_saveData:function(c,a,d,b){if("undefined"==typeof this.data.items){this.data.items=new Array()}this.data.items[c.identifier]=c;if("undefined"==typeof this.data[c.gallery]){this.galleryTypes[c.gallery]=d;this.data[c.gallery]=new Array();this.data[c.gallery]["totalItems"]=0}if("undefined"==typeof this.data[c.gallery]["items"]){this.data[c.gallery]["items"]=new Array()}if("undefined"==typeof this.data[c.gallery]["order"]){this.data[c.gallery]["order"]=new Array()}this.data[c.gallery]["items"][c.identifier]=c.identifier;if(-1==this.data[c.gallery]["order"].indexOf(c.identifier)){if("prev"==a){this.data[c.gallery]["order"].unshift(c.identifier)}else{this.data[c.gallery]["order"].push(c.identifier)}}if("undefined"==typeof this.data[c.gallery]["loadedItems"]){this.data[c.gallery]["loadedItems"]=0}if("update"!=b){this.data[c.gallery].loadedItems++}if(this.data[c.gallery].loadedItems>this.data[c.gallery].totalItems){this.data[c.gallery].totalItems=this.data[c.gallery].loadedItems;this._lightBoxUpdateFrom()}}});if("undefined"===typeof document.createStyleSheet){document.createStyleSheet=(function(){function b(c){var e=document.createElement("style");e.type="text/css";document.getElementsByTagName("head")[0].appendChild(e);var d=document.styleSheets[document.styleSheets.length-1];if(typeof d.addRule==="undefined"){d.addRule=a}if(typeof d.removeRule==="undefined"){d.removeRule=d.deleteRule}return d}function a(e,d,c){if(typeof c==="undefined"){c=this.cssRules.length}this.insertRule(e+" {"+d+"}",c)}return b})()}Object.extend(Event,{wheel:function(a){var b=0;if(!a){a=window.event}if(a.wheelDelta){b=a.wheelDelta/120;if(window.opera){b=-b}}else{if(a.detail){b=-a.detail/3}}return Math.round(b)}});var RubicusFrontendIns=new RubicusFrontend();var RubicusContactMailObserver=Class.create();Object.extend(RubicusContactMailObserver.prototype,RubicusFrontendObserver.prototype);Object.extend(RubicusContactMailObserver.prototype,{onContentChange:function(){RubicusFrontendIns.emailWrap()}});RubicusFrontendIns.addObserver(new RubicusContactMailObserver());var RubicusStaticServers={index:0,servers:new Array(),skin:"default",fileToServerMap:new Array(),initialize:function(){this.index=0;this.servers=RS_CFG.staticServers;if(RS_CFG.skin){this.skin=RS_CFG.skin}else{this.skin="default"}},getServer:function(){if(!this.servers||!this.servers.length){return""}var a=(this.index++)%this.servers.length;return this.servers[a]},getClientServer:function(){return this.getServer()+"_system/client/"},getSkinServer:function(b,a){if(b){if(!this.fileToServerMap[b]){if(a&&this.fileToServerMap.cssFileServer){this.fileToServerMap[b]=this.fileToServerMap.cssFileServer}else{this.fileToServerMap[b]=this.getClientServer()+"skins/"+this.skin+"/"}}return this.fileToServerMap[b]}else{return this.getClientServer()+"skins/"+this.skin+"/"}},setCssSkinServer:function(a){this.fileToServerMap.cssFileServer=a},resetIndex:function(){this.index=0}};RubicusStaticServers.initialize();var RubicusBasicTools={createAssocArray:function(c){var a=new Array();for(var b=0;b<c.length;b++){a[c[b][0]]=c[b][1]}return a}};
