﻿
/*
 * Rubicus Team 2008
 */

var Prototype={Version:'1.5.0_rc1',Browser:{IE:!!(window.attachEvent&&!window.opera),Opera:!!window.opera,WebKit:navigator.userAgent.indexOf('AppleWebKit/index.html')>-1,Gecko:navigator.userAgent.indexOf('Gecko')>-1&&navigator.userAgent.indexOf('KHTML')==-1},ScriptFragment:'<script[^>]*>([\\S\\s]*?)<\/script>',emptyFunction:function() {},K:function(x) {return x}};var Class={create:function() {return function() {this.initialize.apply(this,arguments);}}};var Abstract={};Object.extend=function(A,B) {for (var C in B) {A[C]=B[C];};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 (e) {if (e instanceof RangeError) return '...';throw e;}},keys:function(A) {var B=[];for (var C in A) B.push(C);return B;},values:function(A) {var B=[];for (var C in A) B.push(A[C]);return B;},clone:function(A) {return Object.extend({},A);}});Function.prototype.bind=function() {var B=this,args=$A(arguments),object=args.shift();return function() {return B.apply(object,args.concat($A(arguments)));}};Function.prototype.bindAsEventListener=function(B) {var C=this,args=$A(arguments),B=args.shift();return function(event) {return C.apply(B,[(event||window.event)].concat(args).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 A;for (var i=0;i<arguments.length;i++) {var B=arguments[i];try {A=B();break;} catch (e) {}};return A;}};var PeriodicalExecuter=Class.create();PeriodicalExecuter.prototype={initialize:function(A,B) {this.callback=A;this.frequency=B;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(A,B) {var C='',source=this,match;B=arguments.callee.prepareReplacement(B);while (source.length>0) {if (match=source.match(A)) {C+=source.slice(0,match.index);C+=(B(match)||'').toString();source=source.slice(match.index+match[0].length);} else {C+=source,source='';}};return C;},sub:function(A,B,C) {B=this.gsub.prepareReplacement(B);C=C===undefined?1:C;return this.gsub(A,function(match) {if (--C<0) return match[0];return B(match);});},scan:function(A,B) {this.gsub(A,B);return this;},truncate:function(A,B) {A=A||30;B=B===undefined?'...':B;return this.length>A?this.slice(0,A-B.length)+B: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 A=new RegExp(Prototype.ScriptFragment,'img');var B=new RegExp(Prototype.ScriptFragment,'im');return (this.match(A)||[]).map(function(scriptTag) {return (scriptTag.match(B)||['',''])[1];});},evalScripts:function() {return this.extractScripts().map(function(script) { return eval(script) });},escapeHTML:function() {var A=document.createElement('div');var B=document.createTextNode(this);A.appendChild(B);return A.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(params,pairString) {var B=pairString.split('=');var C=B[1]?decodeURIComponent(B[1]):undefined;params[decodeURIComponent(B[0])]=C;return params;});},toArray:function() {return this.split('');},camelize:function() {var A=this.split('-');if (A.length==1) return A[0];var B=this.indexOf('-')==0?A[0].charAt(0).toUpperCase()+A[0].substring(1):A[0];for (var i=1,len=A.length;i<len;i++) {var s=A[i];B+=s.charAt(0).toUpperCase()+s.substring(1);};return B;},inspect:function(A) {var B=this.replace(/\\/g,'\\\\');if (A) return '"'+B.replace(/"/g,'\\"')+'"';else return "'"+B.replace(/'/g,'\\\'') + "'";}});String.prototype.gsub.prepareReplacement=function(A) {if (typeof A=='function') return A;var B=new Template(A);return function(match) { return B.evaluate(match) };};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(match) {var B=match[1];if (B=='\\') return match[2];return B+(A[match[3]]||'').toString();});}};var $break={};var $continue={};var Enumerable={each:function(A) {var B=0;try {this._each(function(value) {try {A(value,B++);} catch (e) {if (e!=$continue) throw e;}});} catch (e) {if (e!=$break) throw e;}},all:function(A) {var B=true;this.each(function(value,index) {B=B&&!!(A||Prototype.K)(value,index);if (!B) throw $break;});return B;},any:function(A) {var B=false;this.each(function(value,index) {if (B=!!(A||Prototype.K)(value,index)) throw $break;});return B;},collect:function(A) {var B=[];this.each(function(value,index) {B.push(A(value,index));});return B;},detect:function (A) {var B;this.each(function(value,index) {if (A(value,index)) {B=value;throw $break;}});return B;},findAll:function(A) {var B=[];this.each(function(value,index) {if (A(value,index)) B.push(value);});return B;},grep:function(A,B) {var C=[];this.each(function(value,index) {var D=value.toString();if (D.match(A)) C.push((B||Prototype.K)(value,index));});return C;},include:function(A) {var B=false;this.each(function(value) {if (value==A) {B=true;throw $break;}});return B;},inject:function(A,B) {this.each(function(value,index) {A=B(A,value,index);});return A;},invoke:function(B) {var C=$A(arguments).slice(1);return this.collect(function(value) {return value[B].apply(value,C);});},max:function(A) {var B;this.each(function(value,index) {value=(A||Prototype.K)(value,index);if (B==undefined||value>=B) B=value;});return B;},min:function(A) {var B;this.each(function(value,index) {value=(A||Prototype.K)(value,index);if (B==undefined||value<B) B=value;});return B;},partition:function(A) {var B=[],falses=[];this.each(function(value,index) {((A||Prototype.K)(value,index)?B:falses).push(value);});return [B,falses];},pluck:function(A) {var B=[];this.each(function(value,index) {B.push(value[A]);});return B;},reject:function(A) {var B=[];this.each(function(value,index) {if (!A(value,index)) B.push(value);});return B;},sortBy:function(A) {return this.collect(function(value,index) {return {value:value,criteria:A(value,index)};}).sort(function(left,right) {var a=left.criteria,b=right.criteria;return a<b?-1:a>b?1:0;}).pluck('value');},toArray:function() {return this.collect(Prototype.K);},zip:function() {var B=Prototype.K,args=$A(arguments);if (typeof args.last()=='function') B=args.pop();var C=[this].concat(args).map($A);return this.map(function(value,index) {return B(C.pluck(index));});},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(A) {if (!A) return [];if (A.toArray) {return A.toArray();} else {var B=[];for (var i=0;i<A.length;i++) B.push(A[i]);return B;}};Object.extend(Array.prototype,Enumerable);if (!Array.prototype._reverse) Array.prototype._reverse=Array.prototype.reverse;Object.extend(Array.prototype,{_each:function(A) {for (var i=0;i<this.length;i++) A(this[i]);},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(value) {return value!=undefined||value!=null;});},flatten:function() {return this.inject([],function(array,value) {return array.concat(value&&value.constructor==Array?value.flatten():[value]);});},without:function() {var B=$A(arguments);return this.select(function(value) {return!B.include(value);});},indexOf:function(A) {for (var i=0;i<this.length;i++) if (this[i]==A) return i;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(array,value) {return array.include(value)?array:array.concat([value]);});},inspect:function() {return '['+this.map(Object.inspect).join(', ')+']';}});var Hash={_each:function(A) {for (var B in this) {var C=this[B];if (typeof C=='function') continue;var D=[B,C];D.key=B;D.value=C;A(D);}},keys:function() {return this.pluck('key');},values:function() {return this.pluck('value');},merge:function(A) {return $H(A).inject($H(this),function(mergedHash,pair) {mergedHash[pair.key]=pair.value;return mergedHash;});},toQueryString:function() {return this.map(function(pair) {return pair.map(encodeURIComponent).join('=');}).join('&');},inspect:function() {return '#<Hash:{'+this.map(function(pair) {return pair.map(Object.inspect).join(': ');}).join(', ')+'}>';}};function $H(object) {var hash=Object.extend({},object||{});Object.extend(hash,Enumerable);Object.extend(hash,Hash);return hash;};ObjectRange=Class.create();Object.extend(ObjectRange.prototype,Enumerable);Object.extend(ObjectRange.prototype,{initialize:function(A,B,C) {this.start=A;this.end=B;this.exclusive=C;},_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(A,B,C) {return new ObjectRange(A,B,C);};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(A,B,C,D) {this.each(function(responder) {if (responder[A]&&typeof responder[A]=='function'){responder[A].apply(responder,[B,C,D]);}});}};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(A,B) {Ajax.activeRequestParams={ request:this,A:A,B:B };this.transport=Ajax.getTransport();this.setOptions(B);this.request(A);},request:function(A) {var B=this.options.parameters||'';if (B.length>0) B+='&_=';if (this.options.method!='get'&&this.options.method!='post') {B+=(B.length>0?'&':'')+'_method='+this.options.method;this.options.method='post';};try {this.url=A;if (this.options.method=='get'&&B.length>0) this.url+=(this.url.match(/\?/)?'&':'?')+B;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 C=this.options.postBody?this.options.postBody:B;this.transport.send(this.options.method=='post'?C:null);if (!this.options.asynchronous&&this.transport.overrideMimeType) this.onStateChange();} catch (e) {this.dispatchException(e);}},setRequestHeaders:function() {var A=['X-Requested-With','XMLHttpRequest','Accept','text/javascript, text/html, application/xml, text/xml, */*'];if (this.options.method=='post') {A.push('Content-type',this.options.contentType);};if (this.options.requestHeaders) A.push.apply(A,this.options.requestHeaders);for (var i=0;i<A.length;i+=2) this.transport.setRequestHeader(A[i],A[i+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 (e) {}},evalJSON:function() {try {return eval('('+this.header('X-JSON')+')');} catch (e) {}},evalResponse:function() {return eval(this.transport.responseText);},respondToReadyState:function(A) {var B=Ajax.Request.Events[A];var C=this.transport,json=this.evalJSON();if (B=='Complete') {(this.options['on'+this.transport.status]||this.options['on'+(this.responseIsSuccess()?'Success':'Failure')]||Prototype.emptyFunction)(C,json);if ((this.header('Content-type')||'').match(/^text\/javascript/i)) this.evalResponse();};(this.options['on'+B]||Prototype.emptyFunction)(C,json);Ajax.Responders.dispatch('on'+B,this,C,json);if (B=='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,B,C) {this.containers={success:A.success?$(A.success):$(A),failure:A.failure?$(A.failure):(A.success?null:$(A))};this.transport=Ajax.getTransport();this.setOptions(C);var D=this.options.onComplete||Prototype.emptyFunction;this.options.onComplete=(function(transport,object) {this.updateContent();D(transport,object);}).bind(this);this.request(B);},updateContent:function() {var A=this.responseIsSuccess()?this.containers.success:this.containers.failure;var B=this.transport.responseText;if (!this.options.evalScripts) B=B.stripScripts();if (A) {if (this.options.insertion) {new this.options.insertion(A,B);} else {Element.update(A,B);}};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,B,C) {this.setOptions(C);this.onComplete=this.options.onComplete;this.frequency=(this.options.frequency||2);this.decay=(this.options.decay||1);this.updater={};this.container=A;this.url=B;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 results=[],element;for (var i=0;i<arguments.length;i++) {element=arguments[i];if (typeof element=='string') element=document.getElementById(element);results.push(Element.extend(element));};return results.reduce();};document.getElementsByClassName=function(A,B) {var C=($(B)||document.body).getElementsByTagName('*');var D=[],child,pattern=new RegExp("(^|\\s)"+A+"(\\s|$)");for (var i=0,length=C.length;i<length;i++) {child=C[i];var E=child.className;if (E.length==0) continue;if (E==A||E.match(pattern)) D.push(Element.extend(child));};return D;};if (!window.Element) var Element={};Element.extend=function(A) {if (!A) return;try{if (_nativeExtensions||A.nodeType==3) return A;}catch (e){return A;};if (!A._extended&&A.tagName&&A!=window) {var B=Object.clone(Element.Methods),cache=Element.extend.cache;if (A.tagName=='FORM') Object.extend(B,Form.Methods);if (['INPUT','TEXTAREA','SELECT'].include(A.tagName)) Object.extend(B,Form.Element.Methods);for (var C in B) {var D=B[C];if (typeof D=='function') A[C]=cache.findOrStore(D);}};A._extended=true;return A;};Element.extend.cache={findOrStore:function(B) {return this[B]=this[B]||function() {return B.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(A,B) {$(A).innerHTML=B.stripScripts();setTimeout(function() {B.evalScripts()},10);return A;},replace:function(A,B) {A=$(A);if (A.outerHTML) {A.outerHTML=B.stripScripts();} else {var C=A.ownerDocument.createRange();C.selectNodeContents(A);A.parentNode.replaceChild(C.createContextualFragment(B.stripScripts()),A);};setTimeout(function() {B.evalScripts()},10);return A;},inspect:function(A) {A=$(A);var B='<'+A.tagName.toLowerCase();$H({'id':'id','className':'class'}).each(function(pair) {var C=pair.first(),attribute=pair.last();var D=(A[C]||'').toString();if (D) B+=' '+attribute+'='+D.inspect(true);});return B+'>';},recursivelyCollect:function(A,B) {A=$(A);var C=[];while (A=A[B]) if (A.nodeType==1) C.push(Element.extend(A));return C;},ancestors:function(A) {return $(A).recursivelyCollect('parentNode');},descendants:function(B) {B=$(B);return $A(B.getElementsByTagName('*'));},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(A,B) {A=$(A);if (typeof B=='string') B=new Selector(B);return B.match(A);},up:function(A,B,C) {return Selector.findElement($(A).ancestors(),B,C);},down:function(A,B,C) {return Selector.findElement($(A).descendants(),B,C);},previous:function(A,B,C) {return Selector.findElement($(A).previousSiblings(),B,C);},next:function(A,B,C) {return Selector.findElement($(A).nextSiblings(),B,C);},getElementsBySelector:function() {var B=$A(arguments),element=$(B.shift());return Selector.findChildElements(element,B);},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(A) {A=$(A);var B=A.firstChild;while (B) {var C=B.nextSibling;if (B.nodeType==3&&!/\S/.test(B.nodeValue)) A.removeChild(B);B=C;};return A;},empty:function(A) {return $(A).innerHTML.match(/^\s*$/);},childOf:function(A,B) {A=$(A),B=$(B);while (A=A.parentNode) if (A==B) return true;return false;},scrollTo:function(A) {A=$(A);var x=A.x?A.x:A.offsetLeft,y=A.y?A.y:A.offsetTop;window.scrollTo(x,y);return A;},getStyle:function(A,B) {A=$(A);var C=A.style[B.camelize()];if (!C) {if (document.defaultView&&document.defaultView.getComputedStyle) {var D=document.defaultView.getComputedStyle(A,null);C=D?D.getPropertyValue(B):null;} else if (A.currentStyle) {C=A.currentStyle[B.camelize()];}};if (window.opera&&['left','top','right','bottom'].include(B)) if (Element.getStyle(A,'position')=='static') C='auto';return C=='auto'?null:C;},setStyle:function(A,B) {A=$(A);for (var C in B) A.style[C.camelize()]=B[C];return A;},getDimensions:function(A) {A=$(A);var B=$(A).getStyle('display');if (B!='none'&&B!=null) return {width:A.offsetWidth,height:A.offsetHeight};var C=A.style;var D=C.visibility;var E=C.position;var F=C.display;C.visibility='hidden';C.position='absolute';C.display='block';var G=A.clientWidth;var H=A.clientHeight;C.display=F;C.position=E;C.visibility=D;return {width:G,height:H};},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(B,C) {B=$(B);var D=B.tagName.toUpperCase();if (['THEAD','TBODY','TR','TD'].indexOf(D)>-1) {var E=document.createElement('div');switch (D) {case 'THEAD':case 'TBODY':E.innerHTML='<table><tbody>'+C.stripScripts()+'</tbody></table>';depth=2;break;case 'TR':E.innerHTML='<table><tbody><tr>'+C.stripScripts()+'</tr></tbody></table>';depth=3;break;case 'TD':E.innerHTML='<table><tbody><tr><td>'+C.stripScripts()+'</td></tr></tbody></table>';depth=4;};$A(B.childNodes).each(function(node){B.removeChild(node)});depth.times(function(){ E=E.firstChild });$A(E.childNodes).each(function(node){ B.appendChild(node) });} else {B.innerHTML=C.stripScripts();};setTimeout(function() {C.evalScripts()},10);return B;}};Object.extend(Element,Element.Methods);var _nativeExtensions=false;if (!window.HTMLElement&&/Konqueror|Safari|KHTML/.test(navigator.userAgent)) {['','Form','Input','TextArea','Select'].each(function(A) {var B=window['HTML'+A+'Element']={};B.prototype=document.createElement(A?A.toLowerCase():'div').__proto__;});};Element.addMethods=function(A) {Object.extend(Element.Methods,A||{});function copy(A,destination) {var B=Element.extend.cache;for (var C in A) {var D=A[C];destination[C]=B.findOrStore(D);}};if (typeof HTMLElement!='undefined') {copy(Element.Methods,HTMLElement.prototype);copy(Form.Methods,HTMLFormElement.prototype);[HTMLInputElement,HTMLTextAreaElement,HTMLSelectElement].each(function(klass) {copy(Form.Element.Methods,klass.prototype);});_nativeExtensions=true;}};var Toggle={};Toggle.display=Element.toggle;Abstract.Insertion=function(A) {this.adjacency=A;};Abstract.Insertion.prototype={initialize:function(A,B) {this.element=$(A);this.content=B.stripScripts();if (this.adjacency&&this.element.insertAdjacentHTML) {try {this.element.insertAdjacentHTML(this.adjacency,this.content);} catch (e) {var C=this.element.tagName.toLowerCase();if (C=='tbody'||C=='tr') {this.insertContent(this.contentFromAnonymousTable());} else {throw e;}}} else {this.range=this.element.ownerDocument.createRange();if (this.initializeRange) this.initializeRange();this.insertContent([this.range.createContextualFragment(this.content)]);};setTimeout(function() {B.evalScripts()},10);},contentFromAnonymousTable:function() {var B=document.createElement('div');B.innerHTML='<table><tbody>'+this.content+'</tbody></table>';return $A(B.childNodes[0].childNodes[0].childNodes);}};var Insertion={};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(fragment) {this.element.parentNode.insertBefore(fragment,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(fragment) {this.element.insertBefore(fragment,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(fragment) {this.element.appendChild(fragment);}).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(fragment) {this.element.parentNode.insertBefore(fragment,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(name) {return name.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(className) {return className!=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 abort(message) { throw 'Parse error in selector: '+message;};if (this.expression=='')  abort('empty expression');var A=this.params,expr=this.expression,match,modifier,clause,rest;while (match=expr.match(/^(.*)\[([a-z0-9_:-]+?)(?:([~\|!]?=)(?:"([^"]*)"|([^\]\s]*)))?\]$/i)) {A.attributes=A.attributes||[];A.attributes.push({name:match[2],operator:match[3],value:match[4]||match[5]||''});expr=match[1];};if (expr=='*') return this.params.wildcard=true;while (match=expr.match(/^([^a-z0-9_-])?([a-z0-9_-]+)(.*)/i)) {modifier=match[1],clause=match[2],rest=match[3];switch (modifier) {case '#':A.id=clause;break;case '.':A.classNames.push(clause);break;case '':case undefined:A.tagName=clause.toUpperCase();break;default:abort(expr.inspect());};expr=rest;};if (expr.length>0) abort(expr.inspect());},buildMatchExpression:function() {var A=this.params,conditions=[],clause;if (A.wildcard) conditions.push('true');if (clause=A.id) conditions.push('element.id == '+clause.inspect());if (clause=A.tagName) conditions.push('element.tagName.toUpperCase() == '+clause.inspect());if ((clause=A.classNames).length>0) for (var i=0;i<clause.length;i++) conditions.push('Element.hasClassName(element, '+clause[i].inspect()+')');if (clause=A.attributes) {clause.each(function(attribute) {var B='element.getAttribute('+attribute.name.inspect()+')';var C=function(delimiter) {return B+' && '+B+'.split('+delimiter.inspect()+')';};switch (attribute.operator) {case '=':conditions.push(B+' == '+attribute.value.inspect());break;case '~=':conditions.push(C(' ')+'.include('+attribute.value.inspect()+')');break;case '|=':conditions.push(C('-')+'.first().toUpperCase() == '+attribute.value.toUpperCase().inspect());break;case '!=':conditions.push(B+' != '+attribute.value.inspect());break;case '':case undefined:conditions.push(B+' != null');break;default:throw 'Unknown operator '+attribute.operator+' in selector';}});};return conditions.join(' && ');},compileMatcher:function() {this.match=new Function('element','if (!element.tagName) return false; \n      return '+this.buildMatchExpression());},findElements:function(A) {var B;if (B=$(this.params.id)) if (this.match(B)) if (!A||Element.childOf(B,A)) return [B];A=(A||document).getElementsByTagName(this.params.tagName||'*');var C=[];for (var i=0;i<A.length;i++) if (this.match(B=A[i])) C.push(Element.extend(B));return C;},toString:function() {return this.expression;}};Object.extend(Selector,{matchElements:function(A,B) {var C=new Selector(B);return A.select(C.match.bind(C));},findElement:function(A,B,C) {if (typeof B=='number') C=B,B=false;return Selector.matchElements(A,B||'*')[C||0];},findChildElements:function(A,B) {return B.map(function(expression) {return expression.strip().split(/\s+/).inject([null],function(results,expr) {var C=new Selector(expr);return results.inject([],function(elements,result) {return elements.concat(C.findElements(result||A));});});}).flatten();}});function $$() {return Selector.findChildElements(document,$A(arguments));};var Form={reset:function(A) {$(A).reset();return A;}};Form.Methods={serialize:function(A) {var B=Form.getElements($(A));var C=[];for (var i=0;i<B.length;i++) {var D=Form.Element.serialize(B[i]);if (D) C.push(D);};return C.join('&');},getElements:function(A) {A=$(A);var B=[];for (var C in Form.Element.Serializers){var D=A.getElementsByTagName(C);for (var j=0;j<D.length;j++){B.push(D[j]);}};return B;},getInputs:function(A,B,C) {A=$(A);var D=A.getElementsByTagName('input');if (!B&&!C) return D;var E=[];for (var i=0;i<D.length;i++) {var F=D[i];if ((B&&F.type!=B)||(C&&F.name!=C)) continue;E.push(F);};return E;},disable:function(A) {A=$(A);var B=Form.getElements(A);for (var i=0;i<B.length;i++) {var C=B[i];C.blur();C.disabled='true';};return A;},enable:function(A) {A=$(A);var B=Form.getElements(A);for (var i=0;i<B.length;i++) {var C=B[i];C.disabled='';};return A;},findFirstElement:function(A) {return Form.getElements(A).find(function(element) {return element.type!='hidden'&&!element.disabled&&['input','select','textarea'].include(element.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 (e){};return A;},select:function(A) {$(A).select();return A;}};Form.Element.Methods={serialize:function(A) {A=$(A);var B=A.tagName.toLowerCase();var C=Form.Element.Serializers[B](A);if (C) {var D=encodeURIComponent(C[0]);if (D.length==0) return;if (C[1].constructor!=Array) C[1]=[C[1]];return C[1].map(function(value) {return D+'='+encodeURIComponent(value);}).join('&');}},getValue:function(A) {A=$(A);var B=A.tagName.toLowerCase();var C=Form.Element.Serializers[B](A);if (C) return C[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 (e){};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(A) {var B='',opt,index=A.selectedIndex;if (index>=0) {opt=A.options[index];B=opt.value||opt.text;};return [A.name,B];},selectMany:function(A) {var B=[];for (var i=0;i<A.length;i++) {var C=A.options[i];if (C.selected) B.push(C.value||C.text);};return [A.name,B];}};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 A=Form.getElements(this.element);for (var i=0;i<A.length;i++) this.registerCallback(A[i]);},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={};};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(A,B) {var C=Event.element(A);while (C.parentNode&&(!C.tagName||(C.tagName.toUpperCase()!=B.toUpperCase()))) C=C.parentNode;return C;},observers:false,_observeAndCache:function(A,B,C,D) {if (!this.observers) this.observers=[];if (A.addEventListener) {this.observers.push([A,B,C,D]);A.addEventListener(B,C,D);} else if (A.attachEvent) {this.observers.push([A,B,C,D]);A.attachEvent('on'+B,C);}},unloadCache:function() {if (!Event.observers) return;try{for (var i=0;i<Event.observers.length;i++) {Event.stopObserving.apply(this,Event.observers[i]);Event.observers[i][0]=null;}}catch (e){};Event.observers=false;},observe:function(A,B,C,D) {A=$(A);D=D||false;if (B=='keypress'&&(navigator.appVersion.match(/Konqueror|Safari|KHTML/)||A.attachEvent)) B='keydown';Event._observeAndCache(A,B,C,D);},stopObserving:function(A,B,C,D) {A=$(A);D=D||false;if (B=='keypress'&&(navigator.appVersion.match(/Konqueror|Safari|KHTML/)||A.detachEvent)) B='keydown';if (A.removeEventListener) {A.removeEventListener(B,C,D);} else if (A.detachEvent) {try {A.detachEvent('on'+B,C);} catch (e) {}}}});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(A) {var B=0,valueL=0;do {B+=A.scrollTop||0;valueL+=A.scrollLeft||0;A=A.parentNode;} while (A);return [valueL,B];},cumulativeOffset:function(A) {var B=0,valueL=0;do {B+=A.offsetTop||0;valueL+=A.offsetLeft||0;A=A.offsetParent;} while (A);return [valueL,B];},positionedOffset:function(A) {var B=0,valueL=0;do {B+=A.offsetTop||0;valueL+=A.offsetLeft||0;A=A.offsetParent;if (A) {p=Element.getStyle(A,'position');if (p=='relative'||p=='absolute') break;}} while (A);return [valueL,B];},offsetParent:function(A) {try{if (A.offsetParent) return A.offsetParent;}catch (e){};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(A,x,y) {if (this.includeScrollOffsets) return this.withinIncludingScrolloffsets(A,x,y);this.xcomp=x;this.ycomp=y;this.offset=this.cumulativeOffset(A);return (y>=this.offset[1]&&y<this.offset[1]+A.offsetHeight&&x>=this.offset[0]&&x<this.offset[0]+A.offsetWidth);},withinIncludingScrolloffsets:function(A,x,y) {var B=this.realOffset(A);this.xcomp=x+B[0]-this.deltaX;this.ycomp=y+B[1]-this.deltaY;this.offset=this.cumulativeOffset(A);return (this.ycomp>=this.offset[1]&&this.ycomp<this.offset[1]+A.offsetHeight&&this.xcomp>=this.offset[0]&&this.xcomp<this.offset[0]+A.offsetWidth);},overlap:function(A,B) {if (!A) return 0;if (A=='vertical') return ((this.offset[1]+B.offsetHeight)-this.ycomp)/B.offsetHeight;if (A=='horizontal') return ((this.offset[0]+B.offsetWidth)-this.xcomp)/B.offsetWidth;},page:function(A) {var B=0,valueL=0;var C=A;do {B+=C.offsetTop||0;valueL+=C.offsetLeft||0;if (C.offsetParent==document.body) if (Element.getStyle(C,'position')=='absolute') break;} while (C=C.offsetParent);C=A;do {if (!window.opera||C.tagName=='BODY') {B-=C.scrollTop||0;valueL-=C.scrollLeft||0;}} while (C=C.parentNode);return [valueL,B];},clone:function(A,B) {var C=Object.extend({setLeft:true,setTop:true,setWidth:true,setHeight:true,offsetTop:0,offsetLeft:0},arguments[2]||{});A=$(A);var p=Position.page(A);B=$(B);var D=[0,0];var E=null;if (Element.getStyle(B,'position')=='absolute') {E=Position.offsetParent(B);D=Position.page(E);};if (E==document.body) {D[0]-=document.body.offsetLeft;D[1]-=document.body.offsetTop;};if(C.setLeft)   B.style.left=(p[0]-D[0]+C.offsetLeft)+'px';if(C.setTop)    B.style.top=(p[1]-D[1]+C.offsetTop)+'px';if(C.setWidth)  B.style.width=A.offsetWidth+'px';if(C.setHeight) B.style.height=A.offsetHeight+'px';},absolutize:function(A) {A=$(A);if (A.style.position=='absolute') return;Position.prepare();var B=Position.positionedOffset(A);var C=B[1];var D=B[0];var E=A.clientWidth;var F=A.clientHeight;A._originalLeft=D-parseFloat(A.style.left||0);A._originalTop=C-parseFloat(A.style.top||0);A._originalWidth=A.style.width;A._originalHeight=A.style.height;A.style.position='absolute';A.style.top=C+'px';;A.style.left=D+'px';;A.style.width=E+'px';;A.style.height=F+'px';;},relativize:function(A) {A=$(A);if (A.style.position=='relative') return;Position.prepare();if (A._originalLeft==undefined){var B=Position.positionedOffset(A);var C=B[1];var D=B[0];var E=A.clientWidth;var F=A.clientHeight;A._originalLeft=D-parseFloat(A.style.left||0);A._originalTop=C-parseFloat(A.style.top||0);A._originalWidth=A.style.width;A._originalHeight=A.style.height;};A.style.position='relative';var C=parseFloat(A.style.top||0)-(A._originalTop||0);var D=parseFloat(A.style.left||0)-(A._originalLeft||0);A.style.top=C+'px';A.style.left=D+'px';A.style.height=A._originalHeight;A.style.width=A._originalWidth;}};if (/Konqueror|Safari|KHTML/.test(navigator.userAgent)) {Position.cumulativeOffset=function(A) {var B=0,valueL=0;do {B+=A.offsetTop||0;valueL+=A.offsetLeft||0;if (A.offsetParent==document.body) if (Element.getStyle(A,'position')=='absolute') break;A=A.offsetParent;} while (A);return [valueL,B];}};Element.addMethods();
var RubicusFrontend=Class.create();RubicusFrontend.prototype={pollHandler:null,faqs:null,photoDetailHandler:null,discussionServer:null,observers:[],absoluteHeaderBlockIds:[],initialize:function (){this.observers=[];this.pollHandler=new RubicusFrontendPoll();this.faqs=[];this.photoDetailHandler=new RubicusFrontendPhotogallery();this.preloader=new RubicusFrontendPreloader();Event.observe(window,'load',this.initOnLoad.bind(this));},initOnLoad:function (){this.photoDetailHandler.onload();this.preloader.loadFiles();this.emailWrap();},addObserver:function(A){this.removeObserver(A);this.observers.push(A);},removeObserver:function(A){this.observers=this.observers.reject(function(o) {return o==A});},notify:function(A,B){var C=false;this.observers.each(function(o) {if (o[A]){try{C=o[A](A,B);}catch (e){Rubicus.alert('Error> RubicusFrontend::notify: '+A);}}});return C;},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(A,B,C,D){this.pollHandler.init();this.pollHandler.setElement(A);this.pollHandler.setLink(B);this.pollHandler.setTempArea(C);this.pollHandler.setTempAreaCode(D);this.pollHandler.vote(B);},faqInit:function (A,B){var C=document.getElementsByClassName(A);if (C){for (var i=0;i<C.length;i++){this.addFaqBlock(C[i],B);this.onResize(C[i]);}}},addFaqBlock:function (A,B){var A=$(A);if (A){A.RFFAQ=new RubicusFrontendFaq(A,B)}},showFaqItem:function (A,B){var A=$(A);if (A.RFFAQ){A.RFFAQ.showItem(B);this.onResize(A);}},onResize:function(A){if (this.isAdminMode()){var B=Rubicus.util.getElementParentWithClassName(A,'rbcContentBlock');if (B){var C=B.id;Rubicus.util.setBlockRowMenu(C);var D=Rubicus.cZones.getBlockZone(C);if (D){Rubicus.skin.setZoneBorderStyle(D.element);}}}},addPhotogalleryZone:function (A,B,C){return this.photoDetailHandler.addZone(A,B,C);},setPhotogalleryInit:function (A,B){this.photoDetailHandler.setWaitingArea(A);this.photoDetailHandler.setServerLink(B);},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 (A,B){if (!this.isPhotoDetail()){B.submit(true);return true;};var C=new RubicusFrontendDiscussion();C.setDiscussionElement(A);C.setFormElement(B);C.setServerLink(this.getDiscussionServer());C.sendForm();B.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 A=$('rbcContactEmail');var B=8;if (A){emailText=A.innerHTML;emailLength=emailText.length;if (emailLength<B||emailText.search('<WBR>')>-1||emailText.search('<wbr>')>-1){return;};cycle=parseInt(emailLength/B,10);var C='';var D='';for(var i=0;i<cycle;i++){var E=(i?(i*B):0);C+=D+emailText.substr(E,B);D='<wbr>';};if (E<emailLength){C+=D+emailText.substr((i*B));};A.innerHTML=C;}}};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 A=this.tempElement;}else{var A=this.element;};if (this.tempElementCode){var C=this.tempElementCode;}else{var C=false;};if (C){A.style.height=A.offsetHeight+'px';A.innerHTML=C;}},onSuccess:function(A){this.element.replace(A.responseText);}};RubicusFrontendFaq=Class.create();RubicusFrontendFaq.prototype={topElement:false,answersCssClass:false,activeItem:false,initialize:function (A,B){this.topElement=$(A);this.answersCssClass=B;this.initBlock();},initBlock:function (){var A=this.topElement.getElementsByClassName(this.answersCssClass);if (A.length){for (var i=0;i<A.length;i++){A[i].hide();}}},showItem:function(A){A=$(A);A.toggle();}};RubicusFrontendPhotogallery=Class.create();RubicusFrontendPhotogallery.prototype={zones:[],zoneMap:[],waitingArea:'',masterZone:null,serverLink:null,postData:'',previousPhotoLink:'',nextPhotoLink:'',slideshowFirstTimeout:500,slideshowTimeout:4000,slideshowState:false,slideshowHandler:null,initialize:function (){this.zones=[];this.masterZone=null;this.waitingArea=null;this.serverLink=null;this.postData='';},addZone:function (A,B,C){var D=$(A);D._identifier=B;D._isMaster=(C?true:false);this.zones.push(D);this.zoneMap[D._identifier]=this.zones[this.zones.length-1];if (D._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;},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(A){if (!A){return;};new Ajax.Request(this.serverLink,{method:'post',postBody:'mode=photogallery&identifier='+A+'&zones='+this.getSerializeZones()+this.postData,onSuccess:this.onSuccess.bind(this)});this.postData='';},getSerializeZones:function (){var A='';var B='';for (var i=0;i<this.zones.length;i++){A+=B+this.zones[i]._identifier;B=';';};return A;},showImageFromLinkWithHash:function (A){this.setWaitingArea();var B=A.indexOf('#');if (B==-1){document.location.href=A;return true;};var C=A.substr(B+1);document.location.hash='#'+C;this.showImage(C);},showImageFromLink:function (A){try{if (Rubicus){var B=true;}else{var B=false;}}catch (e){var B=false;};if (B){document.location.href=A;}else{var E=A.match(/(.*\/album\/[a-z0-9\-]+\/)([a-z0-9\-]+)\//);if (!E){return false;};var F=E[1];var G=E[2];document.location.href=F+'#'+G;}},onSuccess:function(A){var B=A.responseXML.getElementsByTagName('zone');for (var i=0;i<B.length;i++){if (B[i].firstChild&&B[i].firstChild.nodeType==4){var C=B[i].firstChild.nodeValue;}else{var C=B[i].text;};if (!C){var C='';};this.zoneMap[B[i].getAttribute('id')].innerHTML=C;C.evalScripts();};this.modifyDetailLinks();RubicusFrontendIns.notify('onShowImage');},modifyDetailLinks:function (){var A=document.getElementsByTagName('a');for (var i=0;i<A.length;i++){var B=A[i].href;if (B&&B.match(/.*\/(products|news)\/[a-z0-9\-]+\//)){A[i].onclick=function (event){var C=this.href+'?redirsuffix='+escape('#')+RubicusFrontendIns.photoDetailHandler.getPhotoIdentifier();this.href=C;}}}},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;},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();}},isSlideshowMode:function (){return this.slideshowState;},setSlideshowInterval:function (A){return this.photoDetailHandler.slideshowTimeout=A;}};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=[];this.completeFiles=[];},addFile:function(A){this.files.push(A);},loadFiles:function(){for (var i=0;i<this.files.length;i++){var A=new Image();A.src=this.files[i];this.completeFiles.push(A);}}};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:[],skin:'default',fileToServerMap:[],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(A,B){if (A){if (!this.fileToServerMap[A]){if (B&&this.fileToServerMap['cssFileServer']){this.fileToServerMap[A]=this.fileToServerMap['cssFileServer'];}else{this.fileToServerMap[A]=this.getClientServer()+'skins/'+this.skin+'/';}};return this.fileToServerMap[A];}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 (A){var B=[];for (var i=0;i<A.length;i++){B[A[i][0]]=A[i][1];};return B;}}

