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(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()},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){this.photoDetailHandler.setWaitingArea(b);this.photoDetailHandler.setServerLink(a)},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()}};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()}};RubicusFrontendPhotogallery=Class.create();RubicusFrontendPhotogallery.prototype={zones:new Array(),zoneMap:new Array(),waitingArea:"",masterZone:null,serverLink:null,postData:"",previousPhotoLink:"",nextPhotoLink:"",slideshowFirstTimeout:500,slideshowTimeout:4000,slideshowState:false,slideshowHandler:null,initialize:function(){this.zones=new Array();this.masterZone=null;this.waitingArea=null;this.serverLink=null;this.postData=""},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},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 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(c){try{if(Rubicus){var g=true}else{var g=false}}catch(f){var g=false}if(g){document.location.href=c}else{var b=c.match(/(.*\/album\/[^\/]+\/)([^\/]+)\//);if(!b){return false}var a=b[1];var d=b[2];document.location.href=a+"#"+d}},onSuccess:function(d){var a=d.responseXML.getElementsByTagName("zone");for(var b=0;b<a.length;b++){if(a[b].firstChild&&a[b].firstChild.nodeType==4){var c=a[b].firstChild.nodeValue}else{var c=a[b].text}if(!c){var c=""}this.zoneMap[a[b].getAttribute("id")].innerHTML=c;c.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},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}};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))}};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}};
