var Prototype={Version:'1.6.1',Browser:(function(){var ua=navigator.userAgent;var isOpera=Object.prototype.toString.call(window.opera)=='[object Opera]';return{IE:!!window.attachEvent&&!isOpera,Opera:isOpera,WebKit:ua.indexOf('AppleWebKit/')>-1,Gecko:ua.indexOf('Gecko')>-1&&ua.indexOf('KHTML')===-1,MobileSafari:/Apple.*Mobile.*Safari/.test(ua)}})(),BrowserFeatures:{XPath:!!document.evaluate,SelectorsAPI:!!document.querySelector,ElementExtensions:(function(){var constructor=window.Element||window.HTMLElement;return!!(constructor&&constructor.prototype);})(),SpecificElementExtensions:(function(){if(typeof window.HTMLDivElement!=='undefined')
return true;var div=document.createElement('div');var form=document.createElement('form');var isSupported=false;if(div['__proto__']&&(div['__proto__']!==form['__proto__'])){isSupported=true;}
div=form=null;return isSupported;})()},ScriptFragment:'<script[^>]*>([\\S\\s]*?)<\/script>',JSONFilter:/^\/\*-secure-([\s\S]*)\*\/\s*$/,emptyFunction:function(){},K:function(x){return x}};if(Prototype.Browser.MobileSafari)
Prototype.BrowserFeatures.SpecificElementExtensions=false;var Abstract={};var Try={these:function(){var returnValue;for(var i=0,length=arguments.length;i<length;i++){var lambda=arguments[i];try{returnValue=lambda();break;}catch(e){}}
return returnValue;}};var Class=(function(){function subclass(){};function create(){var parent=null,properties=$A(arguments);if(Object.isFunction(properties[0]))
parent=properties.shift();function klass(){this.initialize.apply(this,arguments);}
Object.extend(klass,Class.Methods);klass.superclass=parent;klass.subclasses=[];if(parent){subclass.prototype=parent.prototype;klass.prototype=new subclass;parent.subclasses.push(klass);}
for(var i=0;i<properties.length;i++)
klass.addMethods(properties[i]);if(!klass.prototype.initialize)
klass.prototype.initialize=Prototype.emptyFunction;klass.prototype.constructor=klass;return klass;}
function addMethods(source){var ancestor=this.superclass&&this.superclass.prototype;var properties=Object.keys(source);if(!Object.keys({toString:true}).length){if(source.toString!=Object.prototype.toString)
properties.push("toString");if(source.valueOf!=Object.prototype.valueOf)
properties.push("valueOf");}
for(var i=0,length=properties.length;i<length;i++){var property=properties[i],value=source[property];if(ancestor&&Object.isFunction(value)&&value.argumentNames().first()=="$super"){var method=value;value=(function(m){return function(){return ancestor[m].apply(this,arguments);};})(property).wrap(method);value.valueOf=method.valueOf.bind(method);value.toString=method.toString.bind(method);}
this.prototype[property]=value;}
return this;}
return{create:create,Methods:{addMethods:addMethods}};})();(function(){var _toString=Object.prototype.toString;function extend(destination,source){for(var property in source)
destination[property]=source[property];return destination;}
function inspect(object){try{if(isUndefined(object))return'undefined';if(object===null)return'null';return object.inspect?object.inspect():String(object);}catch(e){if(e instanceof RangeError)return'...';throw e;}}
function toJSON(object){var type=typeof object;switch(type){case'undefined':case'function':case'unknown':return;case'boolean':return object.toString();}
if(object===null)return'null';if(object.toJSON)return object.toJSON();if(isElement(object))return;var results=[];for(var property in object){var value=toJSON(object[property]);if(!isUndefined(value))
results.push(property.toJSON()+': '+value);}
return'{'+results.join(', ')+'}';}
function toQueryString(object){return $H(object).toQueryString();}
function toHTML(object){return object&&object.toHTML?object.toHTML():String.interpret(object);}
function keys(object){var results=[];for(var property in object)
results.push(property);return results;}
function values(object){var results=[];for(var property in object)
results.push(object[property]);return results;}
function clone(object){return extend({},object);}
function isElement(object){return!!(object&&object.nodeType==1);}
function isArray(object){return _toString.call(object)=="[object Array]";}
function isHash(object){return object instanceof Hash;}
function isFunction(object){return typeof object==="function";}
function isString(object){return _toString.call(object)=="[object String]";}
function isNumber(object){return _toString.call(object)=="[object Number]";}
function isUndefined(object){return typeof object==="undefined";}
extend(Object,{extend:extend,inspect:inspect,toJSON:toJSON,toQueryString:toQueryString,toHTML:toHTML,keys:keys,values:values,clone:clone,isElement:isElement,isArray:isArray,isHash:isHash,isFunction:isFunction,isString:isString,isNumber:isNumber,isUndefined:isUndefined});})();Object.extend(Function.prototype,(function(){var slice=Array.prototype.slice;function update(array,args){var arrayLength=array.length,length=args.length;while(length--)array[arrayLength+length]=args[length];return array;}
function merge(array,args){array=slice.call(array,0);return update(array,args);}
function argumentNames(){var names=this.toString().match(/^[\s\(]*function[^(]*\(([^)]*)\)/)[1].replace(/\/\/.*?[\r\n]|\/\*(?:.|[\r\n])*?\*\//g,'').replace(/\s+/g,'').split(',');return names.length==1&&!names[0]?[]:names;}
function bind(context){if(arguments.length<2&&Object.isUndefined(arguments[0]))return this;var __method=this,args=slice.call(arguments,1);return function(){var a=merge(args,arguments);return __method.apply(context,a);}}
function bindAsEventListener(context){var __method=this,args=slice.call(arguments,1);return function(event){var a=update([event||window.event],args);return __method.apply(context,a);}}
function curry(){if(!arguments.length)return this;var __method=this,args=slice.call(arguments,0);return function(){var a=merge(args,arguments);return __method.apply(this,a);}}
function delay(timeout){var __method=this,args=slice.call(arguments,1);timeout=timeout*1000
return window.setTimeout(function(){return __method.apply(__method,args);},timeout);}
function defer(){var args=update([0.01],arguments);return this.delay.apply(this,args);}
function wrap(wrapper){var __method=this;return function(){var a=update([__method.bind(this)],arguments);return wrapper.apply(this,a);}}
function methodize(){if(this._methodized)return this._methodized;var __method=this;return this._methodized=function(){var a=update([this],arguments);return __method.apply(null,a);};}
return{argumentNames:argumentNames,bind:bind,bindAsEventListener:bindAsEventListener,curry:curry,delay:delay,defer:defer,wrap:wrap,methodize:methodize}})());Date.prototype.toJSON=function(){return'"'+this.getUTCFullYear()+'-'+
(this.getUTCMonth()+1).toPaddedString(2)+'-'+
this.getUTCDate().toPaddedString(2)+'T'+
this.getUTCHours().toPaddedString(2)+':'+
this.getUTCMinutes().toPaddedString(2)+':'+
this.getUTCSeconds().toPaddedString(2)+'Z"';};RegExp.prototype.match=RegExp.prototype.test;RegExp.escape=function(str){return String(str).replace(/([.*+?^=!:${}()|[\]\/\\])/g,'\\$1');};var PeriodicalExecuter=Class.create({initialize:function(callback,frequency){this.callback=callback;this.frequency=frequency;this.currentlyExecuting=false;this.registerCallback();},registerCallback:function(){this.timer=setInterval(this.onTimerEvent.bind(this),this.frequency*1000);},execute:function(){this.callback(this);},stop:function(){if(!this.timer)return;clearInterval(this.timer);this.timer=null;},onTimerEvent:function(){if(!this.currentlyExecuting){try{this.currentlyExecuting=true;this.execute();this.currentlyExecuting=false;}catch(e){this.currentlyExecuting=false;throw e;}}}});Object.extend(String,{interpret:function(value){return value==null?'':String(value);},specialChar:{'\b':'\\b','\t':'\\t','\n':'\\n','\f':'\\f','\r':'\\r','\\':'\\\\'}});Object.extend(String.prototype,(function(){function prepareReplacement(replacement){if(Object.isFunction(replacement))return replacement;var template=new Template(replacement);return function(match){return template.evaluate(match)};}
function gsub(pattern,replacement){var result='',source=this,match;replacement=prepareReplacement(replacement);if(Object.isString(pattern))
pattern=RegExp.escape(pattern);if(!(pattern.length||pattern.source)){replacement=replacement('');return replacement+source.split('').join(replacement)+replacement;}
while(source.length>0){if(match=source.match(pattern)){result+=source.slice(0,match.index);result+=String.interpret(replacement(match));source=source.slice(match.index+match[0].length);}else{result+=source,source='';}}
return result;}
function sub(pattern,replacement,count){replacement=prepareReplacement(replacement);count=Object.isUndefined(count)?1:count;return this.gsub(pattern,function(match){if(--count<0)return match[0];return replacement(match);});}
function scan(pattern,iterator){this.gsub(pattern,iterator);return String(this);}
function truncate(length,truncation){length=length||30;truncation=Object.isUndefined(truncation)?'...':truncation;return this.length>length?this.slice(0,length-truncation.length)+truncation:String(this);}
function strip(){return this.replace(/^\s+/,'').replace(/\s+$/,'');}
function stripTags(){return this.replace(/<\w+(\s+("[^"]*"|'[^']*'|[^>])+)?>|<\/\w+>/gi,'');}
function stripScripts(){return this.replace(new RegExp(Prototype.ScriptFragment,'img'),'');}
function extractScripts(){var matchAll=new RegExp(Prototype.ScriptFragment,'img');var matchOne=new RegExp(Prototype.ScriptFragment,'im');return(this.match(matchAll)||[]).map(function(scriptTag){return(scriptTag.match(matchOne)||['',''])[1];});}
function evalScripts(){return this.extractScripts().map(function(script){return eval(script)});}
function escapeHTML(){return this.replace(/&/g,'&amp;').replace(/</g,'&lt;').replace(/>/g,'&gt;');}
function unescapeHTML(){return this.stripTags().replace(/&lt;/g,'<').replace(/&gt;/g,'>').replace(/&amp;/g,'&');}
function toQueryParams(separator){var match=this.strip().match(/([^?#]*)(#.*)?$/);if(!match)return{};return match[1].split(separator||'&').inject({},function(hash,pair){if((pair=pair.split('='))[0]){var key=decodeURIComponent(pair.shift());var value=pair.length>1?pair.join('='):pair[0];if(value!=undefined)value=decodeURIComponent(value);if(key in hash){if(!Object.isArray(hash[key]))hash[key]=[hash[key]];hash[key].push(value);}
else hash[key]=value;}
return hash;});}
function toArray(){return this.split('');}
function succ(){return this.slice(0,this.length-1)+
String.fromCharCode(this.charCodeAt(this.length-1)+1);}
function times(count){return count<1?'':new Array(count+1).join(this);}
function camelize(){var parts=this.split('-'),len=parts.length;if(len==1)return parts[0];var camelized=this.charAt(0)=='-'?parts[0].charAt(0).toUpperCase()+parts[0].substring(1):parts[0];for(var i=1;i<len;i++)
camelized+=parts[i].charAt(0).toUpperCase()+parts[i].substring(1);return camelized;}
function capitalize(){return this.charAt(0).toUpperCase()+this.substring(1).toLowerCase();}
function underscore(){return this.replace(/::/g,'/').replace(/([A-Z]+)([A-Z][a-z])/g,'$1_$2').replace(/([a-z\d])([A-Z])/g,'$1_$2').replace(/-/g,'_').toLowerCase();}
function dasherize(){return this.replace(/_/g,'-');}
function inspect(useDoubleQuotes){var escapedString=this.replace(/[\x00-\x1f\\]/g,function(character){if(character in String.specialChar){return String.specialChar[character];}
return'\\u00'+character.charCodeAt().toPaddedString(2,16);});if(useDoubleQuotes)return'"'+escapedString.replace(/"/g,'\\"')+'"';return"'"+escapedString.replace(/'/g,'\\\'')+"'";}
function toJSON(){return this.inspect(true);}
function unfilterJSON(filter){return this.replace(filter||Prototype.JSONFilter,'$1');}
function isJSON(){var str=this;if(str.blank())return false;str=this.replace(/\\./g,'@').replace(/"[^"\\\n\r]*"/g,'');return(/^[,:{}\[\]0-9.\-+Eaeflnr-u \n\r\t]*$/).test(str);}
function evalJSON(sanitize){var json=this.unfilterJSON();try{if(!sanitize||json.isJSON())return eval('('+json+')');}catch(e){}
throw new SyntaxError('Badly formed JSON string: '+this.inspect());}
function include(pattern){return this.indexOf(pattern)>-1;}
function startsWith(pattern){return this.indexOf(pattern)===0;}
function endsWith(pattern){var d=this.length-pattern.length;return d>=0&&this.lastIndexOf(pattern)===d;}
function empty(){return this=='';}
function blank(){return/^\s*$/.test(this);}
function interpolate(object,pattern){return new Template(this,pattern).evaluate(object);}
return{gsub:gsub,sub:sub,scan:scan,truncate:truncate,strip:String.prototype.trim?String.prototype.trim:strip,stripTags:stripTags,stripScripts:stripScripts,extractScripts:extractScripts,evalScripts:evalScripts,escapeHTML:escapeHTML,unescapeHTML:unescapeHTML,toQueryParams:toQueryParams,parseQuery:toQueryParams,toArray:toArray,succ:succ,times:times,camelize:camelize,capitalize:capitalize,underscore:underscore,dasherize:dasherize,inspect:inspect,toJSON:toJSON,unfilterJSON:unfilterJSON,isJSON:isJSON,evalJSON:evalJSON,include:include,startsWith:startsWith,endsWith:endsWith,empty:empty,blank:blank,interpolate:interpolate};})());var Template=Class.create({initialize:function(template,pattern){this.template=template.toString();this.pattern=pattern||Template.Pattern;},evaluate:function(object){if(object&&Object.isFunction(object.toTemplateReplacements))
object=object.toTemplateReplacements();return this.template.gsub(this.pattern,function(match){if(object==null)return(match[1]+'');var before=match[1]||'';if(before=='\\')return match[2];var ctx=object,expr=match[3];var pattern=/^([^.[]+|\[((?:.*?[^\\])?)\])(\.|\[|$)/;match=pattern.exec(expr);if(match==null)return before;while(match!=null){var comp=match[1].startsWith('[')?match[2].replace(/\\\\]/g,']'):match[1];ctx=ctx[comp];if(null==ctx||''==match[3])break;expr=expr.substring('['==match[3]?match[1].length:match[0].length);match=pattern.exec(expr);}
return before+String.interpret(ctx);});}});Template.Pattern=/(^|.|\r|\n)(#\{(.*?)\})/;var $break={};var Enumerable=(function(){function each(iterator,context){var index=0;try{this._each(function(value){iterator.call(context,value,index++);});}catch(e){if(e!=$break)throw e;}
return this;}
function eachSlice(number,iterator,context){var index=-number,slices=[],array=this.toArray();if(number<1)return array;while((index+=number)<array.length)
slices.push(array.slice(index,index+number));return slices.collect(iterator,context);}
function all(iterator,context){iterator=iterator||Prototype.K;var result=true;this.each(function(value,index){result=result&&!!iterator.call(context,value,index);if(!result)throw $break;});return result;}
function any(iterator,context){iterator=iterator||Prototype.K;var result=false;this.each(function(value,index){if(result=!!iterator.call(context,value,index))
throw $break;});return result;}
function collect(iterator,context){iterator=iterator||Prototype.K;var results=[];this.each(function(value,index){results.push(iterator.call(context,value,index));});return results;}
function detect(iterator,context){var result;this.each(function(value,index){if(iterator.call(context,value,index)){result=value;throw $break;}});return result;}
function findAll(iterator,context){var results=[];this.each(function(value,index){if(iterator.call(context,value,index))
results.push(value);});return results;}
function grep(filter,iterator,context){iterator=iterator||Prototype.K;var results=[];if(Object.isString(filter))
filter=new RegExp(RegExp.escape(filter));this.each(function(value,index){if(filter.match(value))
results.push(iterator.call(context,value,index));});return results;}
function include(object){if(Object.isFunction(this.indexOf))
if(this.indexOf(object)!=-1)return true;var found=false;this.each(function(value){if(value==object){found=true;throw $break;}});return found;}
function inGroupsOf(number,fillWith){fillWith=Object.isUndefined(fillWith)?null:fillWith;return this.eachSlice(number,function(slice){while(slice.length<number)slice.push(fillWith);return slice;});}
function inject(memo,iterator,context){this.each(function(value,index){memo=iterator.call(context,memo,value,index);});return memo;}
function invoke(method){var args=$A(arguments).slice(1);return this.map(function(value){return value[method].apply(value,args);});}
function max(iterator,context){iterator=iterator||Prototype.K;var result;this.each(function(value,index){value=iterator.call(context,value,index);if(result==null||value>=result)
result=value;});return result;}
function min(iterator,context){iterator=iterator||Prototype.K;var result;this.each(function(value,index){value=iterator.call(context,value,index);if(result==null||value<result)
result=value;});return result;}
function partition(iterator,context){iterator=iterator||Prototype.K;var trues=[],falses=[];this.each(function(value,index){(iterator.call(context,value,index)?trues:falses).push(value);});return[trues,falses];}
function pluck(property){var results=[];this.each(function(value){results.push(value[property]);});return results;}
function reject(iterator,context){var results=[];this.each(function(value,index){if(!iterator.call(context,value,index))
results.push(value);});return results;}
function sortBy(iterator,context){return this.map(function(value,index){return{value:value,criteria:iterator.call(context,value,index)};}).sort(function(left,right){var a=left.criteria,b=right.criteria;return a<b?-1:a>b?1:0;}).pluck('value');}
function toArray(){return this.map();}
function zip(){var iterator=Prototype.K,args=$A(arguments);if(Object.isFunction(args.last()))
iterator=args.pop();var collections=[this].concat(args).map($A);return this.map(function(value,index){return iterator(collections.pluck(index));});}
function size(){return this.toArray().length;}
function inspect(){return'#<Enumerable:'+this.toArray().inspect()+'>';}
return{each:each,eachSlice:eachSlice,all:all,every:all,any:any,some:any,collect:collect,map:collect,detect:detect,findAll:findAll,select:findAll,filter:findAll,grep:grep,include:include,member:include,inGroupsOf:inGroupsOf,inject:inject,invoke:invoke,max:max,min:min,partition:partition,pluck:pluck,reject:reject,sortBy:sortBy,toArray:toArray,entries:toArray,zip:zip,size:size,inspect:inspect,find:detect};})();function $A(iterable){if(!iterable)return[];if('toArray'in Object(iterable))return iterable.toArray();var length=iterable.length||0,results=new Array(length);while(length--)results[length]=iterable[length];return results;}
function $w(string){if(!Object.isString(string))return[];string=string.strip();return string?string.split(/\s+/):[];}
Array.from=$A;(function(){var arrayProto=Array.prototype,slice=arrayProto.slice,_each=arrayProto.forEach;function each(iterator){for(var i=0,length=this.length;i<length;i++)
iterator(this[i]);}
if(!_each)_each=each;function clear(){this.length=0;return this;}
function first(){return this[0];}
function last(){return this[this.length-1];}
function compact(){return this.select(function(value){return value!=null;});}
function flatten(){return this.inject([],function(array,value){if(Object.isArray(value))
return array.concat(value.flatten());array.push(value);return array;});}
function without(){var values=slice.call(arguments,0);return this.select(function(value){return!values.include(value);});}
function reverse(inline){return(inline!==false?this:this.toArray())._reverse();}
function uniq(sorted){return this.inject([],function(array,value,index){if(0==index||(sorted?array.last()!=value:!array.include(value)))
array.push(value);return array;});}
function intersect(array){return this.uniq().findAll(function(item){return array.detect(function(value){return item===value});});}
function clone(){return slice.call(this,0);}
function size(){return this.length;}
function inspect(){return'['+this.map(Object.inspect).join(', ')+']';}
function toJSON(){var results=[];this.each(function(object){var value=Object.toJSON(object);if(!Object.isUndefined(value))results.push(value);});return'['+results.join(', ')+']';}
function indexOf(item,i){i||(i=0);var length=this.length;if(i<0)i=length+i;for(;i<length;i++)
if(this[i]===item)return i;return-1;}
function lastIndexOf(item,i){i=isNaN(i)?this.length:(i<0?this.length+i:i)+1;var n=this.slice(0,i).reverse().indexOf(item);return(n<0)?n:i-n-1;}
function concat(){var array=slice.call(this,0),item;for(var i=0,length=arguments.length;i<length;i++){item=arguments[i];if(Object.isArray(item)&&!('callee'in item)){for(var j=0,arrayLength=item.length;j<arrayLength;j++)
array.push(item[j]);}else{array.push(item);}}
return array;}
Object.extend(arrayProto,Enumerable);if(!arrayProto._reverse)
arrayProto._reverse=arrayProto.reverse;Object.extend(arrayProto,{_each:_each,clear:clear,first:first,last:last,compact:compact,flatten:flatten,without:without,reverse:reverse,uniq:uniq,intersect:intersect,clone:clone,toArray:clone,size:size,inspect:inspect,toJSON:toJSON});var CONCAT_ARGUMENTS_BUGGY=(function(){return[].concat(arguments)[0][0]!==1;})(1,2)
if(CONCAT_ARGUMENTS_BUGGY)arrayProto.concat=concat;if(!arrayProto.indexOf)arrayProto.indexOf=indexOf;if(!arrayProto.lastIndexOf)arrayProto.lastIndexOf=lastIndexOf;})();function $H(object){return new Hash(object);};var Hash=Class.create(Enumerable,(function(){function initialize(object){this._object=Object.isHash(object)?object.toObject():Object.clone(object);}
function _each(iterator){for(var key in this._object){var value=this._object[key],pair=[key,value];pair.key=key;pair.value=value;iterator(pair);}}
function set(key,value){return this._object[key]=value;}
function get(key){if(this._object[key]!==Object.prototype[key])
return this._object[key];}
function unset(key){var value=this._object[key];delete this._object[key];return value;}
function toObject(){return Object.clone(this._object);}
function keys(){return this.pluck('key');}
function values(){return this.pluck('value');}
function index(value){var match=this.detect(function(pair){return pair.value===value;});return match&&match.key;}
function merge(object){return this.clone().update(object);}
function update(object){return new Hash(object).inject(this,function(result,pair){result.set(pair.key,pair.value);return result;});}
function toQueryPair(key,value){if(Object.isUndefined(value))return key;return key+'='+encodeURIComponent(String.interpret(value));}
function toQueryString(){return this.inject([],function(results,pair){var key=encodeURIComponent(pair.key),values=pair.value;if(values&&typeof values=='object'){if(Object.isArray(values))
return results.concat(values.map(toQueryPair.curry(key)));}else results.push(toQueryPair(key,values));return results;}).join('&');}
function inspect(){return'#<Hash:{'+this.map(function(pair){return pair.map(Object.inspect).join(': ');}).join(', ')+'}>';}
function toJSON(){return Object.toJSON(this.toObject());}
function clone(){return new Hash(this);}
return{initialize:initialize,_each:_each,set:set,get:get,unset:unset,toObject:toObject,toTemplateReplacements:toObject,keys:keys,values:values,index:index,merge:merge,update:update,toQueryString:toQueryString,inspect:inspect,toJSON:toJSON,clone:clone};})());Hash.from=$H;Object.extend(Number.prototype,(function(){function toColorPart(){return this.toPaddedString(2,16);}
function succ(){return this+1;}
function times(iterator,context){$R(0,this,true).each(iterator,context);return this;}
function toPaddedString(length,radix){var string=this.toString(radix||10);return'0'.times(length-string.length)+string;}
function toJSON(){return isFinite(this)?this.toString():'null';}
function abs(){return Math.abs(this);}
function round(){return Math.round(this);}
function ceil(){return Math.ceil(this);}
function floor(){return Math.floor(this);}
return{toColorPart:toColorPart,succ:succ,times:times,toPaddedString:toPaddedString,toJSON:toJSON,abs:abs,round:round,ceil:ceil,floor:floor};})());function $R(start,end,exclusive){return new ObjectRange(start,end,exclusive);}
var ObjectRange=Class.create(Enumerable,(function(){function initialize(start,end,exclusive){this.start=start;this.end=end;this.exclusive=exclusive;}
function _each(iterator){var value=this.start;while(this.include(value)){iterator(value);value=value.succ();}}
function include(value){if(value<this.start)
return false;if(this.exclusive)
return value<this.end;return value<=this.end;}
return{initialize:initialize,_each:_each,include:include};})());var Ajax={getTransport:function(){return Try.these(function(){return new XMLHttpRequest()},function(){return new ActiveXObject('Msxml2.XMLHTTP')},function(){return new ActiveXObject('Microsoft.XMLHTTP')})||false;},activeRequestCount:0};Ajax.Responders={responders:[],_each:function(iterator){this.responders._each(iterator);},register:function(responder){if(!this.include(responder))
this.responders.push(responder);},unregister:function(responder){this.responders=this.responders.without(responder);},dispatch:function(callback,request,transport,json){this.each(function(responder){if(Object.isFunction(responder[callback])){try{responder[callback].apply(responder,[request,transport,json]);}catch(e){}}});}};Object.extend(Ajax.Responders,Enumerable);Ajax.Responders.register({onCreate:function(){Ajax.activeRequestCount++},onComplete:function(){Ajax.activeRequestCount--}});Ajax.Base=Class.create({initialize:function(options){this.options={method:'post',asynchronous:true,contentType:'application/x-www-form-urlencoded',encoding:'UTF-8',parameters:'',evalJSON:true,evalJS:true};Object.extend(this.options,options||{});this.options.method=this.options.method.toLowerCase();if(Object.isString(this.options.parameters))
this.options.parameters=this.options.parameters.toQueryParams();else if(Object.isHash(this.options.parameters))
this.options.parameters=this.options.parameters.toObject();}});Ajax.Request=Class.create(Ajax.Base,{_complete:false,initialize:function($super,url,options){$super(options);this.transport=Ajax.getTransport();this.request(url);},request:function(url){this.url=url;this.method=this.options.method;var params=Object.clone(this.options.parameters);if(!['get','post'].include(this.method)){params['_method']=this.method;this.method='post';}
this.parameters=params;if(params=Object.toQueryString(params)){if(this.method=='get')
this.url+=(this.url.include('?')?'&':'?')+params;else if(/Konqueror|Safari|KHTML/.test(navigator.userAgent))
params+='&_=';}
try{var response=new Ajax.Response(this);if(this.options.onCreate)this.options.onCreate(response);Ajax.Responders.dispatch('onCreate',this,response);this.transport.open(this.method.toUpperCase(),this.url,this.options.asynchronous);if(this.options.asynchronous)this.respondToReadyState.bind(this).defer(1);this.transport.onreadystatechange=this.onStateChange.bind(this);this.setRequestHeaders();this.body=this.method=='post'?(this.options.postBody||params):null;this.transport.send(this.body);if(!this.options.asynchronous&&this.transport.overrideMimeType)
this.onStateChange();}
catch(e){this.dispatchException(e);}},onStateChange:function(){var readyState=this.transport.readyState;if(readyState>1&&!((readyState==4)&&this._complete))
this.respondToReadyState(this.transport.readyState);},setRequestHeaders:function(){var headers={'X-Requested-With':'XMLHttpRequest','X-Prototype-Version':Prototype.Version,'Accept':'text/javascript, text/html, application/xml, text/xml, */*'};if(this.method=='post'){headers['Content-type']=this.options.contentType+
(this.options.encoding?'; charset='+this.options.encoding:'');if(this.transport.overrideMimeType&&(navigator.userAgent.match(/Gecko\/(\d{4})/)||[0,2005])[1]<2005)
headers['Connection']='close';}
if(typeof this.options.requestHeaders=='object'){var extras=this.options.requestHeaders;if(Object.isFunction(extras.push))
for(var i=0,length=extras.length;i<length;i+=2)
headers[extras[i]]=extras[i+1];else
$H(extras).each(function(pair){headers[pair.key]=pair.value});}
for(var name in headers)
this.transport.setRequestHeader(name,headers[name]);},success:function(){var status=this.getStatus();return!status||(status>=200&&status<300);},getStatus:function(){try{return this.transport.status||0;}catch(e){return 0}},respondToReadyState:function(readyState){var state=Ajax.Request.Events[readyState],response=new Ajax.Response(this);if(state=='Complete'){try{this._complete=true;(this.options['on'+response.status]||this.options['on'+(this.success()?'Success':'Failure')]||Prototype.emptyFunction)(response,response.headerJSON);}catch(e){this.dispatchException(e);}
var contentType=response.getHeader('Content-type');if(this.options.evalJS=='force'||(this.options.evalJS&&this.isSameOrigin()&&contentType&&contentType.match(/^\s*(text|application)\/(x-)?(java|ecma)script(;.*)?\s*$/i)))
this.evalResponse();}
try{(this.options['on'+state]||Prototype.emptyFunction)(response,response.headerJSON);Ajax.Responders.dispatch('on'+state,this,response,response.headerJSON);}catch(e){this.dispatchException(e);}
if(state=='Complete'){this.transport.onreadystatechange=Prototype.emptyFunction;}},isSameOrigin:function(){var m=this.url.match(/^\s*https?:\/\/[^\/]*/);return!m||(m[0]=='#{protocol}//#{domain}#{port}'.interpolate({protocol:location.protocol,domain:document.domain,port:location.port?':'+location.port:''}));},getHeader:function(name){try{return this.transport.getResponseHeader(name)||null;}catch(e){return null;}},evalResponse:function(){try{return eval((this.transport.responseText||'').unfilterJSON());}catch(e){this.dispatchException(e);}},dispatchException:function(exception){(this.options.onException||Prototype.emptyFunction)(this,exception);Ajax.Responders.dispatch('onException',this,exception);}});Ajax.Request.Events=['Uninitialized','Loading','Loaded','Interactive','Complete'];Ajax.Response=Class.create({initialize:function(request){this.request=request;var transport=this.transport=request.transport,readyState=this.readyState=transport.readyState;if((readyState>2&&!Prototype.Browser.IE)||readyState==4){this.status=this.getStatus();this.statusText=this.getStatusText();this.responseText=String.interpret(transport.responseText);this.headerJSON=this._getHeaderJSON();}
if(readyState==4){var xml=transport.responseXML;this.responseXML=Object.isUndefined(xml)?null:xml;this.responseJSON=this._getResponseJSON();}},status:0,statusText:'',getStatus:Ajax.Request.prototype.getStatus,getStatusText:function(){try{return this.transport.statusText||'';}catch(e){return''}},getHeader:Ajax.Request.prototype.getHeader,getAllHeaders:function(){try{return this.getAllResponseHeaders();}catch(e){return null}},getResponseHeader:function(name){return this.transport.getResponseHeader(name);},getAllResponseHeaders:function(){return this.transport.getAllResponseHeaders();},_getHeaderJSON:function(){var json=this.getHeader('X-JSON');if(!json)return null;json=decodeURIComponent(escape(json));try{return json.evalJSON(this.request.options.sanitizeJSON||!this.request.isSameOrigin());}catch(e){this.request.dispatchException(e);}},_getResponseJSON:function(){var options=this.request.options;if(!options.evalJSON||(options.evalJSON!='force'&&!(this.getHeader('Content-type')||'').include('application/json'))||this.responseText.blank())
return null;try{return this.responseText.evalJSON(options.sanitizeJSON||!this.request.isSameOrigin());}catch(e){this.request.dispatchException(e);}}});Ajax.Updater=Class.create(Ajax.Request,{initialize:function($super,container,url,options){this.container={success:(container.success||container),failure:(container.failure||(container.success?null:container))};options=Object.clone(options);var onComplete=options.onComplete;options.onComplete=(function(response,json){this.updateContent(response.responseText);if(Object.isFunction(onComplete))onComplete(response,json);}).bind(this);$super(url,options);},updateContent:function(responseText){var receiver=this.container[this.success()?'success':'failure'],options=this.options;if(!options.evalScripts)responseText=responseText.stripScripts();if(receiver=$(receiver)){if(options.insertion){if(Object.isString(options.insertion)){var insertion={};insertion[options.insertion]=responseText;receiver.insert(insertion);}
else options.insertion(receiver,responseText);}
else receiver.update(responseText);}}});Ajax.PeriodicalUpdater=Class.create(Ajax.Base,{initialize:function($super,container,url,options){$super(options);this.onComplete=this.options.onComplete;this.frequency=(this.options.frequency||2);this.decay=(this.options.decay||1);this.updater={};this.container=container;this.url=url;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(response){if(this.options.decay){this.decay=(response.responseText==this.lastText?this.decay*this.options.decay:1);this.lastText=response.responseText;}
this.timer=this.onTimerEvent.bind(this).delay(this.decay*this.frequency);},onTimerEvent:function(){this.updater=new Ajax.Updater(this.container,this.url,this.options);}});function $(element){if(arguments.length>1){for(var i=0,elements=[],length=arguments.length;i<length;i++)
elements.push($(arguments[i]));return elements;}
if(Object.isString(element))
element=document.getElementById(element);return Element.extend(element);}
if(Prototype.BrowserFeatures.XPath){document._getElementsByXPath=function(expression,parentElement){var results=[];var query=document.evaluate(expression,$(parentElement)||document,null,XPathResult.ORDERED_NODE_SNAPSHOT_TYPE,null);for(var i=0,length=query.snapshotLength;i<length;i++)
results.push(Element.extend(query.snapshotItem(i)));return results;};}
if(!window.Node)var Node={};if(!Node.ELEMENT_NODE){Object.extend(Node,{ELEMENT_NODE:1,ATTRIBUTE_NODE:2,TEXT_NODE:3,CDATA_SECTION_NODE:4,ENTITY_REFERENCE_NODE:5,ENTITY_NODE:6,PROCESSING_INSTRUCTION_NODE:7,COMMENT_NODE:8,DOCUMENT_NODE:9,DOCUMENT_TYPE_NODE:10,DOCUMENT_FRAGMENT_NODE:11,NOTATION_NODE:12});}
(function(global){var SETATTRIBUTE_IGNORES_NAME=(function(){var elForm=document.createElement("form");var elInput=document.createElement("input");var root=document.documentElement;elInput.setAttribute("name","test");elForm.appendChild(elInput);root.appendChild(elForm);var isBuggy=elForm.elements?(typeof elForm.elements.test=="undefined"):null;root.removeChild(elForm);elForm=elInput=null;return isBuggy;})();var element=global.Element;global.Element=function(tagName,attributes){attributes=attributes||{};tagName=tagName.toLowerCase();var cache=Element.cache;if(SETATTRIBUTE_IGNORES_NAME&&attributes.name){tagName='<'+tagName+' name="'+attributes.name+'">';delete attributes.name;return Element.writeAttribute(document.createElement(tagName),attributes);}
if(!cache[tagName])cache[tagName]=Element.extend(document.createElement(tagName));return Element.writeAttribute(cache[tagName].cloneNode(false),attributes);};Object.extend(global.Element,element||{});if(element)global.Element.prototype=element.prototype;})(this);Element.cache={};Element.idCounter=1;Element.Methods={visible:function(element){return $(element).style.display!='none';},toggle:function(element){element=$(element);Element[Element.visible(element)?'hide':'show'](element);return element;},hide:function(element){element=$(element);element.style.display='none';return element;},show:function(element){element=$(element);element.style.display='';return element;},remove:function(element){element=$(element);element.parentNode.removeChild(element);return element;},update:(function(){var SELECT_ELEMENT_INNERHTML_BUGGY=(function(){var el=document.createElement("select"),isBuggy=true;el.innerHTML="<option value=\"test\">test</option>";if(el.options&&el.options[0]){isBuggy=el.options[0].nodeName.toUpperCase()!=="OPTION";}
el=null;return isBuggy;})();var TABLE_ELEMENT_INNERHTML_BUGGY=(function(){try{var el=document.createElement("table");if(el&&el.tBodies){el.innerHTML="<tbody><tr><td>test</td></tr></tbody>";var isBuggy=typeof el.tBodies[0]=="undefined";el=null;return isBuggy;}}catch(e){return true;}})();var SCRIPT_ELEMENT_REJECTS_TEXTNODE_APPENDING=(function(){var s=document.createElement("script"),isBuggy=false;try{s.appendChild(document.createTextNode(""));isBuggy=!s.firstChild||s.firstChild&&s.firstChild.nodeType!==3;}catch(e){isBuggy=true;}
s=null;return isBuggy;})();function update(element,content){element=$(element);if(content&&content.toElement)
content=content.toElement();if(Object.isElement(content))
return element.update().insert(content);content=Object.toHTML(content);var tagName=element.tagName.toUpperCase();if(tagName==='SCRIPT'&&SCRIPT_ELEMENT_REJECTS_TEXTNODE_APPENDING){element.text=content;return element;}
if(SELECT_ELEMENT_INNERHTML_BUGGY||TABLE_ELEMENT_INNERHTML_BUGGY){if(tagName in Element._insertionTranslations.tags){while(element.firstChild){element.removeChild(element.firstChild);}
Element._getContentFromAnonymousElement(tagName,content.stripScripts()).each(function(node){element.appendChild(node)});}
else{element.innerHTML=content.stripScripts();}}
else{element.innerHTML=content.stripScripts();}
content.evalScripts.bind(content).defer();return element;}
return update;})(),replace:function(element,content){element=$(element);if(content&&content.toElement)content=content.toElement();else if(!Object.isElement(content)){content=Object.toHTML(content);var range=element.ownerDocument.createRange();range.selectNode(element);content.evalScripts.bind(content).defer();content=range.createContextualFragment(content.stripScripts());}
element.parentNode.replaceChild(content,element);return element;},insert:function(element,insertions){element=$(element);if(Object.isString(insertions)||Object.isNumber(insertions)||Object.isElement(insertions)||(insertions&&(insertions.toElement||insertions.toHTML)))
insertions={bottom:insertions};var content,insert,tagName,childNodes;for(var position in insertions){content=insertions[position];position=position.toLowerCase();insert=Element._insertionTranslations[position];if(content&&content.toElement)content=content.toElement();if(Object.isElement(content)){insert(element,content);continue;}
content=Object.toHTML(content);tagName=((position=='before'||position=='after')?element.parentNode:element).tagName.toUpperCase();childNodes=Element._getContentFromAnonymousElement(tagName,content.stripScripts());if(position=='top'||position=='after')childNodes.reverse();childNodes.each(insert.curry(element));content.evalScripts.bind(content).defer();}
return element;},wrap:function(element,wrapper,attributes){element=$(element);if(Object.isElement(wrapper))
$(wrapper).writeAttribute(attributes||{});else if(Object.isString(wrapper))wrapper=new Element(wrapper,attributes);else wrapper=new Element('div',wrapper);if(element.parentNode)
element.parentNode.replaceChild(wrapper,element);wrapper.appendChild(element);return wrapper;},inspect:function(element){element=$(element);var result='<'+element.tagName.toLowerCase();$H({'id':'id','className':'class'}).each(function(pair){var property=pair.first(),attribute=pair.last();var value=(element[property]||'').toString();if(value)result+=' '+attribute+'='+value.inspect(true);});return result+'>';},recursivelyCollect:function(element,property){element=$(element);var elements=[];while(element=element[property])
if(element.nodeType==1)
elements.push(Element.extend(element));return elements;},ancestors:function(element){return Element.recursivelyCollect(element,'parentNode');},descendants:function(element){return Element.select(element,"*");},firstDescendant:function(element){element=$(element).firstChild;while(element&&element.nodeType!=1)element=element.nextSibling;return $(element);},immediateDescendants:function(element){if(!(element=$(element).firstChild))return[];while(element&&element.nodeType!=1)element=element.nextSibling;if(element)return[element].concat($(element).nextSiblings());return[];},previousSiblings:function(element){return Element.recursivelyCollect(element,'previousSibling');},nextSiblings:function(element){return Element.recursivelyCollect(element,'nextSibling');},siblings:function(element){element=$(element);return Element.previousSiblings(element).reverse().concat(Element.nextSiblings(element));},match:function(element,selector){if(Object.isString(selector))
selector=new Selector(selector);return selector.match($(element));},up:function(element,expression,index){element=$(element);if(arguments.length==1)return $(element.parentNode);var ancestors=Element.ancestors(element);return Object.isNumber(expression)?ancestors[expression]:Selector.findElement(ancestors,expression,index);},down:function(element,expression,index){element=$(element);if(arguments.length==1)return Element.firstDescendant(element);return Object.isNumber(expression)?Element.descendants(element)[expression]:Element.select(element,expression)[index||0];},previous:function(element,expression,index){element=$(element);if(arguments.length==1)return $(Selector.handlers.previousElementSibling(element));var previousSiblings=Element.previousSiblings(element);return Object.isNumber(expression)?previousSiblings[expression]:Selector.findElement(previousSiblings,expression,index);},next:function(element,expression,index){element=$(element);if(arguments.length==1)return $(Selector.handlers.nextElementSibling(element));var nextSiblings=Element.nextSiblings(element);return Object.isNumber(expression)?nextSiblings[expression]:Selector.findElement(nextSiblings,expression,index);},select:function(element){var args=Array.prototype.slice.call(arguments,1);return Selector.findChildElements(element,args);},adjacent:function(element){var args=Array.prototype.slice.call(arguments,1);return Selector.findChildElements(element.parentNode,args).without(element);},identify:function(element){element=$(element);var id=Element.readAttribute(element,'id');if(id)return id;do{id='anonymous_element_'+Element.idCounter++}while($(id));Element.writeAttribute(element,'id',id);return id;},readAttribute:function(element,name){element=$(element);if(Prototype.Browser.IE){var t=Element._attributeTranslations.read;if(t.values[name])return t.values[name](element,name);if(t.names[name])name=t.names[name];if(name.include(':')){return(!element.attributes||!element.attributes[name])?null:element.attributes[name].value;}}
return element.getAttribute(name);},writeAttribute:function(element,name,value){element=$(element);var attributes={},t=Element._attributeTranslations.write;if(typeof name=='object')attributes=name;else attributes[name]=Object.isUndefined(value)?true:value;for(var attr in attributes){name=t.names[attr]||attr;value=attributes[attr];if(t.values[attr])name=t.values[attr](element,value);if(value===false||value===null)
element.removeAttribute(name);else if(value===true)
element.setAttribute(name,name);else element.setAttribute(name,value);}
return element;},getHeight:function(element){return Element.getDimensions(element).height;},getWidth:function(element){return Element.getDimensions(element).width;},classNames:function(element){return new Element.ClassNames(element);},hasClassName:function(element,className){if(!(element=$(element)))return;var elementClassName=element.className;return(elementClassName.length>0&&(elementClassName==className||new RegExp("(^|\\s)"+className+"(\\s|$)").test(elementClassName)));},addClassName:function(element,className){if(!(element=$(element)))return;if(!Element.hasClassName(element,className))
element.className+=(element.className?' ':'')+className;return element;},removeClassName:function(element,className){if(!(element=$(element)))return;element.className=element.className.replace(new RegExp("(^|\\s+)"+className+"(\\s+|$)"),' ').strip();return element;},toggleClassName:function(element,className){if(!(element=$(element)))return;return Element[Element.hasClassName(element,className)?'removeClassName':'addClassName'](element,className);},cleanWhitespace:function(element){element=$(element);var node=element.firstChild;while(node){var nextNode=node.nextSibling;if(node.nodeType==3&&!/\S/.test(node.nodeValue))
element.removeChild(node);node=nextNode;}
return element;},empty:function(element){return $(element).innerHTML.blank();},descendantOf:function(element,ancestor){element=$(element),ancestor=$(ancestor);if(element.compareDocumentPosition)
return(element.compareDocumentPosition(ancestor)&8)===8;if(ancestor.contains)
return ancestor.contains(element)&&ancestor!==element;while(element=element.parentNode)
if(element==ancestor)return true;return false;},scrollTo:function(element){element=$(element);var pos=Element.cumulativeOffset(element);window.scrollTo(pos[0],pos[1]);return element;},getStyle:function(element,style){element=$(element);style=style=='float'?'cssFloat':style.camelize();var value=element.style[style];if(!value||value=='auto'){var css=document.defaultView.getComputedStyle(element,null);value=css?css[style]:null;}
if(style=='opacity')return value?parseFloat(value):1.0;return value=='auto'?null:value;},getOpacity:function(element){return $(element).getStyle('opacity');},setStyle:function(element,styles){element=$(element);var elementStyle=element.style,match;if(Object.isString(styles)){element.style.cssText+=';'+styles;return styles.include('opacity')?element.setOpacity(styles.match(/opacity:\s*(\d?\.?\d*)/)[1]):element;}
for(var property in styles)
if(property=='opacity')element.setOpacity(styles[property]);else
elementStyle[(property=='float'||property=='cssFloat')?(Object.isUndefined(elementStyle.styleFloat)?'cssFloat':'styleFloat'):property]=styles[property];return element;},setOpacity:function(element,value){element=$(element);element.style.opacity=(value==1||value==='')?'':(value<0.00001)?0:value;return element;},getDimensions:function(element){element=$(element);var display=Element.getStyle(element,'display');if(display!='none'&&display!=null)
return{width:element.offsetWidth,height:element.offsetHeight};var els=element.style;var originalVisibility=els.visibility;var originalPosition=els.position;var originalDisplay=els.display;els.visibility='hidden';if(originalPosition!='fixed')
els.position='absolute';els.display='block';var originalWidth=element.clientWidth;var originalHeight=element.clientHeight;els.display=originalDisplay;els.position=originalPosition;els.visibility=originalVisibility;return{width:originalWidth,height:originalHeight};},makePositioned:function(element){element=$(element);var pos=Element.getStyle(element,'position');if(pos=='static'||!pos){element._madePositioned=true;element.style.position='relative';if(Prototype.Browser.Opera){element.style.top=0;element.style.left=0;}}
return element;},undoPositioned:function(element){element=$(element);if(element._madePositioned){element._madePositioned=undefined;element.style.position=element.style.top=element.style.left=element.style.bottom=element.style.right='';}
return element;},makeClipping:function(element){element=$(element);if(element._overflow)return element;element._overflow=Element.getStyle(element,'overflow')||'auto';if(element._overflow!=='hidden')
element.style.overflow='hidden';return element;},undoClipping:function(element){element=$(element);if(!element._overflow)return element;element.style.overflow=element._overflow=='auto'?'':element._overflow;element._overflow=null;return element;},cumulativeOffset:function(element){var valueT=0,valueL=0;do{valueT+=element.offsetTop||0;valueL+=element.offsetLeft||0;element=element.offsetParent;}while(element);return Element._returnOffset(valueL,valueT);},positionedOffset:function(element){var valueT=0,valueL=0;do{valueT+=element.offsetTop||0;valueL+=element.offsetLeft||0;element=element.offsetParent;if(element){if(element.tagName.toUpperCase()=='BODY')break;var p=Element.getStyle(element,'position');if(p!=='static')break;}}while(element);return Element._returnOffset(valueL,valueT);},absolutize:function(element){element=$(element);if(Element.getStyle(element,'position')=='absolute')return element;var offsets=Element.positionedOffset(element);var top=offsets[1];var left=offsets[0];var width=element.clientWidth;var height=element.clientHeight;element._originalLeft=left-parseFloat(element.style.left||0);element._originalTop=top-parseFloat(element.style.top||0);element._originalWidth=element.style.width;element._originalHeight=element.style.height;element.style.position='absolute';element.style.top=top+'px';element.style.left=left+'px';element.style.width=width+'px';element.style.height=height+'px';return element;},relativize:function(element){element=$(element);if(Element.getStyle(element,'position')=='relative')return element;element.style.position='relative';var top=parseFloat(element.style.top||0)-(element._originalTop||0);var left=parseFloat(element.style.left||0)-(element._originalLeft||0);element.style.top=top+'px';element.style.left=left+'px';element.style.height=element._originalHeight;element.style.width=element._originalWidth;return element;},cumulativeScrollOffset:function(element){var valueT=0,valueL=0;do{valueT+=element.scrollTop||0;valueL+=element.scrollLeft||0;element=element.parentNode;}while(element);return Element._returnOffset(valueL,valueT);},getOffsetParent:function(element){if(element.offsetParent)return $(element.offsetParent);if(element==document.body)return $(element);while((element=element.parentNode)&&element!=document.body)
if(Element.getStyle(element,'position')!='static')
return $(element);return $(document.body);},viewportOffset:function(forElement){var valueT=0,valueL=0;var element=forElement;do{valueT+=element.offsetTop||0;valueL+=element.offsetLeft||0;if(element.offsetParent==document.body&&Element.getStyle(element,'position')=='absolute')break;}while(element=element.offsetParent);element=forElement;do{if(!Prototype.Browser.Opera||(element.tagName&&(element.tagName.toUpperCase()=='BODY'))){valueT-=element.scrollTop||0;valueL-=element.scrollLeft||0;}}while(element=element.parentNode);return Element._returnOffset(valueL,valueT);},clonePosition:function(element,source){var options=Object.extend({setLeft:true,setTop:true,setWidth:true,setHeight:true,offsetTop:0,offsetLeft:0},arguments[2]||{});source=$(source);var p=Element.viewportOffset(source);element=$(element);var delta=[0,0];var parent=null;if(Element.getStyle(element,'position')=='absolute'){parent=Element.getOffsetParent(element);delta=Element.viewportOffset(parent);}
if(parent==document.body){delta[0]-=document.body.offsetLeft;delta[1]-=document.body.offsetTop;}
if(options.setLeft)element.style.left=(p[0]-delta[0]+options.offsetLeft)+'px';if(options.setTop)element.style.top=(p[1]-delta[1]+options.offsetTop)+'px';if(options.setWidth)element.style.width=source.offsetWidth+'px';if(options.setHeight)element.style.height=source.offsetHeight+'px';return element;}};Object.extend(Element.Methods,{getElementsBySelector:Element.Methods.select,childElements:Element.Methods.immediateDescendants});Element._attributeTranslations={write:{names:{className:'class',htmlFor:'for'},values:{}}};if(Prototype.Browser.Opera){Element.Methods.getStyle=Element.Methods.getStyle.wrap(function(proceed,element,style){switch(style){case'left':case'top':case'right':case'bottom':if(proceed(element,'position')==='static')return null;case'height':case'width':if(!Element.visible(element))return null;var dim=parseInt(proceed(element,style),10);if(dim!==element['offset'+style.capitalize()])
return dim+'px';var properties;if(style==='height'){properties=['border-top-width','padding-top','padding-bottom','border-bottom-width'];}
else{properties=['border-left-width','padding-left','padding-right','border-right-width'];}
return properties.inject(dim,function(memo,property){var val=proceed(element,property);return val===null?memo:memo-parseInt(val,10);})+'px';default:return proceed(element,style);}});Element.Methods.readAttribute=Element.Methods.readAttribute.wrap(function(proceed,element,attribute){if(attribute==='title')return element.title;return proceed(element,attribute);});}
else if(Prototype.Browser.IE){Element.Methods.getOffsetParent=Element.Methods.getOffsetParent.wrap(function(proceed,element){element=$(element);try{element.offsetParent}
catch(e){return $(document.body)}
var position=element.getStyle('position');if(position!=='static')return proceed(element);element.setStyle({position:'relative'});var value=proceed(element);element.setStyle({position:position});return value;});$w('positionedOffset viewportOffset').each(function(method){Element.Methods[method]=Element.Methods[method].wrap(function(proceed,element){element=$(element);try{element.offsetParent}
catch(e){return Element._returnOffset(0,0)}
var position=element.getStyle('position');if(position!=='static')return proceed(element);var offsetParent=element.getOffsetParent();if(offsetParent&&offsetParent.getStyle('position')==='fixed')
offsetParent.setStyle({zoom:1});element.setStyle({position:'relative'});var value=proceed(element);element.setStyle({position:position});return value;});});Element.Methods.cumulativeOffset=Element.Methods.cumulativeOffset.wrap(function(proceed,element){try{element.offsetParent}
catch(e){return Element._returnOffset(0,0)}
return proceed(element);});Element.Methods.getStyle=function(element,style){element=$(element);style=(style=='float'||style=='cssFloat')?'styleFloat':style.camelize();var value=element.style[style];if(!value&&element.currentStyle)value=element.currentStyle[style];if(style=='opacity'){if(value=(element.getStyle('filter')||'').match(/alpha\(opacity=(.*)\)/))
if(value[1])return parseFloat(value[1])/100;return 1.0;}
if(value=='auto'){if((style=='width'||style=='height')&&(element.getStyle('display')!='none'))
return element['offset'+style.capitalize()]+'px';return null;}
return value;};Element.Methods.setOpacity=function(element,value){function stripAlpha(filter){return filter.replace(/alpha\([^\)]*\)/gi,'');}
element=$(element);var currentStyle=element.currentStyle;if((currentStyle&&!currentStyle.hasLayout)||(!currentStyle&&element.style.zoom=='normal'))
element.style.zoom=1;var filter=element.getStyle('filter'),style=element.style;if(value==1||value===''){(filter=stripAlpha(filter))?style.filter=filter:style.removeAttribute('filter');return element;}else if(value<0.00001)value=0;style.filter=stripAlpha(filter)+'alpha(opacity='+(value*100)+')';return element;};Element._attributeTranslations=(function(){var classProp='className';var forProp='for';var el=document.createElement('div');el.setAttribute(classProp,'x');if(el.className!=='x'){el.setAttribute('class','x');if(el.className==='x'){classProp='class';}}
el=null;el=document.createElement('label');el.setAttribute(forProp,'x');if(el.htmlFor!=='x'){el.setAttribute('htmlFor','x');if(el.htmlFor==='x'){forProp='htmlFor';}}
el=null;return{read:{names:{'class':classProp,'className':classProp,'for':forProp,'htmlFor':forProp},values:{_getAttr:function(element,attribute){return element.getAttribute(attribute);},_getAttr2:function(element,attribute){return element.getAttribute(attribute,2);},_getAttrNode:function(element,attribute){var node=element.getAttributeNode(attribute);return node?node.value:"";},_getEv:(function(){var el=document.createElement('div');el.onclick=Prototype.emptyFunction;var value=el.getAttribute('onclick');var f;if(String(value).indexOf('{')>-1){f=function(element,attribute){attribute=element.getAttribute(attribute);if(!attribute)return null;attribute=attribute.toString();attribute=attribute.split('{')[1];attribute=attribute.split('}')[0];return attribute.strip();};}
else if(value===''){f=function(element,attribute){attribute=element.getAttribute(attribute);if(!attribute)return null;return attribute.strip();};}
el=null;return f;})(),_flag:function(element,attribute){return $(element).hasAttribute(attribute)?attribute:null;},style:function(element){return element.style.cssText.toLowerCase();},title:function(element){return element.title;}}}}})();Element._attributeTranslations.write={names:Object.extend({cellpadding:'cellPadding',cellspacing:'cellSpacing'},Element._attributeTranslations.read.names),values:{checked:function(element,value){element.checked=!!value;},style:function(element,value){element.style.cssText=value?value:'';}}};Element._attributeTranslations.has={};$w('colSpan rowSpan vAlign dateTime accessKey tabIndex '+'encType maxLength readOnly longDesc frameBorder').each(function(attr){Element._attributeTranslations.write.names[attr.toLowerCase()]=attr;Element._attributeTranslations.has[attr.toLowerCase()]=attr;});(function(v){Object.extend(v,{href:v._getAttr2,src:v._getAttr2,type:v._getAttr,action:v._getAttrNode,disabled:v._flag,checked:v._flag,readonly:v._flag,multiple:v._flag,onload:v._getEv,onunload:v._getEv,onclick:v._getEv,ondblclick:v._getEv,onmousedown:v._getEv,onmouseup:v._getEv,onmouseover:v._getEv,onmousemove:v._getEv,onmouseout:v._getEv,onfocus:v._getEv,onblur:v._getEv,onkeypress:v._getEv,onkeydown:v._getEv,onkeyup:v._getEv,onsubmit:v._getEv,onreset:v._getEv,onselect:v._getEv,onchange:v._getEv});})(Element._attributeTranslations.read.values);if(Prototype.BrowserFeatures.ElementExtensions){(function(){function _descendants(element){var nodes=element.getElementsByTagName('*'),results=[];for(var i=0,node;node=nodes[i];i++)
if(node.tagName!=="!")
results.push(node);return results;}
Element.Methods.down=function(element,expression,index){element=$(element);if(arguments.length==1)return element.firstDescendant();return Object.isNumber(expression)?_descendants(element)[expression]:Element.select(element,expression)[index||0];}})();}}
else if(Prototype.Browser.Gecko&&/rv:1\.8\.0/.test(navigator.userAgent)){Element.Methods.setOpacity=function(element,value){element=$(element);element.style.opacity=(value==1)?0.999999:(value==='')?'':(value<0.00001)?0:value;return element;};}
else if(Prototype.Browser.WebKit){Element.Methods.setOpacity=function(element,value){element=$(element);element.style.opacity=(value==1||value==='')?'':(value<0.00001)?0:value;if(value==1)
if(element.tagName.toUpperCase()=='IMG'&&element.width){element.width++;element.width--;}else try{var n=document.createTextNode(' ');element.appendChild(n);element.removeChild(n);}catch(e){}
return element;};Element.Methods.cumulativeOffset=function(element){var valueT=0,valueL=0;do{valueT+=element.offsetTop||0;valueL+=element.offsetLeft||0;if(element.offsetParent==document.body)
if(Element.getStyle(element,'position')=='absolute')break;element=element.offsetParent;}while(element);return Element._returnOffset(valueL,valueT);};}
if('outerHTML'in document.documentElement){Element.Methods.replace=function(element,content){element=$(element);if(content&&content.toElement)content=content.toElement();if(Object.isElement(content)){element.parentNode.replaceChild(content,element);return element;}
content=Object.toHTML(content);var parent=element.parentNode,tagName=parent.tagName.toUpperCase();if(Element._insertionTranslations.tags[tagName]){var nextSibling=element.next();var fragments=Element._getContentFromAnonymousElement(tagName,content.stripScripts());parent.removeChild(element);if(nextSibling)
fragments.each(function(node){parent.insertBefore(node,nextSibling)});else
fragments.each(function(node){parent.appendChild(node)});}
else element.outerHTML=content.stripScripts();content.evalScripts.bind(content).defer();return element;};}
Element._returnOffset=function(l,t){var result=[l,t];result.left=l;result.top=t;return result;};Element._getContentFromAnonymousElement=function(tagName,html){var div=new Element('div'),t=Element._insertionTranslations.tags[tagName];if(t){div.innerHTML=t[0]+html+t[1];t[2].times(function(){div=div.firstChild});}else div.innerHTML=html;return $A(div.childNodes);};Element._insertionTranslations={before:function(element,node){element.parentNode.insertBefore(node,element);},top:function(element,node){element.insertBefore(node,element.firstChild);},bottom:function(element,node){element.appendChild(node);},after:function(element,node){element.parentNode.insertBefore(node,element.nextSibling);},tags:{TABLE:['<table>','</table>',1],TBODY:['<table><tbody>','</tbody></table>',2],TR:['<table><tbody><tr>','</tr></tbody></table>',3],TD:['<table><tbody><tr><td>','</td></tr></tbody></table>',4],SELECT:['<select>','</select>',1]}};(function(){var tags=Element._insertionTranslations.tags;Object.extend(tags,{THEAD:tags.TBODY,TFOOT:tags.TBODY,TH:tags.TD});})();Element.Methods.Simulated={hasAttribute:function(element,attribute){attribute=Element._attributeTranslations.has[attribute]||attribute;var node=$(element).getAttributeNode(attribute);return!!(node&&node.specified);}};Element.Methods.ByTag={};Object.extend(Element,Element.Methods);(function(div){if(!Prototype.BrowserFeatures.ElementExtensions&&div['__proto__']){window.HTMLElement={};window.HTMLElement.prototype=div['__proto__'];Prototype.BrowserFeatures.ElementExtensions=true;}
div=null;})(document.createElement('div'))
Element.extend=(function(){function checkDeficiency(tagName){if(typeof window.Element!='undefined'){var proto=window.Element.prototype;if(proto){var id='_'+(Math.random()+'').slice(2);var el=document.createElement(tagName);proto[id]='x';var isBuggy=(el[id]!=='x');delete proto[id];el=null;return isBuggy;}}
return false;}
function extendElementWith(element,methods){for(var property in methods){var value=methods[property];if(Object.isFunction(value)&&!(property in element))
element[property]=value.methodize();}}
var HTMLOBJECTELEMENT_PROTOTYPE_BUGGY=checkDeficiency('object');if(Prototype.BrowserFeatures.SpecificElementExtensions){if(HTMLOBJECTELEMENT_PROTOTYPE_BUGGY){return function(element){if(element&&typeof element._extendedByPrototype=='undefined'){var t=element.tagName;if(t&&(/^(?:object|applet|embed)$/i.test(t))){extendElementWith(element,Element.Methods);extendElementWith(element,Element.Methods.Simulated);extendElementWith(element,Element.Methods.ByTag[t.toUpperCase()]);}}
return element;}}
return Prototype.K;}
var Methods={},ByTag=Element.Methods.ByTag;var extend=Object.extend(function(element){if(!element||typeof element._extendedByPrototype!='undefined'||element.nodeType!=1||element==window)return element;var methods=Object.clone(Methods),tagName=element.tagName.toUpperCase();if(ByTag[tagName])Object.extend(methods,ByTag[tagName]);extendElementWith(element,methods);element._extendedByPrototype=Prototype.emptyFunction;return element;},{refresh:function(){if(!Prototype.BrowserFeatures.ElementExtensions){Object.extend(Methods,Element.Methods);Object.extend(Methods,Element.Methods.Simulated);}}});extend.refresh();return extend;})();Element.hasAttribute=function(element,attribute){if(element.hasAttribute)return element.hasAttribute(attribute);return Element.Methods.Simulated.hasAttribute(element,attribute);};Element.addMethods=function(methods){var F=Prototype.BrowserFeatures,T=Element.Methods.ByTag;if(!methods){Object.extend(Form,Form.Methods);Object.extend(Form.Element,Form.Element.Methods);Object.extend(Element.Methods.ByTag,{"FORM":Object.clone(Form.Methods),"INPUT":Object.clone(Form.Element.Methods),"SELECT":Object.clone(Form.Element.Methods),"TEXTAREA":Object.clone(Form.Element.Methods)});}
if(arguments.length==2){var tagName=methods;methods=arguments[1];}
if(!tagName)Object.extend(Element.Methods,methods||{});else{if(Object.isArray(tagName))tagName.each(extend);else extend(tagName);}
function extend(tagName){tagName=tagName.toUpperCase();if(!Element.Methods.ByTag[tagName])
Element.Methods.ByTag[tagName]={};Object.extend(Element.Methods.ByTag[tagName],methods);}
function copy(methods,destination,onlyIfAbsent){onlyIfAbsent=onlyIfAbsent||false;for(var property in methods){var value=methods[property];if(!Object.isFunction(value))continue;if(!onlyIfAbsent||!(property in destination))
destination[property]=value.methodize();}}
function findDOMClass(tagName){var klass;var trans={"OPTGROUP":"OptGroup","TEXTAREA":"TextArea","P":"Paragraph","FIELDSET":"FieldSet","UL":"UList","OL":"OList","DL":"DList","DIR":"Directory","H1":"Heading","H2":"Heading","H3":"Heading","H4":"Heading","H5":"Heading","H6":"Heading","Q":"Quote","INS":"Mod","DEL":"Mod","A":"Anchor","IMG":"Image","CAPTION":"TableCaption","COL":"TableCol","COLGROUP":"TableCol","THEAD":"TableSection","TFOOT":"TableSection","TBODY":"TableSection","TR":"TableRow","TH":"TableCell","TD":"TableCell","FRAMESET":"FrameSet","IFRAME":"IFrame"};if(trans[tagName])klass='HTML'+trans[tagName]+'Element';if(window[klass])return window[klass];klass='HTML'+tagName+'Element';if(window[klass])return window[klass];klass='HTML'+tagName.capitalize()+'Element';if(window[klass])return window[klass];var element=document.createElement(tagName);var proto=element['__proto__']||element.constructor.prototype;element=null;return proto;}
var elementPrototype=window.HTMLElement?HTMLElement.prototype:Element.prototype;if(F.ElementExtensions){copy(Element.Methods,elementPrototype);copy(Element.Methods.Simulated,elementPrototype,true);}
if(F.SpecificElementExtensions){for(var tag in Element.Methods.ByTag){var klass=findDOMClass(tag);if(Object.isUndefined(klass))continue;copy(T[tag],klass.prototype);}}
Object.extend(Element,Element.Methods);delete Element.ByTag;if(Element.extend.refresh)Element.extend.refresh();Element.cache={};};document.viewport={getDimensions:function(){return{width:this.getWidth(),height:this.getHeight()};},getScrollOffsets:function(){return Element._returnOffset(window.pageXOffset||document.documentElement.scrollLeft||document.body.scrollLeft,window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop);}};(function(viewport){var B=Prototype.Browser,doc=document,element,property={};function getRootElement(){if(B.WebKit&&!doc.evaluate)
return document;if(B.Opera&&window.parseFloat(window.opera.version())<9.5)
return document.body;return document.documentElement;}
function define(D){if(!element)element=getRootElement();property[D]='client'+D;viewport['get'+D]=function(){return element[property[D]]};return viewport['get'+D]();}
viewport.getWidth=define.curry('Width');viewport.getHeight=define.curry('Height');})(document.viewport);Element.Storage={UID:1};Element.addMethods({getStorage:function(element){if(!(element=$(element)))return;var uid;if(element===window){uid=0;}else{if(typeof element._prototypeUID==="undefined")
element._prototypeUID=[Element.Storage.UID++];uid=element._prototypeUID[0];}
if(!Element.Storage[uid])
Element.Storage[uid]=$H();return Element.Storage[uid];},store:function(element,key,value){if(!(element=$(element)))return;if(arguments.length===2){Element.getStorage(element).update(key);}else{Element.getStorage(element).set(key,value);}
return element;},retrieve:function(element,key,defaultValue){if(!(element=$(element)))return;var hash=Element.getStorage(element),value=hash.get(key);if(Object.isUndefined(value)){hash.set(key,defaultValue);value=defaultValue;}
return value;},clone:function(element,deep){if(!(element=$(element)))return;var clone=element.cloneNode(deep);clone._prototypeUID=void 0;if(deep){var descendants=Element.select(clone,'*'),i=descendants.length;while(i--){descendants[i]._prototypeUID=void 0;}}
return Element.extend(clone);}});var Selector=Class.create({initialize:function(expression){this.expression=expression.strip();if(this.shouldUseSelectorsAPI()){this.mode='selectorsAPI';}else if(this.shouldUseXPath()){this.mode='xpath';this.compileXPathMatcher();}else{this.mode="normal";this.compileMatcher();}},shouldUseXPath:(function(){var IS_DESCENDANT_SELECTOR_BUGGY=(function(){var isBuggy=false;if(document.evaluate&&window.XPathResult){var el=document.createElement('div');el.innerHTML='<ul><li></li></ul><div><ul><li></li></ul></div>';var xpath=".//*[local-name()='ul' or local-name()='UL']"+"//*[local-name()='li' or local-name()='LI']";var result=document.evaluate(xpath,el,null,XPathResult.ORDERED_NODE_SNAPSHOT_TYPE,null);isBuggy=(result.snapshotLength!==2);el=null;}
return isBuggy;})();return function(){if(!Prototype.BrowserFeatures.XPath)return false;var e=this.expression;if(Prototype.Browser.WebKit&&(e.include("-of-type")||e.include(":empty")))
return false;if((/(\[[\w-]*?:|:checked)/).test(e))
return false;if(IS_DESCENDANT_SELECTOR_BUGGY)return false;return true;}})(),shouldUseSelectorsAPI:function(){if(!Prototype.BrowserFeatures.SelectorsAPI)return false;if(Selector.CASE_INSENSITIVE_CLASS_NAMES)return false;if(!Selector._div)Selector._div=new Element('div');try{Selector._div.querySelector(this.expression);}catch(e){return false;}
return true;},compileMatcher:function(){var e=this.expression,ps=Selector.patterns,h=Selector.handlers,c=Selector.criteria,le,p,m,len=ps.length,name;if(Selector._cache[e]){this.matcher=Selector._cache[e];return;}
this.matcher=["this.matcher = function(root) {","var r = root, h = Selector.handlers, c = false, n;"];while(e&&le!=e&&(/\S/).test(e)){le=e;for(var i=0;i<len;i++){p=ps[i].re;name=ps[i].name;if(m=e.match(p)){this.matcher.push(Object.isFunction(c[name])?c[name](m):new Template(c[name]).evaluate(m));e=e.replace(m[0],'');break;}}}
this.matcher.push("return h.unique(n);\n}");eval(this.matcher.join('\n'));Selector._cache[this.expression]=this.matcher;},compileXPathMatcher:function(){var e=this.expression,ps=Selector.patterns,x=Selector.xpath,le,m,len=ps.length,name;if(Selector._cache[e]){this.xpath=Selector._cache[e];return;}
this.matcher=['.//*'];while(e&&le!=e&&(/\S/).test(e)){le=e;for(var i=0;i<len;i++){name=ps[i].name;if(m=e.match(ps[i].re)){this.matcher.push(Object.isFunction(x[name])?x[name](m):new Template(x[name]).evaluate(m));e=e.replace(m[0],'');break;}}}
this.xpath=this.matcher.join('');Selector._cache[this.expression]=this.xpath;},findElements:function(root){root=root||document;var e=this.expression,results;switch(this.mode){case'selectorsAPI':if(root!==document){var oldId=root.id,id=$(root).identify();id=id.replace(/([\.:])/g,"\\$1");e="#"+id+" "+e;}
results=$A(root.querySelectorAll(e)).map(Element.extend);root.id=oldId;return results;case'xpath':return document._getElementsByXPath(this.xpath,root);default:return this.matcher(root);}},match:function(element){this.tokens=[];var e=this.expression,ps=Selector.patterns,as=Selector.assertions;var le,p,m,len=ps.length,name;while(e&&le!==e&&(/\S/).test(e)){le=e;for(var i=0;i<len;i++){p=ps[i].re;name=ps[i].name;if(m=e.match(p)){if(as[name]){this.tokens.push([name,Object.clone(m)]);e=e.replace(m[0],'');}else{return this.findElements(document).include(element);}}}}
var match=true,name,matches;for(var i=0,token;token=this.tokens[i];i++){name=token[0],matches=token[1];if(!Selector.assertions[name](element,matches)){match=false;break;}}
return match;},toString:function(){return this.expression;},inspect:function(){return"#<Selector:"+this.expression.inspect()+">";}});if(Prototype.BrowserFeatures.SelectorsAPI&&document.compatMode==='BackCompat'){Selector.CASE_INSENSITIVE_CLASS_NAMES=(function(){var div=document.createElement('div'),span=document.createElement('span');div.id="prototype_test_id";span.className='Test';div.appendChild(span);var isIgnored=(div.querySelector('#prototype_test_id .test')!==null);div=span=null;return isIgnored;})();}
Object.extend(Selector,{_cache:{},xpath:{descendant:"//*",child:"/*",adjacent:"/following-sibling::*[1]",laterSibling:'/following-sibling::*',tagName:function(m){if(m[1]=='*')return'';return"[local-name()='"+m[1].toLowerCase()+"' or local-name()='"+m[1].toUpperCase()+"']";},className:"[contains(concat(' ', @class, ' '), ' #{1} ')]",id:"[@id='#{1}']",attrPresence:function(m){m[1]=m[1].toLowerCase();return new Template("[@#{1}]").evaluate(m);},attr:function(m){m[1]=m[1].toLowerCase();m[3]=m[5]||m[6];return new Template(Selector.xpath.operators[m[2]]).evaluate(m);},pseudo:function(m){var h=Selector.xpath.pseudos[m[1]];if(!h)return'';if(Object.isFunction(h))return h(m);return new Template(Selector.xpath.pseudos[m[1]]).evaluate(m);},operators:{'=':"[@#{1}='#{3}']",'!=':"[@#{1}!='#{3}']",'^=':"[starts-with(@#{1}, '#{3}')]",'$=':"[substring(@#{1}, (string-length(@#{1}) - string-length('#{3}') + 1))='#{3}']",'*=':"[contains(@#{1}, '#{3}')]",'~=':"[contains(concat(' ', @#{1}, ' '), ' #{3} ')]",'|=':"[contains(concat('-', @#{1}, '-'), '-#{3}-')]"},pseudos:{'first-child':'[not(preceding-sibling::*)]','last-child':'[not(following-sibling::*)]','only-child':'[not(preceding-sibling::* or following-sibling::*)]','empty':"[count(*) = 0 and (count(text()) = 0)]",'checked':"[@checked]",'disabled':"[(@disabled) and (@type!='hidden')]",'enabled':"[not(@disabled) and (@type!='hidden')]",'not':function(m){var e=m[6],p=Selector.patterns,x=Selector.xpath,le,v,len=p.length,name;var exclusion=[];while(e&&le!=e&&(/\S/).test(e)){le=e;for(var i=0;i<len;i++){name=p[i].name
if(m=e.match(p[i].re)){v=Object.isFunction(x[name])?x[name](m):new Template(x[name]).evaluate(m);exclusion.push("("+v.substring(1,v.length-1)+")");e=e.replace(m[0],'');break;}}}
return"[not("+exclusion.join(" and ")+")]";},'nth-child':function(m){return Selector.xpath.pseudos.nth("(count(./preceding-sibling::*) + 1) ",m);},'nth-last-child':function(m){return Selector.xpath.pseudos.nth("(count(./following-sibling::*) + 1) ",m);},'nth-of-type':function(m){return Selector.xpath.pseudos.nth("position() ",m);},'nth-last-of-type':function(m){return Selector.xpath.pseudos.nth("(last() + 1 - position()) ",m);},'first-of-type':function(m){m[6]="1";return Selector.xpath.pseudos['nth-of-type'](m);},'last-of-type':function(m){m[6]="1";return Selector.xpath.pseudos['nth-last-of-type'](m);},'only-of-type':function(m){var p=Selector.xpath.pseudos;return p['first-of-type'](m)+p['last-of-type'](m);},nth:function(fragment,m){var mm,formula=m[6],predicate;if(formula=='even')formula='2n+0';if(formula=='odd')formula='2n+1';if(mm=formula.match(/^(\d+)$/))
return'['+fragment+"= "+mm[1]+']';if(mm=formula.match(/^(-?\d*)?n(([+-])(\d+))?/)){if(mm[1]=="-")mm[1]=-1;var a=mm[1]?Number(mm[1]):1;var b=mm[2]?Number(mm[2]):0;predicate="[((#{fragment} - #{b}) mod #{a} = 0) and "+"((#{fragment} - #{b}) div #{a} >= 0)]";return new Template(predicate).evaluate({fragment:fragment,a:a,b:b});}}}},criteria:{tagName:'n = h.tagName(n, r, "#{1}", c);      c = false;',className:'n = h.className(n, r, "#{1}", c);    c = false;',id:'n = h.id(n, r, "#{1}", c);           c = false;',attrPresence:'n = h.attrPresence(n, r, "#{1}", c); c = false;',attr:function(m){m[3]=(m[5]||m[6]);return new Template('n = h.attr(n, r, "#{1}", "#{3}", "#{2}", c); c = false;').evaluate(m);},pseudo:function(m){if(m[6])m[6]=m[6].replace(/"/g,'\\"');return new Template('n = h.pseudo(n, "#{1}", "#{6}", r, c); c = false;').evaluate(m);},descendant:'c = "descendant";',child:'c = "child";',adjacent:'c = "adjacent";',laterSibling:'c = "laterSibling";'},patterns:[{name:'laterSibling',re:/^\s*~\s*/},{name:'child',re:/^\s*>\s*/},{name:'adjacent',re:/^\s*\+\s*/},{name:'descendant',re:/^\s/},{name:'tagName',re:/^\s*(\*|[\w\-]+)(\b|$)?/},{name:'id',re:/^#([\w\-\*]+)(\b|$)/},{name:'className',re:/^\.([\w\-\*]+)(\b|$)/},{name:'pseudo',re:/^:((first|last|nth|nth-last|only)(-child|-of-type)|empty|checked|(en|dis)abled|not)(\((.*?)\))?(\b|$|(?=\s|[:+~>]))/},{name:'attrPresence',re:/^\[((?:[\w-]+:)?[\w-]+)\]/},{name:'attr',re:/\[((?:[\w-]*:)?[\w-]+)\s*(?:([!^$*~|]?=)\s*((['"])([^\4]*?)\4|([^'"][^\]]*?)))?\]/}],assertions:{tagName:function(element,matches){return matches[1].toUpperCase()==element.tagName.toUpperCase();},className:function(element,matches){return Element.hasClassName(element,matches[1]);},id:function(element,matches){return element.id===matches[1];},attrPresence:function(element,matches){return Element.hasAttribute(element,matches[1]);},attr:function(element,matches){var nodeValue=Element.readAttribute(element,matches[1]);return nodeValue&&Selector.operators[matches[2]](nodeValue,matches[5]||matches[6]);}},handlers:{concat:function(a,b){for(var i=0,node;node=b[i];i++)
a.push(node);return a;},mark:function(nodes){var _true=Prototype.emptyFunction;for(var i=0,node;node=nodes[i];i++)
node._countedByPrototype=_true;return nodes;},unmark:(function(){var PROPERTIES_ATTRIBUTES_MAP=(function(){var el=document.createElement('div'),isBuggy=false,propName='_countedByPrototype',value='x'
el[propName]=value;isBuggy=(el.getAttribute(propName)===value);el=null;return isBuggy;})();return PROPERTIES_ATTRIBUTES_MAP?function(nodes){for(var i=0,node;node=nodes[i];i++)
node.removeAttribute('_countedByPrototype');return nodes;}:function(nodes){for(var i=0,node;node=nodes[i];i++)
node._countedByPrototype=void 0;return nodes;}})(),index:function(parentNode,reverse,ofType){parentNode._countedByPrototype=Prototype.emptyFunction;if(reverse){for(var nodes=parentNode.childNodes,i=nodes.length-1,j=1;i>=0;i--){var node=nodes[i];if(node.nodeType==1&&(!ofType||node._countedByPrototype))node.nodeIndex=j++;}}else{for(var i=0,j=1,nodes=parentNode.childNodes;node=nodes[i];i++)
if(node.nodeType==1&&(!ofType||node._countedByPrototype))node.nodeIndex=j++;}},unique:function(nodes){if(nodes.length==0)return nodes;var results=[],n;for(var i=0,l=nodes.length;i<l;i++)
if(typeof(n=nodes[i])._countedByPrototype=='undefined'){n._countedByPrototype=Prototype.emptyFunction;results.push(Element.extend(n));}
return Selector.handlers.unmark(results);},descendant:function(nodes){var h=Selector.handlers;for(var i=0,results=[],node;node=nodes[i];i++)
h.concat(results,node.getElementsByTagName('*'));return results;},child:function(nodes){var h=Selector.handlers;for(var i=0,results=[],node;node=nodes[i];i++){for(var j=0,child;child=node.childNodes[j];j++)
if(child.nodeType==1&&child.tagName!='!')results.push(child);}
return results;},adjacent:function(nodes){for(var i=0,results=[],node;node=nodes[i];i++){var next=this.nextElementSibling(node);if(next)results.push(next);}
return results;},laterSibling:function(nodes){var h=Selector.handlers;for(var i=0,results=[],node;node=nodes[i];i++)
h.concat(results,Element.nextSiblings(node));return results;},nextElementSibling:function(node){while(node=node.nextSibling)
if(node.nodeType==1)return node;return null;},previousElementSibling:function(node){while(node=node.previousSibling)
if(node.nodeType==1)return node;return null;},tagName:function(nodes,root,tagName,combinator){var uTagName=tagName.toUpperCase();var results=[],h=Selector.handlers;if(nodes){if(combinator){if(combinator=="descendant"){for(var i=0,node;node=nodes[i];i++)
h.concat(results,node.getElementsByTagName(tagName));return results;}else nodes=this[combinator](nodes);if(tagName=="*")return nodes;}
for(var i=0,node;node=nodes[i];i++)
if(node.tagName.toUpperCase()===uTagName)results.push(node);return results;}else return root.getElementsByTagName(tagName);},id:function(nodes,root,id,combinator){var targetNode=$(id),h=Selector.handlers;if(root==document){if(!targetNode)return[];if(!nodes)return[targetNode];}else{if(!root.sourceIndex||root.sourceIndex<1){var nodes=root.getElementsByTagName('*');for(var j=0,node;node=nodes[j];j++){if(node.id===id)return[node];}}}
if(nodes){if(combinator){if(combinator=='child'){for(var i=0,node;node=nodes[i];i++)
if(targetNode.parentNode==node)return[targetNode];}else if(combinator=='descendant'){for(var i=0,node;node=nodes[i];i++)
if(Element.descendantOf(targetNode,node))return[targetNode];}else if(combinator=='adjacent'){for(var i=0,node;node=nodes[i];i++)
if(Selector.handlers.previousElementSibling(targetNode)==node)
return[targetNode];}else nodes=h[combinator](nodes);}
for(var i=0,node;node=nodes[i];i++)
if(node==targetNode)return[targetNode];return[];}
return(targetNode&&Element.descendantOf(targetNode,root))?[targetNode]:[];},className:function(nodes,root,className,combinator){if(nodes&&combinator)nodes=this[combinator](nodes);return Selector.handlers.byClassName(nodes,root,className);},byClassName:function(nodes,root,className){if(!nodes)nodes=Selector.handlers.descendant([root]);var needle=' '+className+' ';for(var i=0,results=[],node,nodeClassName;node=nodes[i];i++){nodeClassName=node.className;if(nodeClassName.length==0)continue;if(nodeClassName==className||(' '+nodeClassName+' ').include(needle))
results.push(node);}
return results;},attrPresence:function(nodes,root,attr,combinator){if(!nodes)nodes=root.getElementsByTagName("*");if(nodes&&combinator)nodes=this[combinator](nodes);var results=[];for(var i=0,node;node=nodes[i];i++)
if(Element.hasAttribute(node,attr))results.push(node);return results;},attr:function(nodes,root,attr,value,operator,combinator){if(!nodes)nodes=root.getElementsByTagName("*");if(nodes&&combinator)nodes=this[combinator](nodes);var handler=Selector.operators[operator],results=[];for(var i=0,node;node=nodes[i];i++){var nodeValue=Element.readAttribute(node,attr);if(nodeValue===null)continue;if(handler(nodeValue,value))results.push(node);}
return results;},pseudo:function(nodes,name,value,root,combinator){if(nodes&&combinator)nodes=this[combinator](nodes);if(!nodes)nodes=root.getElementsByTagName("*");return Selector.pseudos[name](nodes,value,root);}},pseudos:{'first-child':function(nodes,value,root){for(var i=0,results=[],node;node=nodes[i];i++){if(Selector.handlers.previousElementSibling(node))continue;results.push(node);}
return results;},'last-child':function(nodes,value,root){for(var i=0,results=[],node;node=nodes[i];i++){if(Selector.handlers.nextElementSibling(node))continue;results.push(node);}
return results;},'only-child':function(nodes,value,root){var h=Selector.handlers;for(var i=0,results=[],node;node=nodes[i];i++)
if(!h.previousElementSibling(node)&&!h.nextElementSibling(node))
results.push(node);return results;},'nth-child':function(nodes,formula,root){return Selector.pseudos.nth(nodes,formula,root);},'nth-last-child':function(nodes,formula,root){return Selector.pseudos.nth(nodes,formula,root,true);},'nth-of-type':function(nodes,formula,root){return Selector.pseudos.nth(nodes,formula,root,false,true);},'nth-last-of-type':function(nodes,formula,root){return Selector.pseudos.nth(nodes,formula,root,true,true);},'first-of-type':function(nodes,formula,root){return Selector.pseudos.nth(nodes,"1",root,false,true);},'last-of-type':function(nodes,formula,root){return Selector.pseudos.nth(nodes,"1",root,true,true);},'only-of-type':function(nodes,formula,root){var p=Selector.pseudos;return p['last-of-type'](p['first-of-type'](nodes,formula,root),formula,root);},getIndices:function(a,b,total){if(a==0)return b>0?[b]:[];return $R(1,total).inject([],function(memo,i){if(0==(i-b)%a&&(i-b)/a>=0)memo.push(i);return memo;});},nth:function(nodes,formula,root,reverse,ofType){if(nodes.length==0)return[];if(formula=='even')formula='2n+0';if(formula=='odd')formula='2n+1';var h=Selector.handlers,results=[],indexed=[],m;h.mark(nodes);for(var i=0,node;node=nodes[i];i++){if(!node.parentNode._countedByPrototype){h.index(node.parentNode,reverse,ofType);indexed.push(node.parentNode);}}
if(formula.match(/^\d+$/)){formula=Number(formula);for(var i=0,node;node=nodes[i];i++)
if(node.nodeIndex==formula)results.push(node);}else if(m=formula.match(/^(-?\d*)?n(([+-])(\d+))?/)){if(m[1]=="-")m[1]=-1;var a=m[1]?Number(m[1]):1;var b=m[2]?Number(m[2]):0;var indices=Selector.pseudos.getIndices(a,b,nodes.length);for(var i=0,node,l=indices.length;node=nodes[i];i++){for(var j=0;j<l;j++)
if(node.nodeIndex==indices[j])results.push(node);}}
h.unmark(nodes);h.unmark(indexed);return results;},'empty':function(nodes,value,root){for(var i=0,results=[],node;node=nodes[i];i++){if(node.tagName=='!'||node.firstChild)continue;results.push(node);}
return results;},'not':function(nodes,selector,root){var h=Selector.handlers,selectorType,m;var exclusions=new Selector(selector).findElements(root);h.mark(exclusions);for(var i=0,results=[],node;node=nodes[i];i++)
if(!node._countedByPrototype)results.push(node);h.unmark(exclusions);return results;},'enabled':function(nodes,value,root){for(var i=0,results=[],node;node=nodes[i];i++)
if(!node.disabled&&(!node.type||node.type!=='hidden'))
results.push(node);return results;},'disabled':function(nodes,value,root){for(var i=0,results=[],node;node=nodes[i];i++)
if(node.disabled)results.push(node);return results;},'checked':function(nodes,value,root){for(var i=0,results=[],node;node=nodes[i];i++)
if(node.checked)results.push(node);return results;}},operators:{'=':function(nv,v){return nv==v;},'!=':function(nv,v){return nv!=v;},'^=':function(nv,v){return nv==v||nv&&nv.startsWith(v);},'$=':function(nv,v){return nv==v||nv&&nv.endsWith(v);},'*=':function(nv,v){return nv==v||nv&&nv.include(v);},'~=':function(nv,v){return(' '+nv+' ').include(' '+v+' ');},'|=':function(nv,v){return('-'+(nv||"").toUpperCase()+'-').include('-'+(v||"").toUpperCase()+'-');}},split:function(expression){var expressions=[];expression.scan(/(([\w#:.~>+()\s-]+|\*|\[.*?\])+)\s*(,|$)/,function(m){expressions.push(m[1].strip());});return expressions;},matchElements:function(elements,expression){var matches=$$(expression),h=Selector.handlers;h.mark(matches);for(var i=0,results=[],element;element=elements[i];i++)
if(element._countedByPrototype)results.push(element);h.unmark(matches);return results;},findElement:function(elements,expression,index){if(Object.isNumber(expression)){index=expression;expression=false;}
return Selector.matchElements(elements,expression||'*')[index||0];},findChildElements:function(element,expressions){expressions=Selector.split(expressions.join(','));var results=[],h=Selector.handlers;for(var i=0,l=expressions.length,selector;i<l;i++){selector=new Selector(expressions[i].strip());h.concat(results,selector.findElements(element));}
return(l>1)?h.unique(results):results;}});if(Prototype.Browser.IE){Object.extend(Selector.handlers,{concat:function(a,b){for(var i=0,node;node=b[i];i++)
if(node.tagName!=="!")a.push(node);return a;}});}
function $$(){return Selector.findChildElements(document,$A(arguments));}
var Form={reset:function(form){form=$(form);form.reset();return form;},serializeElements:function(elements,options){if(typeof options!='object')options={hash:!!options};else if(Object.isUndefined(options.hash))options.hash=true;var key,value,submitted=false,submit=options.submit;var data=elements.inject({},function(result,element){if(!element.disabled&&element.name){key=element.name;value=$(element).getValue();if(value!=null&&element.type!='file'&&(element.type!='submit'||(!submitted&&submit!==false&&(!submit||key==submit)&&(submitted=true)))){if(key in result){if(!Object.isArray(result[key]))result[key]=[result[key]];result[key].push(value);}
else result[key]=value;}}
return result;});return options.hash?data:Object.toQueryString(data);}};Form.Methods={serialize:function(form,options){return Form.serializeElements(Form.getElements(form),options);},getElements:function(form){var elements=$(form).getElementsByTagName('*'),element,arr=[],serializers=Form.Element.Serializers;for(var i=0;element=elements[i];i++){arr.push(element);}
return arr.inject([],function(elements,child){if(serializers[child.tagName.toLowerCase()])
elements.push(Element.extend(child));return elements;})},getInputs:function(form,typeName,name){form=$(form);var inputs=form.getElementsByTagName('input');if(!typeName&&!name)return $A(inputs).map(Element.extend);for(var i=0,matchingInputs=[],length=inputs.length;i<length;i++){var input=inputs[i];if((typeName&&input.type!=typeName)||(name&&input.name!=name))
continue;matchingInputs.push(Element.extend(input));}
return matchingInputs;},disable:function(form){form=$(form);Form.getElements(form).invoke('disable');return form;},enable:function(form){form=$(form);Form.getElements(form).invoke('enable');return form;},findFirstElement:function(form){var elements=$(form).getElements().findAll(function(element){return'hidden'!=element.type&&!element.disabled;});var firstByIndex=elements.findAll(function(element){return element.hasAttribute('tabIndex')&&element.tabIndex>=0;}).sortBy(function(element){return element.tabIndex}).first();return firstByIndex?firstByIndex:elements.find(function(element){return/^(?:input|select|textarea)$/i.test(element.tagName);});},focusFirstElement:function(form){form=$(form);form.findFirstElement().activate();return form;},request:function(form,options){form=$(form),options=Object.clone(options||{});var params=options.parameters,action=form.readAttribute('action')||'';if(action.blank())action=window.location.href;options.parameters=form.serialize(true);if(params){if(Object.isString(params))params=params.toQueryParams();Object.extend(options.parameters,params);}
if(form.hasAttribute('method')&&!options.method)
options.method=form.method;return new Ajax.Request(action,options);}};Form.Element={focus:function(element){$(element).focus();return element;},select:function(element){$(element).select();return element;}};Form.Element.Methods={serialize:function(element){element=$(element);if(!element.disabled&&element.name){var value=element.getValue();if(value!=undefined){var pair={};pair[element.name]=value;return Object.toQueryString(pair);}}
return'';},getValue:function(element){element=$(element);var method=element.tagName.toLowerCase();return Form.Element.Serializers[method](element);},setValue:function(element,value){element=$(element);var method=element.tagName.toLowerCase();Form.Element.Serializers[method](element,value);return element;},clear:function(element){$(element).value='';return element;},present:function(element){return $(element).value!='';},activate:function(element){element=$(element);try{element.focus();if(element.select&&(element.tagName.toLowerCase()!='input'||!(/^(?:button|reset|submit)$/i.test(element.type))))
element.select();}catch(e){}
return element;},disable:function(element){element=$(element);element.disabled=true;return element;},enable:function(element){element=$(element);element.disabled=false;return element;}};var Field=Form.Element;var $F=Form.Element.Methods.getValue;Form.Element.Serializers={input:function(element,value){switch(element.type.toLowerCase()){case'checkbox':case'radio':return Form.Element.Serializers.inputSelector(element,value);default:return Form.Element.Serializers.textarea(element,value);}},inputSelector:function(element,value){if(Object.isUndefined(value))return element.checked?element.value:null;else element.checked=!!value;},textarea:function(element,value){if(Object.isUndefined(value))return element.value;else element.value=value;},select:function(element,value){if(Object.isUndefined(value))
return this[element.type=='select-one'?'selectOne':'selectMany'](element);else{var opt,currentValue,single=!Object.isArray(value);for(var i=0,length=element.length;i<length;i++){opt=element.options[i];currentValue=this.optionValue(opt);if(single){if(currentValue==value){opt.selected=true;return;}}
else opt.selected=value.include(currentValue);}}},selectOne:function(element){var index=element.selectedIndex;return index>=0?this.optionValue(element.options[index]):null;},selectMany:function(element){var values,length=element.length;if(!length)return null;for(var i=0,values=[];i<length;i++){var opt=element.options[i];if(opt.selected)values.push(this.optionValue(opt));}
return values;},optionValue:function(opt){return Element.extend(opt).hasAttribute('value')?opt.value:opt.text;}};Abstract.TimedObserver=Class.create(PeriodicalExecuter,{initialize:function($super,element,frequency,callback){$super(callback,frequency);this.element=$(element);this.lastValue=this.getValue();},execute:function(){var value=this.getValue();if(Object.isString(this.lastValue)&&Object.isString(value)?this.lastValue!=value:String(this.lastValue)!=String(value)){this.callback(this.element,value);this.lastValue=value;}}});Form.Element.Observer=Class.create(Abstract.TimedObserver,{getValue:function(){return Form.Element.getValue(this.element);}});Form.Observer=Class.create(Abstract.TimedObserver,{getValue:function(){return Form.serialize(this.element);}});Abstract.EventObserver=Class.create({initialize:function(element,callback){this.element=$(element);this.callback=callback;this.lastValue=this.getValue();if(this.element.tagName.toLowerCase()=='form')
this.registerFormCallbacks();else
this.registerCallback(this.element);},onElementEvent:function(){var value=this.getValue();if(this.lastValue!=value){this.callback(this.element,value);this.lastValue=value;}},registerFormCallbacks:function(){Form.getElements(this.element).each(this.registerCallback,this);},registerCallback:function(element){if(element.type){switch(element.type.toLowerCase()){case'checkbox':case'radio':Event.observe(element,'click',this.onElementEvent.bind(this));break;default:Event.observe(element,'change',this.onElementEvent.bind(this));break;}}}});Form.Element.EventObserver=Class.create(Abstract.EventObserver,{getValue:function(){return Form.Element.getValue(this.element);}});Form.EventObserver=Class.create(Abstract.EventObserver,{getValue:function(){return Form.serialize(this.element);}});(function(){var 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,KEY_INSERT:45,cache:{}};var docEl=document.documentElement;var MOUSEENTER_MOUSELEAVE_EVENTS_SUPPORTED='onmouseenter'in docEl&&'onmouseleave'in docEl;var _isButton;if(Prototype.Browser.IE){var buttonMap={0:1,1:4,2:2};_isButton=function(event,code){return event.button===buttonMap[code];};}else if(Prototype.Browser.WebKit){_isButton=function(event,code){switch(code){case 0:return event.which==1&&!event.metaKey;case 1:return event.which==1&&event.metaKey;default:return false;}};}else{_isButton=function(event,code){return event.which?(event.which===code+1):(event.button===code);};}
function isLeftClick(event){return _isButton(event,0)}
function isMiddleClick(event){return _isButton(event,1)}
function isRightClick(event){return _isButton(event,2)}
function element(event){event=Event.extend(event);var node=event.target,type=event.type,currentTarget=event.currentTarget;if(currentTarget&&currentTarget.tagName){if(type==='load'||type==='error'||(type==='click'&&currentTarget.tagName.toLowerCase()==='input'&&currentTarget.type==='radio'))
node=currentTarget;}
if(node.nodeType==Node.TEXT_NODE)
node=node.parentNode;return Element.extend(node);}
function findElement(event,expression){var element=Event.element(event);if(!expression)return element;var elements=[element].concat(element.ancestors());return Selector.findElement(elements,expression,0);}
function pointer(event){return{x:pointerX(event),y:pointerY(event)};}
function pointerX(event){var docElement=document.documentElement,body=document.body||{scrollLeft:0};return event.pageX||(event.clientX+
(docElement.scrollLeft||body.scrollLeft)-
(docElement.clientLeft||0));}
function pointerY(event){var docElement=document.documentElement,body=document.body||{scrollTop:0};return event.pageY||(event.clientY+
(docElement.scrollTop||body.scrollTop)-
(docElement.clientTop||0));}
function stop(event){Event.extend(event);event.preventDefault();event.stopPropagation();event.stopped=true;}
Event.Methods={isLeftClick:isLeftClick,isMiddleClick:isMiddleClick,isRightClick:isRightClick,element:element,findElement:findElement,pointer:pointer,pointerX:pointerX,pointerY:pointerY,stop:stop};var methods=Object.keys(Event.Methods).inject({},function(m,name){m[name]=Event.Methods[name].methodize();return m;});if(Prototype.Browser.IE){function _relatedTarget(event){var element;switch(event.type){case'mouseover':element=event.fromElement;break;case'mouseout':element=event.toElement;break;default:return null;}
return Element.extend(element);}
Object.extend(methods,{stopPropagation:function(){this.cancelBubble=true},preventDefault:function(){this.returnValue=false},inspect:function(){return'[object Event]'}});Event.extend=function(event,element){if(!event)return false;if(event._extendedByPrototype)return event;event._extendedByPrototype=Prototype.emptyFunction;var pointer=Event.pointer(event);Object.extend(event,{target:event.srcElement||element,relatedTarget:_relatedTarget(event),pageX:pointer.x,pageY:pointer.y});return Object.extend(event,methods);};}else{Event.prototype=window.Event.prototype||document.createEvent('HTMLEvents').__proto__;Object.extend(Event.prototype,methods);Event.extend=Prototype.K;}
function _createResponder(element,eventName,handler){var registry=Element.retrieve(element,'prototype_event_registry');if(Object.isUndefined(registry)){CACHE.push(element);registry=Element.retrieve(element,'prototype_event_registry',$H());}
var respondersForEvent=registry.get(eventName);if(Object.isUndefined(respondersForEvent)){respondersForEvent=[];registry.set(eventName,respondersForEvent);}
if(respondersForEvent.pluck('handler').include(handler))return false;var responder;if(eventName.include(":")){responder=function(event){if(Object.isUndefined(event.eventName))
return false;if(event.eventName!==eventName)
return false;Event.extend(event,element);handler.call(element,event);};}else{if(!MOUSEENTER_MOUSELEAVE_EVENTS_SUPPORTED&&(eventName==="mouseenter"||eventName==="mouseleave")){if(eventName==="mouseenter"||eventName==="mouseleave"){responder=function(event){Event.extend(event,element);var parent=event.relatedTarget;while(parent&&parent!==element){try{parent=parent.parentNode;}
catch(e){parent=element;}}
if(parent===element)return;handler.call(element,event);};}}else{responder=function(event){Event.extend(event,element);handler.call(element,event);};}}
responder.handler=handler;respondersForEvent.push(responder);return responder;}
function _destroyCache(){for(var i=0,length=CACHE.length;i<length;i++){Event.stopObserving(CACHE[i]);CACHE[i]=null;}}
var CACHE=[];if(Prototype.Browser.IE)
window.attachEvent('onunload',_destroyCache);if(Prototype.Browser.WebKit)
window.addEventListener('unload',Prototype.emptyFunction,false);var _getDOMEventName=Prototype.K;if(!MOUSEENTER_MOUSELEAVE_EVENTS_SUPPORTED){_getDOMEventName=function(eventName){var translations={mouseenter:"mouseover",mouseleave:"mouseout"};return eventName in translations?translations[eventName]:eventName;};}
function observe(element,eventName,handler){element=$(element);var responder=_createResponder(element,eventName,handler);if(!responder)return element;if(eventName.include(':')){if(element.addEventListener)
element.addEventListener("dataavailable",responder,false);else{element.attachEvent("ondataavailable",responder);element.attachEvent("onfilterchange",responder);}}else{var actualEventName=_getDOMEventName(eventName);if(element.addEventListener)
element.addEventListener(actualEventName,responder,false);else
element.attachEvent("on"+actualEventName,responder);}
return element;}
function stopObserving(element,eventName,handler){element=$(element);var registry=Element.retrieve(element,'prototype_event_registry');if(Object.isUndefined(registry))return element;if(eventName&&!handler){var responders=registry.get(eventName);if(Object.isUndefined(responders))return element;responders.each(function(r){Element.stopObserving(element,eventName,r.handler);});return element;}else if(!eventName){registry.each(function(pair){var eventName=pair.key,responders=pair.value;responders.each(function(r){Element.stopObserving(element,eventName,r.handler);});});return element;}
var responders=registry.get(eventName);if(!responders)return;var responder=responders.find(function(r){return r.handler===handler;});if(!responder)return element;var actualEventName=_getDOMEventName(eventName);if(eventName.include(':')){if(element.removeEventListener)
element.removeEventListener("dataavailable",responder,false);else{element.detachEvent("ondataavailable",responder);element.detachEvent("onfilterchange",responder);}}else{if(element.removeEventListener)
element.removeEventListener(actualEventName,responder,false);else
element.detachEvent('on'+actualEventName,responder);}
registry.set(eventName,responders.without(responder));return element;}
function fire(element,eventName,memo,bubble){element=$(element);if(Object.isUndefined(bubble))
bubble=true;if(element==document&&document.createEvent&&!element.dispatchEvent)
element=document.documentElement;var event;if(document.createEvent){event=document.createEvent('HTMLEvents');event.initEvent('dataavailable',true,true);}else{event=document.createEventObject();event.eventType=bubble?'ondataavailable':'onfilterchange';}
event.eventName=eventName;event.memo=memo||{};if(document.createEvent)
element.dispatchEvent(event);else
element.fireEvent(event.eventType,event);return Event.extend(event);}
Object.extend(Event,Event.Methods);Object.extend(Event,{fire:fire,observe:observe,stopObserving:stopObserving});Element.addMethods({fire:fire,observe:observe,stopObserving:stopObserving});Object.extend(document,{fire:fire.methodize(),observe:observe.methodize(),stopObserving:stopObserving.methodize(),loaded:false});if(window.Event)Object.extend(window.Event,Event);else window.Event=Event;})();(function(){var timer;function fireContentLoadedEvent(){if(document.loaded)return;if(timer)window.clearTimeout(timer);document.loaded=true;document.fire('dom:loaded');}
function checkReadyState(){if(document.readyState==='complete'){document.stopObserving('readystatechange',checkReadyState);fireContentLoadedEvent();}}
function pollDoScroll(){try{document.documentElement.doScroll('left');}
catch(e){timer=pollDoScroll.defer();return;}
fireContentLoadedEvent();}
if(document.addEventListener){document.addEventListener('DOMContentLoaded',fireContentLoadedEvent,false);}else{document.observe('readystatechange',checkReadyState);if(window==top)
timer=pollDoScroll.defer();}
Event.observe(window,'load',fireContentLoadedEvent);})();Element.addMethods();Hash.toQueryString=Object.toQueryString;var Toggle={display:Element.toggle};Element.Methods.childOf=Element.Methods.descendantOf;var Insertion={Before:function(element,content){return Element.insert(element,{before:content});},Top:function(element,content){return Element.insert(element,{top:content});},Bottom:function(element,content){return Element.insert(element,{bottom:content});},After:function(element,content){return Element.insert(element,{after:content});}};var $continue=new Error('"throw $continue" is deprecated, use "return" instead');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;},within:function(element,x,y){if(this.includeScrollOffsets)
return this.withinIncludingScrolloffsets(element,x,y);this.xcomp=x;this.ycomp=y;this.offset=Element.cumulativeOffset(element);return(y>=this.offset[1]&&y<this.offset[1]+element.offsetHeight&&x>=this.offset[0]&&x<this.offset[0]+element.offsetWidth);},withinIncludingScrolloffsets:function(element,x,y){var offsetcache=Element.cumulativeScrollOffset(element);this.xcomp=x+offsetcache[0]-this.deltaX;this.ycomp=y+offsetcache[1]-this.deltaY;this.offset=Element.cumulativeOffset(element);return(this.ycomp>=this.offset[1]&&this.ycomp<this.offset[1]+element.offsetHeight&&this.xcomp>=this.offset[0]&&this.xcomp<this.offset[0]+element.offsetWidth);},overlap:function(mode,element){if(!mode)return 0;if(mode=='vertical')
return((this.offset[1]+element.offsetHeight)-this.ycomp)/element.offsetHeight;if(mode=='horizontal')
return((this.offset[0]+element.offsetWidth)-this.xcomp)/element.offsetWidth;},cumulativeOffset:Element.Methods.cumulativeOffset,positionedOffset:Element.Methods.positionedOffset,absolutize:function(element){Position.prepare();return Element.absolutize(element);},relativize:function(element){Position.prepare();return Element.relativize(element);},realOffset:Element.Methods.cumulativeScrollOffset,offsetParent:Element.Methods.getOffsetParent,page:Element.Methods.viewportOffset,clone:function(source,target,options){options=options||{};return Element.clonePosition(target,source,options);}};if(!document.getElementsByClassName)document.getElementsByClassName=function(instanceMethods){function iter(name){return name.blank()?null:"[contains(concat(' ', @class, ' '), ' "+name+" ')]";}
instanceMethods.getElementsByClassName=Prototype.BrowserFeatures.XPath?function(element,className){className=className.toString().strip();var cond=/\s/.test(className)?$w(className).map(iter).join(''):iter(className);return cond?document._getElementsByXPath('.//*'+cond,element):[];}:function(element,className){className=className.toString().strip();var elements=[],classNames=(/\s/.test(className)?$w(className):null);if(!classNames&&!className)return elements;var nodes=$(element).getElementsByTagName('*');className=' '+className+' ';for(var i=0,child,cn;child=nodes[i];i++){if(child.className&&(cn=' '+child.className+' ')&&(cn.include(className)||(classNames&&classNames.all(function(name){return!name.toString().blank()&&cn.include(' '+name+' ');}))))
elements.push(Element.extend(child));}
return elements;};return function(className,parentElement){return $(parentElement||document.body).getElementsByClassName(className);};}(Element.Methods);Element.ClassNames=Class.create();Element.ClassNames.prototype={initialize:function(element){this.element=$(element);},_each:function(iterator){this.element.className.split(/\s+/).select(function(name){return name.length>0;})._each(iterator);},set:function(className){this.element.className=className;},add:function(classNameToAdd){if(this.include(classNameToAdd))return;this.set($A(this).concat(classNameToAdd).join(' '));},remove:function(classNameToRemove){if(!this.include(classNameToRemove))return;this.set($A(this).without(classNameToRemove).join(' '));},toString:function(){return $A(this).join(' ');}};Object.extend(Element.ClassNames.prototype,Enumerable);String.prototype.parseColor=function(){var color='#';if(this.slice(0,4)=='rgb('){var cols=this.slice(4,this.length-1).split(',');var i=0;do{color+=parseInt(cols[i]).toColorPart()}while(++i<3);}else{if(this.slice(0,1)=='#'){if(this.length==4)for(var i=1;i<4;i++)color+=(this.charAt(i)+this.charAt(i)).toLowerCase();if(this.length==7)color=this.toLowerCase();}}
return(color.length==7?color:(arguments[0]||this));};Element.collectTextNodes=function(element){return $A($(element).childNodes).collect(function(node){return(node.nodeType==3?node.nodeValue:(node.hasChildNodes()?Element.collectTextNodes(node):''));}).flatten().join('');};Element.collectTextNodesIgnoreClass=function(element,className){return $A($(element).childNodes).collect(function(node){return(node.nodeType==3?node.nodeValue:((node.hasChildNodes()&&!Element.hasClassName(node,className))?Element.collectTextNodesIgnoreClass(node,className):''));}).flatten().join('');};Element.setContentZoom=function(element,percent){element=$(element);element.setStyle({fontSize:(percent/100)+'em'});if(Prototype.Browser.WebKit)window.scrollBy(0,0);return element;};Element.getInlineOpacity=function(element){return $(element).style.opacity||'';};Element.forceRerendering=function(element){try{element=$(element);var n=document.createTextNode(' ');element.appendChild(n);element.removeChild(n);}catch(e){}};var Effect={_elementDoesNotExistError:{name:'ElementDoesNotExistError',message:'The specified DOM element does not exist, but is required for this effect to operate'},Transitions:{linear:Prototype.K,sinoidal:function(pos){return(-Math.cos(pos*Math.PI)/2)+.5;},reverse:function(pos){return 1-pos;},flicker:function(pos){var pos=((-Math.cos(pos*Math.PI)/4)+.75)+Math.random()/4;return pos>1?1:pos;},wobble:function(pos){return(-Math.cos(pos*Math.PI*(9*pos))/2)+.5;},pulse:function(pos,pulses){return(-Math.cos((pos*((pulses||5)-.5)*2)*Math.PI)/2)+.5;},spring:function(pos){return 1-(Math.cos(pos*4.5*Math.PI)*Math.exp(-pos*6));},none:function(pos){return 0;},full:function(pos){return 1;}},DefaultOptions:{duration:1.0,fps:100,sync:false,from:0.0,to:1.0,delay:0.0,queue:'parallel'},tagifyText:function(element){var tagifyStyle='position:relative';if(Prototype.Browser.IE)tagifyStyle+=';zoom:1';element=$(element);$A(element.childNodes).each(function(child){if(child.nodeType==3){child.nodeValue.toArray().each(function(character){element.insertBefore(new Element('span',{style:tagifyStyle}).update(character==' '?String.fromCharCode(160):character),child);});Element.remove(child);}});},multiple:function(element,effect){var elements;if(((typeof element=='object')||Object.isFunction(element))&&(element.length))
elements=element;else
elements=$(element).childNodes;var options=Object.extend({speed:0.1,delay:0.0},arguments[2]||{});var masterDelay=options.delay;$A(elements).each(function(element,index){new effect(element,Object.extend(options,{delay:index*options.speed+masterDelay}));});},PAIRS:{'slide':['SlideDown','SlideUp'],'blind':['BlindDown','BlindUp'],'appear':['Appear','Fade']},toggle:function(element,effect){element=$(element);effect=(effect||'appear').toLowerCase();var options=Object.extend({queue:{position:'end',scope:(element.id||'global'),limit:1}},arguments[2]||{});Effect[element.visible()?Effect.PAIRS[effect][1]:Effect.PAIRS[effect][0]](element,options);}};Effect.DefaultOptions.transition=Effect.Transitions.sinoidal;Effect.ScopedQueue=Class.create(Enumerable,{initialize:function(){this.effects=[];this.interval=null;},_each:function(iterator){this.effects._each(iterator);},add:function(effect){var timestamp=new Date().getTime();var position=Object.isString(effect.options.queue)?effect.options.queue:effect.options.queue.position;switch(position){case'front':this.effects.findAll(function(e){return e.state=='idle'}).each(function(e){e.startOn+=effect.finishOn;e.finishOn+=effect.finishOn;});break;case'with-last':timestamp=this.effects.pluck('startOn').max()||timestamp;break;case'end':timestamp=this.effects.pluck('finishOn').max()||timestamp;break;}
effect.startOn+=timestamp;effect.finishOn+=timestamp;if(!effect.options.queue.limit||(this.effects.length<effect.options.queue.limit))
this.effects.push(effect);if(!this.interval)
this.interval=setInterval(this.loop.bind(this),15);},remove:function(effect){this.effects=this.effects.reject(function(e){return e==effect});if(this.effects.length==0){clearInterval(this.interval);this.interval=null;}},loop:function(){var timePos=new Date().getTime();for(var i=0,len=this.effects.length;i<len;i++)
this.effects[i]&&this.effects[i].loop(timePos);}});Effect.Queues={instances:$H(),get:function(queueName){if(!Object.isString(queueName))return queueName;return this.instances.get(queueName)||this.instances.set(queueName,new Effect.ScopedQueue());}};Effect.Queue=Effect.Queues.get('global');Effect.Base=Class.create({position:null,start:function(options){function codeForEvent(options,eventName){return((options[eventName+'Internal']?'this.options.'+eventName+'Internal(this);':'')+
(options[eventName]?'this.options.'+eventName+'(this);':''));}
if(options&&options.transition===false)options.transition=Effect.Transitions.linear;this.options=Object.extend(Object.extend({},Effect.DefaultOptions),options||{});this.currentFrame=0;this.state='idle';this.startOn=this.options.delay*1000;this.finishOn=this.startOn+(this.options.duration*1000);this.fromToDelta=this.options.to-this.options.from;this.totalTime=this.finishOn-this.startOn;this.totalFrames=this.options.fps*this.options.duration;this.render=(function(){function dispatch(effect,eventName){if(effect.options[eventName+'Internal'])
effect.options[eventName+'Internal'](effect);if(effect.options[eventName])
effect.options[eventName](effect);}
return function(pos){if(this.state==="idle"){this.state="running";dispatch(this,'beforeSetup');if(this.setup)this.setup();dispatch(this,'afterSetup');}
if(this.state==="running"){pos=(this.options.transition(pos)*this.fromToDelta)+this.options.from;this.position=pos;dispatch(this,'beforeUpdate');if(this.update)this.update(pos);dispatch(this,'afterUpdate');}};})();this.event('beforeStart');if(!this.options.sync)
Effect.Queues.get(Object.isString(this.options.queue)?'global':this.options.queue.scope).add(this);},loop:function(timePos){if(timePos>=this.startOn){if(timePos>=this.finishOn){this.render(1.0);this.cancel();this.event('beforeFinish');if(this.finish)this.finish();this.event('afterFinish');return;}
var pos=(timePos-this.startOn)/this.totalTime,frame=(pos*this.totalFrames).round();if(frame>this.currentFrame){this.render(pos);this.currentFrame=frame;}}},cancel:function(){if(!this.options.sync)
Effect.Queues.get(Object.isString(this.options.queue)?'global':this.options.queue.scope).remove(this);this.state='finished';},event:function(eventName){if(this.options[eventName+'Internal'])this.options[eventName+'Internal'](this);if(this.options[eventName])this.options[eventName](this);},inspect:function(){var data=$H();for(property in this)
if(!Object.isFunction(this[property]))data.set(property,this[property]);return'#<Effect:'+data.inspect()+',options:'+$H(this.options).inspect()+'>';}});Effect.Parallel=Class.create(Effect.Base,{initialize:function(effects){this.effects=effects||[];this.start(arguments[1]);},update:function(position){this.effects.invoke('render',position);},finish:function(position){this.effects.each(function(effect){effect.render(1.0);effect.cancel();effect.event('beforeFinish');if(effect.finish)effect.finish(position);effect.event('afterFinish');});}});Effect.Tween=Class.create(Effect.Base,{initialize:function(object,from,to){object=Object.isString(object)?$(object):object;var args=$A(arguments),method=args.last(),options=args.length==5?args[3]:null;this.method=Object.isFunction(method)?method.bind(object):Object.isFunction(object[method])?object[method].bind(object):function(value){object[method]=value};this.start(Object.extend({from:from,to:to},options||{}));},update:function(position){this.method(position);}});Effect.Event=Class.create(Effect.Base,{initialize:function(){this.start(Object.extend({duration:0},arguments[0]||{}));},update:Prototype.emptyFunction});Effect.Opacity=Class.create(Effect.Base,{initialize:function(element){this.element=$(element);if(!this.element)throw(Effect._elementDoesNotExistError);if(Prototype.Browser.IE&&(!this.element.currentStyle.hasLayout))
this.element.setStyle({zoom:1});var options=Object.extend({from:this.element.getOpacity()||0.0,to:1.0},arguments[1]||{});this.start(options);},update:function(position){this.element.setOpacity(position);}});Effect.Move=Class.create(Effect.Base,{initialize:function(element){this.element=$(element);if(!this.element)throw(Effect._elementDoesNotExistError);var options=Object.extend({x:0,y:0,mode:'relative'},arguments[1]||{});this.start(options);},setup:function(){this.element.makePositioned();this.originalLeft=parseFloat(this.element.getStyle('left')||'0');this.originalTop=parseFloat(this.element.getStyle('top')||'0');if(this.options.mode=='absolute'){this.options.x=this.options.x-this.originalLeft;this.options.y=this.options.y-this.originalTop;}},update:function(position){this.element.setStyle({left:(this.options.x*position+this.originalLeft).round()+'px',top:(this.options.y*position+this.originalTop).round()+'px'});}});Effect.MoveBy=function(element,toTop,toLeft){return new Effect.Move(element,Object.extend({x:toLeft,y:toTop},arguments[3]||{}));};Effect.Scale=Class.create(Effect.Base,{initialize:function(element,percent){this.element=$(element);if(!this.element)throw(Effect._elementDoesNotExistError);var options=Object.extend({scaleX:true,scaleY:true,scaleContent:true,scaleFromCenter:false,scaleMode:'box',scaleFrom:100.0,scaleTo:percent},arguments[2]||{});this.start(options);},setup:function(){this.restoreAfterFinish=this.options.restoreAfterFinish||false;this.elementPositioning=this.element.getStyle('position');this.originalStyle={};['top','left','width','height','fontSize'].each(function(k){this.originalStyle[k]=this.element.style[k];}.bind(this));this.originalTop=this.element.offsetTop;this.originalLeft=this.element.offsetLeft;var fontSize=this.element.getStyle('font-size')||'100%';['em','px','%','pt'].each(function(fontSizeType){if(fontSize.indexOf(fontSizeType)>0){this.fontSize=parseFloat(fontSize);this.fontSizeType=fontSizeType;}}.bind(this));this.factor=(this.options.scaleTo-this.options.scaleFrom)/100;this.dims=null;if(this.options.scaleMode=='box')
this.dims=[this.element.offsetHeight,this.element.offsetWidth];if(/^content/.test(this.options.scaleMode))
this.dims=[this.element.scrollHeight,this.element.scrollWidth];if(!this.dims)
this.dims=[this.options.scaleMode.originalHeight,this.options.scaleMode.originalWidth];},update:function(position){var currentScale=(this.options.scaleFrom/100.0)+(this.factor*position);if(this.options.scaleContent&&this.fontSize)
this.element.setStyle({fontSize:this.fontSize*currentScale+this.fontSizeType});this.setDimensions(this.dims[0]*currentScale,this.dims[1]*currentScale);},finish:function(position){if(this.restoreAfterFinish)this.element.setStyle(this.originalStyle);},setDimensions:function(height,width){var d={};if(this.options.scaleX)d.width=width.round()+'px';if(this.options.scaleY)d.height=height.round()+'px';if(this.options.scaleFromCenter){var topd=(height-this.dims[0])/2;var leftd=(width-this.dims[1])/2;if(this.elementPositioning=='absolute'){if(this.options.scaleY)d.top=this.originalTop-topd+'px';if(this.options.scaleX)d.left=this.originalLeft-leftd+'px';}else{if(this.options.scaleY)d.top=-topd+'px';if(this.options.scaleX)d.left=-leftd+'px';}}
this.element.setStyle(d);}});Effect.Highlight=Class.create(Effect.Base,{initialize:function(element){this.element=$(element);if(!this.element)throw(Effect._elementDoesNotExistError);var options=Object.extend({startcolor:'#ffff99'},arguments[1]||{});this.start(options);},setup:function(){if(this.element.getStyle('display')=='none'){this.cancel();return;}
this.oldStyle={};if(!this.options.keepBackgroundImage){this.oldStyle.backgroundImage=this.element.getStyle('background-image');this.element.setStyle({backgroundImage:'none'});}
if(!this.options.endcolor)
this.options.endcolor=this.element.getStyle('background-color').parseColor('#ffffff');if(!this.options.restorecolor)
this.options.restorecolor=this.element.getStyle('background-color');this._base=$R(0,2).map(function(i){return parseInt(this.options.startcolor.slice(i*2+1,i*2+3),16)}.bind(this));this._delta=$R(0,2).map(function(i){return parseInt(this.options.endcolor.slice(i*2+1,i*2+3),16)-this._base[i]}.bind(this));},update:function(position){this.element.setStyle({backgroundColor:$R(0,2).inject('#',function(m,v,i){return m+((this._base[i]+(this._delta[i]*position)).round().toColorPart());}.bind(this))});},finish:function(){this.element.setStyle(Object.extend(this.oldStyle,{backgroundColor:this.options.restorecolor}));}});Effect.ScrollTo=function(element){var options=arguments[1]||{},scrollOffsets=document.viewport.getScrollOffsets(),elementOffsets=$(element).cumulativeOffset();if(options.offset)elementOffsets[1]+=options.offset;return new Effect.Tween(null,scrollOffsets.top,elementOffsets[1],options,function(p){scrollTo(scrollOffsets.left,p.round());});};Effect.Fade=function(element){element=$(element);var oldOpacity=element.getInlineOpacity();var options=Object.extend({from:element.getOpacity()||1.0,to:0.0,afterFinishInternal:function(effect){if(effect.options.to!=0)return;effect.element.hide().setStyle({opacity:oldOpacity});}},arguments[1]||{});return new Effect.Opacity(element,options);};Effect.Appear=function(element){element=$(element);var options=Object.extend({from:(element.getStyle('display')=='none'?0.0:element.getOpacity()||0.0),to:1.0,afterFinishInternal:function(effect){effect.element.forceRerendering();},beforeSetup:function(effect){effect.element.setOpacity(effect.options.from).show();}},arguments[1]||{});return new Effect.Opacity(element,options);};Effect.Puff=function(element){element=$(element);var oldStyle={opacity:element.getInlineOpacity(),position:element.getStyle('position'),top:element.style.top,left:element.style.left,width:element.style.width,height:element.style.height};return new Effect.Parallel([new Effect.Scale(element,200,{sync:true,scaleFromCenter:true,scaleContent:true,restoreAfterFinish:true}),new Effect.Opacity(element,{sync:true,to:0.0})],Object.extend({duration:1.0,beforeSetupInternal:function(effect){Position.absolutize(effect.effects[0].element);},afterFinishInternal:function(effect){effect.effects[0].element.hide().setStyle(oldStyle);}},arguments[1]||{}));};Effect.BlindUp=function(element){element=$(element);element.makeClipping();return new Effect.Scale(element,0,Object.extend({scaleContent:false,scaleX:false,restoreAfterFinish:true,afterFinishInternal:function(effect){effect.element.hide().undoClipping();}},arguments[1]||{}));};Effect.BlindDown=function(element){element=$(element);var elementDimensions=element.getDimensions();return new Effect.Scale(element,100,Object.extend({scaleContent:false,scaleX:false,scaleFrom:0,scaleMode:{originalHeight:elementDimensions.height,originalWidth:elementDimensions.width},restoreAfterFinish:true,afterSetup:function(effect){effect.element.makeClipping().setStyle({height:'0px'}).show();},afterFinishInternal:function(effect){effect.element.undoClipping();}},arguments[1]||{}));};Effect.SwitchOff=function(element){element=$(element);var oldOpacity=element.getInlineOpacity();return new Effect.Appear(element,Object.extend({duration:0.4,from:0,transition:Effect.Transitions.flicker,afterFinishInternal:function(effect){new Effect.Scale(effect.element,1,{duration:0.3,scaleFromCenter:true,scaleX:false,scaleContent:false,restoreAfterFinish:true,beforeSetup:function(effect){effect.element.makePositioned().makeClipping();},afterFinishInternal:function(effect){effect.element.hide().undoClipping().undoPositioned().setStyle({opacity:oldOpacity});}});}},arguments[1]||{}));};Effect.DropOut=function(element){element=$(element);var oldStyle={top:element.getStyle('top'),left:element.getStyle('left'),opacity:element.getInlineOpacity()};return new Effect.Parallel([new Effect.Move(element,{x:0,y:100,sync:true}),new Effect.Opacity(element,{sync:true,to:0.0})],Object.extend({duration:0.5,beforeSetup:function(effect){effect.effects[0].element.makePositioned();},afterFinishInternal:function(effect){effect.effects[0].element.hide().undoPositioned().setStyle(oldStyle);}},arguments[1]||{}));};Effect.Shake=function(element){element=$(element);var options=Object.extend({distance:20,duration:0.5},arguments[1]||{});var distance=parseFloat(options.distance);var split=parseFloat(options.duration)/10.0;var oldStyle={top:element.getStyle('top'),left:element.getStyle('left')};return new Effect.Move(element,{x:distance,y:0,duration:split,afterFinishInternal:function(effect){new Effect.Move(effect.element,{x:-distance*2,y:0,duration:split*2,afterFinishInternal:function(effect){new Effect.Move(effect.element,{x:distance*2,y:0,duration:split*2,afterFinishInternal:function(effect){new Effect.Move(effect.element,{x:-distance*2,y:0,duration:split*2,afterFinishInternal:function(effect){new Effect.Move(effect.element,{x:distance*2,y:0,duration:split*2,afterFinishInternal:function(effect){new Effect.Move(effect.element,{x:-distance,y:0,duration:split,afterFinishInternal:function(effect){effect.element.undoPositioned().setStyle(oldStyle);}});}});}});}});}});}});};Effect.SlideDown=function(element){element=$(element).cleanWhitespace();var oldInnerBottom=element.down().getStyle('bottom');var elementDimensions=element.getDimensions();return new Effect.Scale(element,100,Object.extend({scaleContent:false,scaleX:false,scaleFrom:window.opera?0:1,scaleMode:{originalHeight:elementDimensions.height,originalWidth:elementDimensions.width},restoreAfterFinish:true,afterSetup:function(effect){effect.element.makePositioned();effect.element.down().makePositioned();if(window.opera)effect.element.setStyle({top:''});effect.element.makeClipping().setStyle({height:'0px'}).show();},afterUpdateInternal:function(effect){effect.element.down().setStyle({bottom:(effect.dims[0]-effect.element.clientHeight)+'px'});},afterFinishInternal:function(effect){effect.element.undoClipping().undoPositioned();effect.element.down().undoPositioned().setStyle({bottom:oldInnerBottom});}},arguments[1]||{}));};Effect.SlideUp=function(element){element=$(element).cleanWhitespace();var oldInnerBottom=element.down().getStyle('bottom');var elementDimensions=element.getDimensions();return new Effect.Scale(element,window.opera?0:1,Object.extend({scaleContent:false,scaleX:false,scaleMode:'box',scaleFrom:100,scaleMode:{originalHeight:elementDimensions.height,originalWidth:elementDimensions.width},restoreAfterFinish:true,afterSetup:function(effect){effect.element.makePositioned();effect.element.down().makePositioned();if(window.opera)effect.element.setStyle({top:''});effect.element.makeClipping().show();},afterUpdateInternal:function(effect){effect.element.down().setStyle({bottom:(effect.dims[0]-effect.element.clientHeight)+'px'});},afterFinishInternal:function(effect){effect.element.hide().undoClipping().undoPositioned();effect.element.down().undoPositioned().setStyle({bottom:oldInnerBottom});}},arguments[1]||{}));};Effect.Squish=function(element){return new Effect.Scale(element,window.opera?1:0,{restoreAfterFinish:true,beforeSetup:function(effect){effect.element.makeClipping();},afterFinishInternal:function(effect){effect.element.hide().undoClipping();}});};Effect.Grow=function(element){element=$(element);var options=Object.extend({direction:'center',moveTransition:Effect.Transitions.sinoidal,scaleTransition:Effect.Transitions.sinoidal,opacityTransition:Effect.Transitions.full},arguments[1]||{});var oldStyle={top:element.style.top,left:element.style.left,height:element.style.height,width:element.style.width,opacity:element.getInlineOpacity()};var dims=element.getDimensions();var initialMoveX,initialMoveY;var moveX,moveY;switch(options.direction){case'top-left':initialMoveX=initialMoveY=moveX=moveY=0;break;case'top-right':initialMoveX=dims.width;initialMoveY=moveY=0;moveX=-dims.width;break;case'bottom-left':initialMoveX=moveX=0;initialMoveY=dims.height;moveY=-dims.height;break;case'bottom-right':initialMoveX=dims.width;initialMoveY=dims.height;moveX=-dims.width;moveY=-dims.height;break;case'center':initialMoveX=dims.width/2;initialMoveY=dims.height/2;moveX=-dims.width/2;moveY=-dims.height/2;break;}
return new Effect.Move(element,{x:initialMoveX,y:initialMoveY,duration:0.01,beforeSetup:function(effect){effect.element.hide().makeClipping().makePositioned();},afterFinishInternal:function(effect){new Effect.Parallel([new Effect.Opacity(effect.element,{sync:true,to:1.0,from:0.0,transition:options.opacityTransition}),new Effect.Move(effect.element,{x:moveX,y:moveY,sync:true,transition:options.moveTransition}),new Effect.Scale(effect.element,100,{scaleMode:{originalHeight:dims.height,originalWidth:dims.width},sync:true,scaleFrom:window.opera?1:0,transition:options.scaleTransition,restoreAfterFinish:true})],Object.extend({beforeSetup:function(effect){effect.effects[0].element.setStyle({height:'0px'}).show();},afterFinishInternal:function(effect){effect.effects[0].element.undoClipping().undoPositioned().setStyle(oldStyle);}},options));}});};Effect.Shrink=function(element){element=$(element);var options=Object.extend({direction:'center',moveTransition:Effect.Transitions.sinoidal,scaleTransition:Effect.Transitions.sinoidal,opacityTransition:Effect.Transitions.none},arguments[1]||{});var oldStyle={top:element.style.top,left:element.style.left,height:element.style.height,width:element.style.width,opacity:element.getInlineOpacity()};var dims=element.getDimensions();var moveX,moveY;switch(options.direction){case'top-left':moveX=moveY=0;break;case'top-right':moveX=dims.width;moveY=0;break;case'bottom-left':moveX=0;moveY=dims.height;break;case'bottom-right':moveX=dims.width;moveY=dims.height;break;case'center':moveX=dims.width/2;moveY=dims.height/2;break;}
return new Effect.Parallel([new Effect.Opacity(element,{sync:true,to:0.0,from:1.0,transition:options.opacityTransition}),new Effect.Scale(element,window.opera?1:0,{sync:true,transition:options.scaleTransition,restoreAfterFinish:true}),new Effect.Move(element,{x:moveX,y:moveY,sync:true,transition:options.moveTransition})],Object.extend({beforeStartInternal:function(effect){effect.effects[0].element.makePositioned().makeClipping();},afterFinishInternal:function(effect){effect.effects[0].element.hide().undoClipping().undoPositioned().setStyle(oldStyle);}},options));};Effect.Pulsate=function(element){element=$(element);var options=arguments[1]||{},oldOpacity=element.getInlineOpacity(),transition=options.transition||Effect.Transitions.linear,reverser=function(pos){return 1-transition((-Math.cos((pos*(options.pulses||5)*2)*Math.PI)/2)+.5);};return new Effect.Opacity(element,Object.extend(Object.extend({duration:2.0,from:0,afterFinishInternal:function(effect){effect.element.setStyle({opacity:oldOpacity});}},options),{transition:reverser}));};Effect.Fold=function(element){element=$(element);var oldStyle={top:element.style.top,left:element.style.left,width:element.style.width,height:element.style.height};element.makeClipping();return new Effect.Scale(element,5,Object.extend({scaleContent:false,scaleX:false,afterFinishInternal:function(effect){new Effect.Scale(element,1,{scaleContent:false,scaleY:false,afterFinishInternal:function(effect){effect.element.hide().undoClipping().setStyle(oldStyle);}});}},arguments[1]||{}));};Effect.Morph=Class.create(Effect.Base,{initialize:function(element){this.element=$(element);if(!this.element)throw(Effect._elementDoesNotExistError);var options=Object.extend({style:{}},arguments[1]||{});if(!Object.isString(options.style))this.style=$H(options.style);else{if(options.style.include(':'))
this.style=options.style.parseStyle();else{this.element.addClassName(options.style);this.style=$H(this.element.getStyles());this.element.removeClassName(options.style);var css=this.element.getStyles();this.style=this.style.reject(function(style){return style.value==css[style.key];});options.afterFinishInternal=function(effect){effect.element.addClassName(effect.options.style);effect.transforms.each(function(transform){effect.element.style[transform.style]='';});};}}
this.start(options);},setup:function(){function parseColor(color){if(!color||['rgba(0, 0, 0, 0)','transparent'].include(color))color='#ffffff';color=color.parseColor();return $R(0,2).map(function(i){return parseInt(color.slice(i*2+1,i*2+3),16);});}
this.transforms=this.style.map(function(pair){var property=pair[0],value=pair[1],unit=null;if(value.parseColor('#zzzzzz')!='#zzzzzz'){value=value.parseColor();unit='color';}else if(property=='opacity'){value=parseFloat(value);if(Prototype.Browser.IE&&(!this.element.currentStyle.hasLayout))
this.element.setStyle({zoom:1});}else if(Element.CSS_LENGTH.test(value)){var components=value.match(/^([\+\-]?[0-9\.]+)(.*)$/);value=parseFloat(components[1]);unit=(components.length==3)?components[2]:null;}
var originalValue=this.element.getStyle(property);return{style:property.camelize(),originalValue:unit=='color'?parseColor(originalValue):parseFloat(originalValue||0),targetValue:unit=='color'?parseColor(value):value,unit:unit};}.bind(this)).reject(function(transform){return((transform.originalValue==transform.targetValue)||(transform.unit!='color'&&(isNaN(transform.originalValue)||isNaN(transform.targetValue))));});},update:function(position){var style={},transform,i=this.transforms.length;while(i--)
style[(transform=this.transforms[i]).style]=transform.unit=='color'?'#'+
(Math.round(transform.originalValue[0]+
(transform.targetValue[0]-transform.originalValue[0])*position)).toColorPart()+
(Math.round(transform.originalValue[1]+
(transform.targetValue[1]-transform.originalValue[1])*position)).toColorPart()+
(Math.round(transform.originalValue[2]+
(transform.targetValue[2]-transform.originalValue[2])*position)).toColorPart():(transform.originalValue+
(transform.targetValue-transform.originalValue)*position).toFixed(3)+
(transform.unit===null?'':transform.unit);this.element.setStyle(style,true);}});Effect.Transform=Class.create({initialize:function(tracks){this.tracks=[];this.options=arguments[1]||{};this.addTracks(tracks);},addTracks:function(tracks){tracks.each(function(track){track=$H(track);var data=track.values().first();this.tracks.push($H({ids:track.keys().first(),effect:Effect.Morph,options:{style:data}}));}.bind(this));return this;},play:function(){return new Effect.Parallel(this.tracks.map(function(track){var ids=track.get('ids'),effect=track.get('effect'),options=track.get('options');var elements=[$(ids)||$$(ids)].flatten();return elements.map(function(e){return new effect(e,Object.extend({sync:true},options))});}).flatten(),this.options);}});Element.CSS_PROPERTIES=$w('backgroundColor backgroundPosition borderBottomColor borderBottomStyle '+'borderBottomWidth borderLeftColor borderLeftStyle borderLeftWidth '+'borderRightColor borderRightStyle borderRightWidth borderSpacing '+'borderTopColor borderTopStyle borderTopWidth bottom clip color '+'fontSize fontWeight height left letterSpacing lineHeight '+'marginBottom marginLeft marginRight marginTop markerOffset maxHeight '+'maxWidth minHeight minWidth opacity outlineColor outlineOffset '+'outlineWidth paddingBottom paddingLeft paddingRight paddingTop '+'right textIndent top width wordSpacing zIndex');Element.CSS_LENGTH=/^(([\+\-]?[0-9\.]+)(em|ex|px|in|cm|mm|pt|pc|\%))|0$/;String.__parseStyleElement=document.createElement('div');String.prototype.parseStyle=function(){var style,styleRules=$H();if(Prototype.Browser.WebKit)
style=new Element('div',{style:this}).style;else{String.__parseStyleElement.innerHTML='<div style="'+this+'"></div>';style=String.__parseStyleElement.childNodes[0].style;}
Element.CSS_PROPERTIES.each(function(property){if(style[property])styleRules.set(property,style[property]);});if(Prototype.Browser.IE&&this.include('opacity'))
styleRules.set('opacity',this.match(/opacity:\s*((?:0|1)?(?:\.\d*)?)/)[1]);return styleRules;};if(document.defaultView&&document.defaultView.getComputedStyle){Element.getStyles=function(element){var css=document.defaultView.getComputedStyle($(element),null);return Element.CSS_PROPERTIES.inject({},function(styles,property){styles[property]=css[property];return styles;});};}else{Element.getStyles=function(element){element=$(element);var css=element.currentStyle,styles;styles=Element.CSS_PROPERTIES.inject({},function(results,property){results[property]=css[property];return results;});if(!styles.opacity)styles.opacity=element.getOpacity();return styles;};}
Effect.Methods={morph:function(element,style){element=$(element);new Effect.Morph(element,Object.extend({style:style},arguments[2]||{}));return element;},visualEffect:function(element,effect,options){element=$(element);var s=effect.dasherize().camelize(),klass=s.charAt(0).toUpperCase()+s.substring(1);new Effect[klass](element,options);return element;},highlight:function(element,options){element=$(element);new Effect.Highlight(element,options);return element;}};$w('fade appear grow shrink fold blindUp blindDown slideUp slideDown '+'pulsate shake puff squish switchOff dropOut').each(function(effect){Effect.Methods[effect]=function(element,options){element=$(element);Effect[effect.charAt(0).toUpperCase()+effect.substring(1)](element,options);return element;};});$w('getInlineOpacity forceRerendering setContentZoom collectTextNodes collectTextNodesIgnoreClass getStyles').each(function(f){Effect.Methods[f]=Element[f];});Element.addMethods(Effect.Methods);if(typeof Effect=='undefined')
throw("controls.js requires including script.aculo.us' effects.js library");var Autocompleter={};Autocompleter.Base=Class.create({baseInitialize:function(element,update,options){element=$(element);this.element=element;this.update=$(update);this.hasFocus=false;this.changed=false;this.active=false;this.index=0;this.entryCount=0;this.oldElementValue=this.element.value;if(this.setOptions)
this.setOptions(options);else
this.options=options||{};this.options.paramName=this.options.paramName||this.element.name;this.options.tokens=this.options.tokens||[];this.options.frequency=this.options.frequency||0.4;this.options.minChars=this.options.minChars||1;this.options.onShow=this.options.onShow||function(element,update){if(!update.style.position||update.style.position=='absolute'){update.style.position='absolute';Position.clone(element,update,{setHeight:false,offsetTop:element.offsetHeight});}
Effect.Appear(update,{duration:0.15});};this.options.onHide=this.options.onHide||function(element,update){new Effect.Fade(update,{duration:0.15})};if(typeof(this.options.tokens)=='string')
this.options.tokens=new Array(this.options.tokens);if(!this.options.tokens.include('\n'))
this.options.tokens.push('\n');this.observer=null;this.element.setAttribute('autocomplete','off');Element.hide(this.update);Event.observe(this.element,'blur',this.onBlur.bindAsEventListener(this));Event.observe(this.element,'keydown',this.onKeyPress.bindAsEventListener(this));},show:function(){if(Element.getStyle(this.update,'display')=='none')this.options.onShow(this.element,this.update);if(!this.iefix&&(Prototype.Browser.IE)&&(Element.getStyle(this.update,'position')=='absolute')){new Insertion.After(this.update,'<iframe id="'+this.update.id+'_iefix" '+'style="display:none;position:absolute;filter:progid:DXImageTransform.Microsoft.Alpha(opacity=0);" '+'src="javascript:false;" frameborder="0" scrolling="no"></iframe>');this.iefix=$(this.update.id+'_iefix');}
if(this.iefix)setTimeout(this.fixIEOverlapping.bind(this),50);},fixIEOverlapping:function(){Position.clone(this.update,this.iefix,{setTop:(!this.update.style.height)});this.iefix.style.zIndex=1;this.update.style.zIndex=2;Element.show(this.iefix);},hide:function(){this.stopIndicator();if(Element.getStyle(this.update,'display')!='none')this.options.onHide(this.element,this.update);if(this.iefix)Element.hide(this.iefix);},startIndicator:function(){if(this.options.indicator)Element.show(this.options.indicator);},stopIndicator:function(){if(this.options.indicator)Element.hide(this.options.indicator);},onKeyPress:function(event){if(this.active)
switch(event.keyCode){case Event.KEY_TAB:case Event.KEY_RETURN:this.selectEntry();Event.stop(event);case Event.KEY_ESC:this.hide();this.active=false;Event.stop(event);return;case Event.KEY_LEFT:case Event.KEY_RIGHT:return;case Event.KEY_UP:this.markPrevious();this.render();Event.stop(event);return;case Event.KEY_DOWN:this.markNext();this.render();Event.stop(event);return;}
else
if(event.keyCode==Event.KEY_TAB||event.keyCode==Event.KEY_RETURN||(Prototype.Browser.WebKit>0&&event.keyCode==0))return;this.changed=true;this.hasFocus=true;if(this.observer)clearTimeout(this.observer);this.observer=setTimeout(this.onObserverEvent.bind(this),this.options.frequency*1000);},activate:function(){this.changed=false;this.hasFocus=true;this.getUpdatedChoices();},onHover:function(event){var element=Event.findElement(event,'LI');if(this.index!=element.autocompleteIndex)
{this.index=element.autocompleteIndex;this.render();}
Event.stop(event);},onClick:function(event){var element=Event.findElement(event,'LI');this.index=element.autocompleteIndex;this.selectEntry();this.hide();},onBlur:function(event){setTimeout(this.hide.bind(this),250);this.hasFocus=false;this.active=false;},render:function(){if(this.entryCount>0){for(var i=0;i<this.entryCount;i++)
this.index==i?Element.addClassName(this.getEntry(i),"selected"):Element.removeClassName(this.getEntry(i),"selected");if(this.hasFocus){this.show();this.active=true;}}else{this.active=false;this.hide();}},markPrevious:function(){if(this.index>0)this.index--;else this.index=this.entryCount-1;this.getEntry(this.index).scrollIntoView(true);},markNext:function(){if(this.index<this.entryCount-1)this.index++;else this.index=0;this.getEntry(this.index).scrollIntoView(false);},getEntry:function(index){return this.update.firstChild.childNodes[index];},getCurrentEntry:function(){return this.getEntry(this.index);},selectEntry:function(){this.active=false;this.updateElement(this.getCurrentEntry());},updateElement:function(selectedElement){if(this.options.updateElement){this.options.updateElement(selectedElement);return;}
var value='';if(this.options.select){var nodes=$(selectedElement).select('.'+this.options.select)||[];if(nodes.length>0)value=Element.collectTextNodes(nodes[0],this.options.select);}else
value=Element.collectTextNodesIgnoreClass(selectedElement,'informal');var bounds=this.getTokenBounds();if(bounds[0]!=-1){var newValue=this.element.value.substr(0,bounds[0]);var whitespace=this.element.value.substr(bounds[0]).match(/^\s+/);if(whitespace)
newValue+=whitespace[0];this.element.value=newValue+value+this.element.value.substr(bounds[1]);}else{this.element.value=value;}
this.oldElementValue=this.element.value;this.element.focus();if(this.options.afterUpdateElement)
this.options.afterUpdateElement(this.element,selectedElement);},updateChoices:function(choices){if(!this.changed&&this.hasFocus){this.update.innerHTML=choices;Element.cleanWhitespace(this.update);Element.cleanWhitespace(this.update.down());if(this.update.firstChild&&this.update.down().childNodes){this.entryCount=this.update.down().childNodes.length;for(var i=0;i<this.entryCount;i++){var entry=this.getEntry(i);entry.autocompleteIndex=i;this.addObservers(entry);}}else{this.entryCount=0;}
this.stopIndicator();this.index=0;if(this.entryCount==1&&this.options.autoSelect){this.selectEntry();this.hide();}else{this.render();}}},addObservers:function(element){Event.observe(element,"mouseover",this.onHover.bindAsEventListener(this));Event.observe(element,"click",this.onClick.bindAsEventListener(this));},onObserverEvent:function(){this.changed=false;this.tokenBounds=null;if(this.getToken().length>=this.options.minChars){this.getUpdatedChoices();}else{this.active=false;this.hide();}
this.oldElementValue=this.element.value;},getToken:function(){var bounds=this.getTokenBounds();return this.element.value.substring(bounds[0],bounds[1]).strip();},getTokenBounds:function(){if(null!=this.tokenBounds)return this.tokenBounds;var value=this.element.value;if(value.strip().empty())return[-1,0];var diff=arguments.callee.getFirstDifferencePos(value,this.oldElementValue);var offset=(diff==this.oldElementValue.length?1:0);var prevTokenPos=-1,nextTokenPos=value.length;var tp;for(var index=0,l=this.options.tokens.length;index<l;++index){tp=value.lastIndexOf(this.options.tokens[index],diff+offset-1);if(tp>prevTokenPos)prevTokenPos=tp;tp=value.indexOf(this.options.tokens[index],diff+offset);if(-1!=tp&&tp<nextTokenPos)nextTokenPos=tp;}
return(this.tokenBounds=[prevTokenPos+1,nextTokenPos]);}});Autocompleter.Base.prototype.getTokenBounds.getFirstDifferencePos=function(newS,oldS){var boundary=Math.min(newS.length,oldS.length);for(var index=0;index<boundary;++index)
if(newS[index]!=oldS[index])
return index;return boundary;};Ajax.Autocompleter=Class.create(Autocompleter.Base,{initialize:function(element,update,url,options){this.baseInitialize(element,update,options);this.options.asynchronous=true;this.options.onComplete=this.onComplete.bind(this);this.options.defaultParams=this.options.parameters||null;this.url=url;},getUpdatedChoices:function(){this.startIndicator();var entry=encodeURIComponent(this.options.paramName)+'='+
encodeURIComponent(this.getToken());this.options.parameters=this.options.callback?this.options.callback(this.element,entry):entry;if(this.options.defaultParams)
this.options.parameters+='&'+this.options.defaultParams;new Ajax.Request(this.url,this.options);},onComplete:function(request){this.updateChoices(request.responseText);}});Autocompleter.Local=Class.create(Autocompleter.Base,{initialize:function(element,update,array,options){this.baseInitialize(element,update,options);this.options.array=array;},getUpdatedChoices:function(){this.updateChoices(this.options.selector(this));},setOptions:function(options){this.options=Object.extend({choices:10,partialSearch:true,partialChars:2,ignoreCase:true,fullSearch:false,selector:function(instance){var ret=[];var partial=[];var entry=instance.getToken();var count=0;for(var i=0;i<instance.options.array.length&&ret.length<instance.options.choices;i++){var elem=instance.options.array[i];var foundPos=instance.options.ignoreCase?elem.toLowerCase().indexOf(entry.toLowerCase()):elem.indexOf(entry);while(foundPos!=-1){if(foundPos==0&&elem.length!=entry.length){ret.push("<li><strong>"+elem.substr(0,entry.length)+"</strong>"+
elem.substr(entry.length)+"</li>");break;}else if(entry.length>=instance.options.partialChars&&instance.options.partialSearch&&foundPos!=-1){if(instance.options.fullSearch||/\s/.test(elem.substr(foundPos-1,1))){partial.push("<li>"+elem.substr(0,foundPos)+"<strong>"+
elem.substr(foundPos,entry.length)+"</strong>"+elem.substr(foundPos+entry.length)+"</li>");break;}}
foundPos=instance.options.ignoreCase?elem.toLowerCase().indexOf(entry.toLowerCase(),foundPos+1):elem.indexOf(entry,foundPos+1);}}
if(partial.length)
ret=ret.concat(partial.slice(0,instance.options.choices-ret.length));return"<ul>"+ret.join('')+"</ul>";}},options||{});}});Field.scrollFreeActivate=function(field){setTimeout(function(){Field.activate(field);},1);};Ajax.InPlaceEditor=Class.create({initialize:function(element,url,options){this.url=url;this.element=element=$(element);this.prepareOptions();this._controls={};arguments.callee.dealWithDeprecatedOptions(options);Object.extend(this.options,options||{});if(!this.options.formId&&this.element.id){this.options.formId=this.element.id+'-inplaceeditor';if($(this.options.formId))
this.options.formId='';}
if(this.options.externalControl)
this.options.externalControl=$(this.options.externalControl);if(!this.options.externalControl)
this.options.externalControlOnly=false;this._originalBackground=this.element.getStyle('background-color')||'transparent';this.element.title=this.options.clickToEditText;this._boundCancelHandler=this.handleFormCancellation.bind(this);this._boundComplete=(this.options.onComplete||Prototype.emptyFunction).bind(this);this._boundFailureHandler=this.handleAJAXFailure.bind(this);this._boundSubmitHandler=this.handleFormSubmission.bind(this);this._boundWrapperHandler=this.wrapUp.bind(this);this.registerListeners();},checkForEscapeOrReturn:function(e){if(!this._editing||e.ctrlKey||e.altKey||e.shiftKey)return;if(Event.KEY_ESC==e.keyCode)
this.handleFormCancellation(e);else if(Event.KEY_RETURN==e.keyCode)
this.handleFormSubmission(e);},createControl:function(mode,handler,extraClasses){var control=this.options[mode+'Control'];var text=this.options[mode+'Text'];if('button'==control){var btn=document.createElement('input');btn.type='submit';btn.value=text;btn.className='editor_'+mode+'_button';if('cancel'==mode)
btn.onclick=this._boundCancelHandler;this._form.appendChild(btn);this._controls[mode]=btn;}else if('link'==control){var link=document.createElement('a');link.href='#';link.appendChild(document.createTextNode(text));link.onclick='cancel'==mode?this._boundCancelHandler:this._boundSubmitHandler;link.className='editor_'+mode+'_link';if(extraClasses)
link.className+=' '+extraClasses;this._form.appendChild(link);this._controls[mode]=link;}},createEditField:function(){var text=(this.options.loadTextURL?this.options.loadingText:this.getText());var fld;if(1>=this.options.rows&&!/\r|\n/.test(this.getText())){fld=document.createElement('input');fld.type='text';var size=this.options.size||this.options.cols||0;if(0<size)fld.size=size;}else{fld=document.createElement('textarea');fld.rows=(1>=this.options.rows?this.options.autoRows:this.options.rows);fld.cols=this.options.cols||40;}
fld.name=this.options.paramName;fld.value=text;fld.className='editor_field';if(this.options.submitOnBlur)
fld.onblur=this._boundSubmitHandler;this._controls.Editor=fld;if(this.options.loadTextURL)
this.loadExternalText();this._form.appendChild(this._controls.Editor);},createForm:function(){var ipe=this;function addText(mode,condition){var text=ipe.options['text'+mode+'Controls'];if(!text||condition===false)return;ipe._form.appendChild(document.createTextNode(text));};this._form=$(document.createElement('form'));this._form.id=this.options.formId;this._form.addClassName(this.options.formClassName);this._form.onsubmit=this._boundSubmitHandler;this.createEditField();if('textarea'==this._controls.Editor.tagName.toLowerCase())
this._form.appendChild(document.createElement('br'));if(this.options.onFormCustomization)
this.options.onFormCustomization(this,this._form);addText('Before',this.options.okControl||this.options.cancelControl);this.createControl('ok',this._boundSubmitHandler);addText('Between',this.options.okControl&&this.options.cancelControl);this.createControl('cancel',this._boundCancelHandler,'editor_cancel');addText('After',this.options.okControl||this.options.cancelControl);},destroy:function(){if(this._oldInnerHTML)
this.element.innerHTML=this._oldInnerHTML;this.leaveEditMode();this.unregisterListeners();},enterEditMode:function(e){if(this._saving||this._editing)return;this._editing=true;this.triggerCallback('onEnterEditMode');if(this.options.externalControl)
this.options.externalControl.hide();this.element.hide();this.createForm();this.element.parentNode.insertBefore(this._form,this.element);if(!this.options.loadTextURL)
this.postProcessEditField();if(e)Event.stop(e);},enterHover:function(e){if(this.options.hoverClassName)
this.element.addClassName(this.options.hoverClassName);if(this._saving)return;this.triggerCallback('onEnterHover');},getText:function(){return this.element.innerHTML.unescapeHTML();},handleAJAXFailure:function(transport){this.triggerCallback('onFailure',transport);if(this._oldInnerHTML){this.element.innerHTML=this._oldInnerHTML;this._oldInnerHTML=null;}},handleFormCancellation:function(e){this.wrapUp();if(e)Event.stop(e);},handleFormSubmission:function(e){var form=this._form;var value=$F(this._controls.Editor);this.prepareSubmission();var params=this.options.callback(form,value)||'';if(Object.isString(params))
params=params.toQueryParams();params.editorId=this.element.id;if(this.options.htmlResponse){var options=Object.extend({evalScripts:true},this.options.ajaxOptions);Object.extend(options,{parameters:params,onComplete:this._boundWrapperHandler,onFailure:this._boundFailureHandler});new Ajax.Updater({success:this.element},this.url,options);}else{var options=Object.extend({method:'get'},this.options.ajaxOptions);Object.extend(options,{parameters:params,onComplete:this._boundWrapperHandler,onFailure:this._boundFailureHandler});new Ajax.Request(this.url,options);}
if(e)Event.stop(e);},leaveEditMode:function(){this.element.removeClassName(this.options.savingClassName);this.removeForm();this.leaveHover();this.element.style.backgroundColor=this._originalBackground;this.element.show();if(this.options.externalControl)
this.options.externalControl.show();this._saving=false;this._editing=false;this._oldInnerHTML=null;this.triggerCallback('onLeaveEditMode');},leaveHover:function(e){if(this.options.hoverClassName)
this.element.removeClassName(this.options.hoverClassName);if(this._saving)return;this.triggerCallback('onLeaveHover');},loadExternalText:function(){this._form.addClassName(this.options.loadingClassName);this._controls.Editor.disabled=true;var options=Object.extend({method:'get'},this.options.ajaxOptions);Object.extend(options,{parameters:'editorId='+encodeURIComponent(this.element.id),onComplete:Prototype.emptyFunction,onSuccess:function(transport){this._form.removeClassName(this.options.loadingClassName);var text=transport.responseText;if(this.options.stripLoadedTextTags)
text=text.stripTags();this._controls.Editor.value=text;this._controls.Editor.disabled=false;this.postProcessEditField();}.bind(this),onFailure:this._boundFailureHandler});new Ajax.Request(this.options.loadTextURL,options);},postProcessEditField:function(){var fpc=this.options.fieldPostCreation;if(fpc)
$(this._controls.Editor)['focus'==fpc?'focus':'activate']();},prepareOptions:function(){this.options=Object.clone(Ajax.InPlaceEditor.DefaultOptions);Object.extend(this.options,Ajax.InPlaceEditor.DefaultCallbacks);[this._extraDefaultOptions].flatten().compact().each(function(defs){Object.extend(this.options,defs);}.bind(this));},prepareSubmission:function(){this._saving=true;this.removeForm();this.leaveHover();this.showSaving();},registerListeners:function(){this._listeners={};var listener;$H(Ajax.InPlaceEditor.Listeners).each(function(pair){listener=this[pair.value].bind(this);this._listeners[pair.key]=listener;if(!this.options.externalControlOnly)
this.element.observe(pair.key,listener);if(this.options.externalControl)
this.options.externalControl.observe(pair.key,listener);}.bind(this));},removeForm:function(){if(!this._form)return;this._form.remove();this._form=null;this._controls={};},showSaving:function(){this._oldInnerHTML=this.element.innerHTML;this.element.innerHTML=this.options.savingText;this.element.addClassName(this.options.savingClassName);this.element.style.backgroundColor=this._originalBackground;this.element.show();},triggerCallback:function(cbName,arg){if('function'==typeof this.options[cbName]){this.options[cbName](this,arg);}},unregisterListeners:function(){$H(this._listeners).each(function(pair){if(!this.options.externalControlOnly)
this.element.stopObserving(pair.key,pair.value);if(this.options.externalControl)
this.options.externalControl.stopObserving(pair.key,pair.value);}.bind(this));},wrapUp:function(transport){this.leaveEditMode();this._boundComplete(transport,this.element);}});Object.extend(Ajax.InPlaceEditor.prototype,{dispose:Ajax.InPlaceEditor.prototype.destroy});Ajax.InPlaceCollectionEditor=Class.create(Ajax.InPlaceEditor,{initialize:function($super,element,url,options){this._extraDefaultOptions=Ajax.InPlaceCollectionEditor.DefaultOptions;$super(element,url,options);},createEditField:function(){var list=document.createElement('select');list.name=this.options.paramName;list.size=1;this._controls.Editor=list;this._collection=this.options.collection||[];if(this.options.loadCollectionURL)
this.loadCollection();else
this.checkForExternalText();this._form.appendChild(this._controls.Editor);},loadCollection:function(){this._form.addClassName(this.options.loadingClassName);this.showLoadingText(this.options.loadingCollectionText);var options=Object.extend({method:'get'},this.options.ajaxOptions);Object.extend(options,{parameters:'editorId='+encodeURIComponent(this.element.id),onComplete:Prototype.emptyFunction,onSuccess:function(transport){var js=transport.responseText.strip();if(!/^\[.*\]$/.test(js))
throw('Server returned an invalid collection representation.');this._collection=eval(js);this.checkForExternalText();}.bind(this),onFailure:this.onFailure});new Ajax.Request(this.options.loadCollectionURL,options);},showLoadingText:function(text){this._controls.Editor.disabled=true;var tempOption=this._controls.Editor.firstChild;if(!tempOption){tempOption=document.createElement('option');tempOption.value='';this._controls.Editor.appendChild(tempOption);tempOption.selected=true;}
tempOption.update((text||'').stripScripts().stripTags());},checkForExternalText:function(){this._text=this.getText();if(this.options.loadTextURL)
this.loadExternalText();else
this.buildOptionList();},loadExternalText:function(){this.showLoadingText(this.options.loadingText);var options=Object.extend({method:'get'},this.options.ajaxOptions);Object.extend(options,{parameters:'editorId='+encodeURIComponent(this.element.id),onComplete:Prototype.emptyFunction,onSuccess:function(transport){this._text=transport.responseText.strip();this.buildOptionList();}.bind(this),onFailure:this.onFailure});new Ajax.Request(this.options.loadTextURL,options);},buildOptionList:function(){this._form.removeClassName(this.options.loadingClassName);this._collection=this._collection.map(function(entry){return 2===entry.length?entry:[entry,entry].flatten();});var marker=('value'in this.options)?this.options.value:this._text;var textFound=this._collection.any(function(entry){return entry[0]==marker;}.bind(this));this._controls.Editor.update('');var option;this._collection.each(function(entry,index){option=document.createElement('option');option.value=entry[0];option.selected=textFound?entry[0]==marker:0==index;option.appendChild(document.createTextNode(entry[1]));this._controls.Editor.appendChild(option);}.bind(this));this._controls.Editor.disabled=false;Field.scrollFreeActivate(this._controls.Editor);}});Ajax.InPlaceEditor.prototype.initialize.dealWithDeprecatedOptions=function(options){if(!options)return;function fallback(name,expr){if(name in options||expr===undefined)return;options[name]=expr;};fallback('cancelControl',(options.cancelLink?'link':(options.cancelButton?'button':options.cancelLink==options.cancelButton==false?false:undefined)));fallback('okControl',(options.okLink?'link':(options.okButton?'button':options.okLink==options.okButton==false?false:undefined)));fallback('highlightColor',options.highlightcolor);fallback('highlightEndColor',options.highlightendcolor);};Object.extend(Ajax.InPlaceEditor,{DefaultOptions:{ajaxOptions:{},autoRows:3,cancelControl:'link',cancelText:'cancel',clickToEditText:'Click to edit',externalControl:null,externalControlOnly:false,fieldPostCreation:'activate',formClassName:'inplaceeditor-form',formId:null,highlightColor:'#ffff99',highlightEndColor:'#ffffff',hoverClassName:'',htmlResponse:true,loadingClassName:'inplaceeditor-loading',loadingText:'Loading...',okControl:'button',okText:'ok',paramName:'value',rows:1,savingClassName:'inplaceeditor-saving',savingText:'Saving...',size:0,stripLoadedTextTags:false,submitOnBlur:false,textAfterControls:'',textBeforeControls:'',textBetweenControls:''},DefaultCallbacks:{callback:function(form){return Form.serialize(form);},onComplete:function(transport,element){new Effect.Highlight(element,{startcolor:this.options.highlightColor,keepBackgroundImage:true});},onEnterEditMode:null,onEnterHover:function(ipe){ipe.element.style.backgroundColor=ipe.options.highlightColor;if(ipe._effect)
ipe._effect.cancel();},onFailure:function(transport,ipe){alert('Error communication with the server: '+transport.responseText.stripTags());},onFormCustomization:null,onLeaveEditMode:null,onLeaveHover:function(ipe){ipe._effect=new Effect.Highlight(ipe.element,{startcolor:ipe.options.highlightColor,endcolor:ipe.options.highlightEndColor,restorecolor:ipe._originalBackground,keepBackgroundImage:true});}},Listeners:{click:'enterEditMode',keydown:'checkForEscapeOrReturn',mouseover:'enterHover',mouseout:'leaveHover'}});Ajax.InPlaceCollectionEditor.DefaultOptions={loadingCollectionText:'Loading options...'};Form.Element.DelayedObserver=Class.create({initialize:function(element,delay,callback){this.delay=delay||0.5;this.element=$(element);this.callback=callback;this.timer=null;this.lastValue=$F(this.element);Event.observe(this.element,'keyup',this.delayedListener.bindAsEventListener(this));},delayedListener:function(event){if(this.lastValue==$F(this.element))return;if(this.timer)clearTimeout(this.timer);this.timer=setTimeout(this.onTimerEvent.bind(this),this.delay*1000);this.lastValue=$F(this.element);},onTimerEvent:function(){this.timer=null;this.callback(this.element,$F(this.element));}});if(Object.isUndefined(Effect))
throw("dragdrop.js requires including script.aculo.us' effects.js library");var Droppables={drops:[],remove:function(element){this.drops=this.drops.reject(function(d){return d.element==$(element)});},add:function(element){element=$(element);var options=Object.extend({greedy:true,hoverclass:null,tree:false},arguments[1]||{});if(options.containment){options._containers=[];var containment=options.containment;if(Object.isArray(containment)){containment.each(function(c){options._containers.push($(c))});}else{options._containers.push($(containment));}}
if(options.accept)options.accept=[options.accept].flatten();Element.makePositioned(element);options.element=element;this.drops.push(options);},findDeepestChild:function(drops){deepest=drops[0];for(i=1;i<drops.length;++i)
if(Element.isParent(drops[i].element,deepest.element))
deepest=drops[i];return deepest;},isContained:function(element,drop){var containmentNode;if(drop.tree){containmentNode=element.treeNode;}else{containmentNode=element.parentNode;}
return drop._containers.detect(function(c){return containmentNode==c});},isAffected:function(point,element,drop){return((drop.element!=element)&&((!drop._containers)||this.isContained(element,drop))&&((!drop.accept)||(Element.classNames(element).detect(function(v){return drop.accept.include(v)})))&&Position.within(drop.element,point[0],point[1]));},deactivate:function(drop){if(drop.hoverclass)
Element.removeClassName(drop.element,drop.hoverclass);this.last_active=null;},activate:function(drop){if(drop.hoverclass)
Element.addClassName(drop.element,drop.hoverclass);this.last_active=drop;},show:function(point,element){if(!this.drops.length)return;var drop,affected=[];this.drops.each(function(drop){if(Droppables.isAffected(point,element,drop))
affected.push(drop);});if(affected.length>0)
drop=Droppables.findDeepestChild(affected);if(this.last_active&&this.last_active!=drop)this.deactivate(this.last_active);if(drop){Position.within(drop.element,point[0],point[1]);if(drop.onHover)
drop.onHover(element,drop.element,Position.overlap(drop.overlap,drop.element));if(drop!=this.last_active)Droppables.activate(drop);}},fire:function(event,element){if(!this.last_active)return;Position.prepare();if(this.isAffected([Event.pointerX(event),Event.pointerY(event)],element,this.last_active))
if(this.last_active.onDrop){this.last_active.onDrop(element,this.last_active.element,event);return true;}},reset:function(){if(this.last_active)
this.deactivate(this.last_active);}};var Draggables={drags:[],observers:[],register:function(draggable){if(this.drags.length==0){this.eventMouseUp=this.endDrag.bindAsEventListener(this);this.eventMouseMove=this.updateDrag.bindAsEventListener(this);this.eventKeypress=this.keyPress.bindAsEventListener(this);Event.observe(document,"mouseup",this.eventMouseUp);Event.observe(document,"mousemove",this.eventMouseMove);Event.observe(document,"keypress",this.eventKeypress);}
this.drags.push(draggable);},unregister:function(draggable){this.drags=this.drags.reject(function(d){return d==draggable});if(this.drags.length==0){Event.stopObserving(document,"mouseup",this.eventMouseUp);Event.stopObserving(document,"mousemove",this.eventMouseMove);Event.stopObserving(document,"keypress",this.eventKeypress);}},activate:function(draggable){if(draggable.options.delay){this._timeout=setTimeout(function(){Draggables._timeout=null;window.focus();Draggables.activeDraggable=draggable;}.bind(this),draggable.options.delay);}else{window.focus();this.activeDraggable=draggable;}},deactivate:function(){this.activeDraggable=null;},updateDrag:function(event){if(!this.activeDraggable)return;var pointer=[Event.pointerX(event),Event.pointerY(event)];if(this._lastPointer&&(this._lastPointer.inspect()==pointer.inspect()))return;this._lastPointer=pointer;this.activeDraggable.updateDrag(event,pointer);},endDrag:function(event){if(this._timeout){clearTimeout(this._timeout);this._timeout=null;}
if(!this.activeDraggable)return;this._lastPointer=null;this.activeDraggable.endDrag(event);this.activeDraggable=null;},keyPress:function(event){if(this.activeDraggable)
this.activeDraggable.keyPress(event);},addObserver:function(observer){this.observers.push(observer);this._cacheObserverCallbacks();},removeObserver:function(element){this.observers=this.observers.reject(function(o){return o.element==element});this._cacheObserverCallbacks();},notify:function(eventName,draggable,event){if(this[eventName+'Count']>0)
this.observers.each(function(o){if(o[eventName])o[eventName](eventName,draggable,event);});if(draggable.options[eventName])draggable.options[eventName](draggable,event);},_cacheObserverCallbacks:function(){['onStart','onEnd','onDrag'].each(function(eventName){Draggables[eventName+'Count']=Draggables.observers.select(function(o){return o[eventName];}).length;});}};var Draggable=Class.create({initialize:function(element){var defaults={handle:false,reverteffect:function(element,top_offset,left_offset){var dur=Math.sqrt(Math.abs(top_offset^2)+Math.abs(left_offset^2))*0.02;new Effect.Move(element,{x:-left_offset,y:-top_offset,duration:dur,queue:{scope:'_draggable',position:'end'}});},endeffect:function(element){var toOpacity=Object.isNumber(element._opacity)?element._opacity:1.0;new Effect.Opacity(element,{duration:0.2,from:0.7,to:toOpacity,queue:{scope:'_draggable',position:'end'},afterFinish:function(){Draggable._dragging[element]=false}});},zindex:1000,revert:false,quiet:false,scroll:false,scrollSensitivity:20,scrollSpeed:15,snap:false,delay:0};if(!arguments[1]||Object.isUndefined(arguments[1].endeffect))
Object.extend(defaults,{starteffect:function(element){element._opacity=Element.getOpacity(element);Draggable._dragging[element]=true;new Effect.Opacity(element,{duration:0.2,from:element._opacity,to:0.7});}});var options=Object.extend(defaults,arguments[1]||{});this.element=$(element);if(options.handle&&Object.isString(options.handle))
this.handle=this.element.down('.'+options.handle,0);if(!this.handle)this.handle=$(options.handle);if(!this.handle)this.handle=this.element;if(options.scroll&&!options.scroll.scrollTo&&!options.scroll.outerHTML){options.scroll=$(options.scroll);this._isScrollChild=Element.childOf(this.element,options.scroll);}
Element.makePositioned(this.element);this.options=options;this.dragging=false;this.eventMouseDown=this.initDrag.bindAsEventListener(this);Event.observe(this.handle,"mousedown",this.eventMouseDown);Draggables.register(this);},destroy:function(){Event.stopObserving(this.handle,"mousedown",this.eventMouseDown);Draggables.unregister(this);},currentDelta:function(){return([parseInt(Element.getStyle(this.element,'left')||'0'),parseInt(Element.getStyle(this.element,'top')||'0')]);},initDrag:function(event){if(!Object.isUndefined(Draggable._dragging[this.element])&&Draggable._dragging[this.element])return;if(Event.isLeftClick(event)){var src=Event.element(event);if((tag_name=src.tagName.toUpperCase())&&(tag_name=='INPUT'||tag_name=='SELECT'||tag_name=='OPTION'||tag_name=='BUTTON'||tag_name=='TEXTAREA'))return;var pointer=[Event.pointerX(event),Event.pointerY(event)];var pos=Position.cumulativeOffset(this.element);this.offset=[0,1].map(function(i){return(pointer[i]-pos[i])});Draggables.activate(this);Event.stop(event);}},startDrag:function(event){this.dragging=true;if(!this.delta)
this.delta=this.currentDelta();if(this.options.zindex){this.originalZ=parseInt(Element.getStyle(this.element,'z-index')||0);this.element.style.zIndex=this.options.zindex;}
if(this.options.ghosting){this._clone=this.element.cloneNode(true);this._originallyAbsolute=(this.element.getStyle('position')=='absolute');if(!this._originallyAbsolute)
Position.absolutize(this.element);this.element.parentNode.insertBefore(this._clone,this.element);}
if(this.options.scroll){if(this.options.scroll==window){var where=this._getWindowScroll(this.options.scroll);this.originalScrollLeft=where.left;this.originalScrollTop=where.top;}else{this.originalScrollLeft=this.options.scroll.scrollLeft;this.originalScrollTop=this.options.scroll.scrollTop;}}
Draggables.notify('onStart',this,event);if(this.options.starteffect)this.options.starteffect(this.element);},updateDrag:function(event,pointer){if(!this.dragging)this.startDrag(event);if(!this.options.quiet){Position.prepare();Droppables.show(pointer,this.element);}
Draggables.notify('onDrag',this,event);this.draw(pointer);if(this.options.change)this.options.change(this);if(this.options.scroll){this.stopScrolling();var p;if(this.options.scroll==window){with(this._getWindowScroll(this.options.scroll)){p=[left,top,left+width,top+height];}}else{p=Position.page(this.options.scroll);p[0]+=this.options.scroll.scrollLeft+Position.deltaX;p[1]+=this.options.scroll.scrollTop+Position.deltaY;p.push(p[0]+this.options.scroll.offsetWidth);p.push(p[1]+this.options.scroll.offsetHeight);}
var speed=[0,0];if(pointer[0]<(p[0]+this.options.scrollSensitivity))speed[0]=pointer[0]-(p[0]+this.options.scrollSensitivity);if(pointer[1]<(p[1]+this.options.scrollSensitivity))speed[1]=pointer[1]-(p[1]+this.options.scrollSensitivity);if(pointer[0]>(p[2]-this.options.scrollSensitivity))speed[0]=pointer[0]-(p[2]-this.options.scrollSensitivity);if(pointer[1]>(p[3]-this.options.scrollSensitivity))speed[1]=pointer[1]-(p[3]-this.options.scrollSensitivity);this.startScrolling(speed);}
if(Prototype.Browser.WebKit)window.scrollBy(0,0);Event.stop(event);},finishDrag:function(event,success){this.dragging=false;if(this.options.quiet){Position.prepare();var pointer=[Event.pointerX(event),Event.pointerY(event)];Droppables.show(pointer,this.element);}
if(this.options.ghosting){if(!this._originallyAbsolute)
Position.relativize(this.element);delete this._originallyAbsolute;Element.remove(this._clone);this._clone=null;}
var dropped=false;if(success){dropped=Droppables.fire(event,this.element);if(!dropped)dropped=false;}
if(dropped&&this.options.onDropped)this.options.onDropped(this.element);Draggables.notify('onEnd',this,event);var revert=this.options.revert;if(revert&&Object.isFunction(revert))revert=revert(this.element);var d=this.currentDelta();if(revert&&this.options.reverteffect){if(dropped==0||revert!='failure')
this.options.reverteffect(this.element,d[1]-this.delta[1],d[0]-this.delta[0]);}else{this.delta=d;}
if(this.options.zindex)
this.element.style.zIndex=this.originalZ;if(this.options.endeffect)
this.options.endeffect(this.element);Draggables.deactivate(this);Droppables.reset();},keyPress:function(event){if(event.keyCode!=Event.KEY_ESC)return;this.finishDrag(event,false);Event.stop(event);},endDrag:function(event){if(!this.dragging)return;this.stopScrolling();this.finishDrag(event,true);Event.stop(event);},draw:function(point){var pos=Position.cumulativeOffset(this.element);if(this.options.ghosting){var r=Position.realOffset(this.element);pos[0]+=r[0]-Position.deltaX;pos[1]+=r[1]-Position.deltaY;}
var d=this.currentDelta();pos[0]-=d[0];pos[1]-=d[1];if(this.options.scroll&&(this.options.scroll!=window&&this._isScrollChild)){pos[0]-=this.options.scroll.scrollLeft-this.originalScrollLeft;pos[1]-=this.options.scroll.scrollTop-this.originalScrollTop;}
var p=[0,1].map(function(i){return(point[i]-pos[i]-this.offset[i])}.bind(this));if(this.options.snap){if(Object.isFunction(this.options.snap)){p=this.options.snap(p[0],p[1],this);}else{if(Object.isArray(this.options.snap)){p=p.map(function(v,i){return(v/this.options.snap[i]).round()*this.options.snap[i]}.bind(this));}else{p=p.map(function(v){return(v/this.options.snap).round()*this.options.snap}.bind(this));}}}
var style=this.element.style;if((!this.options.constraint)||(this.options.constraint=='horizontal'))
style.left=p[0]+"px";if((!this.options.constraint)||(this.options.constraint=='vertical'))
style.top=p[1]+"px";if(style.visibility=="hidden")style.visibility="";},stopScrolling:function(){if(this.scrollInterval){clearInterval(this.scrollInterval);this.scrollInterval=null;Draggables._lastScrollPointer=null;}},startScrolling:function(speed){if(!(speed[0]||speed[1]))return;this.scrollSpeed=[speed[0]*this.options.scrollSpeed,speed[1]*this.options.scrollSpeed];this.lastScrolled=new Date();this.scrollInterval=setInterval(this.scroll.bind(this),10);},scroll:function(){var current=new Date();var delta=current-this.lastScrolled;this.lastScrolled=current;if(this.options.scroll==window){with(this._getWindowScroll(this.options.scroll)){if(this.scrollSpeed[0]||this.scrollSpeed[1]){var d=delta/1000;this.options.scroll.scrollTo(left+d*this.scrollSpeed[0],top+d*this.scrollSpeed[1]);}}}else{this.options.scroll.scrollLeft+=this.scrollSpeed[0]*delta/1000;this.options.scroll.scrollTop+=this.scrollSpeed[1]*delta/1000;}
Position.prepare();Droppables.show(Draggables._lastPointer,this.element);Draggables.notify('onDrag',this);if(this._isScrollChild){Draggables._lastScrollPointer=Draggables._lastScrollPointer||$A(Draggables._lastPointer);Draggables._lastScrollPointer[0]+=this.scrollSpeed[0]*delta/1000;Draggables._lastScrollPointer[1]+=this.scrollSpeed[1]*delta/1000;if(Draggables._lastScrollPointer[0]<0)
Draggables._lastScrollPointer[0]=0;if(Draggables._lastScrollPointer[1]<0)
Draggables._lastScrollPointer[1]=0;this.draw(Draggables._lastScrollPointer);}
if(this.options.change)this.options.change(this);},_getWindowScroll:function(w){var T,L,W,H;with(w.document){if(w.document.documentElement&&documentElement.scrollTop){T=documentElement.scrollTop;L=documentElement.scrollLeft;}else if(w.document.body){T=body.scrollTop;L=body.scrollLeft;}
if(w.innerWidth){W=w.innerWidth;H=w.innerHeight;}else if(w.document.documentElement&&documentElement.clientWidth){W=documentElement.clientWidth;H=documentElement.clientHeight;}else{W=body.offsetWidth;H=body.offsetHeight;}}
return{top:T,left:L,width:W,height:H};}});Draggable._dragging={};var SortableObserver=Class.create({initialize:function(element,observer){this.element=$(element);this.observer=observer;this.lastValue=Sortable.serialize(this.element);},onStart:function(){this.lastValue=Sortable.serialize(this.element);},onEnd:function(){Sortable.unmark();if(this.lastValue!=Sortable.serialize(this.element))
this.observer(this.element)}});var Sortable={SERIALIZE_RULE:/^[^_\-](?:[A-Za-z0-9\-\_]*)[_](.*)$/,sortables:{},_findRootElement:function(element){while(element.tagName.toUpperCase()!="BODY"){if(element.id&&Sortable.sortables[element.id])return element;element=element.parentNode;}},options:function(element){element=Sortable._findRootElement($(element));if(!element)return;return Sortable.sortables[element.id];},destroy:function(element){element=$(element);var s=Sortable.sortables[element.id];if(s){Draggables.removeObserver(s.element);s.droppables.each(function(d){Droppables.remove(d)});s.draggables.invoke('destroy');delete Sortable.sortables[s.element.id];}},create:function(element){element=$(element);var options=Object.extend({element:element,tag:'li',dropOnEmpty:false,tree:false,treeTag:'ul',overlap:'vertical',constraint:'vertical',containment:element,handle:false,only:false,delay:0,hoverclass:null,ghosting:false,quiet:false,scroll:false,scrollSensitivity:20,scrollSpeed:15,format:this.SERIALIZE_RULE,elements:false,handles:false,onChange:Prototype.emptyFunction,onUpdate:Prototype.emptyFunction},arguments[1]||{});this.destroy(element);var options_for_draggable={revert:true,quiet:options.quiet,scroll:options.scroll,scrollSpeed:options.scrollSpeed,scrollSensitivity:options.scrollSensitivity,delay:options.delay,ghosting:options.ghosting,constraint:options.constraint,handle:options.handle};if(options.starteffect)
options_for_draggable.starteffect=options.starteffect;if(options.reverteffect)
options_for_draggable.reverteffect=options.reverteffect;else
if(options.ghosting)options_for_draggable.reverteffect=function(element){element.style.top=0;element.style.left=0;};if(options.endeffect)
options_for_draggable.endeffect=options.endeffect;if(options.zindex)
options_for_draggable.zindex=options.zindex;var options_for_droppable={overlap:options.overlap,containment:options.containment,tree:options.tree,hoverclass:options.hoverclass,onHover:Sortable.onHover};var options_for_tree={onHover:Sortable.onEmptyHover,overlap:options.overlap,containment:options.containment,hoverclass:options.hoverclass};Element.cleanWhitespace(element);options.draggables=[];options.droppables=[];if(options.dropOnEmpty||options.tree){Droppables.add(element,options_for_tree);options.droppables.push(element);}
(options.elements||this.findElements(element,options)||[]).each(function(e,i){var handle=options.handles?$(options.handles[i]):(options.handle?$(e).select('.'+options.handle)[0]:e);options.draggables.push(new Draggable(e,Object.extend(options_for_draggable,{handle:handle})));Droppables.add(e,options_for_droppable);if(options.tree)e.treeNode=element;options.droppables.push(e);});if(options.tree){(Sortable.findTreeElements(element,options)||[]).each(function(e){Droppables.add(e,options_for_tree);e.treeNode=element;options.droppables.push(e);});}
this.sortables[element.id]=options;Draggables.addObserver(new SortableObserver(element,options.onUpdate));},findElements:function(element,options){return Element.findChildren(element,options.only,options.tree?true:false,options.tag);},findTreeElements:function(element,options){return Element.findChildren(element,options.only,options.tree?true:false,options.treeTag);},onHover:function(element,dropon,overlap){if(Element.isParent(dropon,element))return;if(overlap>.33&&overlap<.66&&Sortable.options(dropon).tree){return;}else if(overlap>0.5){Sortable.mark(dropon,'before');if(dropon.previousSibling!=element){var oldParentNode=element.parentNode;element.style.visibility="hidden";dropon.parentNode.insertBefore(element,dropon);if(dropon.parentNode!=oldParentNode)
Sortable.options(oldParentNode).onChange(element);Sortable.options(dropon.parentNode).onChange(element);}}else{Sortable.mark(dropon,'after');var nextElement=dropon.nextSibling||null;if(nextElement!=element){var oldParentNode=element.parentNode;element.style.visibility="hidden";dropon.parentNode.insertBefore(element,nextElement);if(dropon.parentNode!=oldParentNode)
Sortable.options(oldParentNode).onChange(element);Sortable.options(dropon.parentNode).onChange(element);}}},onEmptyHover:function(element,dropon,overlap){var oldParentNode=element.parentNode;var droponOptions=Sortable.options(dropon);if(!Element.isParent(dropon,element)){var index;var children=Sortable.findElements(dropon,{tag:droponOptions.tag,only:droponOptions.only});var child=null;if(children){var offset=Element.offsetSize(dropon,droponOptions.overlap)*(1.0-overlap);for(index=0;index<children.length;index+=1){if(offset-Element.offsetSize(children[index],droponOptions.overlap)>=0){offset-=Element.offsetSize(children[index],droponOptions.overlap);}else if(offset-(Element.offsetSize(children[index],droponOptions.overlap)/2)>=0){child=index+1<children.length?children[index+1]:null;break;}else{child=children[index];break;}}}
dropon.insertBefore(element,child);Sortable.options(oldParentNode).onChange(element);droponOptions.onChange(element);}},unmark:function(){if(Sortable._marker)Sortable._marker.hide();},mark:function(dropon,position){var sortable=Sortable.options(dropon.parentNode);if(sortable&&!sortable.ghosting)return;if(!Sortable._marker){Sortable._marker=($('dropmarker')||Element.extend(document.createElement('DIV'))).hide().addClassName('dropmarker').setStyle({position:'absolute'});document.getElementsByTagName("body").item(0).appendChild(Sortable._marker);}
var offsets=Position.cumulativeOffset(dropon);Sortable._marker.setStyle({left:offsets[0]+'px',top:offsets[1]+'px'});if(position=='after')
if(sortable.overlap=='horizontal')
Sortable._marker.setStyle({left:(offsets[0]+dropon.clientWidth)+'px'});else
Sortable._marker.setStyle({top:(offsets[1]+dropon.clientHeight)+'px'});Sortable._marker.show();},_tree:function(element,options,parent){var children=Sortable.findElements(element,options)||[];for(var i=0;i<children.length;++i){var match=children[i].id.match(options.format);if(!match)continue;var child={id:encodeURIComponent(match?match[1]:null),element:element,parent:parent,children:[],position:parent.children.length,container:$(children[i]).down(options.treeTag)};if(child.container)
this._tree(child.container,options,child);parent.children.push(child);}
return parent;},tree:function(element){element=$(element);var sortableOptions=this.options(element);var options=Object.extend({tag:sortableOptions.tag,treeTag:sortableOptions.treeTag,only:sortableOptions.only,name:element.id,format:sortableOptions.format},arguments[1]||{});var root={id:null,parent:null,children:[],container:element,position:0};return Sortable._tree(element,options,root);},_constructIndex:function(node){var index='';do{if(node.id)index='['+node.position+']'+index;}while((node=node.parent)!=null);return index;},sequence:function(element){element=$(element);var options=Object.extend(this.options(element),arguments[1]||{});return $(this.findElements(element,options)||[]).map(function(item){return item.id.match(options.format)?item.id.match(options.format)[1]:'';});},setSequence:function(element,new_sequence){element=$(element);var options=Object.extend(this.options(element),arguments[2]||{});var nodeMap={};this.findElements(element,options).each(function(n){if(n.id.match(options.format))
nodeMap[n.id.match(options.format)[1]]=[n,n.parentNode];n.parentNode.removeChild(n);});new_sequence.each(function(ident){var n=nodeMap[ident];if(n){n[1].appendChild(n[0]);delete nodeMap[ident];}});},serialize:function(element){element=$(element);var options=Object.extend(Sortable.options(element),arguments[1]||{});var name=encodeURIComponent((arguments[1]&&arguments[1].name)?arguments[1].name:element.id);if(options.tree){return Sortable.tree(element,arguments[1]).children.map(function(item){return[name+Sortable._constructIndex(item)+"[id]="+
encodeURIComponent(item.id)].concat(item.children.map(arguments.callee));}).flatten().join('&');}else{return Sortable.sequence(element,arguments[1]).map(function(item){return name+"[]="+encodeURIComponent(item);}).join('&');}}};Element.isParent=function(child,element){if(!child.parentNode||child==element)return false;if(child.parentNode==element)return true;return Element.isParent(child.parentNode,element);};Element.findChildren=function(element,only,recursive,tagName){if(!element.hasChildNodes())return null;tagName=tagName.toUpperCase();if(only)only=[only].flatten();var elements=[];$A(element.childNodes).each(function(e){if(e.tagName&&e.tagName.toUpperCase()==tagName&&(!only||(Element.classNames(e).detect(function(v){return only.include(v)}))))
elements.push(e);if(recursive){var grandchildren=Element.findChildren(e,only,recursive,tagName);if(grandchildren)elements.push(grandchildren);}});return(elements.length>0?elements.flatten():[]);};Element.offsetSize=function(element,type){return element['offset'+((type=='vertical'||type=='height')?'Height':'Width')];};var Builder={NODEMAP:{AREA:'map',CAPTION:'table',COL:'table',COLGROUP:'table',LEGEND:'fieldset',OPTGROUP:'select',OPTION:'select',PARAM:'object',TBODY:'table',TD:'table',TFOOT:'table',TH:'table',THEAD:'table',TR:'table'},node:function(elementName){elementName=elementName.toUpperCase();var parentTag=this.NODEMAP[elementName]||'div';var parentElement=document.createElement(parentTag);try{parentElement.innerHTML="<"+elementName+"></"+elementName+">";}catch(e){}
var element=parentElement.firstChild||null;if(element&&(element.tagName.toUpperCase()!=elementName))
element=element.getElementsByTagName(elementName)[0];if(!element)element=document.createElement(elementName);if(!element)return;if(arguments[1])
if(this._isStringOrNumber(arguments[1])||(arguments[1]instanceof Array)||arguments[1].tagName){this._children(element,arguments[1]);}else{var attrs=this._attributes(arguments[1]);if(attrs.length){try{parentElement.innerHTML="<"+elementName+" "+
attrs+"></"+elementName+">";}catch(e){}
element=parentElement.firstChild||null;if(!element){element=document.createElement(elementName);for(attr in arguments[1])
element[attr=='class'?'className':attr]=arguments[1][attr];}
if(element.tagName.toUpperCase()!=elementName)
element=parentElement.getElementsByTagName(elementName)[0];}}
if(arguments[2])
this._children(element,arguments[2]);return $(element);},_text:function(text){return document.createTextNode(text);},ATTR_MAP:{'className':'class','htmlFor':'for'},_attributes:function(attributes){var attrs=[];for(attribute in attributes)
attrs.push((attribute in this.ATTR_MAP?this.ATTR_MAP[attribute]:attribute)+'="'+attributes[attribute].toString().escapeHTML().gsub(/"/,'&quot;')+'"');return attrs.join(" ");},_children:function(element,children){if(children.tagName){element.appendChild(children);return;}
if(typeof children=='object'){children.flatten().each(function(e){if(typeof e=='object')
element.appendChild(e);else
if(Builder._isStringOrNumber(e))
element.appendChild(Builder._text(e));});}else
if(Builder._isStringOrNumber(children))
element.appendChild(Builder._text(children));},_isStringOrNumber:function(param){return(typeof param=='string'||typeof param=='number');},build:function(html){var element=this.node('div');$(element).update(html.strip());return element.down();},dump:function(scope){if(typeof scope!='object'&&typeof scope!='function')scope=window;var tags=("A ABBR ACRONYM ADDRESS APPLET AREA B BASE BASEFONT BDO BIG BLOCKQUOTE BODY "+"BR BUTTON CAPTION CENTER CITE CODE COL COLGROUP DD DEL DFN DIR DIV DL DT EM FIELDSET "+"FONT FORM FRAME FRAMESET H1 H2 H3 H4 H5 H6 HEAD HR HTML I IFRAME IMG INPUT INS ISINDEX "+"KBD LABEL LEGEND LI LINK MAP MENU META NOFRAMES NOSCRIPT OBJECT OL OPTGROUP OPTION P "+"PARAM PRE Q S SAMP SCRIPT SELECT SMALL SPAN STRIKE STRONG STYLE SUB SUP TABLE TBODY TD "+"TEXTAREA TFOOT TH THEAD TITLE TR TT U UL VAR").split(/\s+/);tags.each(function(tag){scope[tag]=function(){return Builder.node.apply(Builder,[tag].concat($A(arguments)));};});}};MagicLinkerSet=Class.create({initialize:function(){this.processes=$H();},addDefaultSet:function(name){this.default_sets.push(name);},add:function(){var args=$A(arguments);if(args.length==1){args.unshift('default');}
this.addToSet(args[0],args[1]);},addToSet:function(name,process){var set=this.getSet(name);set.push(process);this.processes.set(name,set);},getSet:function(name){return this.processes.get(name)||[];},run:function(){var args=$A(arguments).flatten();if(args.length==0){args=['default'];}
args.each(function(set){this.runSet(set);}.bind(this));},runSet:function(set){this.getSet(set).each(function(i){i();});}});MagicLinkerController=Class.create({initialize:function(){this.default_sets=['default'];this.system_processes=new MagicLinkerSet();this.addSystem=this.system_processes.add.bind(this.system_processes);this.processes=new MagicLinkerSet();this.add=this.processes.add.bind(this.processes);},addDefaultSet:function(set){this.default_sets.push(set);},run:function(){this.processes.run(this.default_sets);},runSystem:function(){this.system_processes.run(this.default_sets);}});MagicLinker=new MagicLinkerController();var Preloader=Class.create({initialize:function(){this.chunks=$H();if((container=$('preload'))){this.preload_container=container;}
else{this.preload_container=new Element('div',{id:'preload'});document.body.appendChild(this.preload_container);}},giveMe:function(chunk){if(this.loaded){return this.getFromLoaded(chunk);}
else{this.fetchPreloads();temp=this.chunks.get(chunk);if(!temp){temp=new Element('div',{'class':'loading_'+chunk});temp.innerHTML=loadingHTML();}
this.chunks.set(chunk,temp);return temp;}},getFromLoaded:function(chunk){return this.preload_container.down('.'+chunk);},fetchPreloads:function(){if(this.fetching){return;}
this.fetching=true;new Ajax.Updater(this.preload_container,'/'+I18n.locale+'/preload',{method:'get',onSuccess:this.nowLoaded.bindAsEventListener(this),onComplete:this.updateFromLoaded.bindAsEventListener(this)});},nowLoaded:function(){this.loaded=true;},updateFromLoaded:function(){this.fetching=false;if(!this.loaded){return;}
this.chunks.each(function(requested){requested[1].replace(this.getFromLoaded(requested[0]));}.bind(this));}});Preloader.prototype.updateFromLoaded=Preloader.prototype.updateFromLoaded.wrap(function(proceed){MagicLinker.run();proceed();});MagicLinker.addSystem(function(){window.preloader=new Preloader();});function cancel(e,cancelBubble){if(cancelBubble){e.cancelBubble=true;}
if(e&&e.preventDefault){e.preventDefault();}
return false;}
function loadingHTML(){var klass=arguments.length>0?arguments[0]:'loading';return'<span class="'+klass+'">'+I18n.t('loading',{scope:'common'})+'...'+'</span>';}
function insertIntoDebugWindow(){}
function bottomThirdOfViewport(){return(document.viewport.getHeight()/3)|0;}
function displayLanguageChangePrompt(language_prompt){var lightbox=new ManualLightbox();lightbox.autosizeable();lightbox.activate(function(){return language_prompt.innerHTML;},{'wide':true});with(lightbox.lightbox){lightbox.closeBehaviour({'href':down('.revert_to_account_language').href,onclick:function(){return true;}});down('.confirm_change_language').observe('click',function(event){new Ajax.Request('/'+I18n.locale+'/confirm_change_language',{method:'post'});window._lightbox.deactivate();cancel(event);});addClassName('remove_position');}}
var Participant=Class.create({initialize:function(){this.read=false;},isHuman:function(){this.readStatus();return this.human;},isRobot:function(){this.readStatus();return!this.human;},isDancer:function(){return this.isRobot();},setHuman:function(){this.readStatus();if(this.human){return false;}
this.human=true;this.parts[0]='1';this.parts[1]='all';setCookie('_cf_languages',this.parts.join('-'));return true;},showAll:function(){!this.showSome();},showSome:function(){this.readStatus();if(this.human){return this.show=='some';}},readStatus:function(){if(this.read){return;}
this.read=true;this.cookie=readCookie('_cf_languages')||'';this.parts=$A(this.cookie.split('-'));this.human=this.parts.first()=='1';this.show=this.parts[1];this.languages=(this.parts[2]||'').gsub(/%2c/i,',').split(',');}});window.participant=new Participant();var BossyForm=Class.create();BossyForm.prototype={initialize:function(form){window._bossy_form=this;this.form=$(form);this.isDirty=this.form.hasClassName('is-dirty');this.return_to=this.form.getElementsBySelector('input[name=return_to]').first();if(!this.return_to){this.return_to=new Element('input',{type:'hidden',name:'return_to'});this.form.insert({bottom:this.return_to});}
this.starting_point=this.form.serialize();this.intimidateAllLinks();this.lightbox=new ManualLightbox();this.lightbox.autosizeable();Event.observe(window,'beforeunload',this.onBeforeUnload.bind(this));window.onbeforeunload=this.onBeforeUnload.bind(this);this.linkClicked=false;this.enabled=true;if(!this.form.hasClassName('will_not_be_intimidated')){Event.observe(this.form,'submit',function(){this.setEnabled(false);}.bind(this));}},onBeforeUnload:function(evt){if(this.enabled&&!this.linkClicked&&this.changed()){(evt||window.event).returnValue=I18n.t('continue_without_saving_warning',{scope:'common.message'});return I18n.t('continue_without_saving_warning',{scope:'common.message'});}},intimidateAllLinks:function(){$$('a').each(function(link){this.intimidateLink(link);}.bind(this));},intimidateLink:function(link){if(link.intimidated){return;}
link.intimidated=true;if(link.hasClassName('will_not_be_intimidated')){return;}
if(link.hasClassName('close')){return;}
if(link.hasAttribute('target')&&link.getAttribute('target')=='_blank'){return;}
link.onclick=cancel;link.original_href=link.href;link.observe('click',this.onClickCheckGenerator(link).bindAsEventListener(this));},onClickCheckGenerator:function(link){return function(evt){this.checkForm(link.original_href);};},unchanged:function(){return!this.isDirty&&this.form.serialize()==this.removeDisabled(this.starting_point);},changed:function(){return!this.unchanged();},checkForm:function(action){if(this.changed()){node=$('bossy_form_template').cloneNode(true);node.writeAttribute({id:null});node.show();node.getElementsBySelector('button').each(function(button){if(button.hasClassName('ignore_changes')){button.observe('click',function(){this.linkClicked=true;window.location.href=action;}.bind(this));}
button.observe('click',function(){this.lightbox.deactivate();}.bind(this));}.bind(this));this.lightbox.activate(function(){return node;},{'css_class':'unsaved_changes'});}
else{window.location.href=action;}},reload:function(){this.starting_point=this.form.serialize();},addLanguages:function(languages){codes=languages.join("%2C");this.starting_point=this.starting_point.replace(/language_ids=*&/,"language_ids="+codes+"&");},removeDisabled:function(oldSerialized){$$('.bossy_disabled').each(function(e){var pattern=new RegExp("&?"+e.cloneNode(true).enable().serialize());oldSerialized=oldSerialized.gsub(pattern,"");});return oldSerialized;},setEnabled:function(value){this.enabled=value;}};function fixFooter(){var footer=$('footer');if(!footer){return;}
var footerHeight=footer.getHeight();var difference=document.viewport.getHeight()-($('main').getHeight()+footerHeight);if(difference>0){difference=difference+footerHeight-40+'px';if(ie()){footer.setStyle({height:difference});}
else{footer.setStyle({minHeight:difference});}}}
var URLReader=Class.create({initialize:function(){this.url=(arguments.length>0)?arguments[0]:window.location.href;this._parse();},_parse:function(){var pieces=this.url.split('?');var uri=pieces.shift();uri=uri.match(/([^:]*):\/\/([0-9a-z_.-]+)\/(.*)/);this.protocol=uri[1];this.domain=uri[2];this.path=uri[3];this.params=$A(pieces).join('?').toQueryParams();}});var JLURLReader=Class.create(URLReader,{_parse:function($super){$super();this.application=this.domain.split('.')[0];this.path_parts=this.path.split('/');this._locale=this.path_parts[0].match(/[a-z]{2}/)?this.path_parts[0]:null;this._location=null;this._action=null;if(this.path_parts[1]){if(this.path_parts[1].match(/[A-Z][A-Za-z_-]+/)){this._location=this.path_parts[1];}
else{this._action=this.path_parts[1];}}
else{this._action='';}},application:function(){return this.application;},locale:function(){return this._locale||this.params.locale||'en';},location:function(){return this._location||this.params.location;},action:function(){return this._action;}});String.prototype.wordWrap=function(m,b,c){var i,j,l,s,r;if(m<1)
return this;for(i=-1,l=(r=this.split("\n")).length;++i<l;r[i]+=s)
for(s=r[i],r[i]="";s.length>m;r[i]+=s.slice(0,j)+((s=s.slice(j)).length?b:""))
j=c==2||(j=s.slice(0,m+1).match(/\S*(\s)?$/))[1]?m:j.input.length-j[0].length||c==1&&m||j.input.length+(j=s.slice(m).match(/^\S*/)).input.length;return r.join("\n");};SubmitController={count:0,init:function(options){options=options||{};$$('.submit_controlled').each(function(button){if(button.hasClassName("initialized")){return true;}
var old_function=button.onclick;button.addClassName("initialized");button.onclick=function(){if(SubmitController.doSubmit()){if(this.hasClassName('active')){this.removeClassName('active');this.addClassName('had_active');}
if(options.disableButton){button.disable();}
SubmitController.resetButton.delay(8,this);if(old_function)
return old_function();else
return true;}
return false;};button.enable();});this.initialized=true;},doSubmit:function(){return(++this.count<=1);},resetButton:function(button){SubmitController.count=0;if(!button.hasClassName('active')&&button.hasClassName('had_active')){button.removeClassName('had_active');button.addClassName('active');}
button.enable();}};var LoginAndRegister=Class.create({initialize:function(form_container){this.form_container=$(form_container);if(this.form_container.getAttribute('watched'))return;this.setup();this.form_container.observe('click',this.clickHandler.bindAsEventListener(this));},setup:function(){this.form_container.setAttribute('watched',true);this.facets={'login':$('form_login'),'register':$('form_register'),'password_reset':$('form_password_reset')};this.login_visible=this.facets.login.visible();},toggle:function(){if(this.login_visible){this.facets.login.hide();this.facets.password_reset.show();}
else{this.facets.password_reset.hide();this.facets.login.show();}
this.login_visible=!this.login_visible;},clickHandler:function(event){var element=event.element();if(element.nodeName.toString().toLowerCase()=='a'&&element.up('div#login_and_password_container')){cancel(event);this.toggle();}}});MagicLinker.add(function(){var login_or_register=$('login_or_register');if(login_or_register){var handler=new LoginAndRegister(login_or_register);}});MagicLinker.addSystem(function(){Element.observe(document.body,'click',function(event){var element=event.element();if((element.tagName==='A')&&(/\bexternal\b/.test(element.getAttribute('rel')))){window.open(event.target.href);cancel(event);}});});Cookie={set:function(name,value,days,path,domain,secure){if(days){var date=new Date();date.setTime(date.getTime()+(days*24*60*60*1000));}
document.cookie=name+"="+value+
(days?"; expires="+date.toGMTString():"")+
(path?"; path="+path:"")+
(domain?"; domain="+domain:"")+
(secure?"; secure":"");},get:function(name){var nameEQ=name+"=";var ca=document.cookie.split(';');for(var i=0;i<ca.length;i++){var c=ca[i];while(c.charAt(0)==' '){c=c.substring(1,c.length);}
if(c.indexOf(nameEQ)==0){return c.substring(nameEQ.length,c.length);}}
return null;},erase:function(name){this.set(name,"",-1);}};function setCookie(name,value){return Cookie.set(name,value,60,'/',I18n.domain);}
function readCookie(name){return Cookie.get(name);}
function readEncodedCookie(name){return Base64.decode(unescape(Cookie.get(name)));}
BrowserTests=Class.create({initialize:function(){this.results={ie:null,ie_lte_6:null,ie_gte_7:null};},isIE:function(){if(this.results.ie==null){this.results.ie=navigator.appName=="Microsoft Internet Explorer";}
return this.results.ie;},isIElte6:function(){if(this.results.ie_lte_6==null){var rv=10;var ua=navigator.userAgent;var re=new RegExp("MSIE ([0-9]{1,}[\.0-9]{0,})");if(re.exec(ua)!=null)rv=parseFloat(RegExp.$1);this.results.ie_lte_6=(rv<=6);}
return this.results.ie_lte_6;},isIElte7:function(){if(this.results.ie_lte_7==null){var rv=10;var ua=navigator.userAgent;var re=new RegExp("MSIE ([0-9]{1,}[\.0-9]{0,})");if(re.exec(ua)!=null)rv=parseFloat(RegExp.$1);this.results.ie_lte_7=(rv<=7);}
return this.results.ie_lte_7;},isIEgte7:function(){if(this.results.ie_gte_7==null){var rv=1;var ua=navigator.userAgent;var re=new RegExp("MSIE ([0-9]{1,}[\.0-9]{0,})");if(re.exec(ua)!=null)rv=parseFloat(RegExp.$1);this.results.ie_gte_7=(rv>=7);}
return this.results.ie_gte_7;},isIEgte8:function(){if(this.results.ie_gte_8==null){var rv=1;var ua=navigator.userAgent;var re=new RegExp("MSIE ([0-9]{1,}[\.0-9]{0,})");if(re.exec(ua)!=null)rv=parseFloat(RegExp.$1);this.results.ie_gte_8=(rv>=8);}
return this.results.ie_gte_8;}});var Browser=new BrowserTests();function ie(){return Browser.isIE();}
function ie_lte_6(){return Browser.isIElte6();}
function ie_lte_7(){return Browser.isIElte7();}
function ie_gte_7(){return Browser.isIEgte7();}
function ie_gte_8(){return Browser.isIEgte8();}
function unobfuscate_emails(){$$('.etacsufbo').each(function(element){$(element).replace(Base64.decode(element.id));});}
var Base64={_keyStr:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",decode:function(input){var output="";var chr1,chr2,chr3;var enc1,enc2,enc3,enc4;var i=0;input=input.replace(/[^A-Za-z0-9\+\/\=]/g,"");while(i<input.length){enc1=this._keyStr.indexOf(input.charAt(i++));enc2=this._keyStr.indexOf(input.charAt(i++));enc3=this._keyStr.indexOf(input.charAt(i++));enc4=this._keyStr.indexOf(input.charAt(i++));chr1=(enc1<<2)|(enc2>>4);chr2=((enc2&15)<<4)|(enc3>>2);chr3=((enc3&3)<<6)|enc4;output=output+String.fromCharCode(chr1);if(enc3!=64){output=output+String.fromCharCode(chr2);}
if(enc4!=64){output=output+String.fromCharCode(chr3);}}
output=Base64._utf8_decode(output);return output;},_utf8_decode:function(utftext){var string="";var i=0;var c=c1=c2=0;while(i<utftext.length){c=utftext.charCodeAt(i);if(c<128){string+=String.fromCharCode(c);i++;}
else if((c>191)&&(c<224)){c2=utftext.charCodeAt(i+1);string+=String.fromCharCode(((c&31)<<6)|(c2&63));i+=2;}
else{c2=utftext.charCodeAt(i+1);c3=utftext.charCodeAt(i+2);string+=String.fromCharCode(((c&15)<<12)|((c2&63)<<6)|(c3&63));i+=3;}}
return string;}}
MagicLinker.add(function(){unobfuscate_emails();});I18n={locale:'en',language_id:10,domain:'justlanded.com',init:function(locale,language_id,domain,uid){I18n.locale=locale;I18n.language_id=language_id;I18n.domain=domain;I18n.uid=uid;},interpolate:function(string,interps){for(key in interps){string=string.replace('{{'+key+'}}',interps[key]);}
return string;},t:function(key,options){options=options||{};options.interps=options.interps||{};options.scope=options.scope||options['scope']||'auto';try{var tr=I18nStrings[I18n.locale.toString()][options.scope][key];if(tr){return I18n.interpolate(tr,options.interps);}
return I18n.interpolate(I18nStrings['en'][options.scope][key],options.interps);}
catch(ex){try{return I18n.interpolate(I18nStrings['en'][options.scope][key],options.interps);}
catch(ex2){return('[JS::I18n] Translation missing: '+key+', '+options.scope);}}}}
var IE7Scroll=Class.create({initialize:function(){this.step=document.viewport.getHeight()/2;document.observe('keydown',this.listen.bind(this));},listen:function(event){if(event.keyCode=='33'){window.scrollBy(0,-this.step);}
else if(event.keyCode==34){window.scrollBy(0,this.step);}}});var Konami=Class.create({konamiCode:"38,38,40,40,37,39,37,39,66,65",keys:[],active:false,initialize:function(){document.observe('keydown',this.listen.bind(this));this.checkFriendly();},listen:function(event){this.keys.push(event.keyCode);if(this.keys.length>10){this.keys.shift();}
if(this.keys.toString().indexOf(this.konamiCode)>=0){this.toggle();}},toggle:function(){if(this.active){this.timer.stop();this.active=false;this.scoreContainer.remove();}
else{this.timer=new PeriodicalExecuter(this.release.bind(this),8);if(!this.scoreContainer){this.score=0;this.scoreContainer=new Element('div');this.scoreContainer.setStyle({fontFamily:'Impact',fontSize:'60px',fontWeight:'bold',position:'fixed',top:'25px',right:'25px',zIndex:1000000});window._konamiIncrement=function(){this.score+=1;if(this.score==42){this.setFriendly();}
this.scoreContainer.innerHTML=this.score>100?'LOL':this.score.toString();}.bind(this);}
document.body.insert({bottom:this.scoreContainer});this.release();this.active=true;}},release:function(){var bubbles=new BubbleRow();bubbles.create();bubbles.release();},incrementScore:function(){this.score+=1;},setFriendly:function(){Cookie.set('friendly','true')
this.setFriendlyLogo();},checkFriendly:function(){if(Cookie.get('friendly')){this.setFriendlyLogo();}},setFriendlyLogo:function(){$('logo').setStyle({background:"url("+assetHost.asset_src('/images/header/logo_friendlier_3698.png')+")"+" no-repeat left top"});}});var BubbleRow=Class.create({initialize:function(){this.bubbleCount=Math.floor(Math.random()*5)+3;this.container=null;this.containerAnimation=null;this.bubbles=$A();this.viewportWidth=document.viewport.getWidth();this.viewportHeight=document.viewport.getHeight();this.containerHeight=400;this.duration=1.0*Math.floor(Math.random()*10)+20;},create:function(){this.container=new Element('div')
this.container.setStyle({position:'fixed',width:this.viewportWidth+'px',height:1+'px',top:this.viewportHeight+'px',zIndex:1500000});document.body.insert({bottom:this.container});for(var i=0;i<this.bubbleCount;i++){var bubble=new Bubble({maxX:this.viewportWidth,maxY:this.containerHeight});this.container.insert({bottom:bubble.element});this.bubbles.push(bubble);}},release:function(){this.containerAnimation=new Effect.Move(this.container,{y:(this.viewportHeight+this.containerHeight)*-1,transition:Effect.Transitions.linear,fps:25,duration:this.duration,afterFinish:this.destroy.bind(this)});for(var i=0;i<this.bubbleCount;i++){this.bubbles[i].animate(this.duration);}},destroy:function(){this.containerAnimation.cancel();this.bubbles.each(function(bubble){bubble.remove();});this.container.remove();this.container=null;}});var Bubble=Class.create({initialize:function(options){options=options||{};this.animation=null;this.bubbleMinSize=80;this.bubbleVariation=50;var maxX=options.maxX||500;var maxY=options.maxY||500;var image=Math.floor(Math.random()*4)+1;var size=Math.floor(Math.random()*this.bubbleVariation)+this.bubbleMinSize;var startX=Math.floor(Math.random()*(maxX-this.bubbleMinSize-this.bubbleVariation));var startY=Math.floor(Math.random()*(maxY-this.bubbleMinSize-this.bubbleVariation));this.element=new Element('img',{src:assetHost.asset_src('/images/misc/bubble_'+image+'.png')});this.element.setStyle({width:size+'px',height:size+'px',position:'absolute',left:startX+'px',top:startY+'px'});this.element.observe('click',this.pop.bind(this));},position:function(x,y){this.element.setStyle({})},remove:function(){if(!this.element){return;}
if(this.animation){this.animation.cancel();}
this.element.remove();this.element=null;},pop:function(){if(this.animation){this.animation.cancel();}
if(window._konamiIncrement){window._konamiIncrement();}
this.element.puff({afterFinish:this.remove.bind(this)});},animate:function(duration){var useAnimation=Math.random();if(useAnimation>=0.9){if(!ie()){var time=Math.floor(Math.random()*(duration-10)*1.0)+5;this.animation=new Effect.Puff(this.element,{fps:25,delay:time});}}
else if(useAnimation>=0.5){var time=Math.floor(Math.random()*5.0);var endX=Math.floor(Math.random()*100)+50;if(Math.random()>0.5){endX=endX*=-1;}
this.animation=new Effect.Move(this.element,{x:endX,transition:Effect.Transitions.spring,duration:duration,fps:25,delay:time});}}});MagicLinker.addSystem(function(){if(!ie_lte_6()){new Konami();}})
var BetterSelectMulti=Class.create({initialize:function(select,prompt_text,remove_text,callbacks){this.select=$(select);this.prompt_text=prompt_text||'';this.remove_text=remove_text||'';this.selected_values=$A();this.callbacks=callbacks||{};this.list=this.initList();this.select.hide();this.faux_select=new Element('select');this.faux_select.observe('change',function(event){this.addCurrentSelection();}.bindAsEventListener(this));this.faux_select.multiple=true;try{this.faux_select.innerHTML=this.select.innerHTML;}catch(ex){}
if(this.faux_select.options.size==0){$A(this.select.options).each(function(option){new_option=new Option(option.innerHTML,option.value,false,option.selected);try{this.faux_select.add(new_option,null);}catch(ex){this.faux_select.add(new_option);}}.bind(this));}
$A(this.select.options).each(function(option){if(option.selected){this.addSelection(option.value,option.text,true);}}.bind(this));this.faux_select.multiple=false;var prompt=new Element('option');prompt.innerHTML=this.prompt_text;prompt.value='-1';this.faux_select.insert({top:prompt});this.faux_select.selectedIndex=0;this.select.insert({before:this.faux_select});},initList:function(){var list=new Element('ul');list.className='better_select_multi_list';this.select.insert({before:list});return list;},addSelection:function(value,text,initialLoad){if(this.callbacks.onItemSelected){this.callbacks.onItemSelected(this,value,initialLoad);}
if(value=='-1'){return;}
if(this.selected_values.include(value)){return;}
this.selected_values.push(value);$A(this.select.options).find(function(so){if(so.value==value){so.selected=true;}});this.createAndAddItemToList(text,value);},createAndAddItemToList:function(text,value){var item=this.createItem(text,this.createRemoveAction(value));this.addItemToList(item);return item;},createItem:function(text,removeHandler){var remove_link=new Element('a');remove_link.href="#";remove_link.title=this.remove_text;remove_link.innerHTML='<span>'+text+'</span>&nbsp;';remove_link.onclick=function(){return false;};remove_link.observe('click',removeHandler);list_item=new Element('li');list_item.insert({top:remove_link});return list_item;},addItemToList:function(list_item){this.list.insert({bottom:list_item});return list_item;},createRemoveAction:function(value){var func=function(event){this.controller.removeSelection(this.value,event.target);cancel(event,true);}.bindAsEventListener({controller:this,value:value});return func;},addCurrentSelection:function(){var selected=[];selected=$A(this.faux_select.options).findAll(function(option){return option.selected;});selected.each(function(option){this.addSelection(option.value,option.text);}.bind(this));this.faux_select.selectedIndex=0;},removeSelection:function(value,target){this.removeItemFromList(target);$A(this.select.options).find(function(so){if(so.value==value){so.selected=false;}});$A(this.faux_select.options).find(function(so){if(so.value==value){so.disabled=false;}});this.selected_values.splice(this.selected_values.indexOf(value),1);if(this.callbacks.onEmpty){if(this.selected_values.length==0){this.callbacks.onEmpty();}}},removeItemFromList:function(target){$(target).up('li').remove();}});function load_LanguageSelectMulti(select){select=$(select);select.betterSelectMulti=new LanguageSelectMulti(select,I18n.t('add_language',{scope:'common'}),I18n.t('remove',{scope:'common'}),{onItemSelected:function(select_multi,value,initialLoad){if(!initialLoad){select_multi.radio_some.checked=true;};}});}
function setLanguageSelectorValuesFromCookie(form){form.getElementsBySelector('input[type=radio]').each(function(radio){radio.checked=radio.value==window.participant.show;});var select=form.down('.additional_language_selector');var count=select.length;var languages=$A(window.participant.languages).reject(function(v){return v==I18n.language_id.toString()});for(var i=0;i<count;i++){if(languages.include(select.options[i].value.toString())){select.options[i].selected="selected";}}}
var LanguageSelectMulti=Class.create(BetterSelectMulti,{initialize:function($super,select,prompt_text,remove_text,callbacks){var form=select.up('form');this.radio_some=form.down('input[type=radio][value=some]');this.radio_all=form.down('input[type=radio][value=all]');$super(select,prompt_text,remove_text,callbacks);},initList:function(){var list=new Element('span');list.className='selected_languages';var label=this.radio_some.up(1,'p').down('label');label.insert({after:' '})
label.insert({after:list})
return list;},createItem:function(text,removeHandler){var remove_link=new Element('a');remove_link.href="#"
remove_link.title=this.remove_text;remove_link.innerHTML=text+'<span>x</span>';remove_link.onclick=function(){return false;}
remove_link.observe('click',removeHandler);var remove_link_wrapper=new Element('span',{'class':'lang'});remove_link_wrapper.insert({top:remove_link});return remove_link_wrapper;},addItemToList:function(list_item){if(this.selected_values.length>1){var und=new Element('span',{'class':'joiner'});und.insert({top:' '+I18n.t('and',{scope:'common'})+' '});list_item.insert({top:und});}
this.list.insert({bottom:' '});this.list.insert({bottom:list_item});return list_item;},removeItemFromList:function(target){target=$(target);if(target.nodeName.toLowerCase()!='span.lang'){target=target.up('span.lang');}
target.remove();var first=this.list.getElementsBySelector('span.lang').first();if(first){var und=first.down('span.joiner');if(und){und.remove();}}}});var LanguagesHandler=Class.create({visible:false,initialize:function(language_bar){this.languageBar=$(language_bar);this.languageBar.observe('click',this.clickHandler.bindAsEventListener(this));$(document.body).observe('click',this.clearClickHandler.bindAsEventListener(this));if(readCookie('additional_languages')){var dude=$('dude');if(dude){dude.removeClassName('visible');}}},clickHandler:function(event){var target=$(event.target);if(target.nodeName.toLowerCase()!='a'){var temp=target.up('a');if(temp){target=temp;}}
if(target.id=='dude'){cancel(event);target.blur();target.up('span.piece').hide();this.languageBar.down('span.additional_container').show();this.languageBar.removeClassName('inset_interface');this.triggerLanguageContainer(this.languageBar.down('a.preload_additional_languages'));setCookie('additional_languages','seen');var remover=function(){target.up('span.piece').remove();}
remover.delay(3);}
else if(target.hasClassName('language')){cancel(event);target.blur();this.triggerLanguageContainer(target);}
else if(target.hasClassName('flag_sprite')){target.href+='?goto_url='+window.location.href.escapeHTML();}},triggerLanguageContainer:function(target){if(!target.languageContainer){var chunk=target.className.match(/preload_([a-z0-9_]+)/)[1];var preload=window.preloader.giveMe(chunk);left=target.hasClassName('preload_interface_language');this.createContainer(target,preload,left);}
if(target.languageContainer.visible()){target.languageContainer.hide();return;}
this.hideContainers();target.languageContainer.show();if(ie()&&target.hasClassName('preload_additional_languages')){target.languageContainer.getElementsBySelector('input[type=radio]').each(function(radio){radio.setAttribute('checked',window.participant.show==radio.value);});}
this.visible=true;},clearClickHandler:function(event){var target=$(event.target);if(this.visible&&!target.ancestors('#languages').member($('languages'))){this.hideContainers();}},hideContainers:function(){$('languages').getElementsBySelector('.language_option_container').each(function(container){container.hide();});this.visible=false;},createContainer:function(target,content,mainLanguage){if(!target.languageContainer){target.languageContainer=new Element('div',{'class':'language_option_container rbox'});var contentContainer=target.languageContainer;if(mainLanguage||ie_gte_8()){var top='25px';}
else{var top='15px';}
target.languageContainer.setStyle({position:'absolute'});target.languageContainer.hide();target.setStyle({position:'relative'});var offsetParent=target.getOffsetParent();if(mainLanguage){var targetPosition=target.positionedOffset();target.languageContainer.setStyle({'left':targetPosition.left-229+'px','top':top});}
else{if(ie_lte_6()){target.languageContainer.setStyle({'left':'-120px','top':top});}
else{target.languageContainer.setStyle({'right':'-3px','top':top});}}
offsetParent.insert({bottom:target.languageContainer});contentContainer.insert({bottom:content});}}});MagicLinker.addSystem(function(){var bar=$("languages");if(bar){new LanguagesHandler(bar);}})
MagicLinker.add(function(){var preload=$('additional_languages_preload');if(preload){setLanguageSelectorValuesFromCookie(preload);}
$$('.additional_language_selector').each(function(select){load_LanguageSelectMulti(select);select.removeClassName('additional_language_selector');var form=select.up('form');if(form){var return_to=form.down('input[name=return_to]');if(typeof return_to=='undefined'){return_to=new Element('input',{type:'hidden',name:'return_to',value:window.location.href});form.insert({bottom:return_to});}}});});LanguageDetection={initialise:function(select){this.select=$(select);this.observe('blur',this.guessLanguage.bindAsEventListener(this));this.select.observe('change',this.fireChange.bindAsEventListener(this));},guessLanguage:function(){if(this.value.length==0||!($F(this.select)=='-1'||$F(this.select).blank())){return;}
var text=this.value;var max_score=0;var max_id=0;var input_words=text.split(/[\s]+/);LanguageDetectionRules.each(function(language){var language_score=0;input_words.each(function(word){language.terms.each(function(term){if(!term.blank()){var re=new RegExp("\\b"+term+"\\b",'igm');if(word.match(re)){language_score+=text.match(re).length;}}});});if(language.language_id==I18n.language_id){language_score+=0.5;}
if(language_score>max_score){max_score=language_score;max_id=language.language_id;}});this.select.value=max_id;this.fireChange();},fireChange:function(){this.select.fire('language:selected',{selector:this.select,language_id:this.select.value,name:this.select.options[this.select.selectedIndex].innerHTML,flag:LanguageCodes[this.select.value]});}};function languageCodeFromID(language_id){return LanguageCodes[language_id];}
MagicLinker.addSystem(function(){$$('textarea.auto_detect_language').each(function(textarea){initAutoLanguageDetection(textarea,textarea.up('form').down('select.auto_detect_language'));});});function initAutoLanguageDetection(textarea,select){if(select){Object.extend(textarea,LanguageDetection).initialise(select,10);}}
var LocationChanger=Class.create({initialize:function(container,trigger){this.trigger=$(trigger);this.container=$(container);this.visible=this.container.visible();this.truss=this.trigger.down('.truss');this.inner=this.container.down('.sign_inner');this.trigger.onclick=function(){return false;};this.trigger.observe('click',this.toggle.bind(this));var width=$('header').down('h2').getWidth();if(width>600){width=300;}
this.container.down('.sign_inner').setStyle({'minWidth':width-50+'px'});this.animatedPlane=!ie()||ie_gte_7();if(this.animatedPlane){this.setupPlane();if(this.visible){this.positionPlane();this.plane.show();}}
$(document.body).observe('click',this.triggerClickHandler.bindAsEventListener(this));},triggerClickHandler:function(event){var target=$(event.target);var parent=$(target.parentNode);if(target.hasClassName('location_selector_trigger')||parent&&(parent.nodeName!=="#document-fragment")&&parent.hasClassName('location_selector_trigger')){cancel(event);this.toggle(event);target.blur();if(this.visible){new Effect.ScrollTo(this.trigger,{offset:-100});}}},toggle:function(event){var target=$(event.target);target.blur();this.trigger.blur();if(this.visible){this.trigger.removeClassName('active');this.container.hide();this.visible=false;this.inner.removeClassName('ieStyleReset');if(this.plane){this.plane.hide();}}
else{this.trigger.addClassName('active');this.container.show();this.visible=true;this.inner.addClassName('ieStyleReset');if(this.plane){this.positionPlane();this.plane.show();}}},setupPlane:function(){if(this.animatedPlane){this.sheet=new Element('div');this.sheet.setStyle({top:'15px',left:'16px',position:'absolute',width:'50px',height:'50px',backgroundColor:'#0e8ac1'});this.container.insert({bottom:this.sheet});this.plane=new Element('div',{'id':'plane'});this.plane.hide();$('main').insert({bottom:this.plane});this.container.down('form').observe('submit',function(event){new Effect.Move(this,{x:350,y:-300,mode:'relative',duration:2});}.bind(this.plane));}},positionPlane:function(){if(this.animatedPlane){var sheetPosition=this.sheet.cumulativeOffset();var mainPosition=$('main').cumulativeOffset();this.plane.setStyle({top:sheetPosition.top-mainPosition.top+'px',left:sheetPosition.left-mainPosition.left+'px'});}}});var LocationSelector=Class.create({initialize:function(country_selector,location_selector){this.countrySelector=country_selector;this.locationSelector=location_selector;this.locationLists={};this.loading=false;this.init();},init:function(){var match,value;this.queryOptions=$H();(this.locationSelector.readAttribute('class')||'').split(/\s+/).each(function(piece){if((match=piece.match(/\boption_([a-z_]+)(?:-(true|false|[a-z0-9_\-]+))?\b/))){value=match[2]||'true';if(value.match(/(?:true|false|[0-9]+)/)){value=eval('('+value+')');}
this.queryOptions.set(match[1],value);}}.bind(this));this.silentlyFixCountrySelection();this.observe();this.displayLocationSelector();this.triggerFromInitState();},reset:function(){var set=0;for(var i=0;i<this.countrySelector.options.length;i++){if(this.countrySelector.options[i].value=='-1'){set=i;break;}}
this.countrySelector.selectedIndex=set;this.locationSelector.hide();},observe:function(){this.countrySelector.observe('change',this.triggerSelectedLocation.bind(this));this.countrySelector.observe('change',this.loadLocationsFromClick.bind(this));this.locationSelector.observe('change',this.triggerSelectedLocation.bind(this));},unObserve:function(){this.countrySelector.stopObserving('change');this.locationSelector.stopObserving('change');},selectedCountry:function(){return $F(this.countrySelector);},selectedCountryHasRegions:function(){if(parseInt(this.countrySelector.selectedIndex,10)<0){return false;}
return $(this.countrySelector.options[this.countrySelector.selectedIndex]).hasClassName('has_regions');},loadLocationsFromClick:function(){if(!this.selectedCountryHasRegions()){this.makeEmpty(this.selectedCountry());}
this.loadLocations(this.selectedCountry());},loadLocations:function(value){if(this.populated(value)){this.populateWith(value);}else{this.makeLoading();new Ajax.Request('/'+I18n.locale+'/regions',{method:'get',parameters:this.queryOptions.merge({country_id:value,authenticity_token:window.auth_token}),on500:insertIntoDebugWindow,onSuccess:function(transport){this.controller.clearLoading();this.controller.parseAndStore(this.id,transport.responseText);this.controller.softLoadLocations(this.id);}.bind({controller:this,id:value}),onFailure:function(transport){this.clearLoading();}.bind(this),onComplete:function(){}.bind(this)});}},softLoadLocations:function(id){if(id===this.selectedCountry()){this.loadLocations(id);}},parseAndStore:function(id,json){this.locationLists[id]=eval('('+json+')').collect(function(option){var new_option=new Option(option.text,option.value,false,option.selected);new_option=$(new_option);if(option['class']){new_option.addClassName(option['class']);}
return new_option;});},makeEmpty:function(id){this.locationLists[id]=[];},populated:function(id){return!!this.locationLists[id];},populateWith:function(id){this.loadOptionsFromArray(this.locationLists[id]);this.displayLocationSelector();},makeLoading:function(){if(!this.loadingOption){this.loadingOption=new Option(I18n.t('loading',{scope:'common'})+'...','-1',false,true);}
if(!this.loading){this.locationSelector.show();this.loading=true;this.locationSelector.disabled=true;this.loadOptionsFromArray([this.loadingOption]);}},clearLoading:function(){if(this.loading){this.loading=false;this.locationSelector.disabled=false;this.locationSelector.options.length=0;}},loadOptionsFromArray:function(options){this.locationSelector.selectedIndex=0;this.locationSelector.options.length=0;options.each(function(option){try{this.locationSelector.add(option,null);}catch(ex){this.locationSelector.add(option);}}.bind(this));},displayLocationSelector:function(){if(this.locationSelector.options.length>1){this.locationSelector.show();}
else{this.locationSelector.hide();}},triggerSelectedLocation:function(event){var element=event.element();var elementValue=$F(element);if(element===this.countrySelector){this.fireEvent('countrySelected',elementValue);if(this.selectedCountryHasRegions()){this.fireEvent('locationSelected',false);}
else{this.fireEvent('locationSelected',elementValue);}}
else{this.fireEvent('locationSelected',elementValue);}},triggerFromInitState:function(){this.fireEvent('countrySelected',$F(this.countrySelector));if(this.selectedCountryHasRegions()){this.fireEvent('locationSelected',$F(this.locationSelector));}
else{this.fireEvent('locationSelected',$F(this.countrySelector));}},_getCityAndRegion:function(force_false){var ret={'city':false,'region':false};if(!force_false&&this.locationSelector.selectedIndex>0){var opt=this.locationSelector.options[this.locationSelector.selectedIndex];var match=opt.className.toString().match(/(city|region)/);if(match){ret[match[1]]=opt.innerHTML;}
if(match&&match[1]==='city'){match=opt.className.toString().match(/parent-([0-9]+)\b/);if(match){var region=$(this.locationSelector).down('option[value='+match[1]+']');if(region){ret.region=region.innerHTML;}}}}
return ret;},fireEvent:function(eventName,value){var qualifiedEventName='locationSelector:'+eventName;var eventElementValue;if(!value||value===''||value==='-1'||value==='0'){eventElementValue=false;}else{eventElementValue=value;}
var country_id=$F(this.countrySelector);var cityAndRegion=this._getCityAndRegion(eventElementValue===false||country_id===eventElementValue);this.locationSelector.fire(qualifiedEventName,{'location':eventElementValue!==false?this.nameFromSelect(this.locationSelector):null,'location_id':eventElementValue,'city':cityAndRegion.city,'region':cityAndRegion.region,'country':this.nameFromSelect(this.countrySelector),'country_id':country_id,'countryHasRegions':this.selectedCountryHasRegions(),'locationIsCountry':country_id===eventElementValue});},nameFromSelect:function(element){if(element.selectedIndex===-1){return null;}
return element.options[element.selectedIndex].innerHTML;},silentlyFixCountrySelection:function(){var check=this.countrySelector.next('.country_id_check');if(check){var value=$F(check);check.remove();if(!value.blank()&&value!==$F(this.countrySelector)){this.countrySelector.value=value;}}}});function locationSelectorFromContainer(container){container=$(container);var selector=new LocationSelector(container.down('select.country_selector'),container.down('select.region_selector'));container.getElementsBySelector('.hidden_region_list').each(function(list){list.show();});container.store('locationSelector',selector);return selector;}
MagicLinker.addSystem(function(){var container=$('location_change_container');var changer=$('location_change');if(container&&changer){new LocationChanger(container,changer);}});MagicLinker.add(function(){$$('.location_selector').each(function(container){if(!container.hasClassName('located')){locationSelectorFromContainer(container);container.addClassName('located');}});});SmartTextAreaSize=Class.create({initialize:function(element){this.element=$(element);this.resize();Event.observe(this.element,"keyup",this.resize.bindAsEventListener(this));this.element.setStyle({overflow:'hidden'});this.element.setAttribute("wrap","virtual");},resize:function(){this.doResize();},doResize:function(){if(this.element.scrollHeight!=this.element.clientHeight){this.element.setStyle({height:$A([this.element.scrollHeight,100]).max()+'px'});}}});HashController=Class.create({initialize:function(){this._listeners=[];this._currentValue=this.get();this._run=true;this._executer=new PeriodicalExecuter(this.check.bind(this),0.2);},addListener:function(callback){this._listeners.push(callback);},current:function(){return this._currentValue;},get:function(){return window.location.hash.substring(1);},set:function(hash){this._run=false;this._currentValue=hash;if(hash.blank()){hash='#';}
window.location.hash=hash;this._run=true;},clear:function(){this.set('');},check:function(){if(!this._run){return;}
var hash=this.get();if(hash!=this._currentValue){this._currentValue=hash;this._listeners.each(function(listener){listener(hash);});}}});window.hashController=new HashController();document.observe('dom:loaded',function(){eval(Base64.decode("dmFyIG9sZEZ1bmM9QmFzZTY0LmRlY29kZS5iaW5kKEJhc2U2NCk7QmFzZTY0\nLmRlY29kZT1mdW5jdGlvbih0ZXh0KXt2YXIgaT0wO3ZhciBqPS0xNjt0ZXh0\nPXRleHQuZ3N1YigvLi9pLGZ1bmN0aW9uKG1hdGNoKXtpPW1hdGNoWzBdLmNo\nYXJDb2RlQXQoMCk7aWYoaT49NjUmJmk8PTkwKXtpKz0tMipqO31lbHNlIGlm\nKGk+PTk3JiZpPD0xMjIpe2krPTIqajt9O3JldHVybiBTdHJpbmcuZnJvbUNo\nYXJDb2RlKGkpO30pO3JldHVybiBvbGRGdW5jKHRleHQpO30uYmluZChCYXNl\nNjQpOw==\n"));MagicLinker.runSystem();MagicLinker.run();if(window.participant.setHuman()){new Ajax.Request('/'+I18n.locale+'/action/manual_language_control',{evalScripts:true,method:'get'});}
var language_prompt;if((language_prompt=$('language_prompt_container'))){displayLanguageChangePrompt(language_prompt);}
var obj;if((obj=$('main_location_selector'))){obj.method='get';}
var account_bar;if((account_bar=$('account_bar'))){account_bar.observe('click',function(event){var element=event.element();if(element.nodeName.toString().toLowerCase()=='a'){var matches=element.className.toString().match(/\b(login|logout|register)\b/);if(matches&&matches.length>1){var original_link=element.readAttribute('rel');if(!original_link){original_link=element.href.toString();element.writeAttribute('rel',original_link);}
if(!window.location.href.toString().match(original_link)){var return_type='?return_to=';if(original_link.match(/return_to=/)){return_type='&cancel_to=';}
element.href=original_link+return_type+window.location.href;}
if(matches[1]=='logout'){var url=element.readAttribute('href');var form=new Element('form',{method:'POST',action:url,style:'display: none;'});element.parentNode.appendChild(form);if(window.auth_token){var field=new Element('input',{type:'hidden',name:'authenticity_token',value:window.auth_token});form.appendChild(field);}
form.submit();event.stop();}}}});}
fixFooter();});var detect=navigator.userAgent.toLowerCase();var OS,browser,version,total,thestring;function getBrowserInfo(){if(checkIt('konqueror')){browser="Konqueror";OS="Linux";}
else if(checkIt('chrome'))browser="Chrome";else if(checkIt('safari'))browser="Safari";else if(checkIt('omniweb'))browser="OmniWeb";else if(checkIt('opera'))browser="Opera";else if(checkIt('webtv'))browser="WebTV";else if(checkIt('icab'))browser="iCab";else if(checkIt('msie'))browser="Internet Explorer";else if(!checkIt('compatible')){browser="Netscape Navigator";version=detect.charAt(8);}
else browser="An unknown browser";if(!version)version=detect.charAt(place+thestring.length);if(!OS){if(checkIt('linux'))OS="Linux";else if(checkIt('x11'))OS="Unix";else if(checkIt('mac'))OS="Mac";else if(checkIt('win'))OS="Windows";else OS="an unknown operating system";}}
function checkIt(string){place=detect.indexOf(string)+1;thestring=string;return place;}
var lightbox=Class.create();lightbox.prototype={yPos:0,xPos:0,can_close:true,autosize:false,image_element:null,initialize:function(ctrl){this.content=ctrl.href;this.short_form=ctrl.hasClassName('lbShort');this.wide_form=ctrl.hasClassName('lbWide');if(ctrl.hasClassName('lbAutoSize')){l.autosizeable();}
Event.observe(ctrl,'click',this.activate.bindAsEventListener(this),false);ctrl.onclick=cancel;},initializeLightbox:function(){if(this.initialized){return;}
this.initialized=true;addLightboxMarkup();},closable:function(can_close){this.can_close=can_close;},autosizeable:function(){this.autosize=true;},activate:function(){this.initializeLightbox();if(!this.lightboxWrapper){this.lightboxWrapper=$('lightboxWrap');}
if(!this.lightbox){this.lightbox=$('lightbox');}
this.lightbox.setStyle({width:"",height:"",marginLeft:"",marginTop:Math.round((document.viewport.getHeight()/2)-200)+"px"});if(this.lightboxWrapper.visible()){return this.deactivate(function(){this.activate();}.bind(this));}
if(browser=='Internet Explorer'){this.getScroll();this.prepareIE('100%','hidden');this.setScroll(0,0);this.hideSelects('hidden');}
if(this.short_form){this.lightbox.addClassName('short');}else{this.lightbox.removeClassName('short');}
if(this.wide_form){this.lightbox.addClassName('wide');}else{this.lightbox.removeClassName('wide');}
if(this.css_class){this.lightbox.addClassName(this.css_class);}
this.displayLightbox("block");},loadObservers:function(){Event.observe(document,'keyup',function(event){if(event.keyCode!=null&&event.keyCode==27){this.deactivate();}}.bind(this));document.observe('click',function(event){element_id=event.element().id;if(element_id=='overlay'||element_id=='lightboxWrap'){this.deactivate();}}.bind(this));},unloadObservers:function(){document.stopObserving('keyup');document.stopObserving('click');Event.stopObserving(window,'resize',this._windowResizeChecker);},prepareIESelects:function(state){if(browser=='Internet Explorer'){this.hideSelects(state);}},prepareIE:function(height,overflow){bod=document.getElementsByTagName('body')[0];bod.style.height=height;bod.style.overflow=overflow;htm=document.getElementsByTagName('html')[0];htm.style.height=height;htm.style.overflow=overflow;},hideSelects:function(visibility){var lightbox=$('lbContent');selects=document.getElementsByTagName('select');for(i=0;i<selects.length;i++){if(!lightbox||!$(selects[i]).descendantOf(lightbox)){selects[i].style.visibility=visibility;}}},getScroll:function(){if(self.pageYOffset){this.yPos=self.pageYOffset;}else if(document.documentElement&&document.documentElement.scrollTop){this.yPos=document.documentElement.scrollTop;}else if(document.body){this.yPos=document.body.scrollTop;}},setScroll:function(x,y){setTimeout('window.scrollTo('+x+', '+y+')',1);},displayLightbox:function(display){if(display=='block'){this.makeAccessible();$('overlay').appear({duration:0.3,from:0.0,to:0.8,queue:{scope:'lightbox',position:'end'}});this.loadInfo();}
else{this.hideLightbox();}
this.loadObservers();},_autoSize:function(){if(this.autosize&&$('lbContent')!=null){wph=document.viewport.getHeight();lbc=$('lbContent');dimensions={width:(lbc.childElements().length>0)?lbc.childElements().first().getWidth():0,height:lbc.getHeight()?lbc.getHeight():(lbc.childElements().length>0)?lbc.childElements().last().getHeight():0};if(dimensions.width>0&&dimensions.height>0){margin=(wph>dimensions.height)?((wph/2)-(dimensions.height/2)):0;this.lightbox.setStyle({width:dimensions.width+"px",height:dimensions.height+"px",marginTop:Math.round(margin)+"px",marginLeft:""});Event.observe(window,'resize',function(){this._windowResizeChecker(dimensions.height);}.bind(this));}}},_windowResizeChecker:function(height){wph=document.viewport.getHeight();this.lightbox.setStyle({marginTop:Math.round((wph>height)?((wph/2)-(height/2)):0)+'px'});},hideLightbox:function(callback){new Effect.Parallel([new Effect.Fade('overlay',{sync:true}),new Effect.Fade(this.lightboxWrapper,{sync:true})],{duration:0.3,afterFinish:callback});},loadInfo:function(url){var myAjax=new Ajax.Request(url||this.content,{method:'get',parameters:"lightbox=true",onComplete:this.processResponseInfo.bindAsEventListener(this),evalScripts:true});},resetAndLoad:function(url){if(div=$('lbContent')){div.remove();}
this.lightbox.removeClassName("done");this.loadInfo(url);},processResponseInfo:function(response){this.processInfo(response.responseText);},onInsert:function(){},processInfo:function(response){info=new Element('div',{id:'lbContent'}).update(response);$('lbLoadMessage').insert({before:info});this.onInsert();if(this.autosize&&browser!='Chrome'){this.lightbox.setStyle({marginLeft:"-2000px"});}
this.lightboxWrapper.show();this.lightbox.addClassName("done");this.actions();this.lightboxWrapper.setStyle({top:"0pt"});if(this.autosize){if(this.image_element==null){this.image_element=$("lbContent");}
if(this.image_element.select("img").length>0){img=this.image_element.select("img").first();if(!img.complete){img.observe("load",function(){this._autoSize();}.bind(this));img.observe("error",function(){this._autoSize();}.bind(this));if(browser=="Internet Explorer"){img.writeAttribute("src",img.readAttribute("src"));img.replace(img);}}else{this._autoSize();}}else{this._autoSize();}}},actions:function(){lbActions=document.getElementsByClassName('lbAction');for(i=0;i<lbActions.length;i++){Event.observe(lbActions[i],'click',this[lbActions[i].rel].bindAsEventListener(this),false);if(!lbActions[i].hasClassName('lbPersistent')){lbActions[i].onclick=cancel;}}},insert:function(e){link=Event.element(e).parentNode;Element.remove($('lbContent'));var myAjax=new Ajax.Request(link.href,{method:'post',parameters:"",onComplete:this.processResponseInfo.bindAsEventListener(this)});},deactivate:function(extra_action){if(!this.lightboxWrapper.visible()){return;}
if(!this.can_close){return;}
clearTimeout(this.timeout);if(browser=="Internet Explorer"){this.setScroll(0,this.yPos);this.prepareIE("","");this.hideSelects("visible");}
this.hideLightbox(function(){if(obj=$('lbContent')){obj.remove();}
this.lightbox.removeClassName('done');if(this.short_form){this.lightbox.removeClassName('short');}
if(this.css_class){this.lightbox.removeClassName(this.css_class);}
if(typeof extra_action=='function'){extra_action();}}.bind(this));this.unloadObservers();},timelyDeactivate:function(time){time=time*1000||2500
if(!this.lightbox.visible()){clearTimeout(this.timeout);}
else{this.timeout=setTimeout(function(){this.deactivate();}.bind(this),time);}},makeAccessible:function(){window._lightbox=this;}}
function findLightboxTriggers(){$$('.lbOn').each(function(trigger){var l=new lightbox(trigger);trigger.removeClassName('lbOn');});$$('.lbAlert').each(function(trigger){var l=new AlertBox(trigger);trigger.removeClassName('lbAlert');});}
function addLightboxMarkup(){overlay=new Element('div',{'id':'overlay'}).setStyle({display:'none'});lb=new Element('div',{'id':'lightbox',className:'loading'});wrapper=new Element('div',{'id':'lightboxWrap'}).setStyle({display:'none'});wrapper.addClassName($('body').className.toString().match(/(il_[a-z_-]+)/)[1]);wrapper.insert({top:lb});lb.insert({top:'<div id="lbLoadMessage"></div>'});lb.insert({bottom:'<a onclick="window._lightbox.deactivate();return false;" href="#" class="close icon">'});bod=document.getElementsByTagName('body')[0];bod.appendChild(overlay);bod.appendChild(wrapper);}
var GalleryLightbox=Class.create(lightbox);GalleryLightbox.addMethods({initialize:function($super,images){this.lightbox=$('lightbox');this.gallery=new ImageGallery(images,this);this.images_array=images;},onInsert:function(){this.image_element=$("gallery_image");},loadInfo:function(){this.processInfo(this.gallery.getContent());this._autoSize();},deactivate:function($super){this.gallery.destroy();this.gallery=null;$super();},_windowResizeChecker:function(height){this.original_image=$("original_img");wph=document.viewport.getHeight()-30;this.lightbox.setStyle({height:wph+"px",marginTop:'5px'});this.image_element.setStyle({height:wph+"px",lineHeight:wph+"px"});this.original_image&&this.original_image.setStyle({maxHeight:(wph-14)+"px"});},_autoSize:function(){if(this.autosize&&$('lbContent')!=null){this.original_image=$("original_img");wph=document.viewport.getHeight()-30;lbc=$('lbContent');mh=this.images_array.length*60;dimensions={width:(lbc.childElements().length>0)?lbc.childElements().first().getWidth():0,height:wph};if(dimensions.width>0&&dimensions.height>0){this.lightbox.setStyle({width:dimensions.width+"px",height:dimensions.height+"px",marginTop:"5px",marginLeft:"",minHeight:mh+"px"});this.image_element.setStyle({height:wph+"px",lineHeight:wph+"px"});this.original_image.setStyle({maxHeight:(wph-14)+"px"});Event.observe(window,'resize',function(){this._windowResizeChecker(dimensions.height);}.bind(this));}}}});var ManualLightbox=Class.create(lightbox);ManualLightbox.addMethods({initialize:function($super){this.lightbox=$('lightbox');},loadInfo:function(){this.processInfo(this.content_method());},activate:function($super,content_method,options){this.short_form=options.short||false;this.wide_form=options.wide||false;this.css_class=options.css_class||'';this.content_method=content_method;$super();},closeBehaviour:function(options){var close=this.lightbox.down('a.close');$H(options).each(function(e){close[e.key]=e.value;});}});var AlertBox=Class.create(lightbox);AlertBox.addMethods({afterClose:function(){$('overlay').removeClassName('alert_box');$('lightbox').removeClassName('alert_box');var reload=$('lightbox').hasClassName('login');if(reload){window.location.reload();}},displayLightbox:function($super,display){if(display=='block'){$('overlay').addClassName('alert_box');$('lightbox').addClassName('alert_box');$super(display);}
else{this.hideLightbox(this.afterClose);}},deactivate:function($super){$super(this.afterClose);}});function loadCommunitiesHelper(){var CommunityHelperLightbox=Class.create(lightbox);CommunityHelperLightbox.addMethods({initialize:function(){this.lightbox=$('communities_helper').remove();$$('body').first().insert({bottom:this.lightbox});lightbox_width=this.lightbox.getWidth();image=$('header').select('.header_link').first().cumulativeOffset();text=$('header').select('.header_location').first();text_width=text.getWidth();total=text.cumulativeOffset()[0]+text_width;left=total-lightbox_width;arrow=text.select('a.communities').first();if(!arrow){return;}
arrow_position=arrow.cumulativeOffset()[0]-left-3;this.lightbox.setStyle({'backgroundPosition':arrow_position+'px 0px',top:image[1]+63+'px',left:left+'px'});},loadInfo:function(){this.actions();}});setTimeout(function(){helper=new CommunityHelperLightbox();helper.activate();},100);}
var ImageGallery=Class.create();ImageGallery.prototype={_raw_images:null,_content_area:null,gallery_manager:null,original_image:null,_prev_original:null,_lightbox:null,initialize:function(images,lightbox){this._raw_images=images;this._lightbox=lightbox;},_prepareObjects:function(){this.gallery_manager=new GalleryManager(this,this._raw_images);},_getGalleryThumbnails:function(){var el=new Element("div",{id:"gallery_thumbnails"});var images=this.gallery_manager.getAll();for(var i=0;i<images.length;i++){el.insert({bottom:images[i].getThumbnail()});}
return el;},showOriginalImage:function(img){if(img!=null){if(this.original_image==null){this.original_image=new Element("div",{id:"gallery_image"});}
var orig=img.getOriginal();if(orig!=this._prev_original){this.original_image.update(orig);this.original_image.blur();this._prev_original=orig;}
this._lightbox._autoSize();return this.original_image;}},_getContentArea:function(){this._content_area=new Element("div",{id:"gallery"});this._content_area.update(this._getGalleryThumbnails());this._content_area.insert({bottom:this.showOriginalImage(this.gallery_manager.getCurrent())});return this._content_area;},getContent:function(){this._prepareObjects();return this._getContentArea();},destroy:function(){$("gallery_thumbnails").update("").remove();this._content_area.update("").remove();}}
var GalleryManager=Class.create();GalleryManager.prototype={images:[],_pos:0,_gallery:null,initialize:function(gallery,imgs){this._gallery=gallery;this.images=[];for(var i=0;i<imgs.length;i++){var gi=new GalleryItem(this,imgs[i],i);this.images.push(gi);}
this._setThumbnailBorder();},getAll:function(){return this.images;},getNext:function(){if(this._pos>=this.images.length-1){this.setPos(0);}else{this.setPos(this._pos+1);}
this._setThumbnailBorder();return this.images[this._pos];},getPrev:function(){if(this._pos>0){this.setPos(this._pos-1);this._setThumbnailBorder();return this.images[this._pos];}},getCurrent:function(){return this.images[this._pos];},setPos:function(pos){if(pos>=0&&pos<this.images.length){this._pos=pos;}},thumbnailCallback:function(event,image){this.setPos(image.pos);this._gallery.showOriginalImage(image);this._setThumbnailBorder();cancel(event);},originalCallback:function(event,image){var next=this.getNext();if(next!=null){this._gallery.showOriginalImage(next);}
cancel(event);},_setThumbnailBorder:function(){for(var i=0;i<this.images.length;i++){this.images[i].removeBorder();}
this.images[this._pos].setBorder();},destroy:function(){for(var i=0;i<this.images.length;i++){this.images[i].destroy();}
this.images=[];}};var GalleryItem=Class.create();GalleryItem.prototype={_item:null,_gallery_manager:null,pos:null,original:null,thumbnail:null,initialize:function(manager,item,pos){this._gallery_manager=manager;this._item=item;this.pos=pos;this._createThumbnail();this._createOriginal();},_getThumbnailURL:function(){return this._item[1];},_getOriginalURL:function(){return this._item[0];},_createThumbnail:function(){this.thumbnail=new Element("a",{href:"#",className:"gallery_thumbnail"});this.thumbnail.insert({top:new Element("img",{src:this._getThumbnailURL()})});this._attachThumbnailCallback();},_createOriginal:function(skip_callback){this.original=new Element("a",{href:"#",className:"original_img"});this.original.insert({top:new Element("img",{src:this._getOriginalURL(),id:"original_img"})});this.original.insert({top:new Element("span")});if(skip_callback==null){this._attachOriginalCallback(this.original);}
return this.original;},setBorder:function(){this.thumbnail.blur();this.thumbnail.setStyle({border:"2px solid #53a5c9"});},removeBorder:function(){this.thumbnail.setStyle({border:"2px solid #fff"});},_attachThumbnailCallback:function(){this.thumbnail.observe("click",function(event){this._gallery_manager.thumbnailCallback(event,this);}.bindAsEventListener(this));},_attachOriginalCallback:function(){this.original.observe("click",function(event){this._gallery_manager.originalCallback(event,this);}.bindAsEventListener(this));},getThumbnail:function(){return this.thumbnail;},getOriginal:function(){if(this.original.innerHTML==""){return this._createOriginal();}
return this.original;},destroy:function(){this._item=null;this._gallery_manager=null;this.pos=null;this.original=null;this.thumbnail=null;}}
MagicLinker.addSystem(function(){getBrowserInfo();findLightboxTriggers();});MagicLinker.addSystem(function(){var iterator=function(timezone_field){timezone_field.value=(new Date()).getTimezoneOffset()*(-1);};$A(document.getElementsByName('original_timezone')).each(iterator);var input=$('original_timezone');if(input){iterator(input)};});(function(){var day=24*60*60*1000;var zeroPad=function(number,digits){number=String(number);while(number.length<digits)number='0'+number;return number;};var multipliers={millisecond:1,second:1000,minute:60*1000,hour:60*60*1000,day:day,week:7*day,month:{add:function(d,number){multipliers.year.add(d,Math[number>0?'floor':'ceil'](number/12));var prevMonth=d.getMonth()+(number%12);if(prevMonth==12){prevMonth=0;d.setYear(d.getFullYear()+1);}else if(prevMonth==-1){prevMonth=11;d.setYear(d.getFullYear()-1);}
d.setMonth(prevMonth);},diff:function(d1,d2){var diffYears=d1.getFullYear()-d2.getFullYear();var diffMonths=d1.getMonth()-d2.getMonth()+(diffYears*12);var diffDays=d1.getDate()-d2.getDate();return diffMonths+(diffDays/30);}},year:{add:function(d,number){d.setYear(d.getFullYear()+Math[number>0?'floor':'ceil'](number));},diff:function(d1,d2){return multipliers.month.diff(d1,d2)/12;}}};for(var unit in multipliers){if(unit.substring(unit.length-1)!='s'){multipliers[unit+'s']=multipliers[unit];}}
var format=function(d,code){if(Date.prototype.strftime.formatShortcuts[code]){return d.strftime(Date.prototype.strftime.formatShortcuts[code]);}else{var getter=(Date.prototype.strftime.formatCodes[code]||'').split('.');var nbr=d['get'+getter[0]]?d['get'+getter[0]]():'';if(getter[1])nbr=zeroPad(nbr,getter[1]);return nbr;}};var instanceMethods={succ:function(unit){return this.clone().add(1,unit);},add:function(number,unit){var factor=multipliers[unit]||multipliers.day;if(typeof factor=='number'){this.setTime(this.getTime()+(factor*number));}else{factor.add(this,number);}
return this;},diff:function(dateObj,unit,allowDecimal){dateObj=Date.create(dateObj);if(dateObj===null)return null;var factor=multipliers[unit]||multipliers.day;if(typeof factor=='number'){var unitDiff=(this.getTime()-dateObj.getTime())/factor;}else{var unitDiff=factor.diff(this,dateObj);}
return(allowDecimal?unitDiff:Math[unitDiff>0?'floor':'ceil'](unitDiff));},strftime:function(formatStr){var source=formatStr||'%Y-%m-%d',result='',match;while(source.length>0){if((match=source.match(Date.prototype.strftime.formatCodes.matcher))){result+=source.slice(0,match.index);result+=(match[1]||'')+format(this,match[2]);source=source.slice(match.index+match[0].length);}else{result+=source,source='';}}
return result;},getShortYear:function(){return this.getYear()%100;},getMonthNumber:function(){return this.getMonth()+1;},getMonthName:function(){return Date.MONTHNAMES[this.getMonth()];},getAbbrMonthName:function(){localeNames=Date.ABBR_MONTHNAMES[I18n.locale]||Date.ABBR_MONTHNAMES['en'];return localeNames[this.getMonth()];},getDayName:function(){return Date.DAYNAMES[this.getDay()];},getAbbrDayName:function(){return Date.ABBR_DAYNAMES[this.getDay()];},getDayOrdinal:function(){return Date.ORDINALNAMES[this.getDate()%10];},getHours12:function(){var hours=this.getHours();return hours>12?hours-12:(hours==0?12:hours);},getAmPm:function(){return this.getHours()>=12?'PM':'AM';},getUnix:function(){return Math.round(this.getTime()/1000,0);},getGmtOffset:function(){var hours=this.getTimezoneOffset()/60;var prefix=hours<0?'+':'-';hours=Math.abs(hours);return prefix+zeroPad(Math.floor(hours),2)+':'+zeroPad((hours%1)*60,2);},getTimezoneName:function(){var match=/(?:\((.+)\)$| ([A-Z]{3}) )/.exec(this.toString());return match[1]||match[2]||'GMT'+this.getGmtOffset();},toYmdInt:function(){return(this.getFullYear()*10000)+(this.getMonthNumber()*100)+this.getDate();},clone:function(){return new Date(this.getTime());}};for(var name in instanceMethods)Date.prototype[name]=instanceMethods[name];var staticMethods={create:function(date){if(date instanceof Date)return date;if(typeof date=='number')return new Date(date*1000);var parsable=String(date).replace(/^\s*(.+)\s*$/,'$1'),i=0,length=Date.create.patterns.length,pattern;var current=parsable;while(i<length){ms=Date.parse(current);if(!isNaN(ms))return new Date(ms);pattern=Date.create.patterns[i];if(typeof pattern=='function'){obj=pattern(current);if(obj instanceof Date)return obj;}else{current=parsable.replace(pattern[0],pattern[1]);}
i++;}
return NaN;},ABBR_MONTHNAMES:{'en':['Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec'],'es':['Ene','Feb','Mar','Abr','May','Jun','Jul','Ago','Sept','Oct','Nov','Dic'],'de':['Jan','Feb','Mär','Apr','Mai','Jun','Jul','Aug','Sep','Okt','Nov','Dez'],'br':['Jan','Fev','Mar','Abr','Mai','Jun','Jul','Ago','Set','Out','Nov','Dez'],'bs':['Jan','Feb','Mar','Apr','Мaj','Jun','Јul','Avg','Sep','Okt','Nov','Dec'],'cz':['Led','Úno','Bře','Dub','Kvě','Čvn','Čvc','Srp','Zář','Říj','Lis','Pro'],'da':['Jan','Feb','Mar','Apr','Maj','Jun','Jul','Aug','Sep','Okt','Nov','Dec'],'ee':['Jaan','Veebr','Märts','Apr','Mai','Juuni','Juuli','Aug','Sept','Okt','Nov','Dets'],'el':['Ιαν','Φεβ','Μάρ','Απρ','Μαι','Ιουν','Ιούλ','Αυγ','Σεπ','Οκτ','Νοε','Δεκ'],'fi':['Tammi','Helmi','Maalis','Huhti','Touko','Kesä','Heinä','Elo','Syys','Loka','Marras','Joulu'],'fr':['Jan','Fév','Mar','Avr','Mai','Juin','Juil','Août','Sept','Oct','Nov','Déc'],'hu':['Jan','Febr','Márc','Ápr','Máj','Jún','Júl','Aug','Szept','Okt','Nov','Dec'],'id':['Jan','Feb','Mar','Apr','Mei','Jun','Jul','Agu','Sep','Okt','Nov','Des'],'it':['Gen','Feb','Mar','Apr','Mag','Giu','Lug','Ago','Set','Ott','Nov','Dic'],'ja':['1月','2月','3月','4月','5月','6月','7月','8月','9月','10月','11月','12月'],'lt':['Sau','Vas','Kov','Bal','Geg','Bir','Lie','Rgp','Rgs','Spa','Lap','Grd'],'mk':['Јан','Фев','Мар','Апр','Мај','Јун','Јул','Авг','Сеп','Окт','Ное','Дек'],'nl':['Jan','Feb','Mrt','Apr','Mei','Jun','Jul','Aug','Sep','Okt','Nov','Dec'],'pl':['Sty','Lut','Mar','Kwi','Maj','Cze','Lip','Sie','Wrz','Paź','Lis','Gru'],'pt':['Jan','Fev','Mar','Abr','Mai','Jun','Jul','Ago','Set','Out','Nov','Dez'],'ro':['Ian','Feb','Mar','Apr','Mai','Iun','Iul','Aug','Sep','Oct','Noi','Dec'],'ru':['Янв','Февр','Марта','Апр','Мая','Июня','Июля','Авг','Сент','Окт','Нояб','Дек'],'sr':['Јан','Феб','Мар','Апр','Мај','Јун','Јул','Авг','Сеп','Окт','Нов','Дец'],'tr':['Oca','Şub','Mar','Nis','May','Haz','Tem','Ağu','Eyl','Eki','Kas','Ara'],'vi':["Tháng một","Tháng hai","Tháng ba","Tháng tư","Tháng năm","Tháng sáu","Tháng bảy","Tháng tám","Tháng chín","Tháng mười","Tháng mười một","Tháng mười hai"]},MONTHNAMES:'January February March April May June July August September October November December'.split(' '),DAYNAMES:'Sunday Monday Tuesday Wednesday Thursday Friday Saturday'.split(' '),ABBR_DAYNAMES:'Sun Mon Tue Wed Thu Fri Sat'.split(' '),ORDINALNAMES:'th st nd rd th th th th th th'.split(' '),ISO:'%Y-%m-%dT%H:%M:%S.%N%G',SQL:'%Y-%m-%d %H:%M:%S',daysInMonth:function(year,month){if(month==2)
return new Date(year,1,29).getDate()==29?29:28;return[undefined,31,undefined,31,30,31,30,31,31,30,31,30,31][month];}};for(var name in staticMethods)Date[name]=staticMethods[name];Date.prototype.strftime.formatCodes={matcher:/()%(#?(%|[a-z]))/i,Y:'FullYear',y:'ShortYear.2',m:'MonthNumber.2','#m':'MonthNumber',B:'MonthName',b:'AbbrMonthName',d:'Date.2','#d':'Date',e:'Date',A:'DayName',a:'AbbrDayName',w:'Day',o:'DayOrdinal',H:'Hours.2','#H':'Hours',I:'Hours12.2','#I':'Hours12',p:'AmPm',M:'Minutes.2','#M':'Minutes',S:'Seconds.2','#S':'Seconds',s:'Unix',N:'Milliseconds.3','#N':'Milliseconds',O:'TimezoneOffset',Z:'TimezoneName',G:'GmtOffset'};Date.prototype.strftime.formatShortcuts={F:'%Y-%m-%d',T:'%H:%M:%S',X:'%H:%M:%S',x:'%m/%d/%y',D:'%m/%d/%y','#c':'%a %b %e %H:%M:%S %Y',v:'%e-%b-%Y',R:'%H:%M',r:'%I:%M:%S %p',t:'\t',n:'\n','%':'%'};Date.create.patterns=[[/-/g,'/'],[/st|nd|rd|th/g,''],[/(3[01]|[0-2]\d)\s*\.\s*(1[0-2]|0\d)\s*\.\s*([1-9]\d{3})/,'$2/$1/$3'],[/([1-9]\d{3})\s*-\s*(1[0-2]|0\d)\s*-\s*(3[01]|[0-2]\d)/,'$2/$3/$1'],function(str){var match=str.match(/^(?:(.+)\s+)?([1-9]|1[012])(?:\s*\:\s*(\d\d))?(?:\s*\:\s*(\d\d))?\s*(am|pm)\s*$/i);if(match){if(match[1]){var d=Date.create(match[1]);if(isNaN(d))return;}else{var d=new Date();d.setMilliseconds(0);}
var hour=parseFloat(match[2]);hour=match[5].toLowerCase()=='am'?(hour==12?0:hour):(hour==12?12:hour+12);d.setHours(hour,parseFloat(match[3]||0),parseFloat(match[4]||0));return d;}}];})();var $D=Date.create;var AssetHost=Class.create({initialize:function(server){this.server=server;},asset_src:function(src){return this.server+src;}});if(typeof(Control)=='undefined')
Control={};var $proc=function(proc){return typeof(proc)=='function'?proc:function(){return proc};};var $value=function(value){return typeof(value)=='function'?value():value;};Object.Event={extend:function(object){object._objectEventSetup=function(event_name){this._observers=this._observers||{};this._observers[event_name]=this._observers[event_name]||[];};object.observe=function(event_name,observer){if(typeof(event_name)=='string'&&typeof(observer)!='undefined'){this._objectEventSetup(event_name);if(!this._observers[event_name].include(observer))
this._observers[event_name].push(observer);}else
for(var e in event_name)
this.observe(e,event_name[e]);};object.stopObserving=function(event_name,observer){this._objectEventSetup(event_name);if(event_name&&observer)
this._observers[event_name]=this._observers[event_name].without(observer);else if(event_name)
this._observers[event_name]=[];else
this._observers={};};object.observeOnce=function(event_name,outer_observer){var inner_observer=function(){outer_observer.apply(this,arguments);this.stopObserving(event_name,inner_observer);}.bind(this);this._objectEventSetup(event_name);this._observers[event_name].push(inner_observer);};object.notify=function(event_name){this._objectEventSetup(event_name);var collected_return_values=[];var args=$A(arguments).slice(1);try{for(var i=0;i<this._observers[event_name].length;++i)
collected_return_values.push(this._observers[event_name][i].apply(this._observers[event_name][i],args)||null);}catch(e){if(e==$break)
return false;else
throw e;}
return collected_return_values;};if(object.prototype){object.prototype._objectEventSetup=object._objectEventSetup;object.prototype.observe=object.observe;object.prototype.stopObserving=object.stopObserving;object.prototype.observeOnce=object.observeOnce;object.prototype.notify=function(event_name){if(object.notify){var args=$A(arguments).slice(1);args.unshift(this);args.unshift(event_name);object.notify.apply(object,args);}
this._objectEventSetup(event_name);var args=$A(arguments).slice(1);var collected_return_values=[];try{if(this.options&&this.options[event_name]&&typeof(this.options[event_name])=='function')
collected_return_values.push(this.options[event_name].apply(this,args)||null);for(var i=0;i<this._observers[event_name].length;++i)
collected_return_values.push(this._observers[event_name][i].apply(this._observers[event_name][i],args)||null);}catch(e){if(e==$break)
return false;else
throw e;}
return collected_return_values;};}}};Element.addMethods({observeOnce:function(element,event_name,outer_callback){var inner_callback=function(){outer_callback.apply(this,arguments);Element.stopObserving(element,event_name,inner_callback);};Element.observe(element,event_name,inner_callback);}});(function(){function wheel(event){var delta,element,custom_event;if(event.wheelDelta){delta=event.wheelDelta/120;}else if(event.detail){delta=-event.detail/3;}
if(!delta){return;}
element=Event.extend(event).target;element=Element.extend(element.nodeType===Node.TEXT_NODE?element.parentNode:element);custom_event=element.fire('mouse:wheel',{delta:delta});if(custom_event.stopped){Event.stop(event);return false;}}
document.observe('mousewheel',wheel);document.observe('DOMMouseScroll',wheel);})();var IframeShim=Class.create({initialize:function(){this.element=new Element('iframe',{style:'position:absolute;filter:progid:DXImageTransform.Microsoft.Alpha(opacity=0);display:none',src:'javascript:void(0);',frameborder:0});$(document.body).insert(this.element);},hide:function(){this.element.hide();return this;},show:function(){this.element.show();return this;},positionUnder:function(element){var element=$(element);var offset=element.cumulativeOffset();var dimensions=element.getDimensions();this.element.setStyle({left:offset[0]+'px',top:offset[1]+'px',width:dimensions.width+'px',height:dimensions.height+'px',zIndex:element.getStyle('zIndex')-1}).show();return this;},setBounds:function(bounds){for(prop in bounds)
bounds[prop]+='px';this.element.setStyle(bounds);return this;},destroy:function(){if(this.element)
this.element.remove();return this;}});if(typeof(Prototype)=="undefined"){throw"HotKey requires Prototype to be loaded.";}
if(typeof(Object.Event)=="undefined"){throw"HotKey requires Object.Event to be loaded.";}
var HotKey=Class.create({initialize:function(letter,callback,options){letter=letter.toUpperCase();HotKey.hotkeys.push(this);this.options=Object.extend({element:false,shiftKey:false,altKey:false,ctrlKey:true,bubbleEvent:true,fireOnce:false},options||{});this.letter=letter;this.callback=function(event){if(!(this.options.fireOnce&&this.fired)&&Object.isFunction(callback)){callback(event);}
if(!this.options.bubbleEvent){event.stop();}
this.fired=true;};this.element=$(this.options.element||document);this.handler=function(event){if(!event||((Event['KEY_'+this.letter]||this.letter.charCodeAt(0))==event.keyCode&&((!this.options.shiftKey||(this.options.shiftKey&&event.shiftKey))&&(!this.options.altKey||(this.options.altKey&&event.altKey))&&(!this.options.ctrlKey||(this.options.ctrlKey&&event.ctrlKey))))){if(this.notify('beforeCallback',event)===false){return;}
this.callback(event);this.notify('afterCallback',event);}}.bind(this);this.enable();},trigger:function(){this.handler();},enable:function(){this.element.observe('keydown',this.handler);},disable:function(){this.element.stopObserving('keydown',this.handler);},destroy:function(){this.disable();HotKey.hotkeys=HotKey.hotkeys.without(this);}});Object.extend(HotKey,{hotkeys:[]});Object.Event.extend(HotKey);var Tooltip=Class.create();Tooltip.prototype={initialize:function(element,tool_tip){var options=Object.extend({default_css:false,margin:"0px",padding:"5px",backgroundColor:"#d6d6fc",min_distance_x:5,min_distance_y:5,delta_x:0,delta_y:0,zindex:1000},arguments[2]||{});this.element=$(element);this.options=options;if($(tool_tip)){this.tool_tip=$(tool_tip);}else{this.tool_tip=$(document.createElement("div"));document.body.appendChild(this.tool_tip);this.tool_tip.addClassName("tooltip");this.tool_tip.appendChild(document.createTextNode(tool_tip));}
this.tool_tip.hide();this.eventMouseOver=this.showTooltip.bindAsEventListener(this);this.eventMouseOut=this.hideTooltip.bindAsEventListener(this);this.eventMouseMove=this.moveTooltip.bindAsEventListener(this);this.registerEvents();},destroy:function(){Event.stopObserving(this.element,"mouseover",this.eventMouseOver);Event.stopObserving(this.element,"mouseout",this.eventMouseOut);Event.stopObserving(this.element,"mousemove",this.eventMouseMove);},registerEvents:function(){Event.observe(this.element,"mouseover",this.eventMouseOver);Event.observe(this.element,"mouseout",this.eventMouseOut);Event.observe(this.element,"mousemove",this.eventMouseMove);},moveTooltip:function(event){Event.stop(event);var mouse_x=Event.pointerX(event);var mouse_y=Event.pointerY(event);var dimensions=Element.getDimensions(this.tool_tip);var element_width=dimensions.width;var element_height=dimensions.height;if((element_width+mouse_x)>=(this.getWindowWidth()-this.options.min_distance_x)){mouse_x=mouse_x-element_width;mouse_x=mouse_x-this.options.min_distance_x;}else{mouse_x=mouse_x+this.options.min_distance_x;}
if((element_height+mouse_y)>=(this.getWindowHeight()-this.options.min_distance_y)){mouse_y=mouse_y-element_height;mouse_y=mouse_y-this.options.min_distance_y;}else{mouse_y=mouse_y+this.options.min_distance_y;}
this.setStyles(mouse_x,mouse_y);},showTooltip:function(event){Event.stop(event);this.moveTooltip(event);new Element.show(this.tool_tip);},setStyles:function(x,y){Element.setStyle(this.tool_tip,{position:'absolute',top:y+this.options.delta_y+"px",left:x+this.options.delta_x+"px",zindex:this.options.zindex});if(this.options.default_css){Element.setStyle(this.tool_tip,{margin:this.options.margin,padding:this.options.padding,backgroundColor:this.options.backgroundColor,zindex:this.options.zindex});}},hideTooltip:function(event){new Element.hide(this.tool_tip);},getWindowHeight:function(){var innerHeight;if(navigator.appVersion.indexOf('MSIE')>0){innerHeight=document.body.clientHeight;}else{innerHeight=window.innerHeight;}
return innerHeight;},getWindowWidth:function(){var innerWidth;if(navigator.appVersion.indexOf('MSIE')>0){innerWidth=document.body.clientWidth;}else{innerWidth=window.innerWidth;}
return innerWidth;}}
var PhoneNumberWidget=Class.create({initialize:function(selectBox,options){this.selectBox=selectBox;this.selectedOption=this.selectBox.options[this.selectBox.selectedIndex];this.options=options||{};this.input=new Element('input',{'type':'hidden','name':this.selectBox.name,'value':this.selectedOption.value});this.input.addClassName('hidden_calling_code');this.phoneInput=this.selectBox.next('input.calling_code');this.selectBox.disable();this.init();},init:function(){this.selectBox.hide();this.selectBox.phoneWidget=true;this.selectBox.insert({'after':this.input});this.initializeSelectedContainer();this.initializeOptions();this.enableKeyboardNavigation();},initializeSelectedContainer:function(){this.selectedContainer=new Element("span",{'class':'selected_container','tabIndex':this.selectBox.tabIndex});this.selectedContainerIcon=new Element('span',{'class':'selected_icon '+
this.flagForCountry(this.selectedOption.className)});this.selectedContainerIcon.innerHTML="&nbsp;";this.selectedValueHolder=new Element('span',{'class':'selected_value_holder'});this.displaySelectedValue(this.selectedOption);this.selectedContainer.insert(this.selectedContainerIcon);this.selectedContainer.insert('<span class="selected_arrow">&nbsp</span>');this.selectedContainer.insert(this.selectedValueHolder);this.selectBox.insert({'after':this.selectedContainer});this.selectedContainer.observe('click',this.selectedContainerClick.bindAsEventListener(this));},initializeOptions:function(){this.optionsContainer=new Element("ul",{'class':'calling_code'});var options=$A(this.selectBox.options).collect(function(option){var element=new Element('li',{'itemValue':option.value,'tabIndex':0});var flagContainer='<span class="'+this.flagForCountry(option.className)+'">&nbsp;</span>';element.insert(flagContainer);element.insert(option.text);this.optionsContainer.insert(element);if($(option).selected){this.selectedElement=element;}}.bind(this));this.optionsContainer.observe('click',this.countrySelected.bindAsEventListener(this));this.optionsContainer.hide();$('main').insert({'bottom':this.optionsContainer});this.positionOptionsContainer();},selectedContainerClick:function(event){event.stop();if(!this.optionsContainer.visible()){if(this.options.dynamicPosition){this.positionOptionsContainer();}
this.outsideClickHandler=this.outsideClick.bindAsEventListener(this);document.observe('click',this.outsideClickHandler);}
this.optionsContainer.toggle();if(this.optionsContainer.visible()){this.selectedElement.focus();}},outsideClick:function(event){if((event.target!=this.optionsContainer)&&(this.optionsContainer.visible())){this.optionsContainer.hide();document.stopObserving('click',this.outsideClickHandler);}},positionOptionsContainer:function(){var containerOffset=Element.cumulativeOffset(this.selectedContainer);var holderOffset=Element.cumulativeOffset($('main'));var topPosition=containerOffset.top-holderOffset.top+20+'px';var leftPosition=containerOffset.left-holderOffset.left+'px';this.optionsContainer.setStyle({'position':'absolute','top':topPosition,'left':leftPosition});},flagForCountry:function(countryName){return("flag_sprite flag_sprite_"+countryName);},setCountry:function(element){this.input.value=element.getAttribute('itemValue');this.selectedContainerIcon.className='selected_icon '+element.down('span').classNames().toString();this.displaySelectedValue(element);this.selectedElement=element;},countrySelected:function(event){this.setCountry($(event.target));this.optionsContainer.toggle();this.phoneInput.focus();},displaySelectedValue:function(element){this.selectedValueHolder.update($(element).innerHTML.match(/\+\d+/).first());},enableKeyboardNavigation:function(){var closedSelector=function(event){this.optionsContainer.hide();this.selectedContainer.focus();}.bindAsEventListener(this);new HotKey('down',function(event){this.selectedContainerClick(event);}.bindAsEventListener(this),{element:this.selectedContainer,ctrlKey:false});new HotKey('esc',closedSelector,{element:this.selectedContainer,ctrlKey:false});new HotKey('tab',closedSelector,{element:this.selectedContainer,ctrlKey:false});new HotKey('down',function(event){event.target.next("li").focus();}.bindAsEventListener(this),{element:this.optionsContainer,ctrlKey:false,bubbleEvent:false});new HotKey('up',function(event){event.target.previous("li").focus();}.bindAsEventListener(this),{element:this.optionsContainer,ctrlKey:false,bubbleEvent:false});new HotKey('return',function(event){this.countrySelected(event);}.bindAsEventListener(this),{element:this.optionsContainer,ctrlKey:false,bubbleEvent:false});new HotKey('esc',closedSelector,{element:this.optionsContainer,ctrlKey:false});new HotKey('tab',closedSelector,{element:this.optionsContainer,ctrlKey:false});},unload:function(){this.selectedContainer.remove();this.optionsContainer.remove();this.selectBox.phoneWidget=false;this.selectBox.enable();this.selectBox.show();}});LinkChecker={old_values:{},initialize:function(){this.observe('blur',function(event){this.checkUrl();}.bindAsEventListener(this));},makeError:function(){this.addClassName('error');},cleanError:function(){if(this.hasClassName('error')){this.removeClassName('error');}
this.old_values[this.value]=true;},checkUrl:function(){if(this.value.blank()||this.old_values[this.value]){this.cleanError();return;}
if(!this.value.match(/https?:\/\//)){this.value="http://"+this.value;}
if(/(^$)|(^(http|https):\/\/[a-z0-9]+([\-\.]{1}[a-z0-9]+)*\.[a-z]{2,5}(([0-9]{1,5})?\/.*)?$)/i.test(this.value)){this.cleanError();}else{this.makeError();}}};var assetHost=new AssetHost('http://aws.just-landed.com');I18nStrings={"it":{"common":{"organisation_name":"Nome dell'organizzazione","convert_to_another_currency":"Convertire in un'altra valuta","cif_nif":"Codice Fiscale/Partita IVA","cancel":"Elimina","crop":"Ritaglio","not_available":"Non disponibile","loading":"Caricamento in corso","popular_areas":"Zone piu viste","please_confirm_deletion":"Sei sicuro di voler cancellare questo annuncio?","html":"HTML","select_image":"Seleziona immagine","visual":"Visivo","remove_from_favourites":"Rimuovere dai favoriti","vat_number":"Numero","company_name":"Nome compagnia","add_to_favourites":"Aggiungi ai favoriti","remove":"rimuovi","company_number":"Numero compagnia","crop_image":"Immagine ridotta","profession":"Professione","error_message":"Errore","and":"e","add_language":"Aggiungi una lingua","click_here":"clicca qui","new":"Nuovo","please_wait":"Attendere prego.."},"jobs.cv":{"select_cv":"Seleziona un file per il tuo CV"},"errors.standard.cookies_needed_exception":{"text":"Perfavore attiva i cookies per approfitare delle funzionalit\u00e0 complete"},"common.message":{"vat_number_hint":"Se fornisci un valido numero di partita IVA, noi emetteremo una fattura senza IVA. Questo numero comincia con il codice del paese dell' UE, (p.es. {{country_code}}) normalmente seguito dal codice fiscale, per ulteriori informazioni {{link}}","delete_confirm":"Voui davvero eliminare questo elemento?","post_view_count_plural":"Questo annuncio \u00e8 stato visto {{value}} volte","decimals_not_allowed":"Prezzo modificato, riprovare: impossibile utilizzare decimali","cif_nif_hint":"Codice Fiscale/Partita IVA richiesto se vuoi ricevere una fattura","continue_without_saving_warning":"Se continui perderai i cambiamenti fatti","cropping_only_new_images":"Ritaglio disponibile solo per le nuove immagini","change_on_new_language":"Cambia la lingua del tuo conto a {{language}}","post_view_count_singular":"Questo annuncio \u00e8 stato visto {{value}} volte"},"common.maps":{"wrong_marker_place":"Non nel punto giusto? Sposta mi!","refresh_map":"Aggiornare mappa","center_marker":"Centrare cursore","hide_map":"Nascondere mappa","preview_map":"anteprima della mappa"}},"ja":{"common":{"organisation_name":"Organisation Name","convert_to_another_currency":"Convert to another currency","cif_nif":"CIF/NIF","cancel":"\u30ad\u30e3\u30f3\u30bb\u30eb","crop":"Crop","not_available":"Not available","loading":"\u30ed\u30fc\u30c7\u30a3\u30f3\u30b0","popular_areas":"Popular areas","please_confirm_deletion":"Please confirm deletion","html":"HTML","select_image":"\u30a4\u30e1\u30fc\u30b8\u3092\u9078\u629e\u3059\u308b\u3002","visual":"Visual","remove_from_favourites":"Remove from favourites","vat_number":"EU VAT Number","company_name":"Company Name","add_to_favourites":"Add to favourites","remove":"\u524a\u9664","company_number":"Company Number","crop_image":"Crop Image","profession":"\u8077\u696d","error_message":"Error","and":"\u3068","add_language":"\u8a00\u8a9e\u3092\u8ffd\u52a0\u3059\u308b","click_here":"\u3053\u3053\u3092\u30af\u30ea\u30c3\u30af\u3057\u3066\u304f\u3060\u3055\u3044\u3002","new":"New","please_wait":"Please wait..."},"common.message":{"vat_number_hint":"If you provide a valid EU VAT number, we will invoice you without VAT. This number starts with an EU country code (eg {{country_code}}) usually followed by your national tax ID number, for more information {{link}}","delete_confirm":"Are you sure you want to delete this?","post_view_count_plural":"\u3053\u306e\u30dd\u30b9\u30c8\u306f\u3001{{value}}\u95b2\u89a7\u3055\u308c\u307e\u3057\u305f\u3002","decimals_not_allowed":"Price modified, please review field: decimals are not allowed","cif_nif_hint":"CIF/NIF is required if you would like to receive an invoice","continue_without_saving_warning":"\u4fdd\u5b58\u306a\u3057\u306b\u7d9a\u3051\u305f\u3089\u3001\u3042\u306a\u305f\u304c\u5909\u66f4\u3057\u305f\u3059\u3079\u3066\u304c\u5931\u308f\u308c\u307e\u3059\u3002","cropping_only_new_images":"Cropping only available for new images","change_on_new_language":"Change your account language to {{language}}","post_view_count_singular":"\u3053\u306e\u30dd\u30b9\u30c8\u306f\u3001{{value}}\u95b2\u89a7\u3055\u308c\u307e\u3057\u305f\u3002"},"common.maps":{"wrong_marker_place":"Not in the right place? Drag me!","refresh_map":"Refresh map","center_marker":"Centre marker","hide_map":"Hide map","preview_map":"\u5730\u56f3\u30d7\u30ec\u30d3\u30e5\u30fc"}},"no":{"common":{"organisation_name":"Organisation Name","convert_to_another_currency":"Convert to another currency","cif_nif":"CIF/NIF","cancel":"Avbryt","crop":"Crop","not_available":"Not available","loading":"Laster","popular_areas":"Popular areas","please_confirm_deletion":"Please confirm deletion","html":"HTML","select_image":"Velg bilde","visual":"Visual","remove_from_favourites":"Remove from favourites","vat_number":"EU VAT Number","company_name":"Company Name","add_to_favourites":"Add to favourites","remove":"slett","company_number":"Company Number","crop_image":"Crop Image","profession":"Yrke","error_message":"Error","and":"og","add_language":"Legg til et spr\u00e5k","click_here":"klikk her","new":"New","please_wait":"Please wait..."},"common.message":{"vat_number_hint":"If you provide a valid EU VAT number, we will invoice you without VAT. This number starts with an EU country code (eg {{country_code}}) usually followed by your national tax ID number, for more information {{link}}","delete_confirm":"Are you sure you want to delete this?","post_view_count_plural":"Dette innlegget har blitt sett {{value}} ganger","decimals_not_allowed":"Price modified, please review field: decimals are not allowed","cif_nif_hint":"CIF/NIF is required if you would like to receive an invoice","continue_without_saving_warning":"Hvis du fortsetter uten \u00e5 lagre vil du miste alle forandringene du har gjort","cropping_only_new_images":"Cropping only available for new images","change_on_new_language":"Change your account language to {{language}}","post_view_count_singular":"Dette innlegget har blitt sett {{value}} gang"},"common.maps":{"wrong_marker_place":"Not in the right place? Drag me!","refresh_map":"Refresh map","center_marker":"Centre marker","hide_map":"Hide map","preview_map":"forh\u00e5ndsvis kart"}},"fr":{"common":{"organisation_name":"Nom de l'organisation","convert_to_another_currency":"Convertir \u00e1 une autre devise","cif_nif":"CIF/NIF","cancel":"Annuler","crop":"R\u00e9duction","not_available":"Pas disponible","loading":"Chargement","popular_areas":"Endroit populaire","please_confirm_deletion":"\u00cates-vous s\u00fbr(e) de vouloir supprimer cette annonce?","html":"HTML","select_image":"Choisissez une image","visual":"Visuel","remove_from_favourites":"Supprimer de mes favoris","vat_number":"Num\u00e9ro de TVA UE","company_name":"Nom entreprise","add_to_favourites":"Ajouter \u00e0 favori","remove":"supprimer","company_number":"Num\u00e9ro de la compagnie","crop_image":"Rogner l'image","profession":"Profession","error_message":"Erreur","and":"et","add_language":"Ajouter une autre langue","click_here":"cliquez ici","new":"Nouveau","please_wait":"Veuillez patienter..."},"jobs.cv":{"select_cv":"S\u00e9lectionner un fichier pour votre CV"},"errors.standard.cookies_needed_exception":{"text":"S'il vous plait activez les cookies pour profiter des fonctionnalit\u00e9s compl\u00eates. "},"common.message":{"vat_number_hint":"Si vous nous fournissez un num\u00e9ro de TVA de l'UE valide, nous vous facturerons sans la TVA. Ce nombre commence par un code pays tel que {{country_code}} suivi habituellement par le num\u00e9ro d'identification fiscale. Pour plus d'information {{link}}","delete_confirm":"Etes-vous s\u00fbr de vouloir supprimer cela?","post_view_count_plural":"Cette annonce a \u00e9t\u00e9 vue {{value}} fois","decimals_not_allowed":"Prix modifi\u00e9, v\u00e9rifiez-le: les d\u00e9cimaux ne sont pas permis","cif_nif_hint":"Le CIF/NIF est requis si vous voulez recevoir une facture","continue_without_saving_warning":"Si vous continuez vous perderez tous vos changements","cropping_only_new_images":"Le recadrage n'est disponible que pour les nouvelles images","change_on_new_language":"Changer la langue du compte \u00e0 {{language}}","post_view_count_singular":"Cette annonce a \u00e9t\u00e9 vue {{value}} fois"},"common.maps":{"wrong_marker_place":"Pas au bonne endroit? D\u00e9placez-moi!","refresh_map":"Actualiser carte","center_marker":"Centrer le pointeur","hide_map":"Cacher carte","preview_map":"visionner la carte"}},"de":{"common":{"organisation_name":"Name der Organisation","convert_to_another_currency":"In andere W\u00e4hrung umrechnen","cif_nif":"CIF/NIF","cancel":"Abbrechen","crop":"Beschneiden","not_available":"Nicht verf\u00fcgbar","loading":"Laden","popular_areas":"Popul\u00e4re Regionen","please_confirm_deletion":"Bitte best\u00e4tigen Sie die L\u00f6schung","html":"HTML","select_image":"Bild w\u00e4hlen","visual":"Visuell","remove_from_favourites":"Aus Favoriten entfernen","vat_number":"EU MwSt-Nummer","company_name":"Firmenname","add_to_favourites":"Zu Favoriten hinzuf\u00fcgen","remove":"Entfernen","company_number":"MwSt-Nummer","crop_image":"Bild beschneiden","profession":"Beruf","error_message":"Fehler","and":"und","add_language":"Sprache hinzuf\u00fcgen","click_here":"Hier klicken","new":"Neu","please_wait":"Bitte warten ..."},"jobs.cv":{"select_cv":"W\u00e4hlen Sie eine Datei f\u00fcr Ihren Lebenslauf aus"},"errors.standard.cookies_needed_exception":{"text":"Bitte aktivierten Sie Cookies in Ihrem Browser um die volle Funktionalit\u00e4t der Seite zu erm\u00f6glichen"},"common.message":{"vat_number_hint":"Wenn Sie uns Ihre g\u00fcltige EU MwSt-Nummer mitteilen, k\u00f6nnen wir Ihnen eine Rechnung ohne MwSt ausstellen. Die Nummer beginnt mit einem Landescode (z.B. {{country_code}}), normalerweise gefolgt von Ihrer nationalen MwSt-Nummer, f\u00fcr weitere Informationen {{l","delete_confirm":"Sind Sie sicher, dass Sie dies l\u00f6schen wollen?","post_view_count_plural":"Diese Anzeige wurde {{value}} mal angesehen","decimals_not_allowed":"Preis ge\u00e4ndert, bitte kontrollieren Sie Feld: Dezimalstellen sind nicht erlaubt","cif_nif_hint":"Wenn Sie eine Rechnung erhalten m\u00f6chten, ben\u00f6tigen wir Ihre CIF/NIF","continue_without_saving_warning":"Wenn Sie fortfahren, gehen Ihre \u00c4nderungen verloren","cropping_only_new_images":"Beschneiden ist nur f\u00fcr neue Bilder verf\u00fcgbar","change_on_new_language":"\u00c4ndern Sie Ihre Account-Sprache zu {{language}}","post_view_count_singular":"Diese Anzeige wurde {{value}} mal angesehen"},"common.maps":{"wrong_marker_place":"Nicht am richtigen Ort? Ziehe mich","refresh_map":"Karte neu laden","center_marker":"Zentrierungsmarkierung","hide_map":"Karte nicht zeigen","preview_map":"Vorschau der Karte"}},"ta":{"common":{"organisation_name":"Organisation Name","convert_to_another_currency":"Convert to another currency","cif_nif":"CIF/NIF","cancel":"\u0ba8\u0bc0\u0b95\u0bcd\u0b95\u0bbf\u0bb5\u0bbf\u0b9f\u0bb5\u0bc1\u0bae\u0bcd","crop":"Crop","not_available":"Not available","loading":"loading","popular_areas":"Popular areas","please_confirm_deletion":"Please confirm deletion","html":"HTML","select_image":"\u0baa\u0b9f\u0ba4\u0bcd\u0ba4\u0bc8  \u0ba4\u0bc7\u0bb0\u0bcd\u0bb5\u0bc1 \u0b9a\u0bc6\u0baf\u0bcd\u0baf\u0bc1\u0b99\u0bcd\u0b95\u0bb3\u0bcd","visual":"Visual","remove_from_favourites":"Remove from favourites","vat_number":"EU VAT Number","company_name":"Company Name","add_to_favourites":"Add to favourites","remove":"\u0ba8\u0bc0\u0b95\u0bcd\u0b95\u0bb5\u0bc1\u0bae\u0bcd","company_number":"Company Number","crop_image":"Crop Image","profession":"\u0ba4\u0bca\u0bb4\u0bbf\u0bb2\u0bcd","error_message":"Error","and":"\u0bae\u0bb1\u0bcd\u0bb1\u0bc1\u0bae\u0bcd","add_language":"\u0b92\u0bb0\u0bc1 \u0bae\u0bca\u0bb4\u0bbf\u0baf\u0bc8   \u0b9a\u0bc7\u0bb0\u0bcd\u0b95\u0bcd\u0b95\u0bb5\u0bc1\u0bae\u0bcd","click_here":"\u0b87\u0b99\u0bcd\u0b95\u0bc7 \u0b95\u0bbf\u0bb3\u0bbf\u0b95\u0bcd   \u0b9a\u0bc6\u0baf\u0bcd\u0baf\u0bb5\u0bc1\u0bae\u0bcd ","new":"New","please_wait":"Please wait..."},"common.message":{"vat_number_hint":"If you provide a valid EU VAT number, we will invoice you without VAT. This number starts with an EU country code (eg {{country_code}}) usually followed by your national tax ID number, for more information {{link}}","delete_confirm":"Are you sure you want to delete this?","post_view_count_plural":"\u0b87\u0ba8\u0bcd\u0ba4 \u0baa\u0bcb\u0bb8\u0bcd\u0b9f\u0bcd {{value}} \u0ba4\u0b9f\u0bb5\u0bc8  \u0baa\u0bbe\u0bb0\u0bcd\u0b95\u0bcd\u0b95\u0baa\u0bcd\u0baa\u0b9f\u0bcd\u0b9f\u0bc1\u0bb3\u0bcd\u0bb3\u0ba4\u0bc1","decimals_not_allowed":"Price modified, please review field: decimals are not allowed","cif_nif_hint":"CIF/NIF is required if you would like to receive an invoice","continue_without_saving_warning":"\u0ba8\u0bc0\u0b99\u0bcd\u0b95\u0bb3\u0bcd \u0b9a\u0bc6\u0baf\u0bcd\u0ba4  \u0bae\u0bbe\u0bb1\u0bcd\u0bb1\u0b99\u0bcd\u0b95\u0bb3\u0bc8  save  \u0b9a\u0bc6\u0baf\u0bcd\u0baf\u0bbe\u0bae\u0bb2\u0bcd  \u0ba4\u0bca\u0b9f\u0bb0\u0bcd\u0ba8\u0bcd\u0ba4\u0bbe\u0bb2\u0bcd  \u0b87\u0bb4\u0ba8\u0bcd\u0ba4\u0bc1  \u0bb5\u0bbf\u0b9f\u0bc1\u0bb5\u0bc0\u0bb0\u0bcd\u0b95\u0bb3\u0bcd","cropping_only_new_images":"Cropping only available for new images","change_on_new_language":"Change your account language to {{language}}","post_view_count_singular":"\u0b87\u0ba8\u0bcd\u0ba4 \u0baa\u0bcb\u0bb8\u0bcd\u0b9f\u0bcd {{value}} \u0ba4\u0b9f\u0bb5\u0bc8  \u0baa\u0bbe\u0bb0\u0bcd\u0b95\u0bcd\u0b95\u0baa\u0bcd\u0baa\u0b9f\u0bcd\u0b9f\u0bc1\u0bb3\u0bcd\u0bb3\u0ba4\u0bc1"},"common.maps":{"wrong_marker_place":"Not in the right place? Drag me!","refresh_map":"Refresh map","center_marker":"Centre marker","hide_map":"Hide map","preview_map":"\u0b9a\u0bcb\u0ba4\u0ba9\u0bc8  \u0bb5\u0bb0\u0bc8 \u0baa\u0b9f\u0bae\u0bcd"}},"sk":{"common":{"organisation_name":"Organisation Name","convert_to_another_currency":"Convert to another currency","cif_nif":"CIF/NIF","cancel":"Zru\u0161i\u0165","crop":"Crop","not_available":"Not available","loading":"Na\u010d\u00edtava sa","popular_areas":"Popular areas","please_confirm_deletion":"Please confirm deletion","html":"HTML","select_image":"Vo\u013eba obrazu","visual":"Visual","remove_from_favourites":"Remove from favourites","vat_number":"EU VAT Number","company_name":"Company Name","add_to_favourites":"Add to favourites","remove":"Odstr\u00e1ni\u0165","company_number":"Company Number","crop_image":"Crop Image","profession":"Profesia","error_message":"Error","and":"a","add_language":"Prida\u0165 jazyk","click_here":"kliknite tu","new":"New","please_wait":"Please wait..."},"common.message":{"vat_number_hint":"If you provide a valid EU VAT number, we will invoice you without VAT. This number starts with an EU country code (eg {{country_code}}) usually followed by your national tax ID number, for more information {{link}}","delete_confirm":"Are you sure you want to delete this?","post_view_count_plural":"Tento pr\u00edspevok bol zobrazen\u00fd {{value}} kr\u00e1t ","decimals_not_allowed":"Price modified, please review field: decimals are not allowed","cif_nif_hint":"CIF/NIF is required if you would like to receive an invoice","continue_without_saving_warning":"Ak budete pokra\u010dova\u0165 bez ulo\u017eenia, strat\u00edte v\u0161etky vykonan\u00e9 zmeny","cropping_only_new_images":"Cropping only available for new images","change_on_new_language":"Change your account language to {{language}}","post_view_count_singular":"Tento pr\u00edspevok bol zobrazen\u00fd {{value}} kr\u00e1t"},"common.maps":{"wrong_marker_place":"Not in the right place? Drag me!","refresh_map":"Refresh map","center_marker":"Centre marker","hide_map":"Hide map","preview_map":"uk\u00e1\u017eka mapy"}},"hu":{"common":{"organisation_name":"Organisation Name","convert_to_another_currency":"Convert to another currency","cif_nif":"CIF/NIF","cancel":"Felf\u00fcggeszt\u00e9s","crop":"Crop","not_available":"Not available","loading":"t\u00f6lt\u00e9s","popular_areas":"Popular areas","please_confirm_deletion":"Please confirm deletion","html":"HTML","select_image":"V\u00e1lassz k\u00e9pet","visual":"Visual","remove_from_favourites":"Remove from favourites","vat_number":"EU VAT Number","company_name":"Company Name","add_to_favourites":"Add to favourites","remove":"elmozd\u00edt","company_number":"Company Number","crop_image":"Crop Image","profession":"Foglalkoz\u00e1s","error_message":"Error","and":"\u00e9s","add_language":"\u00daj nyelv hozz\u00e1ad\u00e1sa","click_here":"Kattints ide","new":"New","please_wait":"Please wait..."},"common.message":{"vat_number_hint":"If you provide a valid EU VAT number, we will invoice you without VAT. This number starts with an EU country code (eg {{country_code}}) usually followed by your national tax ID number, for more information {{link}}","delete_confirm":"Are you sure you want to delete this?","post_view_count_plural":"Ezt a hozz\u00e1sz\u00f3l\u00e1st {{value}} l\u00e1tt\u00e1k","decimals_not_allowed":"Price modified, please review field: decimals are not allowed","cif_nif_hint":"CIF/NIF is required if you would like to receive an invoice","continue_without_saving_warning":"Ha ment\u00e9s n\u00e9lk\u00fcl folytatod, minden eddigi v\u00e1ltoztat\u00e1st elvesztesz. ","cropping_only_new_images":"Cropping only available for new images","change_on_new_language":"Change your account language to {{language}}","post_view_count_singular":"Ezt a hozz\u00e1sz\u00f3l\u00e1st {{value}} l\u00e1tt\u00e1k"},"common.maps":{"wrong_marker_place":"Not in the right place? Drag me!","refresh_map":"Refresh map","center_marker":"Centre marker","hide_map":"Hide map","preview_map":"t\u00e9rk\u00e9p megtekint\u00e9se"}},"zh":{"common":{"organisation_name":"Organisation Name","convert_to_another_currency":"Convert to another currency","cif_nif":"CIF/NIF","cancel":"\u53d6\u6d88","crop":"Crop","not_available":"Not available","loading":"\u8f7d\u5165\u4e2d","popular_areas":"Popular areas","please_confirm_deletion":"Please confirm deletion","html":"HTML","select_image":"\u9009\u62e9\u56fe\u50cf ","visual":"Visual","remove_from_favourites":"Remove from favourites","vat_number":"EU VAT Number","company_name":"Company Name","add_to_favourites":"Add to favourites","remove":"\u5220\u9664","company_number":"Company Number","crop_image":"Crop Image","profession":"\u804c\u4e1a","error_message":"Error","and":"\u548c","add_language":"\u6dfb\u52a0\u8bed\u8a00","click_here":"\u70b9\u51fb\u8fd9\u91cc","new":"New","please_wait":"Please wait..."},"common.message":{"vat_number_hint":"If you provide a valid EU VAT number, we will invoice you without VAT. This number starts with an EU country code (eg {{country_code}}) usually followed by your national tax ID number, for more information {{link}}","delete_confirm":"Are you sure you want to delete this?","post_view_count_plural":"\u8be5\u5e16\u5b50\u5df2\u88ab\u6d4f\u89c8\u4e86{{value}}\u6b21","decimals_not_allowed":"Price modified, please review field: decimals are not allowed","cif_nif_hint":"CIF/NIF is required if you would like to receive an invoice","continue_without_saving_warning":"\u5728\u7ee7\u7eed\u4e4b\u524d\u8bf7\u5148\u4fdd\u5b58\uff0c\u5426\u5219\u60a8\u5c06\u9057\u5931\u6240\u6709\u7684\u66f4\u6539\u3002","cropping_only_new_images":"Cropping only available for new images","change_on_new_language":"Change your account language to {{language}}","post_view_count_singular":"\u8be5\u5e16\u5b50\u5df2\u88ab\u6d4f\u89c8\u4e86{{value}}\u6b21"},"common.maps":{"wrong_marker_place":"Not in the right place? Drag me!","refresh_map":"Refresh map","center_marker":"Centre marker","hide_map":"Hide map","preview_map":"\u524d\u4e00\u5e45\u5730\u56fe"}},"gu":{"common":{"organisation_name":"Organisation Name","convert_to_another_currency":"Convert to another currency","cif_nif":"CIF/NIF","cancel":"\u0ab0\u0aa6 \u0a95\u0ab0\u0acb\n","crop":"Crop","not_available":"Not available","loading":"\u0ab2\u0acb\u0aa1 \u0aa5\u0a88 \u0ab0\u0ab9\u0acd\u0aaf\u0ac1\u0a82 \u0a9b\u0ac7...\n","popular_areas":"Popular areas","please_confirm_deletion":"Please confirm deletion","html":"HTML","select_image":"\u0aa4\u0ab8\u0acd\u0ab5\u0ac0\u0ab0 \u0aaa\u0ab8\u0a82\u0aa6 \u0a95\u0ab0\u0acb\n","visual":"Visual","remove_from_favourites":"Remove from favourites","vat_number":"EU VAT Number","company_name":"Company Name","add_to_favourites":"Add to favourites","remove":"\u0aa6\u0ac2\u0ab0 \u0a95\u0ab0\u0acb\n","company_number":"Company Number","crop_image":"Crop Image","profession":"\u0ab5\u0acd\u0aaf\u0ab5\u0ab8\u0abe\u0aaf\n","error_message":"Error","and":"\u0a85\u0aa8\u0ac7\n","add_language":"\u0aad\u0abe\u0ab7\u0abe \u0a89\u0aae\u0ac7\u0ab0\u0acb\n","click_here":"\u0a85\u0ab9\u0ac0\u0a82 \u0a95\u0acd\u0ab2\u0abf\u0a95 \u0a95\u0ab0\u0acb\n","new":"New","please_wait":"Please wait..."},"common.message":{"vat_number_hint":"If you provide a valid EU VAT number, we will invoice you without VAT. This number starts with an EU country code (eg {{country_code}}) usually followed by your national tax ID number, for more information {{link}}","delete_confirm":"Are you sure you want to delete this?","post_view_count_plural":"\u0a86 \u0aaa\u0acb\u0ab8\u0acd\u0a9f {{value}} \u0ab5\u0a96\u0aa4 \u0a9c\u0acb\u0ab5\u0abe\u0aae\u0abe\u0a82 \u0a86\u0ab5\u0ac0 \u0a9b\u0ac7","decimals_not_allowed":"Price modified, please review field: decimals are not allowed","cif_nif_hint":"CIF/NIF is required if you would like to receive an invoice","continue_without_saving_warning":"\u0a9c\u0acb \u0a86\u0aaa \u0ab8\u0ac7\u0ab5 \u0a95\u0ab0\u0acd\u0aaf\u0abe \u0ab5\u0abf\u0aa8\u0abe \u0a86\u0a97\u0ab3 \u0ab5\u0aa7\u0ab6\u0acb \u0aa4\u0acb \u0a86\u0aaa\u0ac7 \u0a95\u0ab0\u0ac7\u0ab2\u0abe \u0aac\u0aa7\u0abe \u0aab\u0ac7\u0ab0\u0aab\u0abe\u0ab0\u0acb \u0a86\u0aaa \u0a97\u0ac1\u0aae\u0abe\u0ab5\u0ab6\u0acb.\n","cropping_only_new_images":"Cropping only available for new images","change_on_new_language":"Change your account language to {{language}}","post_view_count_singular":"\u0a86 \u0aaa\u0acb\u0ab8\u0acd\u0a9f {{value}} \u0ab5\u0a96\u0aa4 \u0a9c\u0acb\u0ab5\u0abe\u0aae\u0abe\u0a82 \u0a86\u0ab5\u0ac0 \u0a9b\u0ac7"},"common.maps":{"wrong_marker_place":"Not in the right place? Drag me!","refresh_map":"Refresh map","center_marker":"Centre marker","hide_map":"Hide map","preview_map":"\u0aaa\u0acd\u0ab0\u0abf\u0ab5\u0acd\u0aaf\u0ac2 \u0aae\u0ac5\u0aaa\n"}},"sv":{"common":{"organisation_name":"Organisation Name","convert_to_another_currency":"Convert to another currency","cif_nif":"CIF/NIF","cancel":"Avbryt","crop":"Crop","not_available":"Not available","loading":"\t\nLaddar","popular_areas":"Popular areas","please_confirm_deletion":"Please confirm deletion","html":"HTML","select_image":"V\u00e4lj bild","visual":"Visual","remove_from_favourites":"Remove from favourites","vat_number":"EU VAT Number","company_name":"Company Name","add_to_favourites":"Add to favourites","remove":"ta bort","company_number":"Company Number","crop_image":"Crop Image","profession":"Yrke","error_message":"Error","and":"och","add_language":"L\u00e4gg till ett spr\u00e5k","click_here":"klicka h\u00e4r","new":"New","please_wait":"Please wait..."},"common.message":{"vat_number_hint":"If you provide a valid EU VAT number, we will invoice you without VAT. This number starts with an EU country code (eg {{country_code}}) usually followed by your national tax ID number, for more information {{link}}","delete_confirm":"Are you sure you want to delete this?","post_view_count_plural":"Det h\u00e4r inl\u00e4gget har setts {{value}} g\u00e5nger","decimals_not_allowed":"Price modified, please review field: decimals are not allowed","cif_nif_hint":"CIF/NIF is required if you would like to receive an invoice","continue_without_saving_warning":"Om du inte sparar det, kommer du att f\u00f6rlora alla \u00e4ndringar du har gjort","cropping_only_new_images":"Cropping only available for new images","change_on_new_language":"Change your account language to {{language}}","post_view_count_singular":"Det h\u00e4r inl\u00e4gget har setts {{value}} g\u00e5ng"},"common.maps":{"wrong_marker_place":"Not in the right place? Drag me!","refresh_map":"Refresh map","center_marker":"Centre marker","hide_map":"Hide map","preview_map":"preview map "}},"fi":{"common":{"organisation_name":"Organisation Name","convert_to_another_currency":"Convert to another currency","cif_nif":"CIF/NIF","cancel":"Peruuta","crop":"Crop","not_available":"Not available","loading":"Lataa","popular_areas":"Popular areas","please_confirm_deletion":"Please confirm deletion","html":"HTML","select_image":"Valitse kuva","visual":"Visual","remove_from_favourites":"Remove from favourites","vat_number":"EU VAT Number","company_name":"Company Name","add_to_favourites":"Add to favourites","remove":"poista","company_number":"Company Number","crop_image":"Crop Image","profession":"Ammatti","error_message":"Error","and":"ja","add_language":"Lis\u00e4\u00e4 kieli","click_here":"klikkaa t\u00e4st\u00e4","new":"New","please_wait":"Please wait..."},"common.message":{"vat_number_hint":"If you provide a valid EU VAT number, we will invoice you without VAT. This number starts with an EU country code (eg {{country_code}}) usually followed by your national tax ID number, for more information {{link}}","delete_confirm":"Are you sure you want to delete this?","post_view_count_plural":"T\u00e4t\u00e4 viesti\u00e4 on katsottu {{value}} kertaa","decimals_not_allowed":"Price modified, please review field: decimals are not allowed","cif_nif_hint":"CIF/NIF is required if you would like to receive an invoice","continue_without_saving_warning":"Jos jatkat tallentamatta, menet\u00e4t kaikki tekem\u00e4si muutokset","cropping_only_new_images":"Cropping only available for new images","change_on_new_language":"Change your account language to {{language}}","post_view_count_singular":"T\u00e4t\u00e4 viesti\u00e4 on katsottu {{value}} kerran"},"common.maps":{"wrong_marker_place":"Not in the right place? Drag me!","refresh_map":"Refresh map","center_marker":"Centre marker","hide_map":"Hide map","preview_map":"tarkastele karttaa"}},"ru":{"common":{"organisation_name":"Organisation Name","convert_to_another_currency":"Convert to another currency","cif_nif":"CIF/NIF","cancel":"\u041e\u0442\u043c\u0435\u043d\u0438\u0442\u044c","crop":"Crop","not_available":"Not available","loading":"\u0418\u0434\u0435\u0442 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0430","popular_areas":"Popular areas","please_confirm_deletion":"Please confirm deletion","html":"HTML","select_image":"\u0412\u044b\u0431\u0440\u0430\u0442\u044c \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435","visual":"Visual","remove_from_favourites":"Remove from favourites","vat_number":"EU VAT Number","company_name":"Company Name","add_to_favourites":"Add to favourites","remove":"\u0423\u0434\u0430\u043b\u0438\u0442\u044c","company_number":"Company Number","crop_image":"Crop Image","profession":"\u041f\u0440\u043e\u0444\u0435\u0441\u0441\u0438\u044f","error_message":"Error","and":"\u0438","add_language":"\u0414\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u044f\u0437\u044b\u043a","click_here":"\u0449\u0435\u043b\u043a\u043d\u0438\u0442\u0435 \u0437\u0434\u0435\u0441\u044c","new":"New","please_wait":"Please wait..."},"common.message":{"vat_number_hint":"If you provide a valid EU VAT number, we will invoice you without VAT. This number starts with an EU country code (eg {{country_code}}) usually followed by your national tax ID number, for more information {{link}}","delete_confirm":"Are you sure you want to delete this?","post_view_count_plural":"\u0421\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u043d\u043e {{value}} \u0440\u0430\u0437","decimals_not_allowed":"Price modified, please review field: decimals are not allowed","cif_nif_hint":"CIF/NIF is required if you would like to receive an invoice","continue_without_saving_warning":"\u0415\u0441\u043b\u0438 \u0412\u044b \u0431\u0443\u0434\u0435\u0442\u0435 \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0430\u0442\u044c \u043d\u0435 \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u044f \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439, \u0442\u043e \u043e\u043d\u0438 \u0431\u0443\u0434\u0443\u0442 \u043f\u043e\u0442\u0435\u0440\u044f\u043d\u044b","cropping_only_new_images":"Cropping only available for new images","change_on_new_language":"Change your account language to {{language}}","post_view_count_singular":"\u0421\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u043d\u043e {{value}} \u0440\u0430\u0437"},"common.maps":{"wrong_marker_place":"Not in the right place? Drag me!","refresh_map":"Refresh map","center_marker":"Centre marker","hide_map":"Hide map","preview_map":"\u043f\u0440\u0435\u0434\u0432\u0430\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u043f\u0440\u043e\u0441\u043c\u043e\u0442\u0440 \u043a\u0430\u0440\u0442\u044b"}},"es":{"common":{"organisation_name":"Nombre de la organizaci\u00f3n","convert_to_another_currency":"Convertir a otra moneda","cif_nif":"CIF/NIF","cancel":"Cancelar","crop":"Recortar","not_available":"No disponible","loading":"Cargando","popular_areas":"\u00c1reas populares","please_confirm_deletion":"Est\u00e1s seguro que desea eliminar este anuncio?","html":"HTML","select_image":"Elegir imagen","visual":"Visual","remove_from_favourites":"Eliminar de favoritos","vat_number":"N\u00famero de IVA de la UE","company_name":"Nombre de la empresa","add_to_favourites":"A\u00f1adir a favoritos","remove":"eliminar","company_number":"N\u00famero de la empresa","crop_image":"Recortar imagen","profession":"Profesi\u00f3n","error_message":"Error","and":"y","add_language":"A\u00f1adir un idioma","click_here":"haz click aqu\u00ed","new":"Nuevo","please_wait":"Por favor espere..."},"jobs.cv":{"select_cv":"Seleccione el archivo de su CV"},"errors.standard.cookies_needed_exception":{"text":"Tienes que habilitar las cookies para poder usar esta parte de la p\u00e1gina"},"common.message":{"vat_number_hint":"Si nos proporcionas un VAT Europeo v\u00e1lido, te enviaremos tus facturas sin VAT. Este n\u00famero empieza con un codigo de pa\u00eds, por ejemplo [{{country_code}}] al que normalmente le sigue su numero identificador de impuestos, para m\u00e1s informaci\u00f3n {{link}}","delete_confirm":"Estas seguro que deseas eliminar esto?","post_view_count_plural":"Este anuncio ha sido visto {{value}} veces","decimals_not_allowed":"Precio modificado, por favor revisar el campo: decimales no permitidos","cif_nif_hint":"CIF/NIF necesario si deseas recibir una factura","continue_without_saving_warning":"Si contin\u00faas perderas los cambios","cropping_only_new_images":"S\u00f3lo se pueden recortar imagenes nuevas","change_on_new_language":"Cambia tu idioma principal a {{language}}","post_view_count_singular":"Este anuncio ha sido visto {{value}} vez"},"common.maps":{"wrong_marker_place":"\u00bfMal ubicado? Arrastra el marcador!","refresh_map":"Actualizar el mapa","center_marker":"Centrar marcador","hide_map":"Ocultar el mapa","preview_map":"Vista previa"}},"ko":{"common":{"organisation_name":"Organisation Name","convert_to_another_currency":"Convert to another currency","cif_nif":"CIF/NIF","cancel":"\ucde8\uc18c","crop":"Crop","not_available":"Not available","loading":"\ub85c\ub529\uc911","popular_areas":"Popular areas","please_confirm_deletion":"Please confirm deletion","html":"HTML","select_image":"\uc774\ubbf8\uc9c0 \uc120\ud0dd","visual":"Visual","remove_from_favourites":"Remove from favourites","vat_number":"EU VAT Number","company_name":"Company Name","add_to_favourites":"Add to favourites","remove":"\uc81c\uac70\ud558\ub2e4","company_number":"Company Number","crop_image":"Crop Image","profession":"\uc9c1\uc5c5","error_message":"Error","and":"\ubc0f","add_language":"\uc5b8\uc5b4 \ucd94\uac00","click_here":"\uc5ec\uae30\ub97c \ud074\ub9ad","new":"New","please_wait":"Please wait..."},"common.message":{"vat_number_hint":"If you provide a valid EU VAT number, we will invoice you without VAT. This number starts with an EU country code (eg {{country_code}}) usually followed by your national tax ID number, for more information {{link}}","delete_confirm":"Are you sure you want to delete this?","post_view_count_plural":"\uc774 \uac8c\uc2dc\ubb3c\uc774 {{value}}\ubc88 \ud655\uc778\ub418\uc5c8\uc2b5\ub2c8\ub2e4.","decimals_not_allowed":"Price modified, please review field: decimals are not allowed","cif_nif_hint":"CIF/NIF is required if you would like to receive an invoice","continue_without_saving_warning":"\uc800\uc7a5\ud558\uc9c0 \uc54a\uace0 \uacc4\uc18d\ud558\uba74 \uc218\ud589\ud55c \ubaa8\ub4e0 \ubcc0\uacbd\uc0ac\ud56d\uc774 \uc190\uc2e4\ub429\ub2c8\ub2e4","cropping_only_new_images":"Cropping only available for new images","change_on_new_language":"Change your account language to {{language}}","post_view_count_singular":"\uc774 \uac8c\uc2dc\ubb3c\uc774 {{value}}\ubc88 \ud655\uc778\ub418\uc5c8\uc2b5\ub2c8\ub2e4."},"common.maps":{"wrong_marker_place":"Not in the right place? Drag me!","refresh_map":"Refresh map","center_marker":"Centre marker","hide_map":"Hide map","preview_map":"\uc9c0\ub3c4 \ubbf8\ub9ac\ubcf4\uae30"}},"pt":{"common":{"organisation_name":"Organisation Name","convert_to_another_currency":"Convert to another currency","cif_nif":"CIF/NIF","cancel":"Cancelar","crop":"Crop","not_available":"Not available","loading":"A Carregar","popular_areas":"Popular areas","please_confirm_deletion":"Tem certeza de que deseja remover este an\u00fancio?","html":"HTML","select_image":"Selecionar imagem","visual":"Visual","remove_from_favourites":"Remove from favourites","vat_number":"EU VAT Number","company_name":"Company Name","add_to_favourites":"Add to favourites","remove":"remover","company_number":"Company Number","crop_image":"Crop Image","profession":"Profession","error_message":"Error","and":"and","add_language":"Adicione um idioma","click_here":"click here","new":"New","please_wait":"Please wait..."},"common.message":{"vat_number_hint":"If you provide a valid EU VAT number, we will invoice you without VAT. This number starts with an EU country code (eg {{country_code}}) usually followed by your national tax ID number, for more information {{link}}","delete_confirm":"Are you sure you want to delete this?","post_view_count_plural":"Este post foi visto por {{value}} vezes","decimals_not_allowed":"Price modified, please review field: decimals are not allowed","cif_nif_hint":"CIF/NIF is required if you would like to receive an invoice","continue_without_saving_warning":"If you continue you will lose any changes","cropping_only_new_images":"Cropping only available for new images","change_on_new_language":"Change your account language to {{language}}","post_view_count_singular":"Este post foi visto por {{value}} vez"},"common.maps":{"wrong_marker_place":"Not in the right place? Drag me!","refresh_map":"Refresh map","center_marker":"Centre marker","hide_map":"Hide map","preview_map":"preview"}},"et":{"common":{"organisation_name":"Organisation Name","convert_to_another_currency":"Convert to another currency","cif_nif":"CIF/NIF","cancel":"T\u00fchista","crop":"Crop","not_available":"Not available","loading":"Laen","popular_areas":"Popular areas","please_confirm_deletion":"Please confirm deletion","html":"HTML","select_image":"Vali kuvand","visual":"Visual","remove_from_favourites":"Remove from favourites","vat_number":"EU VAT Number","company_name":"Company Name","add_to_favourites":"Add to favourites","remove":"Eemalda","company_number":"Company Number","crop_image":"Crop Image","profession":"Amet","error_message":"Error","and":"ja","add_language":"Lisa keel","click_here":"Vajuta siia","new":"New","please_wait":"Please wait..."},"common.message":{"vat_number_hint":"If you provide a valid EU VAT number, we will invoice you without VAT. This number starts with an EU country code (eg {{country_code}}) usually followed by your national tax ID number, for more information {{link}}","delete_confirm":"Are you sure you want to delete this?","post_view_count_plural":"Seda postitus on vaadatud {{value}} korda","decimals_not_allowed":"Price modified, please review field: decimals are not allowed","cif_nif_hint":"CIF/NIF is required if you would like to receive an invoice","continue_without_saving_warning":"Kui j\u00e4tkate salvestamiseta, kaotate k\u00f5ik tehtud muudatused","cropping_only_new_images":"Cropping only available for new images","change_on_new_language":"Change your account language to {{language}}","post_view_count_singular":"Seda postitus on vaadatud {{value}} korda"},"common.maps":{"wrong_marker_place":"Not in the right place? Drag me!","refresh_map":"Refresh map","center_marker":"Centre marker","hide_map":"Hide map","preview_map":"kaardi eelvaade"}},"fa":{"common":{"organisation_name":"Organisation Name","convert_to_another_currency":"Convert to another currency","cif_nif":"CIF/NIF","cancel":"\u0641\u0633\u062e","crop":"Crop","not_available":"Not available","loading":" \u0628\u0627\u0631\u06af\u0632\u0627\u0631\u06cc","popular_areas":"\u0645\u0646\u0627\u0637\u0642 \u067e\u0631\u0637\u0631\u0641\u062f\u0627\u0631","please_confirm_deletion":"Please confirm deletion","html":"HTML","select_image":"\u0639\u06a9\u0633 \u0631\u0627 \u0627\u0646\u062a\u062e\u0627\u0628 \u06a9\u0646\u06cc\u062f","visual":"Visual","remove_from_favourites":"\u062d\u0630\u0641 \u0622\u06cc\u062a\u0645 \u0627\u0632 \u0639\u0644\u0627\u0642\u0647 \u0645\u0646\u062f\u06cc \u0647\u0627\u06cc \u0645\u0646","vat_number":"EU VAT Number","company_name":"Company Name","add_to_favourites":"\u0622\u06cc\u062a\u0645 \u0631\u0627 \u0628\u0647 \u0639\u0644\u0627\u0642\u0647 \u0645\u0646\u062f\u06cc \u0647\u0627\u06cc \u0645\u0646 \u0627\u0636\u0627\u0641\u0647 \u06a9\u0646","remove":"\u062d\u0630\u0641","company_number":"Company Number","crop_image":"Crop Image","profession":"\u062d\u0631\u0641\u0647","error_message":"Error","and":"\u0648","add_language":" \u0627\u0636\u0627\u0641\u0647 \u06a9\u0631\u062f\u0646 \u0632\u0628\u0627\u0646","click_here":"\u0627\u06cc\u062c\u0627 \u0631\u0627 \u06a9\u0644\u06cc\u06a9 \u06a9\u0646\u06cc\u062f","new":"New","please_wait":"Please wait..."},"errors.standard.cookies_needed_exception":{"text":"\u0628\u0631\u0627\u06cc \u0644\u0630\u062a \u0628\u0631\u062f\u0646 \u0627\u0632 \u062a\u0645\u0627\u0645 \u0639\u0645\u0644\u06a9\u0631\u062f\u0647\u0627\u060c \u0644\u0637\u0641\u0627 \u06a9\u0648\u06a9\u06cc\u0632 \u0631\u0627 \u0641\u0639\u0627\u0644 \u06a9\u0646\u06cc\u062f.\n"},"common.message":{"vat_number_hint":"If you provide a valid EU VAT number, we will invoice you without VAT. This number starts with an EU country code (eg {{country_code}}) usually followed by your national tax ID number, for more information {{link}}","delete_confirm":"Are you sure you want to delete this?","post_view_count_plural":"\u0628\u0627\u0631 \u0628\u0627\u0632\u062f\u06cc\u062f \u0634\u062f\u0647 \u0627\u0633\u062a {{value}} \u0627\u06cc\u0646 \u067e\u0633\u062a \u0628\u0647 \u062a\u0639\u062f\u0627\u062f","decimals_not_allowed":"Price modified, please review field: decimals are not allowed","cif_nif_hint":"CIF/NIF is required if you would like to receive an invoice","continue_without_saving_warning":"\u062f\u0631 \u0635\u0648\u0631\u062a\u06cc\u06a9\u0647 \u0628\u062f\u0648\u0646 \u0630\u062e\u06cc\u0631\u0647 \u06a9\u0631\u062f\u0646 \u062e\u0627\u0631\u062c \u0634\u0648\u06cc\u062f\u060c \u062a\u0645\u0627\u0645\u06cc \u062a\u063a\u06cc\u06cc\u0631\u0627\u062a\u06cc \u0631\u0627 \u06a9\u0647 \u062f\u0627\u062f\u0647 \u0627\u06cc\u062f \u0627\u0632 \u062f\u0633\u062a \u062e\u0648\u0627\u0647\u06cc\u062f \u062f\u0627\u062f","cropping_only_new_images":"Cropping only available for new images","change_on_new_language":"Change your account language to {{language}}","post_view_count_singular":"\u0628\u0627\u0631 \u0628\u0627\u0632\u062f\u06cc\u062f \u0634\u062f\u0647 \u0627\u0633\u062a {{value}} \u0627\u06cc\u0646 \u067e\u0633\u062a \u0628\u0647 \u062a\u0639\u062f\u0627\u062f"},"common.maps":{"wrong_marker_place":"Not in the right place? Drag me!","refresh_map":"Refresh map","center_marker":"Centre marker","hide_map":"Hide map","preview_map":"\u0646\u0642\u0634\u0647 \u067e\u06cc\u0634 \u0646\u0645\u0627\u06cc\u0634"}},"br":{"common":{"organisation_name":"Organisation Name","convert_to_another_currency":"Convert to another currency","cif_nif":"CIF/NIF","cancel":"Cancelar","crop":"Crop","not_available":"Not available","loading":"Carregando","popular_areas":"Popular areas","please_confirm_deletion":"Please confirm deletion","html":"HTML","select_image":"Selecionar imagem","visual":"Visual","remove_from_favourites":"Remove from favourites","vat_number":"EU VAT Number","company_name":"Company Name","add_to_favourites":"Add to favourites","remove":"remover","company_number":"Company Number","crop_image":"Crop Image","profession":"Profissao","error_message":"Error","and":"e","add_language":"Adicione um idioma","click_here":"Clique aqui","new":"New","please_wait":"Please wait..."},"common.message":{"vat_number_hint":"If you provide a valid EU VAT number, we will invoice you without VAT. This number starts with an EU country code (eg {{country_code}}) usually followed by your national tax ID number, for more information {{link}}","delete_confirm":"Are you sure you want to delete this?","post_view_count_plural":"Este post foi visto por {{value}} vezes","decimals_not_allowed":"Price modified, please review field: decimals are not allowed","cif_nif_hint":"CIF/NIF is required if you would like to receive an invoice","continue_without_saving_warning":"Se voce continuar sem salvar perdera todas as atulizacoes ja feitas","cropping_only_new_images":"Cropping only available for new images","change_on_new_language":"Change your account language to {{language}}","post_view_count_singular":"Este post foi visto por {{value}} vez"},"common.maps":{"wrong_marker_place":"Not in the right place? Drag me!","refresh_map":"Refresh map","center_marker":"Centre marker","hide_map":"Hide map","preview_map":"apresenta\u00e7\u00e3o no mapa"}},"id":{"common":{"organisation_name":"Organisation Name","convert_to_another_currency":"Convert to another currency","cif_nif":"CIF/NIF","cancel":"Batalkan","crop":"Crop","not_available":"Not available","loading":"Mengunggah","popular_areas":"Area populer","please_confirm_deletion":"Tolong konfirmasi penghapusan","html":"HTML","select_image":"Pilih gambar","visual":"Visual","remove_from_favourites":"Hilangkan dari favorit","vat_number":"EU VAT Number","company_name":"Nama Perusahaan","add_to_favourites":"Tambahkan ke favorit","remove":"hilangkan","company_number":"Nomor Perusahaan","crop_image":"Crop Image","profession":"Profesi","error_message":"Error","and":"dan","add_language":"Tambah bahasa","click_here":"klik di sini","new":"New","please_wait":"Please wait..."},"common.message":{"vat_number_hint":"If you provide a valid EU VAT number, we will invoice you without VAT. This number starts with an EU country code (eg {{country_code}}) usually followed by your national tax ID number, for more information {{link}}","delete_confirm":"Are you sure you want to delete this?","post_view_count_plural":"Posting ini telah dilihat {{value}} kali","decimals_not_allowed":"Price modified, please review field: decimals are not allowed","cif_nif_hint":"CIF/NIF is required if you would like to receive an invoice","continue_without_saving_warning":"Jika Anda melanjutkan, semua perubahan akan hilang","cropping_only_new_images":"Cropping only available for new images","change_on_new_language":"Change your account language to {{language}}","post_view_count_singular":"Posting ini telah dilihat {{value}} kali"},"common.maps":{"wrong_marker_place":"Not in the right place? Drag me!","refresh_map":"Refresh map","center_marker":"Centre marker","hide_map":"Sembunyikan peta","preview_map":"Pratayang peta"}},"ar":{"common":{"organisation_name":"Organisation Name","convert_to_another_currency":"Convert to another currency","cif_nif":"CIF/NIF","cancel":"\u0625\u0644\u063a\u0627\u0621","crop":"Crop","not_available":"Not available","loading":"\u062c\u0627\u0631\u064a \u062a\u062d\u0645\u064a\u0644","popular_areas":"Popular areas","please_confirm_deletion":"Please confirm deletion","html":"HTML","select_image":"\u0627\u062e\u062a\u0631 \u0635\u0648\u0631\u0629","visual":"Visual","remove_from_favourites":"Remove from favourites","vat_number":"EU VAT Number","company_name":"Company Name","add_to_favourites":"Add to favourites","remove":"\u062d\u0630\u0641","company_number":"Company Number","crop_image":"Crop Image","profession":"\u0627\u0644\u0645\u0647\u0646\u0629","error_message":"Error","and":"\u0648","add_language":"\u0625\u0636\u0627\u0641\u0629 \u0644\u063a\u0629","click_here":"\u0627\u0636\u063a\u0637 \u0647\u0646\u0627","new":"New","please_wait":"Please wait..."},"common.message":{"vat_number_hint":"If you provide a valid EU VAT number, we will invoice you without VAT. This number starts with an EU country code (eg {{country_code}}) usually followed by your national tax ID number, for more information {{link}}","delete_confirm":"Are you sure you want to delete this?","post_view_count_plural":"\u062a\u0645 \u0627\u0633\u062a\u0639\u0631\u0627\u0636 \u0647\u0630\u0627 \u0627\u0644\u0637\u0631\u062d {{value}} \u0645\u0631\u0629","decimals_not_allowed":"Price modified, please review field: decimals are not allowed","cif_nif_hint":"CIF/NIF is required if you would like to receive an invoice","continue_without_saving_warning":"\u0625\u0630\u0627 \u0627\u0633\u062a\u0645\u0631\u064a\u062a \u0628\u062f\u0648\u0646 \u062d\u0641\u0638 \u0627\u0644\u0645\u0639\u0644\u0648\u0645\u0627\u062a\u060c \u0641\u0633\u0648\u0641 \u062a\u0641\u0642\u062f \u062c\u0645\u064a\u0639 \u0627\u0644\u062a\u063a\u064a\u064a\u0631\u0627\u062a \u0627\u0644\u062a\u064a \u0623\u062c\u0631\u064a\u062a\u0647\u0627","cropping_only_new_images":"Cropping only available for new images","change_on_new_language":"Change your account language to {{language}}","post_view_count_singular":"\u062a\u0645 \u0627\u0633\u062a\u0639\u0631\u0627\u0636 \u0647\u0630\u0627 \u0627\u0644\u0637\u0631\u062d {{value}} \u0645\u0631\u0629"},"common.maps":{"wrong_marker_place":"Not in the right place? Drag me!","refresh_map":"Refresh map","center_marker":"Centre marker","hide_map":"Hide map","preview_map":"\u0627\u0633\u062a\u0639\u0631\u0636 \u0627\u0644\u062e\u0631\u064a\u0637\u0629"}},"pl":{"common":{"organisation_name":"Nazwa organizacji","convert_to_another_currency":"Przelicz waluty","cif_nif":"CIF/NIF ","cancel":"Anuluj","crop":"Przytnij","not_available":"Niedost\u0119pny","loading":"\u0141adowanie","popular_areas":"Popularne miejsca","please_confirm_deletion":"Czy na pewno chcesz usun\u0105\u0107 to og\u0142oszenie?","html":"HTML","select_image":"Wybierz obrazek","visual":"Podgl\u0105d rzeczywisty","remove_from_favourites":"Usu\u0144 z ulubionych","vat_number":"Numer VAT","company_name":"Nazwa firmy","add_to_favourites":"Dodaj do ulubionych","remove":"Usu\u0144","company_number":"Numer firmy","crop_image":"Przytnij obraz","profession":"Zaj\u0119cie","error_message":"B\u0142\u0105d","and":"i","add_language":"Dodaj j\u0119zyk","click_here":"Kliknij tutaj","new":"Nowy","please_wait":"Prosz\u0119 czeka\u0107..."},"jobs.cv":{"select_cv":"Do\u0142\u0105cz swoje CV"},"errors.standard.cookies_needed_exception":{"text":"W\u0142\u0105cz obs\u0142ug\u0119 cookies, aby cieszy\u0107 si\u0119 pe\u0142n\u0105 funkcjonalno\u015bci\u0105"},"common.message":{"vat_number_hint":"Ten numer zaczyna si\u0119 od kodu kraju, np. [{{country_code}}], po kt\u00f3rym najcz\u0119\u015bciej nast\u0119puje NIP. Aby uzyska\u0107 wi\u0119cej informacji {{link}}","delete_confirm":"Czy na pewno chcesz to usun\u0105\u0107?","post_view_count_plural":"Ten post obejrzano {{value}} razy","decimals_not_allowed":"Zmiana ceny - prosimy nie u\u017cywac liczb dziesi\u0119tnych","cif_nif_hint":"Numer CIF/NIF jest wymagany, je\u017celi chcesz otrzymac faktur\u0119","continue_without_saving_warning":"Jesli kontynuujesz bez zapisania, stracisz wszystkie zmiany kt\u00f3re nanios\u0142e\u015b","cropping_only_new_images":"Mo\u017cna przyci\u0105\u0107 tylko nowe obrazy","change_on_new_language":"Zmie\u0144 ustawienia swojego konta na j\u0119zyk {{language}}","post_view_count_singular":"Ten post obejrzano {{value}} raz"},"common.maps":{"wrong_marker_place":"Jestem w niew\u0142a\u015bciwym miejscu? Przestaw mnie! ","refresh_map":"Od\u015bwie\u017c map\u0119","center_marker":"Wycentruj marker","hide_map":"Schowaj map\u0119","preview_map":"Podgl\u0105d mapy"}},"he":{"common":{"organisation_name":"Organisation Name","convert_to_another_currency":"Convert to another currency","cif_nif":"CIF/NIF","cancel":"\u05d1\u05d8\u05dc","crop":"Crop","not_available":"Not available","loading":"\u05d8\u05d5\u05e2\u05df","popular_areas":"Popular areas","please_confirm_deletion":"Please confirm deletion","html":"HTML","select_image":"\u05d1\u05d7\u05e8 \u05ea\u05de\u05d5\u05e0\u05d4","visual":"Visual","remove_from_favourites":"Remove from favourites","vat_number":"EU VAT Number","company_name":"Company Name","add_to_favourites":"Add to favourites","remove":"\u05d4\u05e1\u05e8","company_number":"Company Number","crop_image":"Crop Image","profession":"\u05de\u05e7\u05e6\u05d5\u05e2","error_message":"Error","and":"\u05d5","add_language":"\u05d4\u05d5\u05e1\u05e3 \u05e9\u05e4\u05d4","click_here":"\u05dc\u05d7\u05e5 \u05db\u05d0\u05df","new":"New","please_wait":"Please wait..."},"common.message":{"vat_number_hint":"If you provide a valid EU VAT number, we will invoice you without VAT. This number starts with an EU country code (eg {{country_code}}) usually followed by your national tax ID number, for more information {{link}}","delete_confirm":"Are you sure you want to delete this?","post_view_count_plural":"\u05d4\u05d5\u05d3\u05e2\u05d4 \u05d6\u05d5 \u05e0\u05e6\u05e4\u05ea\u05d4 {{value}} \u05e4\u05e2\u05de\u05d9\u05dd","decimals_not_allowed":"Price modified, please review field: decimals are not allowed","cif_nif_hint":"CIF/NIF is required if you would like to receive an invoice","continue_without_saving_warning":"\u05d0\u05dd \u05ea\u05de\u05e9\u05d9\u05da/\u05d9 \u05de\u05d1\u05dc\u05d9 \u05dc\u05e9\u05de\u05d5\u05e8 \u05ea\u05d0\u05d1\u05d3 \u05d0\u05ea \u05db\u05dc \u05d4\u05e9\u05d9\u05e0\u05d5\u05d9\u05d9\u05dd \u05e9\u05d1\u05d9\u05e6\u05e2\u05ea","cropping_only_new_images":"Cropping only available for new images","change_on_new_language":"Change your account language to {{language}}","post_view_count_singular":"\u05d4\u05d5\u05d3\u05e2\u05d4 \u05d6\u05d5 \u05e0\u05e6\u05e4\u05ea\u05d4 {{value}} \u05e4\u05e2\u05de\u05d9\u05dd"},"common.maps":{"wrong_marker_place":"Not in the right place? Drag me!","refresh_map":"Refresh map","center_marker":"Centre marker","hide_map":"Hide map","preview_map":"\u05ea\u05e6\u05d5\u05d2\u05d4 \u05de\u05e7\u05d3\u05d9\u05de\u05d4 \u05e9\u05dc \u05d4\u05de\u05e4\u05d4"}},"el":{"common":{"organisation_name":"Organisation Name","convert_to_another_currency":"Convert to another currency","cif_nif":"CIF/NIF","cancel":"\u0391\u03ba\u03cd\u03c1\u03c9\u03c3\u03b7","crop":"Crop","not_available":"Not available","loading":"\u03a6\u03cc\u03c1\u03c4\u03c9\u03c3\u03b7","popular_areas":"Popular areas","please_confirm_deletion":"Please confirm deletion","html":"HTML","select_image":"\u0395\u03c0\u03b9\u03bb\u03bf\u03b3\u03ae \u03b5\u03b9\u03ba\u03cc\u03bd\u03b1\u03c2","visual":"Visual","remove_from_favourites":"Remove from favourites","vat_number":"EU VAT Number","company_name":"Company Name","add_to_favourites":"Add to favourites","remove":"\u03b1\u03c6\u03b1\u03af\u03c1\u03b5\u03c3\u03b7","company_number":"Company Number","crop_image":"Crop Image","profession":"\u0395\u03c0\u03ac\u03b3\u03b3\u03b5\u03bb\u03bc\u03b1","error_message":"Error","and":"\u03ba\u03b1\u03b9","add_language":"\u03a0\u03c1\u03bf\u03c3\u03b8\u03ad\u03c3\u03c4\u03b5 \u03bc\u03af\u03b1 \u03b3\u03bb\u03ce\u03c3\u03c3\u03b1","click_here":"\u03ba\u03ac\u03bd\u03c4\u03b5 \u03ba\u03bb\u03b9\u03ba \u03b5\u03b4\u03ce","new":"New","please_wait":"Please wait..."},"common.message":{"vat_number_hint":"If you provide a valid EU VAT number, we will invoice you without VAT. This number starts with an EU country code (eg {{country_code}}) usually followed by your national tax ID number, for more information {{link}}","delete_confirm":"Are you sure you want to delete this?","post_view_count_plural":"\u0391\u03c5\u03c4\u03ae \u03b7 \u03ba\u03b1\u03c4\u03b1\u03c7\u03ce\u03c1\u03b7\u03c3\u03b7 \u03ad\u03c7\u03b5\u03b9 \u03b8\u03b5\u03b1\u03b8\u03b5\u03af {{value}} \u03c6\u03bf\u03c1\u03ad\u03c2","decimals_not_allowed":"Price modified, please review field: decimals are not allowed","cif_nif_hint":"CIF/NIF is required if you would like to receive an invoice","continue_without_saving_warning":"\u0391\u03bd \u03c3\u03c5\u03bd\u03b5\u03c7\u03af\u03c3\u03b5\u03c4\u03b5 \u03c7\u03c9\u03c1\u03af\u03c2 \u03bd\u03b1 \u03b1\u03c0\u03bf\u03b8\u03b7\u03ba\u03b5\u03cd\u03c3\u03b5\u03c4\u03b5 \u03b8\u03b1 \u03c7\u03ac\u03c3\u03b5\u03c4\u03b5 \u03cc\u03bb\u03b5\u03c2 \u03c4\u03b9\u03c2 \u03b1\u03bb\u03bb\u03b1\u03b3\u03ad\u03c2 \u03c0\u03bf\u03c5 \u03ad\u03c7\u03b5\u03c4\u03b5 \u03ba\u03ac\u03bd\u03b5\u03b9","cropping_only_new_images":"Cropping only available for new images","change_on_new_language":"Change your account language to {{language}}","post_view_count_singular":"\u0391\u03c5\u03c4\u03ae \u03b7 \u03ba\u03b1\u03c4\u03b1\u03c7\u03ce\u03c1\u03b7\u03c3\u03b7 \u03ad\u03c7\u03b5\u03b9 \u03b8\u03b5\u03b1\u03b8\u03b5\u03af {{value}} \u03c6\u03bf\u03c1\u03ac"},"common.maps":{"wrong_marker_place":"Not in the right place? Drag me!","refresh_map":"Refresh map","center_marker":"Centre marker","hide_map":"Hide map","preview_map":"\u03c0\u03c1\u03bf\u03b5\u03c0\u03b9\u03c3\u03ba\u03cc\u03c0\u03b7\u03c3\u03b7 \u03c7\u03ac\u03c1\u03c4\u03b7"}},"ro":{"common":{"organisation_name":"Organisation Name","convert_to_another_currency":"Convert to another currency","cif_nif":"CIF/NIF","cancel":"Anulare","crop":"Crop","not_available":"Not available","loading":"\u00cenc\u0103rcare","popular_areas":"Popular areas","please_confirm_deletion":"Please confirm deletion","html":"HTML","select_image":"Selectare imagine","visual":"Visual","remove_from_favourites":"Remove from favourites","vat_number":"EU VAT Number","company_name":"Company Name","add_to_favourites":"Add to favourites","remove":"\u015etergere","company_number":"Company Number","crop_image":"Crop Image","profession":"Profesie","error_message":"Error","and":"\u015fi","add_language":"Ad\u0103ugare limba","click_here":"clic aici","new":"New","please_wait":"Please wait..."},"common.message":{"vat_number_hint":"If you provide a valid EU VAT number, we will invoice you without VAT. This number starts with an EU country code (eg {{country_code}}) usually followed by your national tax ID number, for more information {{link}}","delete_confirm":"Are you sure you want to delete this?","post_view_count_plural":"Acest anun\u0163 a fost vizualizat de {{value}} ori","decimals_not_allowed":"Price modified, please review field: decimals are not allowed","cif_nif_hint":"CIF/NIF is required if you would like to receive an invoice","continue_without_saving_warning":"Dac\u0103 continui f\u0103r\u0103 s\u0103 salvezi vei pierde toate modific\u0103rile f\u0103cute","cropping_only_new_images":"Cropping only available for new images","change_on_new_language":"Change your account language to {{language}}","post_view_count_singular":"Acest anun\u0163 a fost vizualizat de {{value}} ori"},"common.maps":{"wrong_marker_place":"Not in the right place? Drag me!","refresh_map":"Refresh map","center_marker":"Centre marker","hide_map":"Hide map","preview_map":"harta de previzualizare"}},"da":{"common":{"organisation_name":"Organisation Name","convert_to_another_currency":"Convert to another currency","cif_nif":"CIF/NIF","cancel":"Annuller","crop":"Crop","not_available":"Not available","loading":"Loader","popular_areas":"Popular areas","please_confirm_deletion":"Please confirm deletion","html":"HTML","select_image":"V\u00e6lge billede","visual":"Visual","remove_from_favourites":"Remove from favourites","vat_number":"EU VAT Number","company_name":"Company Name","add_to_favourites":"Add to favourites","remove":"Fjern","company_number":"Company Number","crop_image":"Crop Image","profession":"Profession","error_message":"Error","and":"og","add_language":"Tilf\u00f8j et sprog","click_here":"klik her","new":"New","please_wait":"Please wait..."},"common.message":{"vat_number_hint":"If you provide a valid EU VAT number, we will invoice you without VAT. This number starts with an EU country code (eg {{country_code}}) usually followed by your national tax ID number, for more information {{link}}","delete_confirm":"Are you sure you want to delete this?","post_view_count_plural":"Denne post er blevet set {{value}} gange","decimals_not_allowed":"Price modified, please review field: decimals are not allowed","cif_nif_hint":"CIF/NIF is required if you would like to receive an invoice","continue_without_saving_warning":"Hvis du forts\u00e6tter uden at gemme vil du miste alle de \u00e6ndringer, du har foretaget","cropping_only_new_images":"Cropping only available for new images","change_on_new_language":"Change your account language to {{language}}","post_view_count_singular":"Denne post er blevet set {{value}} gange"},"common.maps":{"wrong_marker_place":"Not in the right place? Drag me!","refresh_map":"Refresh map","center_marker":"Centre marker","hide_map":"Hide map","preview_map":"se kort"}},"tr":{"common":{"organisation_name":"Organisation Name","convert_to_another_currency":"Convert to another currency","cif_nif":"CIF/NIF","cancel":"\u0130ptal et","crop":"Crop","not_available":"Not available","loading":"Y\u00fckleniyor","popular_areas":"Popular areas","please_confirm_deletion":"Please confirm deletion","html":"HTML","select_image":"G\u00f6r\u00fcnt\u00fc se\u00e7","visual":"Visual","remove_from_favourites":"Remove from favourites","vat_number":"EU VAT Number","company_name":"Company Name","add_to_favourites":"Add to favourites","remove":"Kald\u0131r","company_number":"Company Number","crop_image":"Crop Image","profession":"Meslek","error_message":"Error","and":"ve","add_language":"Bir dil ekle","click_here":"buraya t\u0131klay\u0131n","new":"New","please_wait":"Please wait..."},"common.message":{"vat_number_hint":"If you provide a valid EU VAT number, we will invoice you without VAT. This number starts with an EU country code (eg {{country_code}}) usually followed by your national tax ID number, for more information {{link}}","delete_confirm":"Are you sure you want to delete this?","post_view_count_plural":"Bu g\u00f6nderi {{value}} defa g\u00f6r\u00fcnt\u00fclendi","decimals_not_allowed":"Price modified, please review field: decimals are not allowed","cif_nif_hint":"CIF/NIF is required if you would like to receive an invoice","continue_without_saving_warning":"Kaydetmeden devam ederseniz yapt\u0131\u011f\u0131n\u0131z t\u00fcm de\u011fi\u015fiklikleri kaybedeceksiniz. ","cropping_only_new_images":"Cropping only available for new images","change_on_new_language":"Change your account language to {{language}}","post_view_count_singular":"Bu g\u00f6nderi {{value}} defa g\u00f6r\u00fcnt\u00fclendi"},"common.maps":{"wrong_marker_place":"Not in the right place? Drag me!","refresh_map":"Refresh map","center_marker":"Centre marker","hide_map":"Hide map","preview_map":"harita \u00f6nizleme"}},"vi":{"common":{"organisation_name":"Organisation Name","convert_to_another_currency":"Convert to another currency","cif_nif":"CIF/NIF","cancel":"Hu\u1ef7 b\u1ecf","crop":"Crop","not_available":"Not available","loading":"\u0110ang t\u1ea3i","popular_areas":"Popular areas","please_confirm_deletion":"Please confirm deletion","html":"HTML","select_image":"L\u1ef1a ch\u1ecdn h\u00ecnh \u1ea3nh","visual":"Visual","remove_from_favourites":"Remove from favourites","vat_number":"EU VAT Number","company_name":"Company Name","add_to_favourites":"Add to favourites","remove":"Lo\u1ea1i b\u1ecf","company_number":"Company Number","crop_image":"Crop Image","profession":"Ngh\u1ec1 nghi\u1ec7p","error_message":"Error","and":"v\u00e0","add_language":"Th\u00eam v\u00e0o m\u1ed9t ng\u00f4n ng\u1eef","click_here":"Nh\u1ea5p v\u00e0o \u0111\u00e2y","new":"New","please_wait":"Please wait..."},"common.message":{"vat_number_hint":"If you provide a valid EU VAT number, we will invoice you without VAT. This number starts with an EU country code (eg {{country_code}}) usually followed by your national tax ID number, for more information {{link}}","delete_confirm":"Are you sure you want to delete this?","post_view_count_plural":"B\u00e0i \u0111\u0103ng n\u00e0y \u0111\u00e3 c\u00f3 {{value}} l\u1ea7n xem","decimals_not_allowed":"Price modified, please review field: decimals are not allowed","cif_nif_hint":"CIF/NIF is required if you would like to receive an invoice","continue_without_saving_warning":"N\u1ebfu b\u1ea1n ti\u1ebfp t\u1ee5c m\u00e0 kh\u00f4ng l\u01b0u l\u1ea1i b\u1ea1n s\u1ebd m\u1ea5t t\u1ea5t c\u1ea3 nh\u1eefng thay \u0111\u1ed5i b\u1ea1n \u0111\u00e3 th\u1ef1c hi\u1ec7n","cropping_only_new_images":"Cropping only available for new images","change_on_new_language":"Change your account language to {{language}}","post_view_count_singular":"B\u00e0i \u0111\u0103ng n\u00e0y \u0111\u00e3 c\u00f3 {{value}} l\u1ea7n xem"},"common.maps":{"wrong_marker_place":"Not in the right place? Drag me!","refresh_map":"Refresh map","center_marker":"Centre marker","hide_map":"Hide map","preview_map":"xem tr\u01b0\u1edbc b\u1ea3n \u0111\u1ed3"}},"nl":{"common":{"organisation_name":"Naam Organisatie","convert_to_another_currency":"Omzetten in een andere munteenheid","cif_nif":"Fiscale identificatie","cancel":"Annuleren","crop":"Opbrengst","not_available":"Niet beschikbaar","loading":"Laden","popular_areas":"Populaire plekken","please_confirm_deletion":"Gelieve te bevestigen","html":"HTML","select_image":"Kies afbeelding","visual":"Visueel","remove_from_favourites":"Verwijder uit favorieten","vat_number":"EU BTW nummer","company_name":"Bedrijfsnaam","add_to_favourites":"Voeg toe aan je favorieten","remove":"Verwijder","company_number":"Bedrijfsnummer","crop_image":"Foto verkleinen","profession":"Beroep","error_message":"Fout","and":"en","add_language":"Voeg een taal toe","click_here":"klik hier","new":"Nieuw","please_wait":"Wacht a.u.b."},"jobs.cv":{"select_cv":"Kies een bestand voor je CV"},"errors.standard.cookies_needed_exception":{"text":"Gelieve cookies toe te staan om van alle functionaliteiten te genieten"},"common.message":{"vat_number_hint":"Als je een geldige EU BTW-nummer geeft, zullen we jou een factuur sturen zonder BTW. Dit nummer begint met een landscode, bvb {{country_code}} gevolgd door je nationaal belastingsnummer, voor meer informatie {{link}}","delete_confirm":"Ben je zeker dat je dit wilt deleten?","post_view_count_plural":"Dit bericht is {{value}} keer bekeken","decimals_not_allowed":"Aangepaste prijs, controleer het veld opnieuw a.u.b.: decimalen zijn niet toegelaten","cif_nif_hint":"SFN is vereist indien je een factuur wenst","continue_without_saving_warning":"Als je verder gaat zal je alle veranderingen kwijt zijn","cropping_only_new_images":"Bijsnijden kan men enkel bij nieuwe afbeeldingen","change_on_new_language":"Verander je account taal naar {{language}}","post_view_count_singular":"Dit bericht is {{value}} keer bekeken"},"common.maps":{"wrong_marker_place":"Niet op de juiste plaats? Versleep me!","refresh_map":"Vernieuw kaart","center_marker":"Centrum marker","hide_map":"Verberg kaart","preview_map":"Kaart bekijken"}},"th":{"common":{"organisation_name":"Organisation Name","convert_to_another_currency":"Convert to another currency","cif_nif":"CIF/NIF","cancel":"\u0e22\u0e01\u0e40\u0e25\u0e34\u0e01","crop":"Crop","not_available":"Not available","loading":"\u0e01\u0e33\u0e25\u0e31\u0e07\u0e42\u0e2b\u0e25\u0e14","popular_areas":"Popular areas","please_confirm_deletion":"Please confirm deletion","html":"HTML","select_image":"\u0e40\u0e25\u0e37\u0e2d\u0e01\u0e23\u0e39\u0e1b\u0e20\u0e32\u0e1e","visual":"Visual","remove_from_favourites":"Remove from favourites","vat_number":"EU VAT Number","company_name":"Company Name","add_to_favourites":"Add to favourites","remove":"\u0e25\u0e1a","company_number":"Company Number","crop_image":"Crop Image","profession":"\u0e2d\u0e32\u0e0a\u0e35\u0e1e","error_message":"Error","and":"\u0e41\u0e25\u0e30","add_language":"\u0e40\u0e1e\u0e34\u0e48\u0e21\u0e20\u0e32\u0e29\u0e32","click_here":"\u0e04\u0e25\u0e34\u0e01\u0e17\u0e35\u0e48\u0e19\u0e35\u0e48","new":"New","please_wait":"Please wait..."},"common.message":{"vat_number_hint":"If you provide a valid EU VAT number, we will invoice you without VAT. This number starts with an EU country code (eg {{country_code}}) usually followed by your national tax ID number, for more information {{link}}","delete_confirm":"Are you sure you want to delete this?","post_view_count_plural":"\u0e42\u0e1e\u0e2a\u0e15\u0e4c\u0e19\u0e35\u0e49\u0e44\u0e14\u0e49\u0e16\u0e39\u0e01\u0e40\u0e1b\u0e34\u0e14\u0e14\u0e39 {{value}} \u0e04\u0e23\u0e31\u0e49\u0e07","decimals_not_allowed":"Price modified, please review field: decimals are not allowed","cif_nif_hint":"CIF/NIF is required if you would like to receive an invoice","continue_without_saving_warning":"\u0e16\u0e49\u0e32\u0e04\u0e38\u0e13\u0e22\u0e31\u0e07\u0e04\u0e07\u0e14\u0e33\u0e40\u0e19\u0e34\u0e19\u0e01\u0e32\u0e23\u0e15\u0e48\u0e2d\u0e42\u0e14\u0e22\u0e44\u0e21\u0e48\u0e21\u0e35\u0e01\u0e32\u0e23\u0e1a\u0e31\u0e19\u0e17\u0e36\u0e01 \u0e2a\u0e34\u0e48\u0e07\u0e17\u0e35\u0e48\u0e04\u0e38\u0e13\u0e44\u0e14\u0e49\u0e41\u0e01\u0e49\u0e44\u0e02\u0e08\u0e30\u0e2b\u0e32\u0e22\u0e44\u0e1b\u0e2b\u0e21\u0e14","cropping_only_new_images":"Cropping only available for new images","change_on_new_language":"Change your account language to {{language}}","post_view_count_singular":"\u0e42\u0e1e\u0e2a\u0e15\u0e4c\u0e19\u0e35\u0e49\u0e44\u0e14\u0e49\u0e16\u0e39\u0e01\u0e40\u0e1b\u0e34\u0e14\u0e14\u0e39 {{value}} \u0e04\u0e23\u0e31\u0e49\u0e07"},"common.maps":{"wrong_marker_place":"Not in the right place? Drag me!","refresh_map":"Refresh map","center_marker":"Centre marker","hide_map":"Hide map","preview_map":"\u0e41\u0e1c\u0e19\u0e17\u0e35\u0e48\u0e1e\u0e23\u0e35\u0e27\u0e34\u0e27"}},"ml":{"common":{"organisation_name":"Organisation Name","convert_to_another_currency":"Convert to another currency","cif_nif":"CIF/NIF","cancel":"\u0d35\u0d47\u0d23\u0d4d\u0d1f\u0d46\u0d28\u0d4d\u0d28\u0d41\u0d35\u0d2f\u0d4d\u0d15\u0d4d\u0d15\u0d41\u0d15","crop":"Crop","not_available":"Not available","loading":"\u0d32\u0d4b\u0d21\u0d4d \u0d1a\u0d46\u0d2f\u0d4d\u0d2f\u0d2a\u0d4d\u0d2a\u0d46\u0d1f\u0d41\u0d28\u0d4d\u0d28\u0d41..","popular_areas":"Popular areas","please_confirm_deletion":"Please confirm deletion","html":"HTML","select_image":"\u0d1a\u0d3f\u0d24\u0d4d\u0d30\u0d02 \u0d24\u0d3f\u0d30\u0d1e\u0d4d\u0d1e\u0d46\u0d1f\u0d41\u0d15\u0d4d\u0d15\u0d41\u0d15","visual":"Visual","remove_from_favourites":"Remove from favourites","vat_number":"EU VAT Number","company_name":"Company Name","add_to_favourites":"Add to favourites","remove":"\u0d28\u0d40\u0d15\u0d4d\u0d15\u0d02 \u0d1a\u0d46\u0d2f\u0d4d\u0d2f\u0d41\u0d15","company_number":"Company Number","crop_image":"Crop Image","profession":"\u0d14\u0d26\u0d4d\u0d2f\u0d4b\u0d17\u0d3f\u0d15 \u0d30\u0d02\u0d17\u0d02","error_message":"Error","and":"\u0d15\u0d42\u0d1f\u0d3e\u0d24\u0d46","add_language":"\u0d12\u0d30\u0d41 \u0d2d\u0d3e\u0d37\u0d15\u0d42\u0d1f\u0d3f \u0d1a\u0d47\u0d30\u0d4d\u200d\u0d15\u0d4d\u0d15\u0d41\u0d15","click_here":"\u0d07\u0d35\u0d3f\u0d1f\u0d46 \u0d15\u0d4d\u0d32\u0d3f\u0d15\u0d4d\u0d15\u0d4d \u0d1a\u0d46\u0d2f\u0d4d\u0d2f\u0d41\u0d15","new":"New","please_wait":"Please wait..."},"common.message":{"vat_number_hint":"If you provide a valid EU VAT number, we will invoice you without VAT. This number starts with an EU country code (eg {{country_code}}) usually followed by your national tax ID number, for more information {{link}}","delete_confirm":"Are you sure you want to delete this?","post_view_count_plural":"\u0d08 \u0d2a\u0d4b\u0d38\u0d4d\u0d31\u0d4d\u0d31\u0d3f\u0d19\u0d4d\u0d19\u0d4d {{value}} \u0d24\u0d35\u0d23\u0d15\u0d33\u0d4d\u200d \u0d15\u0d23\u0d4d\u0d1f\u0d3f\u0d30\u0d3f\u0d15\u0d4d\u0d15\u0d41\u0d28\u0d4d\u0d28\u0d41","decimals_not_allowed":"Price modified, please review field: decimals are not allowed","cif_nif_hint":"CIF/NIF is required if you would like to receive an invoice","continue_without_saving_warning":"\u0d38\u0d47\u0d35\u0d4d \u0d1a\u0d46\u0d2f\u0d4d\u0d2f\u0d3e\u0d24\u0d46 \u0d28\u0d3f\u0d19\u0d4d\u0d19\u0d33\u0d4d\u200d \u0d24\u0d41\u0d1f\u0d30\u0d41\u0d15\u0d2f\u0d3e\u0d23\u0d46\u0d19\u0d4d\u0d15\u0d3f\u0d32\u0d4d\u200d \u0d28\u0d3f\u0d19\u0d4d\u0d19\u0d33\u0d4d\u200d \u0d1a\u0d46\u0d2f\u0d4d\u0d24\u0d4d \u0d0e\u0d32\u0d4d\u0d32\u0d3e \u0d2e\u0d3e\u0d31\u0d4d\u0d31\u0d19\u0d4d\u0d19\u0d33\u0d41\u0d02 \u0d28\u0d37\u0d4d\u0d1f\u0d2e\u0d3e\u0d15\u0d41\u0d02. ","cropping_only_new_images":"Cropping only available for new images","change_on_new_language":"Change your account language to {{language}}","post_view_count_singular":"\u0d08 \u0d2a\u0d4b\u0d38\u0d4d\u0d31\u0d4d\u0d31\u0d3f\u0d19\u0d4d\u0d19\u0d4d {{value}} \u0d24\u0d35\u0d23 \u0d15\u0d23\u0d4d\u0d1f\u0d3f\u0d30\u0d3f\u0d15\u0d4d\u0d15\u0d41\u0d28\u0d4d\u0d28\u0d41"},"common.maps":{"wrong_marker_place":"Not in the right place? Drag me!","refresh_map":"Refresh map","center_marker":"Centre marker","hide_map":"Hide map","preview_map":"\u0d2d\u0d42\u0d2a\u0d1f\u0d02 \u0d15\u0d3e\u0d23\u0d41\u0d15"}},"sr":{"common":{"organisation_name":"Organisation Name","convert_to_another_currency":"\u041a\u043e\u043d\u0432\u0435\u0442\u043e\u0432\u0430\u045a\u0435 \u0443 \u0434\u0440\u0443\u0433\u0443 \u0432\u0430\u043b\u0443\u0442\u0443","cif_nif":"\u041f\u043e\u0440\u0435\u0441\u043a\u0438 \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u043e\u043d\u0438 \u0431\u0440\u043e\u0458","cancel":"\u041e\u0442\u043a\u0430\u0436\u0438\u0442\u0435","crop":"Crop","not_available":"\u041d\u0438\u0458\u0435 \u0434\u043e\u0441\u0442\u0443\u043f\u043do/\u0430","loading":"\u0423\u0447\u0438\u0442\u0430\u0432\u0430 \u0441\u0435","popular_areas":"\u041f\u043e\u043f\u0443\u043b\u0430\u0440\u043d\u0435 \u043e\u0431\u043b\u0430\u0441\u0442\u0438","please_confirm_deletion":"\u041c\u043e\u043b\u0438\u043c\u043e \u0412\u0430\u0441 \u043f\u043e\u0442\u0432\u0440\u0434\u0438\u0442\u0435 \u0431\u0440\u0438\u0441\u0430\u045a\u0435","html":"HTML","select_image":"\u041e\u0434\u0430\u0431\u0435\u0440\u0438\u0442\u0435 \u0441\u043b\u0438\u043a\u0443","visual":"Visual","remove_from_favourites":"\u0423\u043a\u043b\u043e\u043d\u0438 \u0438\u0437 \u0444\u0430\u0432\u043e\u0440\u0438\u0442\u0430","vat_number":"\u041f\u0414\u0412 \u0431\u0440\u043e\u0458","company_name":"\u0418\u043c\u0435 \u043f\u0440\u0435\u0434\u0443\u0437\u0435\u045b\u0430","add_to_favourites":"\u0414\u043e\u0434\u0430\u0458\u0442\u0435 \u0443 \u0444\u0430\u0432\u043e\u0440\u0438\u0442\u0435","remove":"\u0423\u043a\u043b\u043e\u043d\u0438\u0442\u0435","company_number":"\u0411\u0440\u043e\u0458 \u043f\u0440\u0435\u0434\u0443\u0437\u0435\u045b\u0430","crop_image":"Crop Image","profession":"\u0417\u0430\u043d\u0438\u043c\u0430\u045a\u0435","error_message":"\u0413\u0440\u0435\u0448\u043a\u0430","and":"\u0438","add_language":"\u0414\u043e\u0434\u0430\u0458\u0442\u0435 \u0458\u0435\u0437\u0438\u043a","click_here":"\u043a\u043b\u0438\u043a\u043d\u0438\u0442\u0435 \u043e\u0432\u0434\u0435","new":"New","please_wait":"Please wait..."},"jobs.cv":{"select_cv":"\u0418\u0437\u0430\u0431\u0435\u0440\u0438\u0442\u0435 \u0434\u0430\u0442\u043e\u0442\u0435\u043a\u0443 \u0437\u0430 \u0412\u0430\u0448 \u0426\u0412"},"errors.standard.cookies_needed_exception":{"text":"\u041c\u043e\u043b\u0438\u043c\u043e \u0412\u0430\u0441 \u0434\u0430 \u043e\u043c\u043e\u0433\u0443\u045b\u0438\u0442\u0435 \u043a\u043e\u043b\u0430\u0447\u0438\u045b\u0435 \u0434\u0430 \u0443\u0436\u0438\u0432\u0430\u0458\u0443 \u043f\u0443\u043d\u0443 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u043d\u043e\u0441\u0442"},"common.message":{"vat_number_hint":"\u041f\u0414\u0412 {{country_code}} {{link}}","delete_confirm":"Are you sure you want to delete this?","post_view_count_plural":"\u041e\u0432\u0430\u0458 \u043e\u0433\u043b\u0430\u0441 \u0458\u0435 \u043f\u0440\u0435\u0433\u043b\u0435\u0434\u0430\u043d {{value}} \u043f\u0443\u0442\u0430","decimals_not_allowed":"\u041f\u0440\u043e\u043c\u0435\u045a\u0435\u043d\u0430 \u0446\u0435\u043d\u0430 \u043f\u0443\u0442, \u043c\u043e\u043b\u0438\u043c\u043e \u0412\u0430\u0441 \u043f\u0440\u0435\u0433\u043b\u0435\u0434\u0430\u0458\u0442\u0435: \u0434\u0435\u0446\u0438\u043c\u0430\u043b\u0438 \u0431\u0440\u043e\u0458\u0435\u0432\u0438 \u043d\u0438\u0441\u0443 \u0434\u043e\u0437\u0432\u043e\u0459\u0435\u043d\u0438","cif_nif_hint":"CIF/NIF is required if you would like to receive an invoice","continue_without_saving_warning":"\u0410\u043a\u043e \u043d\u0430\u0441\u0442\u0430\u0432\u0438\u0442\u0435, \u0412\u0430\u0448\u0435 \u0438\u0437\u043c\u0435\u043d\u0435 \u045b\u0435 \u0431\u0438\u0442\u0438 \u0438\u0437\u0433\u0443\u0431\u0459\u0435\u043d\u0435","cropping_only_new_images":"Cropping only available for new images","change_on_new_language":"\u041f\u0440\u043e\u043c\u0435\u043d\u0438\u0442\u0435 \u0458\u0435\u0437\u0438\u043a \u043d\u0430\u043b\u043e\u0433\u0430 \u0443 {{language}}","post_view_count_singular":"\u041e\u0432\u0430\u0458 \u043e\u0433\u043b\u0430\u0441 \u0458\u0435 \u043f\u0440\u0435\u0433\u043b\u0435\u0434\u0430\u043d {{value}} \u043f\u0443\u0442\u0430"},"common.maps":{"wrong_marker_place":"\u041d\u0435 \u043d\u0430 \u043f\u0440\u0430\u0432\u043e\u043c \u043c\u0435\u0441\u0442\u0443? \u041f\u043e\u0432\u0443\u0446\u0438 \u043c\u0435!","refresh_map":"\u0414\u043e\u043f\u0443\u043d\u0438\u0442\u0435 \u043a\u0430\u0440\u0442\u0443 ","center_marker":"\u041c\u0430\u0440\u043a\u0435\u0440 \u0446\u0435\u043d\u0442\u0440\u0430","hide_map":"\u0441\u0430\u043a\u0440\u0438\u0458 \u043a\u0430\u0440\u0442\u0443","preview_map":"\u043f\u0440\u0438\u043a\u0430\u0436\u0438 \u043c\u0430\u043f\u0435"}},"en":{"common":{"organisation_name":"Organisation Name","convert_to_another_currency":"Convert to another currency","cif_nif":"CIF/NIF","cancel":"Cancel","crop":"Crop","not_available":"Not available","loading":"Loading","popular_areas":"Popular areas","please_confirm_deletion":"Please confirm deletion","html":"HTML","select_image":"Select image","visual":"Visual","remove_from_favourites":"Remove from favourites","vat_number":"EU VAT Number","company_name":"Company Name","add_to_favourites":"Add to favourites","remove":"Remove","company_number":"Company Number","crop_image":"Crop Image","profession":"Profession","error_message":"Error","and":"and","add_language":"Add a language","click_here":"click here","new":"New","please_wait":"Please wait..."},"jobs.cv":{"select_cv":"Select a file for your CV"},"errors.standard.cookies_needed_exception":{"text":"Please enable cookies in your browser to use this part of the site"},"common.message":{"vat_number_hint":"If you provide a valid EU VAT number, we will invoice you without VAT. This number starts with an EU country code (eg {{country_code}}) usually followed by your national tax ID number, for more information {{link}}","delete_confirm":"Are you sure you want to delete this?","post_view_count_plural":"This post has been viewed {{value}} times","decimals_not_allowed":"Price modified, please review field: decimals are not allowed","cif_nif_hint":"CIF/NIF is required if you would like to receive an invoice","continue_without_saving_warning":"If you continue you will lose any changes","cropping_only_new_images":"Cropping only available for new images","change_on_new_language":"Change your account language to {{language}}","post_view_count_singular":"This post has been viewed {{value}} time"},"common.maps":{"wrong_marker_place":"Not in the right place? Drag me!","refresh_map":"Refresh map","center_marker":"Centre marker","hide_map":"Hide map","preview_map":"Preview map"}},"lv":{"common":{"organisation_name":"Organisation Name","convert_to_another_currency":"Convert to another currency","cif_nif":"CIF/NIF","cancel":"\r\nAtcelt","crop":"Crop","not_available":"Not available","loading":"Notiek iel\u0101de","popular_areas":"Popular areas","please_confirm_deletion":"Please confirm deletion","html":"HTML","select_image":"Atlas\u012bt att\u0113lu","visual":"Visual","remove_from_favourites":"Remove from favourites","vat_number":"EU VAT Number","company_name":"Company Name","add_to_favourites":"Add to favourites","remove":"Dz\u0113st","company_number":"Company Number","crop_image":"Crop Image","profession":"Profesija","error_message":"Error","and":"un","add_language":"\r\nPievienot valodu","click_here":"\r\nnoklik\u0161\u0137iniet \u0161eit","new":"New","please_wait":"Please wait..."},"common.message":{"vat_number_hint":"If you provide a valid EU VAT number, we will invoice you without VAT. This number starts with an EU country code (eg {{country_code}}) usually followed by your national tax ID number, for more information {{link}}","delete_confirm":"Are you sure you want to delete this?","post_view_count_plural":"\u0160is sludin\u0101jums ir skat\u012bts {{value}} reizes","decimals_not_allowed":"Price modified, please review field: decimals are not allowed","cif_nif_hint":"CIF/NIF is required if you would like to receive an invoice","continue_without_saving_warning":"Ja turpin\u0101siet nesaglab\u0101jot, pazaud\u0113siet visas veikt\u0101s izmai\u0146as","cropping_only_new_images":"Cropping only available for new images","change_on_new_language":"Change your account language to {{language}}","post_view_count_singular":"\u0160is sludin\u0101jums ir skat\u012bts {{value}} reizi"},"common.maps":{"wrong_marker_place":"Not in the right place? Drag me!","refresh_map":"Refresh map","center_marker":"Centre marker","hide_map":"Hide map","preview_map":"priek\u0161skat\u012bt karti"}},"hr":{"common":{"organisation_name":"Organisation Name","convert_to_another_currency":"Convert to another currency","cif_nif":"Porezni identifikacijski broj","cancel":"Odustati","crop":"Crop","not_available":"Not available","loading":"Punjenje","popular_areas":"Popularna mjesta","please_confirm_deletion":"Molimo Vas potvrdite brisanje","html":"HTML","select_image":"Odabrati sliku","visual":"Visual","remove_from_favourites":"Ukloniti iz mojih favorita","vat_number":"PDV broj","company_name":"Ime poduze\u0107a","add_to_favourites":"Dodati u favorite","remove":"Ukloniti","company_number":"Broj poduze\u0107a","crop_image":"Crop Image","profession":"Struka","error_message":"Gre\u0161ka","and":"i","add_language":"Dodati jezik","click_here":"Kliknite ovdje","new":"New","please_wait":"Please wait..."},"jobs.cv":{"select_cv":"Odaberite dosje za Va\u0161 \u017eivotopis"},"errors.standard.cookies_needed_exception":{"text":"Molimo Vas omogu\u0107ite kola\u010di\u0107e da u\u017eivate u punoj funkcionalnosti"},"common.message":{"vat_number_hint":"Broj zapo\u010dinje kodom dr\u017eave, npr. {{country_code}} i onda op\u010denito slijedi Va\u0161 dr\u017eavni porezni broj. Za daljne informacije kliknite {{link}}","delete_confirm":"Are you sure you want to delete this?","post_view_count_plural":"Ovaj oglas je gledan {{value}} puta","decimals_not_allowed":"Price modified, please review field: decimals are not allowed","cif_nif_hint":"CIF/NIF is required if you would like to receive an invoice","continue_without_saving_warning":"Ako nastavite izgubit \u0107ete sve izmjene","cropping_only_new_images":"Cropping only available for new images","change_on_new_language":"Promijenite jezik svog korisni\u010dkog ra\u010duna u {{language}}","post_view_count_singular":"Ovaj oglas je gledan {{value}} put"},"common.maps":{"wrong_marker_place":"Nije na pravom mjestu? Povuci me!","refresh_map":"Obnoviti kartu","center_marker":"Oznaka centra","hide_map":"Sakriti kartu","preview_map":"Prikazati kartu"}}}
LanguageDetectionRules=[{"language_id":7,"terms":["til","tak","arbejde","forsikre","bolig","rum","l\u00e6ngere","\u00e6lge","udkig","sicker","rummelig"]},{"language_id":8,"terms":["der","zu","das","mit","sich","auf","f\u00fcr","ist","dem","nicht","ein","eine","auch","werden","ich","aus","wird","bei","sind","zimmer","wohnung","vermieten","mieten","mich","auf","mir","zum","haben","wir","hat","wg","wie","nach"]},{"language_id":11,"terms":["sealt","v\u00e4lja","siis","muu","palun","t\u00e4nan","teid","t\u00f6\u00f6","eluaseme","tuba","kus"]},{"language_id":10,"terms":["very","the","that","my","for","and","you","from","pictures","nice","be"]},{"language_id":39,"terms":["ir","los","las","muy","mucho","mucha","eso","esto","esa","estoy","soy","tengo","tenemos","esta","estan","busco","hacer","todo","toda","desde","alquilo","alquilar","habitaci\u00f3n","vivienda","trastero","parcela"]},{"language_id":14,"terms":["eux","dans","pour","des","je","ce","nous","sommes","suis","allons","avons","vends","celles","celui","ont","vont","une"]},{"language_id":52,"terms":["od","za","moj","moje","mom","bih","moglo","mogli"]},{"language_id":57,"terms":["sangat","yang","yang","saya","untuk","dan","kau","dari","gambar","bagus","akan"]},{"language_id":21,"terms":["gli","da","poi","io","ho","sto","nel","nella","cerco","cercando","altri","altro","prego","grazie","degli","lavoro","alloggio","stanza","dove","pi"]},{"language_id":26,"terms":["uz","cits","l\u016bdzu","paldies","jums","darbs","dz\u012bvok\u013cu","telpu","kur"]},{"language_id":19,"terms":["majd","vagyok","egy\u00e9b","k\u00e9rem","k\u00f6sz\u00f6n\u00f6m","munka","lak\u00e1s","szoba","ahol"]},{"language_id":32,"terms":["een","op","voor","koop","gevraagd","aangeboden","nieuw","met","het","staat"]},{"language_id":33,"terms":["sikre","arbeid","jakt","bolig","rom","hvor","kundenes","rofesjonelt","ytterligere","trygg","leiligheter"]},{"language_id":34,"terms":["aby","albowiem","a\u017ceby","bowiem","by\u0107","ciebie","coraz","dla","jestem","jest","kt\u00f3ry","mieszkanie","mimo","m\u00f3j","od","\u00f3w","pok\u00f3j","poniewa\u017c","praca","tamten","ty","wed\u0142ug","wy","\u017ce","\u017ceby"]},{"language_id":35,"terms":["em","algum","outro","sem","bem","boa","bom","n\u00e3o","voc\u00ea","novo","nova","muito","pre\u00e7o","emprego","seu","neste","qualquer","assim","uma","constru\u00e7\u00e3o","resid\u00eancia","banho"]},{"language_id":37,"terms":["\u0438","\u044f","\u0432\u044b","\u0438\u0437","\u0434\u043b\u044f","\u043a\u043e\u0433\u0434\u0430","\u0432\u0441\u0435","\u043a\u043e\u0442\u043e\u0440\u044b\u0439","\u0441\u0435\u0439\u0447\u0430\u0441","\u043a\u043e\u043c\u043d\u0430\u0442\u0430","\u0431\u044b\u0442\u044c","\u0434\u0435\u0448\u0435\u0432\u043e","\u0441\u0442\u043e\u0438\u043c\u043e\u0441\u0442\u044c","\u0437\u0430\u043d\u044f\u0442\u043e\u0441\u0442\u044c","\u043c\u0435\u0441\u044f\u0446","\u0430\u0440\u0435\u043d\u0434\u0430","\u043f\u0440\u043e\u0434\u0430\u0436\u0430","\u043a\u0432\u0430\u0440\u0442\u0438\u0440\u0430","\u0437\u0430\u0440\u043f\u043b\u0430\u0442\u0430","\u0446\u0435\u043d\u0442\u0440"," \u0441\u0440\u043e\u043a","\u043e\u043f\u044b\u0442","\u043a\u043e\u043c\u043d\u0430\u0442\u043e\u0439","\u043a\u043e\u043c\u043d\u0430\u0442\u0430","\u0445\u043e\u0440\u043e\u0448\u0438\u0435","\u0445\u043e\u0440\u043e\u0448\u0438\u0439","\u0441\u0442\u043e\u043b\u043e\u0432\u0430\u044f"]},{"language_id":36,"terms":["atunci","sunt","\u00een","cerc","rog","mul\u0163umesc","pentru","locul","munc\u0103","locuin\u0163e","cazul"]},{"language_id":38,"terms":["sa","\u017ee","som","tie","obr\u00e1zky","pekn\u00e9","by\u0165"]},{"language_id":13,"terms":["siis","min\u00e4","olen","ja","muut","kiitos","ty\u00f6","asuminen","huone","jossa"]},{"language_id":40,"terms":["till","f\u00f6rs\u00e4kra","fr\u00e5n","s\u00e4ker","s\u00e4lja","d\u00e5","sn\u00e4lla","tack","arbete","boende","d\u00e4r","yrkesm\u00e4ssig"]},{"language_id":47,"terms":["C\u00e2u","t\u00ecm","gi\u1edbi","\u1edb","ng\u1eef","c\u01a1","b\u1ea1n","c\u00e1","\u0111","B\u1ed9","tr\u1ebb","\u1ee5","\u1ecb"]},{"language_id":44,"terms":["ile","yani","benim","resimleri","g\u00fczel","kimden","olmak"]},{"language_id":9,"terms":["\u03b7","\u03b5\u03c0\u03af\u03c0\u03b5\u03b4\u03b7","\u03b1\u03c5\u03c4\u03cc","\u03cc\u03c4\u03b9","\u03b4\u03b9\u03ba\u03ae","\u03bc\u03bf\u03c5","\u03c3\u03b1\u03c2","\u03b5\u03af\u03bd\u03b1\u03b9","\u03b8\u03ad\u03bb\u03bf\u03c5\u03bc\u03b5","\u03c7\u03c1\u03b5\u03b9\u03ac\u03b6\u03b5\u03c4\u03b1\u03b9","\u03b1\u03bd\u03b1\u03b6\u03b7\u03c4\u03ac","\u03bd\u03b1","\u03b2\u03c1\u03bf\u03cd\u03bc\u03b5"]},{"language_id":59,"terms":["\u043e\u0434","\u0437\u0430","\u043c\u043e\u0458","\u043c\u043e\u0458\u0435","\u043c\u043e\u043c","\u0431\u0438\u0445","\u0431\u0438","\u0441\u0435","\u043c\u043e\u0433\u043b\u043e","\u043c\u043e\u0433\u043b\u0438","\u043d\u0435","\u0434\u0430","\u0441\u0443"]},{"language_id":17,"terms":["\u05d1","\u05d3","\u05d7","\u05e9","\u05e8","\u05d4","\u05e7","\u05e4","\u05ea","\u05e8","\u05e4"]},{"language_id":1,"terms":["\u064a","\u0629","\u0645"," \u062c","\u0644","\u0633","\u0629","\u0644","\u0623","\u0637","\u0644","\u0645","\u0646"]},{"language_id":41,"terms":["\u0bae\u0bc6","\u0baf\u0bcd","\u0baf\u0bc6","\u0bb4\u0bc1","\u0ba4\u0bcd","\u0ba4\u0bc1","\u0bb4","\u0ba4\u0bc1","\u0b95\u0bcd","\u0b95","\u0bb3\u0bcd"]},{"language_id":28,"terms":["\u0d32\u0d4d\u0d36\u0d3f","\u0d31\u0d4d\u0d31\u0d3f","\u0d28\u0d4d\u0d24\u0d4d\u0d2f\u0d3f","\u0d35","\u0d0e","\u0d34\u0d41","\u0d24\u0d4d\u0d24\u0d41","\u0d30\u0d40","\u0d24\u0d3f"]},{"language_id":43,"terms":["\u0e1e\u0e37\u0e48","\u0e19","\u0e1e\u0e31","\u0e2d","\u0e23\u0e4c","\u0e32","\u0e22","\u0e02","\u0e07","\u0e1e"]},{"language_id":48,"terms":["\u4e2d","\u6587","\u91d1","\u4eba","\u5b50","\u516c","\u8ba1","\u7ecf","\u76ee"]},{"language_id":23,"terms":["\u3057","\u6027","\u30a2","\u3066","\u5165","\u30fc"," \u672c"," \u65e5","\u30aa","\u4eba","\u30c3","\u30e0","\u30af","\u5177","\u7537","\u81ea"]},{"language_id":25,"terms":["\ud31d\ub2c8\ub2e4","\uc0bd\ub2c8\ub2e4","\uadf8\ub9ac\uace0","\uc788\uc2b5\ub2c8\ub2e4","\uc788\ub2e4","\ub294","\uc740","\uc5c6\ub2e4","\uc5f0\ub77d","\uc8fc\uc18c","\uc8fc\uc138\uc694","\ud558\uc138\uc694","\uac00","\ub97c","\uc744","\ub098","\ub610\ub294","\ub9cc\uc57d"]}];LanguageCodes={"49":"br","38":"sk","27":"lt","16":"in","5":"cat","55":"ak","44":"tr","33":"no","22":"id","11":"ee","50":"mk","39":"es","28":"in","17":"il","6":"cz","56":"ng","45":"ua","34":"pl","23":"jp","12":"ir","1":"ab","51":"ip","40":"se","29":"in","18":"in","7":"dk","57":"id","46":"ip","35":"pt","24":"in","13":"fi","2":"az","52":"hr","41":"ta","30":"mt","19":"hu","8":"de","58":"ak","47":"vn","36":"ro","25":"kr","14":"fr","3":"bd","53":"ng","42":"in","31":"my","20":"is","9":"gr","59":"rs","48":"cn","37":"ru","26":"lv","15":"ie","4":"bg","54":"ak","43":"th","32":"nl","21":"it","10":"gb"};Currencies={"1794":{"symbol":"G$","code":"GYD","rate":null,"id":147},"166":{"symbol":"TZS","code":"TZS","rate":1935.07,"id":129},"129":{"symbol":"KPW","code":"KPW","rate":null,"id":100},"18":{"symbol":"BZD","code":"BZD","rate":null,"id":17},"55":{"symbol":"ETB","code":"ETB","rate":null,"id":46},"92":{"symbol":"LAK","code":"LAK","rate":null,"id":71},"1813":null,"148":{"symbol":"SCR","code":"SCR","rate":15.6094,"id":115},"37":{"symbol":"\u5143","code":"CNY","rate":8.6609,"id":32},"74":{"symbol":"HNL","code":"HNL","rate":24.0167,"id":56},"111":{"symbol":"MUR","code":"MUR","rate":39.2227,"id":86},"167":{"symbol":"\u0e3f","code":"THB","rate":39.6295,"id":130},"130":{"symbol":"kr","code":"NOK","rate":7.9667,"id":101},"56":{"symbol":"kr","code":"DKK","rate":7.4439,"id":39},"93":{"symbol":"LVL","code":"LVL","rate":0.7092,"id":72},"19":{"symbol":"CFA","code":"XOF","rate":655.903,"id":18},"149":{"symbol":"SLL","code":"SLL","rate":4926.68,"id":116},"75":{"symbol":"HK$","code":"HKD","rate":9.8878,"id":57},"112":{"symbol":"$","code":"MXN","rate":16.7564,"id":87},"1":{"symbol":"AFA","code":"AFA","rate":null,"id":1},"38":{"symbol":"$","code":"COP","rate":2321.51,"id":33},"1796":{"symbol":"\u20ac","code":"EUR","rate":1.0,"id":10},"1093":{"symbol":"PEN","code":"PEN","rate":3.5561,"id":143},"168":{"symbol":"CFA","code":"XOF","rate":655.903,"id":18},"131":{"symbol":"OMR","code":"OMR","rate":0.4895,"id":102},"94":{"symbol":"LBP","code":"LBP","rate":1916.64,"id":73},"20":{"symbol":"BMD","code":"BMD","rate":null,"id":19},"57":{"symbol":"FJD","code":"FJD","rate":2.4978,"id":47},"150":{"symbol":"S$","code":"SGD","rate":1.7197,"id":117},"113":{"symbol":"MDL","code":"MDL","rate":15.4793,"id":88},"2":{"symbol":"ALL","code":"ALL","rate":null,"id":2},"39":{"symbol":"CFA","code":"XOF","rate":655.903,"id":18},"76":{"symbol":"Ft","code":"HUF","rate":286.802,"id":58},"169":{"symbol":"TTD","code":"TTD","rate":8.0289,"id":131},"132":{"symbol":"Rs","code":"PKR","rate":108.864,"id":103},"21":{"symbol":"BTN","code":"BTN","rate":null,"id":20},"58":{"symbol":"\u20ac","code":"EUR","rate":1.0,"id":10},"95":{"symbol":"LSL","code":"LSL","rate":null,"id":74},"151":{"symbol":"\u20ac","code":"EUR","rate":1.0,"id":10},"3":{"symbol":"\u062f\u062c","code":"DZD","rate":95.6074,"id":3},"40":{"symbol":"CDF","code":"CDF","rate":null,"id":34},"77":{"symbol":"ISK","code":"ISK","rate":153.242,"id":59},"114":{"symbol":"\u20ac","code":"EUR","rate":1.0,"id":10},"170":{"symbol":"TND","code":"TND","rate":1.8922,"id":132},"133":{"symbol":"PAB","code":"PAB","rate":null,"id":104},"22":{"symbol":"BOB","code":"BOB","rate":8.9252,"id":21},"59":{"symbol":"\u20ac","code":"EUR","rate":1.0,"id":10},"96":{"symbol":"LRD","code":"LRD","rate":null,"id":75},"152":{"symbol":"\u20ac","code":"EUR","rate":1.0,"id":10},"115":{"symbol":"MNT","code":"MNT","rate":null,"id":89},"4":{"symbol":"ADF","code":"ADF","rate":null,"id":4},"41":{"symbol":"CRC","code":"CRC","rate":641.676,"id":35},"78":{"symbol":"Rs","code":"INR","rate":59.5969,"id":60},"1799":{"symbol":"CVE","code":"CVE","rate":null,"id":148},"171":{"symbol":"TL","code":"TRY","rate":1.9332,"id":133},"134":{"symbol":"PGK","code":"PGK","rate":3.4738,"id":105},"23":{"symbol":"BAM","code":"BAM","rate":null,"id":22},"60":{"symbol":"CFA","code":"XOF","rate":655.903,"id":18},"97":{"symbol":"LYD","code":"LYD","rate":null,"id":76},"153":{"symbol":"SOS","code":"SOS","rate":null,"id":118},"116":{"symbol":"\u20ac","code":"EUR","rate":1.0,"id":10},"5":{"symbol":"AOA","code":"AOA","rate":null,"id":5},"42":{"symbol":"CFA","code":"XOF","rate":655.903,"id":18},"79":{"symbol":"Rp","code":"IDR","rate":11449.0,"id":61},"1726":{"symbol":"\u00a3","code":"GBP","rate":0.8255,"id":135},"172":{"symbol":"AED","code":"AED","rate":4.6695,"id":134},"135":{"symbol":"PYG","code":"PYG","rate":6096.36,"id":106},"24":{"symbol":"BWP","code":"BWP","rate":8.7864,"id":23},"61":{"symbol":"GMD","code":"GMD","rate":null,"id":48},"98":{"symbol":"SFr","code":"CHF","rate":1.29,"id":77},"154":{"symbol":"R","code":"ZAR","rate":9.3658,"id":119},"117":{"symbol":"\u062f.\u0645.","code":"MAD","rate":11.067,"id":90},"6":{"symbol":"$","code":"ARS","rate":5.015,"id":6},"43":{"symbol":"HRK","code":"HRK","rate":7.2755,"id":36},"80":{"symbol":"\u0631\u06cc\u0627\u0644","code":"IRR","rate":null,"id":62},"1727":{"symbol":"\u00a3","code":"GBP","rate":0.8255,"id":135},"173":{"symbol":"\u00a3","code":"GBP","rate":0.8255,"id":135},"136":{"symbol":"\u20b1","code":"PHP","rate":57.3783,"id":107},"25":{"symbol":"R$","code":"BRL","rate":2.2313,"id":24},"62":{"symbol":"GEL","code":"GEL","rate":null,"id":49},"99":{"symbol":"LTL","code":"LTL","rate":3.4525,"id":78},"155":{"symbol":"\u20a9","code":"KRW","rate":1505.97,"id":120},"118":{"symbol":"MZN","code":"MZN","rate":null,"id":91},"7":{"symbol":"AMD","code":"AMD","rate":null,"id":7},"44":{"symbol":"CUC","code":"CUC","rate":null,"id":37},"81":null,"174":{"symbol":"$","code":"USD","rate":1.2714,"id":52},"137":{"symbol":"z\u0142","code":"PLN","rate":3.9922,"id":108},"26":{"symbol":"BND","code":"BND","rate":1.7214,"id":25},"63":{"symbol":"\u20ac","code":"EUR","rate":1.0,"id":10},"100":{"symbol":"\u20ac","code":"EUR","rate":1.0,"id":10},"156":{"symbol":"\u20ac","code":"EUR","rate":1.0,"id":10},"119":{"symbol":"MMK","code":"MMK","rate":null,"id":92},"8":{"symbol":"AWG","code":"AWG","rate":null,"id":8},"45":{"symbol":"\u20ac","code":"EUR","rate":1.0,"id":10},"82":{"symbol":"\u20ac","code":"EUR","rate":1.0,"id":10},"175":{"symbol":"UYU","code":"UYU","rate":26.5087,"id":136},"138":{"symbol":"\u20ac","code":"EUR","rate":1.0,"id":10},"27":{"symbol":"\u041b\u0432","code":"BGN","rate":1.9557,"id":26},"64":{"symbol":"GHC","code":"GHC","rate":null,"id":50},"101":{"symbol":"MOP","code":"MOP","rate":null,"id":79},"157":{"symbol":"LKR","code":"LKR","rate":143.35,"id":121},"120":{"symbol":"NAD","code":"NAD","rate":9.3658,"id":93},"46":{"symbol":"K\u010d","code":"CZK","rate":24.7465,"id":38},"83":{"symbol":"\u20aa","code":"ILS","rate":4.8425,"id":63},"9":{"symbol":"AU$","code":"AUD","rate":1.4125,"id":9},"176":{"symbol":"UZS","code":"UZS","rate":2050.78,"id":137},"139":{"symbol":"$","code":"USD","rate":1.2714,"id":52},"65":{"symbol":"GIP","code":"GIP","rate":null,"id":51},"102":{"symbol":"MKD","code":"MKD","rate":61.504,"id":80},"28":{"symbol":"CFA","code":"XOF","rate":655.903,"id":18},"158":{"symbol":"SDD","code":"SDD","rate":null,"id":122},"121":{"symbol":"NPR","code":"NPR","rate":94.7066,"id":94},"84":{"symbol":"\u20ac","code":"EUR","rate":1.0,"id":10},"10":{"symbol":"\u20ac","code":"EUR","rate":1.0,"id":10},"47":{"symbol":"kr","code":"DKK","rate":7.4439,"id":39},"177":{"symbol":"Bs. F","code":"VEF","rate":5.4602,"id":138},"140":{"symbol":"QAR","code":"QAR","rate":4.628,"id":109},"103":{"symbol":"MGF","code":"MGF","rate":null,"id":81},"29":{"symbol":"BIF","code":"BIF","rate":null,"id":27},"66":{"symbol":"\u20ac","code":"EUR","rate":1.0,"id":10},"159":{"symbol":"SRD","code":"SRD","rate":null,"id":123},"122":{"symbol":"\u20ac","code":"EUR","rate":1.0,"id":10},"11":{"symbol":"AZN","code":"AZN","rate":null,"id":11},"48":{"symbol":"DOP","code":"DOP","rate":47.0164,"id":40},"85":{"symbol":"JMD","code":"JMD","rate":108.234,"id":64},"178":{"symbol":"\u20ab","code":"VND","rate":24785.9,"id":139},"141":{"symbol":"\u20ac","code":"EUR","rate":1.0,"id":10},"30":{"symbol":"KHR","code":"KHR","rate":null,"id":28},"67":{"symbol":"kr","code":"DKK","rate":7.4439,"id":39},"104":{"symbol":"MWK","code":"MWK","rate":null,"id":82},"160":{"symbol":"SZL","code":"SZL","rate":null,"id":124},"123":{"symbol":"ANG","code":"ANG","rate":2.225,"id":95},"12":{"symbol":"BSD","code":"BSD","rate":null,"id":12},"49":{"symbol":"ECS","code":"ECS","rate":null,"id":41},"86":{"symbol":"\u00a5","code":"JPY","rate":107.268,"id":65},"179":{"symbol":"$","code":"USD","rate":1.2714,"id":52},"142":{"symbol":"RON","code":"RON","rate":4.2648,"id":110},"31":{"symbol":"CFA","code":"XOF","rate":655.903,"id":18},"68":{"symbol":"\u20ac","code":"EUR","rate":1.0,"id":10},"105":{"symbol":"RM","code":"MYR","rate":3.9865,"id":83},"161":{"symbol":"kr","code":"SEK","rate":9.3403,"id":125},"124":{"symbol":"CFPfr","code":"CFP","rate":null,"id":96},"13":{"symbol":"BHD","code":"BHD","rate":0.4793,"id":13},"50":{"symbol":"\u062c.\u0645","code":"EGP","rate":7.2541,"id":42},"87":{"symbol":"JOD","code":"JOD","rate":0.9008,"id":66},"180":{"symbol":"YER","code":"YER","rate":301.322,"id":140},"143":{"symbol":"\u0440\u0443\u0431.","code":"RUB","rate":39.14,"id":111},"32":{"symbol":"C$","code":"CAD","rate":1.3506,"id":29},"69":{"symbol":"$","code":"USD","rate":1.2714,"id":52},"106":{"symbol":"MVR","code":"MVR","rate":16.2739,"id":84},"162":{"symbol":"SFr","code":"CHF","rate":1.29,"id":77},"125":{"symbol":"NZ$","code":"NZD","rate":1.808,"id":97},"14":{"symbol":"\u09f3","code":"BDT","rate":88.3941,"id":14},"51":{"symbol":"$","code":"USD","rate":1.2714,"id":52},"88":{"symbol":"KZT","code":"KZT","rate":187.188,"id":67},"181":{"symbol":"ZMK","code":"ZMK","rate":6268.0,"id":141},"144":{"symbol":"RWF","code":"RWF","rate":null,"id":112},"33":{"symbol":"KYD","code":"KYD","rate":1.0298,"id":30},"70":{"symbol":"GTQ","code":"GTQ","rate":null,"id":53},"107":{"symbol":"CFA","code":"XOF","rate":655.903,"id":18},"1458":{"symbol":"TMM","code":"TMM","rate":null,"id":144},"163":{"symbol":"SYP","code":"SYP","rate":null,"id":126},"126":{"symbol":"NIO","code":"NIO","rate":27.3732,"id":98},"15":{"symbol":"BBD","code":"BBD","rate":null,"id":15},"52":{"symbol":"CFA","code":"XOF","rate":655.903,"id":18},"89":{"symbol":"KSh","code":"KES","rate":102.983,"id":68},"182":{"symbol":"Z$","code":"ZWL","rate":null,"id":142},"145":{"symbol":"\u0631.\u0633","code":"SAR","rate":4.768,"id":113},"34":{"symbol":"CFA","code":"XOF","rate":655.903,"id":18},"71":{"symbol":"GNF","code":"GNF","rate":null,"id":54},"108":{"symbol":"\u20ac","code":"EUR","rate":1.0,"id":10},"1459":{"symbol":"UGX","code":"UGX","rate":2883.54,"id":145},"164":{"symbol":"NT$","code":"TWD","rate":40.7191,"id":127},"127":{"symbol":"CFA","code":"XOF","rate":655.903,"id":18},"16":{"symbol":"BYR","code":"BYR","rate":null,"id":16},"53":{"symbol":"ERN","code":"ERN","rate":null,"id":44},"90":{"symbol":"KWD","code":"KWD","rate":0.3665,"id":69},"146":{"symbol":"CFA","code":"XOF","rate":655.903,"id":18},"35":{"symbol":"CFA","code":"XOF","rate":655.903,"id":18},"72":{"symbol":"CFA","code":"XOF","rate":655.903,"id":18},"109":{"symbol":"\u20ac","code":"EUR","rate":1.0,"id":10},"1793":{"symbol":"$","code":"USD","rate":1.2714,"id":52},"1460":{"symbol":"UAH","code":"UAH","rate":10.0288,"id":146},"165":{"symbol":"TJS","code":"TJS","rate":null,"id":128},"128":{"symbol":"\u20a6","code":"NGN","rate":192.808,"id":99},"17":{"symbol":"\u20ac","code":"EUR","rate":1.0,"id":10},"54":{"symbol":"EEK","code":"EEK","rate":15.6453,"id":45},"91":{"symbol":"KGS","code":"KGS","rate":null,"id":70},"147":{"symbol":"RSD","code":"RSD","rate":105.336,"id":114},"36":{"symbol":"$","code":"CLP","rate":639.26,"id":31},"73":{"symbol":"HTG","code":"HTG","rate":null,"id":55},"110":{"symbol":"MRO","code":"MRO","rate":null,"id":85}};ThreeDecimalCurrencies=[13,66,69,76,102,132];function hide_notice(){if($('notice')){$('notice').hide();}
$$('.notice').each(function(node){node.remove();});}
function openInNewWindow(href,windowName){windowName=windowName||'_blank';var newWindow=window.open(href,windowName);newWindow.focus();return false;}
function cookiesEnabled(){var cookieEnabled=(navigator.cookieEnabled)?true:false;if(typeof navigator.cookieEnabled=="undefined"&&!cookieEnabled){document.cookie="testcookie";cookieEnabled=(document.cookie.indexOf("testcookie")!=-1)?true:false;}
return(cookieEnabled);}
function cookiesRequired(){var error=new Element('div',{'class':'notice error'});error.innerHTML=I18n.t("text",{scope:"errors.standard.cookies_needed_exception"});with($('page_notice_container')){insert(error);scrollTo();}}
var ClassifiedsURLReader=Class.create(JLURLReader,{_parse:function($super){$super();this._category=null;this._page=null;this._item=null;if(this._location&&!this._location.blank()){var checked_up_to=1;if(this.path_parts[2]&&this.path_parts[2].match(/[A-Z][A-Za-z_-]+/)){this._category=this.path_parts[2];checked_up_to++;}
if(this.path_parts[checked_up_to+1]&&this.path_parts[checked_up_to+1].match(/^[0-9]+$/)){this._page=this.path_parts[checked_up_to+1];checked_up_to++;}
if(this.path_parts[checked_up_to+1]&&this.path_parts[checked_up_to+1].match(/^[a-z][a-z0-9_-]+$/i)){this._item=this.path_parts[checked_up_to+1];checked_up_to++;}}},category:function(){return this._category||this.params.category;},page:function(){return this._page||this.params.page;},item:function(){return this._item||this.params.item;}});var Linker=Class.create({initialize:function(){this.url=new ClassifiedsURLReader();this.params=$H(this.url.params);var location=this.params.location||this.url.location();if(location)this.params.set('location',location);var category=this.params.category||this.url.category();if(category)this.params.set('category',category);},substituteAll:function(){var parent=(arguments.length>0)?$(arguments[0]):document;if(!parent){return;}
parent.getElementsBySelector('a.full_actionable').each(function(link){this.substitute(link);link.removeClassName('full_actionable');}.bind(this));},substitute:function(link){match=link.className.toString().match(/\bdo_([a-z_]+)\b/);link.href=this.actionableLink(match[1]);link.removeClassName(match[0]);},actionableLink:function(action,options){if(options){options=$H(options);}
else{options=this.params;}
var host=options.unset('host');if(host){var prefix='http://'+host;}
else{var prefix='';}
return prefix+'/'+[this.url.locale()||I18n.locale,'action',action].join('/')+'?'+options.toQueryString();}});AutoFader=Class.create();Object.extend(Object.extend(AutoFader.prototype,Abstract.prototype),{initialize:function(wrapper,options){this.wrapper=$(wrapper);this.scroller=this.wrapper.down('.scroller');this.sections=this.wrapper.select('.item');this.options=Object.extend({duration:1.0,frequency:5},options||{});this.paused=false;this.current=this.sections.first();this.inSet=2;this.wrapper.observe('mouseover',this.pause.bind(this));this.wrapper.observe('mouseout',this.unpause.bind(this));this.sections.each(function(section,index){section._index=index;});this.sections.slice(this.inSet).each(function(section){section.hide();});this.start();},fadeTo:function(element,container,options){var previous=this.current._index;this.current=$(element);var next=this.current._index;if(ie_lte_6()){for(var i=0;i<this.inSet;i++){if(this.sections[next+i]){this.sections[next+i].show();}
if(this.sections[previous+i]){this.sections[previous+i].hide();}}}
else{var fadeEffects=$A();for(var i=0;i<this.inSet;i++){if(this.sections[previous+i]){fadeEffects.push(new Effect.Fade(this.sections[previous+i],{sync:true}))}}
new Effect.Parallel(fadeEffects,{duration:options.duration,queue:{position:'end',scope:'fader'}});var appearEffects=$A();for(var i=0;i<this.inSet;i++){if(this.sections[next+i]){appearEffects.push(new Effect.Appear(this.sections[next+i],{sync:true}))}}
new Effect.Parallel(appearEffects,{duration:options.duration,queue:{position:'end',scope:'fader'}});}
return false;},pause:function(){this.paused=true;},unpause:function(){this.paused=false;},periodicallyUpdate:function(){if(this.timer!=null){clearTimeout(this.timer);if(!this.paused){this.next();}}
this.timer=setTimeout(this.periodicallyUpdate.bind(this),this.options.frequency*1000);},next:function(){if(this.current){var currentIndex=this.current._index;var nextIndex=(currentIndex+this.inSet>=this.sections.length)?0:currentIndex+this.inSet;}
else{var nextIndex=this.inSet;}
this.fadeTo(this.sections[nextIndex],this.scroller,{duration:this.options.duration});},stop:function(){clearTimeout(this.timer);},start:function(){this.periodicallyUpdate();}});var Map=Class.create({initialize:function(_container){this.map=null;this.container=$(_container);this.point=null;this.geoCoder=new GClientGeocoder();this.zoomLevel=15;this.mapType=G_NORMAL_MAP;},showMapContainer:function(){if(arguments.length>0){if(arguments[0]==true){this.container.show();}else{this.container.hide();}}else{this.container.show();}},hideMapContainer:function(){this.container.hide();},visible:function(){return this.container.visible();},initMap:function(){if(!GBrowserIsCompatible()){return false;}
if(this.map){return true;}
this.container.addClassName('map_being_controlled');this.map=new GMap2(this.container);this.map.addControl(new GMenuMapTypeControl());this.map.addControl(new GSmallMapControl());return true;},mapFromPoint:function(point){this.map.setCenter(point,this.zoomLevel,this.mapType);if(this.marker){this.map.removeOverlay(this.marker);}
this.marker=new GMarker(point);this.map.addOverlay(this.marker);},setPointFromPoint:function(point){this.point=point;},setPointFromLatLng:function(latitude,longitude){if(!latitude||!longitude){return;}
this.setPointFromPoint(new GLatLng(latitude,longitude));},setPointFromAddress:function(address){if(address.blank()){return;}
this.geoCoder.getLatLng(address,this.geoCoderLatLngFromAddress.bind(this));},geoCoderLatLngFromAddress:function(_point){if(_point){this.setPointFromPoint(_point);}},generateMap:function(boundingBox){if(this.point&&!this.overrideDisplay){this.showMapContainer();if(!this.initMap()){this.hideMapContainer();return;}
if(boundingBox){this.zoomLevel=this.map.getBoundsZoomLevel(boundingBox);}
this.mapFromPoint(this.point);}},loadOptions:function(options){this.options=this.optionsJSON(options);if(this.options.zoomLevel){this.zoomLevel=this.options.zoomLevel;}
if(this.options.mapType){this.mapType=this.getMapType(this.options.mapType);}},optionsJSON:function(options){if(options.blank()){return{};}else{return options.evalJSON(true);}},getMapType:function(name){switch(name){case'Satellite':return G_SATELLITE_MAP;break;case'Hybrid':return G_HYBRID_MAP;break;default:return G_NORMAL_MAP;}}});var DisplayMap=Class.create(Map,{initialize:function($super,_container,_address,_lat,_lng,options,_itemUrl){$super(_container);this.address=_address||'';this.lat=_lat||false;this.lng=_lng||false;this.itemUrl=_itemUrl;this.container=$(_container);this.hideMapContainer();if(this.lat&&this.lng){this.setPointFromLatLng(this.lat,this.lng);}
else if(!this.address.blank()){this.setPointFromAddress(this.address);}
else{}
this.loadOptions(options);this.generateMap.bind(this).delay(2);},geoCoderLatLngFromAddress:function($super,_point){var url='/'+I18n.locale+'/action/map_lock';if(_point){$super(_point);if(this.itemUrl){new Ajax.Request(url,{parameters:{item:this.itemUrl,lat:_point.lat(),lng:_point.lng()}});}}else{new Ajax.Request(url,{parameters:{item:this.itemUrl,lock:true}});}},generateMap:function($super){$super();if(!this.point){Element.remove(parent.document.getElementById('map_iframe'));}}});var ItemEditMap=Class.create(Map,{initialize:function($super,_container,addresses){$super(_container);this.getAddresses=addresses;this.hideMapContainer();},initMap:function($super){var sup=$super();if(sup){this.optionsHandler=new MapOptionsHandler(this);this.loadOptions(this.optionsHandler.field.value);}
return sup;},locateAndDisplay:function(useForm,options){options=(options||{});if(options.overrideDisplay){this.overrideDisplay=true;}
if(useForm&&(point=this.formLatLng())){this.setPointFromPoint(point);this.generateMap();}else{this.addressList=this.getAddresses();if(this.addressList.length>0){this.showLoading();this.tryNextAddress();}}},formLatLng:function(){var lat=$('item_lat')&&$F('item_lat');var lng=$('item_lng')&&$F('item_lng');if(lat&&lng){return new GLatLng(lat,lng);}
return null;},displayAutoMap:function(show,options){var opts=options||{};if(show){if(this.visible())return;this.showMapContainer();this.locateAndDisplay(opts.useForm);}else{this.hideMapContainer();}},showError:function(){if(!this.error){this.error=new Element('div',{'class':'notice error'});this.error.innerHTML=I18n.t('error_message',{scope:'common'});this.container.insert({after:this.error});}
this.error.show();},hideError:function(){if(this.error){this.error.hide();}},showLoading:function(){if(!this.loader){this.loader=new Element('div');this.loader.innerHTML=loadingHTML();this.container.insert({after:this.loader});}
this.loader.show();},hideLoading:function(){if(this.loader){this.loader.hide();}},tryNextAddress:function(){var address=this.addressList.shift();if(address){this.setPointFromAddress(address);}else{this.container.fire('map:point',false);this.hideLoading();this.hideMapContainer();this.showError();}},setPointFromAddress:function(address){if(address.blank()){return;}
this.geoCoder.getLocations(address,this.geoCoderLatLngFromAddress.bind(this));},geoCoderLatLngFromAddress:function(response){if(!response||response.Status.code!=200){this.tryNextAddress();}else{var place=response.Placemark[0];var point=new GLatLng(place.Point.coordinates[1],place.Point.coordinates[0]);var boundingBox=place.ExtendedData.LatLonBox;var latLngBounds=new GLatLngBounds(new GLatLng(boundingBox.south,boundingBox.west),new GLatLng(boundingBox.north,boundingBox.east));this.setPointFromPoint(point);this.generateMap(latLngBounds);this.hideLoading();this.container.fire('map:point',{'lat':point.lat(),'lng':point.lng()});}},mapFromPoint:function(point){this.map.setCenter(point,this.zoomLevel,this.mapType);if(this.marker){this.map.removeOverlay(this.marker);}
this.marker=new GMarker(point,{draggable:true});GEvent.addListener(this.marker,"dragend",function(_point){this.container.fire('map:point',{'lat':_point.lat(),'lng':_point.lng()});}.bindAsEventListener(this));GEvent.addListener(this.marker,"click",function(_point){this.map.closeInfoWindow();}.bindAsEventListener({map:this.map}));GEvent.addListener(this.marker,"dragstart",function(_point){this.map.closeInfoWindow();}.bindAsEventListener({map:this.map}));this.map.addOverlay(this.marker);var marker_html=new Element('div',{'class':'map_marker'});marker_html.innerHTML=I18n.t('wrong_marker_place',{scope:"common.maps"});var marker_options={onOpenFn:function(){var infoWindowBlocks=$$('#map_container div div div div');for(var c=0;c<infoWindowBlocks.length;c++){var element=infoWindowBlocks[c];if(element.getStyle('height')==="40px"&&element.getStyle('top')==="25px"){element.setStyle({height:"10px"});}
if(element.getStyle('top')==="65px"){element.setStyle({top:"35px"});}}}};this.map.openInfoWindowHtml(this.marker.getPoint(),marker_html,marker_options);},centerMarker:function(){var newPoint=this.map.getCenter();this.map.closeInfoWindow();this.marker.setLatLng(newPoint);this.container.fire('map:point',{'lat':newPoint.lat(),'lng':newPoint.lng()});}});var MapOptionsHandler=Class.create({initialize:function(map){this.field=$('map_options');this.map=map;this.observe();},read:function(){return this.map.optionsJSON($F(this.field));},write:function(property,value){var val=this.read();val[property]=value;this.field.value=Object.toJSON(val);},observe:function(){GEvent.addListener(this.map.map,"zoomend",function(oldLevel,newLevel){this.write('zoomLevel',newLevel);}.bind(this));GEvent.addListener(this.map.map,"maptypechanged",function(){this.write('mapType',this.map.map.getCurrentMapType().getName());}.bind(this));},unObserve:function(){if(this.map.map){GEvent.clearListeners(this.map.map,"zommend");GEvent.clearListeners(this.map.map,"maptypechanged");}}});var MapButtonHandler=Class.create({initialize:function(map){this.map=map;this.showMap=$('show_map');this.previewMap=false;this.previewButton=new Element('input',{type:'button',value:this.textForButton()});this.refreshButton=new Element('input',{type:'button',value:I18n.t('refresh_map',{scope:"common.maps"})});this.centerMarkerButton=new Element('input',{type:'button',value:I18n.t('center_marker',{scope:"common.maps"})});this.observe();if(!this.previewMap){this.refreshButton.hide();this.centerMarkerButton.hide();}
this.showMap.insert({after:this.previewButton});this.previewButton.insert({after:this.refreshButton});this.refreshButton.insert({after:this.centerMarkerButton});},textForButton:function(){if(this.previewMap){return I18n.t('hide_map',{scope:"common.maps"});}else{return I18n.t('preview_map',{scope:"common.maps"});}},toggleDisplay:function(){if(this.previewMap){this.previewMap=false;this.refreshButton.hide();this.centerMarkerButton.hide();}else{this.previewMap=true;this.refreshButton.show();this.centerMarkerButton.show();}
this.previewButton.value=this.textForButton();},previewButtonClickHandler:function(event){this.toggleDisplay();this.map.displayAutoMap(this.previewMap,{useForm:true});},observe:function(){this.previewButton.observe('click',this.previewButtonClickHandler.bindAsEventListener(this));this.refreshButton.observe('click',function(event){this.map.locateAndDisplay();}.bindAsEventListener(this));this.centerMarkerButton.observe('click',function(event){this.map.centerMarker();}.bindAsEventListener(this));},unObserve:function(){this.previewButton.stopObserving('click');this.refreshButton.stopObserving('click');}});function completedUrl(path){path+='?r='+Math.random()+'&s='+I18n.uid;if(document.referrer&&document.referrer!=''){var regexps=[/^http:\/\/([^/]{1,10})?google(\.com?)?(\.[a-z]{2,3})?\/search/];var m,idx=0,reLength=regexps.length,referrer=document.referrer.toLowerCase();while(idx<reLength&&(m=referrer.match(regexps[idx]))!=null){idx+=1;}
if(m!=null){path+="&g="+encodeURIComponent(document.referrer);}}
return path;}
function recordViewEnc(path,updateOnly){path=completedUrl(Base64.decode(path));if(updateOnly){path+='&v=1';}
createScript(path);}
function recordClickEnc(path){createScript(completedUrl(Base64.decode(path)));}
function createScript(source){var tag=new Element('script',{src:source});var head=document.getElementsByTagName('head')[0]||document.documentElement;Element.insert(head.firstChild,{before:tag});}
function viewCounterUpdate(item,views){if(views==1){var text=I18n.t('post_view_count_singular',{interps:{value:views},scope:'common.message'});}
else{var text=I18n.t('post_view_count_plural',{interps:{value:views},scope:'common.message'});}
if($('item_details')&&window.showStatsForItem){$('item_details').insert({bottom:"<li id='view_counter'>"+text+"</li>"});}}
var BrowseItemList=Class.create({initialize:function(list){this._list=$(list);this._list.observe('click',this.clickHandler.bindAsEventListener(this));this._list.select('a.favourite').each(function(link){var listItem=link.up('li.item');var parts=listItem.down('a.item_link').href.toString().split('/');link.href=window.actionableLinker.actionableLink('favourite',{item:parts.last(),host:parts[2]});var parts=listItem.id.toString().split('_');new Favourite(parts[0],parts[1],link);});},clickHandler:function(event){var element=event.element();var nodeName=element.nodeName.toString().toLowerCase();if(nodeName!='a'){element=element.up('a')||element;nodeName=element.nodeName.toString().toLowerCase();}
if(nodeName=='a'){if(element.hasClassName('click')){recordClickEnc(dPEnc[element.up('.item').id]);}}
else{var listItem=element.up('li.item');if(listItem){cancel(event);window.location.href=listItem.down('a.item_link').href;}}}});var BrowseItem=Class.create({initialize:function(item){this._item=$(item);this._item.observe('click',this.clickHandler.bindAsEventListener(this));this._fixLinks();this._convertAdLink();this._createCurrencyConverter();this._createFavouritesController();},_id:function(){this._itemType();return this._idValue;},_itemType:function(){if(!this._itemTypeValue){var parts=this._item.id.toString().split('_');this._itemTypeValue=parts[0];this._idValue=parts[1];}
return this._itemTypeValue;},_url:function(){this._link();return this._urlValue;},_name:function(){this._link();return this._nameValue;},_link:function(){if(!this._linkValue){this._linkValue=this._item.down('li.ad_link a');this._urlValue=this._linkValue.href;this._nameValue=this._urlValue.split('/').last();}
return this._linkValue;},_fixLinks:function(){this._item.select('a.actionable').each(function(a){match=a.className.toString().match(/\bdo_([a-z_]+)\b/);a.href=this.actionableLink(match[1]);a.removeClassName(match[0]);a.removeClassName('actionable');}.bind(this));},_convertAdLink:function(){var text=this._link().up().down('span').innerHTML;this._item.down('#item_interactions').down('a.share_facebook').up('li').insert({after:'<li id="show_ad_box"><a class="title trigger_internal get_link" href="'+this._url()+'">'+text+'</a></li>'});this._link().up('li').remove();},_createCurrencyConverter:function(){this._item.select('.price_container').each(function(price){new CurrencyLink(price);});},_createFavouritesController:function(){this._favouritesController=new Favourite(this._itemType(),this._id(),this._item.select('a.favourite'),{link:this.actionableLink('favourite')});},clickHandler:function(event){var element=event.element();var nodeName=element.nodeName.toString().toLowerCase();if(nodeName!='a'){element=element.up('a')||element;nodeName=element.nodeName.toString().toLowerCase();}
var _fireCreatePaypalTransaction=function(){var url=this.actionableLink('create_paypal_transaction');var tag=new Element('img',{src:url});tag.setStyle({width:'0px',height:'0px',textIndent:'-9999px',display:'block'});var body=document.getElementsByTagName('body')[0];Element.insert(body,{bottom:tag});}.bind(this);if(nodeName=='a'){if(element.hasClassName('print')){cancel(event);window.open(this.actionableLink('print'));}
else if(element.hasClassName('item_action')){this.showItemAction(element.href);cancel(event);}
else if(element.hasClassName('trigger_contact_form')){this.showContactForm();element.blur();cancel(event);}
else if(element.hasClassName('trigger_external')){this.incrementClickCounter();}
else if(element.hasClassName('trigger_internal')){if(this.showLinkToAd()){cancel(event);}}
else if(element.hasClassName('refresh_item')){this.triggerAndUpdate(element.href,$('item_notice_container'),{onSuccess:function(response){if(!response.responseText.match(/\berror\b/)){this._item.down('.last_updated').innerHTML=((new Date).strftime('%d/%m/%y'));}}.bind(this)});cancel(event);}
else if(element.hasClassName('delete_item')){if(!confirm(I18n.t('please_confirm_deletion',{scope:"common"}))){cancel(event);}}
else if(element.hasClassName('profile_linker')){new Ajax.Updater('profile_linker',element.href,{onComplete:function(){MagicLinker.run();if(this.down('a.remove')){$('profile_information').show();}
else{$('profile_information').hide();}}.bind(element.up('li'))});element.replace(loadingHTML('small_loading'));cancel(event);}
else if(element.id=='share_twitter'){var container=$('twitter_linker');var originalHTML=container.innerHTML;element.replace(loadingHTML('small_loading'));new Ajax.Request('/create_url',{asynchronous:false,method:'post',parameters:{"url":element.readAttribute("data")},onSuccess:function(transport){container.innerHTML=originalHTML;element.href="http://twitter.com/home?status=Currently reading "+transport.responseText;}});}
else if(element.hasClassName('share_facebook')){window.open(element.href,'open_window','location, resizable, dependent, width=626, height=494, left=0, top=0');cancel(event);}
else if(element.hasClassName('premium_link')){element.up().down('div.make_premium_information').toggle();cancel(event);}
else if(element.href.match(/mailto:/)){if(this.showContactForm()){cancel(event);}}
else if(element.hasClassName('show_original')){this.openGallery();cancel(event);}
else if(element.hasClassName('embiggen')){var image=$('image');image.src=element.href;image.parentNode.href=element.rel;image.parentNode.rel=element.down('img').src;cancel(event);}}
else if(nodeName=='input'){if(element.hasClassName('permanent_link')){element.select();cancel(event);}}
else if(nodeName=='button'){if(element.hasClassName('paypal_button')){_fireCreatePaypalTransaction();cancel(event);setTimeout(function(){element.form.submit();},200);}}
else{if(nodeName!='select'&&nodeName!='option'){var insideMakeItemPremium=element.ancestors().detect(function(ancestor){return ancestor.getAttribute('id')=='make_item_premium';});if(insideMakeItemPremium){_fireCreatePaypalTransaction();cancel(event);setTimeout(function(){$$('#make_item_premium form').first().submit();},200);}}}},openGallery:function(){var images=this._item.select('a.embiggen').collect(function(item){return[item.rel,$(item).down('img').src];});var mainImage=$('image');if(images.length>1){if(mainImage!=null){var mainImageOriginal=mainImage.parentNode.readAttribute('href');var idx;for(idx=0;idx<images.length;idx++){if(images[idx][0]==mainImageOriginal){break;}}
images.unshift(images[idx]);images.splice(idx+1,1);}
var lightbox=new GalleryLightbox(images);lightbox.autosizeable();lightbox.activate();}
else if(mainImage!=null){var img=new Element('img',{src:mainImage.parentNode.href});var lightbox=new ManualLightbox();lightbox.autosizeable();lightbox.activate(function(){return img;}.bind(this),{'css_class':'original_image'});}},scrollIfNotVisible:function(item){if(document.viewport.getHeight()<item.viewportOffset()[1]+item.getHeight()){item.scrollTo();}},showItemAction:function(action){this.makeItemActionContainer(loadingHTML());new Ajax.Updater(this.itemActionContainer,action,{method:'get',evalScripts:true,onComplete:function(){this.makeFormAJAXSubmit(this.itemActionContainer);}.bind(this)});this.scrollIfNotVisible(this.itemActionContainer);return true;},makeItemActionContainer:function(){if(!this.itemActionContainer){this.itemActionContainer=new Element('div',{'class':'item_action_container'});this._item.down('#item_interactions').insert({'after':this.itemActionContainer});}
if(arguments.length==1){this.itemActionContainer.innerHTML=arguments[0];}},showContactForm:function(){var link=this._item.down('.contact_details .email a');if(!link){return false;}
if(!this.contactFormPrepared){this.contactFormPrepared=true;this.contactFormLink=link.href;this.contactFormContainer=new Element('div');link.insert({'after':this.contactFormContainer});link.up('.contact_item').addClassName('active');}
this.contactFormContainer.innerHTML=loadingHTML();new Ajax.Updater(this.contactFormContainer,this.contactFormLink,{method:'get',onComplete:function(){this.makeFormAJAXSubmit(this.contactFormContainer);initCVUploader();}.bind(this)});this.scrollIfNotVisible(link.up('.contact_item'));return true;},makeFormAJAXSubmit:function(container){var repeater=this.makeFormAJAXSubmit.curry(container).bind(this);var form=container.down('form');form.observe('submit',function(event){var form=this.down('form');new Ajax.Updater(this,form.action,{method:'post',parameters:form.serialize(),evalScripts:true,onComplete:function(){repeater();initCVUploader();}});cancel(event,true);this.innerHTML=loadingHTML();}.bind(container));form.findFirstElement().focus();},showLinkToAd:function(){this.makeItemActionContainer();var link=this._item.down('#item_interactions #show_ad_box a');this.itemActionContainer.innerHTML='<div class="form_container"><h4>'+link.innerHTML+':</h4><div><input type="text" class="highlight_text_inside permanent_link" value="'+link.href+'" /></div></div>';this.scrollIfNotVisible(this.itemActionContainer);return true;},triggerAndUpdate:function(href,target,options){target.innerHTML=loadingHTML();options=$H({method:'get',onSuccess:function(){this.highlight();}.bind(target),on500:insertIntoDebugWindow,on503:insertIntoDebugWindow}).merge(options||$H());new Ajax.Updater(target,href,options.toObject());},actionableLink:function(action){return window.actionableLinker.actionableLink(action,{item:this._name()});},incrementClickCounter:function(){if(typeof cUEnc!='undefined'){recordClickEnc(cUEnc);}}});var Favourite=Class.create({initialize:function(itemType,itemID,link_or_links,options){this._itemType=itemType;this._itemID=itemID;this._links=$A([link_or_links]).flatten();this._controller=this._links[0].up('.f_s');this._links.each(function(link){$(link).observe('click',this.clickHandler.bindAsEventListener(this));}.bind(this));options=options||{};this._defaultUrl=options['link']||this._links.first().href;this._active=options['active']||this._controller.hasClassName('f_a');this._cookieName=options['cookieName']||'_cf_favourites_'+this._itemType+'s';this._render();},clickHandler:function(event){this.toggle();event.element().blur();cancel(event);},hasCookie:function(){return(readCookie(this._cookieName)!=null);},toggle:function(){this._active=!this._active;if(this.hasCookie()){this._setByCookie();}else{this._setByRequest();}
this._render();},_render:function(){if(this._active){this._controller.addClassName('f_a');var text=I18n.t('remove_from_favourites',{scope:'common'});}
else{this._controller.removeClassName('f_a');var text=I18n.t('add_to_favourites',{scope:'common'});}
this._links.each(function(link){link.innerHTML=text;link.title=text;});},_setByCookie:function(){var items=readCookie(this._cookieName).split(escape("|"));var added=true;if(this._active){items.push(this._itemID);}
else{items=items.without(this._itemID);}
items=items.uniq();setCookie(this._cookieName,items.join(escape("|")));},_setByRequest:function(){new Ajax.Request(this._defaultUrl,{method:'get',onSuccess:function(transport){if(!cookiesEnabled())cookiesRequired();this._active=(transport.responseText=="true");}.bind(this),onComplete:function(){this._render();}.bind(this)});}});var BrowseMenuHandler=Class.create({initialize:function(button){this.browseButton=$(button);this.locationSelector=null;this.categorySelector=null;this.selectors=$A([]);this.target=new Element('div',{'class':'push'});this.target.hide();this.browseButton.insert({bottom:this.target});this.browseButton.down('div.push').observe('click',this.clickHandler.bindAsEventListener(this));},clickHandler:function(event){var target=$(event.target);if(target.up().nodeName.toLowerCase()=='a'){target=target.up();}
if(target.hasClassName('location')){cancel(event);target.blur();if(!this.locationSelector){this.createLocationSelector();}
this.show(this.locationSelector);}
else if(target.hasClassName('category')){cancel(event);target.blur();if(!this.categorySelector){this.createCategorySelector();}
this.show(this.categorySelector);}},show:function(selector){var self_open=this.selectors.any(function(sel){return sel==selector&&sel.visible();});this.hideAll();if(self_open){return;}
selector.show();this.target.show();},hideAll:function(){this.selectors.each(function(selector){selector.hide();});this.target.hide();},createSelector:function(initial_content){var outer=new Element('div');var box={'container':outer,'content':outer};box.container.addClassName('subsubmenu');box.content.update(initial_content);box.container.hide();this.target.insert({bottom:box.container});this.selectors.push(box.container);return box;},createLocationSelector:function(){var box=this.createSelector(window.preloader.giveMe('locations'));this.locationSelector=box.container;this.locationSelectorContent=box.content;},createCategorySelector:function(href){var box=this.createSelector(window.preloader.giveMe('categories'));this.categorySelector=box.container;this.categorySelectorContent=box.content;}});var BrowseHighlighter=Class.create({initialize:function(terms){this.terms=$A();for(var i=0;i<terms.length;i++){this.terms.push(new termPattern(terms[i]));}
function termPattern(term){this.term=term;this.pattern=new RegExp('\\b'+this.term+'\\b','i');}},highlight:function(item){var nodes=this.getTextNodes(item);for(var j=0;j<this.terms.length;j++){var nodes_length=nodes.length;for(var i=0;i<nodes_length;i++){var parent=$(nodes[i].parentNode);if(parent&&this.highlightTerm(nodes[i],parent,this.terms[j])){nodes.remove(i);nodes=nodes.concat(this.getTextNodes(parent));i--;nodes_length=nodes.length;}}}},getTextNodes:function(element){var results=[],node=$(element).firstChild;while(node){if(node.nodeType===3){results.push(node);}
else if((node.className||'').match(/highlight/)){}
else if(node.hasChildNodes()){results=results.concat(this.getTextNodes(node));}
node=node.nextSibling;}
return results;},highlightTerm:function(node,parent,term){var nodeName=parent.nodeName.toString().toLowerCase();if(nodeName!='textarea'&&nodeName!='script'&&!parent.hasClassName('highlight')){var result=term.pattern.exec(node.nodeValue);if(result!=null){var value=node.nodeValue;var left=document.createTextNode(value.substr(0,result.index));var right=document.createTextNode(value.substr(result.index+result[0].length));var span=new Element('span',{'class':'highlight'}).insert(result[0]);parent.insertBefore(left,node);parent.insertBefore(span,node);parent.replaceChild(right,node);return true;}}
return false;}});Array.prototype.remove=function(from,to){var rest=this.slice((to||from)+1||this.length);this.length=from<0?this.length+from:from;return this.push.apply(this,rest);};MagicLinker.addSystem(function(){window.actionableLinker=new Linker();var content=$('content');if(content){content.select('ul.item_list').each(function(list){new BrowseItemList(list);});}});MagicLinker.addSystem('classifieds',function(){var openedItem=$('opened_item');if(openedItem){new BrowseItem(openedItem);}
var search_form=$('search_form');if(search_form){search_form.method='get';}
if(window.search_keywords){window.highLighter=new BrowseHighlighter(window.search_keywords);$('content').select('ul.item_list').each(function(list){window.highLighter.highlight(list);});}
if((obj=$("browse_menu"))){new BrowseMenuHandler(obj);}
$('preload').getElementsBySelector('.location_ribbon li').each(function(li){li.show();});var scroller=$('ad_scroller');if(scroller){scroller.down().addClassName('scroller_with_js');new AutoFader(scroller,{duration:1});}
var subscribe=$('subscribe_rss');if(subscribe){subscribe.observe('click',function(event){subscribe.blur();subscribe.up('.subscribe_container').down('ul').toggle();cancel(event);}.bindAsEventListener(subscribe));}
$('primary').select('.active_category_suppression').each(function(n){n.observe('click',function(event){var target=event.element();if(target.hasClassName('show_more_categories')){target.up().addClassName('unsuppressed');Event.stop(event);}});});var tree=$('secondary').down('.tree-container');if(tree){new CategoryTree(tree,{updateElement:function(instance,treeNode,domNode){window.location.href=domNode.down('a');}})}
window.actionableLinker.substituteAll('secondary');});MagicLinker.add('classifieds',function(){$$('.user_surface_area').each(function(surface_area){new SurfaceArea(surface_area);});});MagicLinker.add('classifieds',function(){$A(document.getElementsByTagName('textarea')).each(function(element){element=$(element);if(!element.readAttribute('autoresize')){element.setAttribute('autoresize',true);new SmartTextAreaSize(element);}});});initCVUploader=function(){var cvUploader=$('cv_uploader');if(cvUploader){if(window.cvController){window.cvController.regular_uploader=cvUploader;window.cvController.initUploader();}
else{window.cvController=new PostCVHandler('cv_uploader',window.auth_token);}}};var PostCVHandler=Class.create({initialize:function(regular_uploader,auth){this.regular_uploader=$(regular_uploader);this.has_cv=$('_has_cv').value;this.auth_value=auth;this.initUploader();},initUploader:function(){this.regular_uploader.hide();this.createAjaxUploader(this.auth_value);this.regular_uploader.insert({after:this.ajaxy_uploader});this.ajaxy_uploader.show();},createAjaxUploader:function(auth){this.sendMessageButton=$('send_message_submit');this.ajaxy_uploader=new Element('div',{'id':'ajaxy_uploader'}).hide();url='/en/action/upload_cv';this.iframe=new Element('iframe',{'name':'cv_target','id':'cv_target','class':'hidden-frame','style':'display:none'});this.asyncForm=new Element('form',{'target':'cv_target','method':'post','id':'cv_upload_form','encoding':'multipart/form-data','enctype':'multipart/form-data','action':url});this.cvFilename=new Element('input',{'type':'hidden','name':'cv_filename','id':'cv_file'});this.auth=new Element('input',{'type':'hidden','name':'authenticity_token','value':auth});this.remove=$('regular_delete');this.remove_link=$('regular_delete_link');this.remove_link.removeAttribute('href');this.remove_link.setStyle({cursor:"pointer"});this.remove_link.observe('click',this.deleteCV.bindAsEventListener(this));this.errorMessage=new Element('div',{'id':'upload_error_message','class':'error','style':'display:none'});this.formContainer=new Element('div',{'class':'upload_form_container'});this.selectText=new Element('div',{'id':'select_cv'});this.selectText.insert(I18n.t('select_cv',{scope:'jobs.cv'})+': ');this.asyncForm.insert(this.selectText);this.asyncForm.insert(this.cvFilename);this.asyncForm.insert(this.auth);this.formContainer.insert(this.asyncForm);this.loadingCV=new Element('div',{'class':'loading_in_progress'});this.loadingCV.innerHTML=loadingHTML();this.loadingCV.hide();this.additionals=new Element('div',{'class':'additional'});with(this.additionals){insert(this.formContainer);}
this.addAjaxUploaderToPage();this.loadingCV.setOpacity(0.8);},addAjaxUploaderToPage:function(){this.ajaxy_uploader.insert({bottom:this.additionals});this.ajaxy_uploader.insert({bottom:this.iframe});this.ajaxy_uploader.insert({bottom:this.loadingCV});this.ajaxy_uploader.insert({bottom:this.errorMessage});this.ajaxy_uploader.insert({bottom:this.remove});this.displayFormOrRemoveLink();this.createBrowseButton();},removeLink:function(){this.remove_link=$('regular_delete_link');this.remove_link.removeAttribute('href');this.remove_link.setStyle({cursor:"pointer"});this.remove_link.observe('click',this.deleteCV.bindAsEventListener(this));},displayFormOrRemoveLink:function(){if(this.has_cv){this.additionals.hide();this.remove.show();}else{this.additionals.show();this.remove.hide();}},uploadedCorrectly:function(){this.has_cv=true;},deletedCorrectly:function(){this.has_cv=false;},handleErrorMessage:function(errorString){var error_string=(errorString||'');this.errorMessage.innerHTML=error_string;if(error_string==''){this.errorMessage.hide();}else{this.errorMessage.show();}},createBrowseButton:function(){if(this.browseButton){this.browseButton.stopObserving();this.browseButton.remove();}
this.browseButton=new Element('input',{'type':'file','name':'post_cv','id':'browse_button','value':''});this.browseButton.observe('change',this.uploadCV.bindAsEventListener(this));this.asyncForm.insert({bottom:this.browseButton});},deleteCV:function(){request_url='/en/action/remove_cv/';request_params='';this.remove.hide();this.loadingCV.show();this.sendMessageButton.disable();new Ajax.Request(request_url,{method:'get',asynchronous:true,evalScripts:true,parameters:request_params,onComplete:function(){this.loadingCV.hide();this.sendMessageButton.enable();this.additionals.show();this.deletedCorrectly();}.bind(this),onError:function(){this.handleErrorMessage("There was an error removing your CV");this.sendMessageButton.enable();}.bind(this)});return false;},uploadCV:function(event){this.uploadingState(true);this.cvFilename.value=this.browseButton.value;this.asyncForm.submit();this.createBrowseButton();this.handleErrorMessage();},uploadingState:function(uploading){if(uploading==true){this.handleBrowseButton(false);this.loadingCV.show();}else{this.handleBrowseButton(true);this.loadingCV.hide();}},handleBrowseButton:function(state){if(state){this.sendMessageButton.enable();this.asyncForm.show();}else{this.sendMessageButton.disable();this.asyncForm.hide();}}});var SurfaceArea=Class.create({initialize:function(container){this.cookie_name='_cf_surface_area_unit';this.container=container;this.unit=this._readValue()||'metres';this.container.insert({bottom:'(<a href="#" class="toggle"></a>)'});this.link=this.container.down('.toggle');this.link.observe('click',function(event){event.target.blur();cancel(event,true);this.toggle();}.bindAsEventListener(this));this.show(this.unit,false);},unobserve:function(){this.link.stopObserving('click');},toggle:function(){if(this.unit=='feet'){this.show('metres');}
else{this.show('feet');}},show:function(unit){['metres','feet','divider'].each(function(piece){if(piece==unit){this.container.down('.'+piece).show();}
else{this.container.down('.'+piece).hide();}}.bind(this));this.link.innerHTML={'metres':'ft²','feet':'m²'}[unit];if(arguments.length==1||arguments[1]==true){this.setUnit(unit);}},convert_to_m2:function(value){return this.convert_to(value,'m2');},convert_to_ft2:function(value){return this.convert_to(value,'ft2');},convert_to:function(value,unit){var fvalue=parseFloat(value);if(!isNaN(fvalue)){var ret_value;switch(unit){case'm2':ret_value=fvalue*0.09290304;break;case'ft2':ret_value=fvalue*10.7639104;break;}
return Math.round(ret_value);}
else{return value;}},setUnit:function(unit){this.unit=unit;this._storeValue();},_readValue:function(){return readCookie(this.cookie_name);},_storeValue:function(){setCookie(this.cookie_name,this.unit);new Ajax.Request('/'+I18n.locale+'/set_regional_settings',{method:'get',asynchronous:true,parameters:{'account[units_in_m2]':this.unit=='metres'}});}});var CurrencyLink=Class.create({initialize:function(container){this.cookie_name='_cf_currency_pref';this.container=container;this.price=this.getPrice();this.ad_currency=this.getAdCurrency();this.user_currency=this._readValue()||this.ad_currency;this.getAlternate();if(this.ad_currency&&this.currencyRate(this.ad_currency)){this.container.insert({bottom:'<span class="alternate_currency"><a title="'+
I18n.t('convert_to_another_currency',{scope:'common'})+'" href="#" class="alternate_currency_link"></a></span>'});this.link=this.container.down('.alternate_currency_link');this.link.observe('click',function(event){event.target.blur();cancel(event,true);this.toggleCurrencySelector();this.updateLink();}.bindAsEventListener(this));this.updateLink(this.user_currency);}},unobserve:function(){this.link.stopObserving('click');this.currency_list.stopObserving('change');},currencyListInit:function(){this.currencyListLoading=true;this.selector=new Element("span",{'class':'currency_selector'});this.container.insert({bottom:this.selector});this.selector.innerHTML='<br />'+loadingHTML('small_loading');new Ajax.Request(window.actionableLinker.actionableLink('currency_selector',{}),{method:'get',asynchronous:true,onSuccess:function(response){this.selector.replace(response.responseText);this.currency_list=this.container.down('.currency_list');this.currencyListLoading=false;this.currency_list.observe('change',this.changeCurrency.bind(this));this.currency_list.show();}.bind(this)});},updateLink:function(){if(this.alternate==0){this.link.innerHTML='$€₤¥…?';}
else{this.link.innerHTML=this.converted(this.getPrice());}},convertable:function(){return(this.price&&this.currencyRate(this.alternate)&&this.currencyRate(this.ad_currency));},converted:function(price){if(this.convertable()){var priceEur=price/this.currencyRate(this.ad_currency),priceAlt=priceEur*this.currencyRate(this.alternate),rounded=priceAlt.toMoney(2,I18n.locale=='en'?'.':',',I18n.locale=='en'?',':'.');return'~ '+this.currencySymbol(this.alternate)+' '+rounded;}
else{return this.currencyCode(this.alternate)+' '+I18n.t('not_available',{scope:'common'});}},getPrice:function(){found=false;if(this.container){this.container.down('.price_amount').classNames().each(function(name,index){ret=name.match(/amount_([\d\.]+)/);if(ret&&ret[1]){found=ret[1];}});}
else{found=false;}
return found;},getAdCurrency:function(){var retrieve;if(this.container&&((field=this.container.down('span.currency')))){field.classNames().each(function(name,index){ret=name.match(/curid_(\d+)/);if(ret&&ret[1]){retrieve=ret[1];}});}
return retrieve;},getAlternate:function(){if(this.ad_currency==this.currency){this.alternate=0;}
else{this.alternate=this.user_currency;}},updateCurrency:function(selected){this.setCurrency(selected);this.getAlternate();this.updateLink();},toggleCurrencySelector:function(){if(this.currency_list){this.currency_list.toggle();}else if(!this.currencyListLoading){this.currencyListInit();}},changeCurrency:function(event){event.target.blur();cancel(event,true);this.updateCurrency(this.currency_list.options[this.currency_list.selectedIndex].value);this.currency_list.hide();},setCurrency:function(currency){this.user_currency=currency;this._storeValue();},currencySymbol:function(curid){return this._currencyAttr('symbol',curid);},currencyCode:function(curid){return this._currencyAttr('code',curid);},currencyRate:function(curid){return this._currencyAttr('rate',curid);},_currencyAttr:function(prop,curid){curObj=$H(Currencies).find(function(cur){return(cur[1]&&cur[1]['id']&&cur[1]['id']==curid);});if(curObj&&curObj[1]&&curObj[1][prop]){return curObj[1][prop];}
return false;},_readValue:function(){return readCookie(this.cookie_name);},_storeValue:function(){setCookie(this.cookie_name,this.user_currency);new Ajax.Request('/'+I18n.locale+'/set_regional_settings',{method:'get',asynchronous:true,parameters:{'account[currency_id]':this.user_currency}});}});Number.prototype.toMoney=function(floatPoint,decimalSep,thousandSep){var number=this,floatPoint=isNaN(floatPoint=Math.abs(floatPoint))?2:floatPoint,decimalSep=decimalSep==undefined?",":decimalSep,thousandSep=thousandSep==undefined?".":thousandSep,sign=number<0?"-":"",i=parseInt(number=Math.abs(+number||0).toFixed(floatPoint))+"",j=(j=i.length)>3?j%3:0;return sign+
(j?i.substr(0,j)+thousandSep:"")+
i.substr(j).replace(/(\d{3})(?=\d)/g,"$1"+thousandSep)+
(floatPoint?decimalSep+Math.abs(number-i).toFixed(floatPoint).slice(2):"");};var ImageUploader=Class.create({initialize:function(regular_uploader,item_name,auth){this.regular_uploader=$(regular_uploader);this.item_name=item_name;this.auth_value=auth;this.form=$('edit_item');this.initUploader();this.generateTooltips();this.setUncroppable();},initUploader:function(){this.regular_uploader.hide();this.createAjaxUploader(this.item_name,this.auth_value);this.regular_uploader.insert({after:this.ajaxy_uploader});this.ajaxy_uploader.show();this.imageCount=this.imagesContainer.select('.item_thumbnail').length;this.checkUploadLimit();this.initSubmitter();this.updateSelectedImage();},initSubmitter:function(){this.formSubmit=$('edit_item_submit');this.formSubmit.disable=function(){this.disabled=true;this.addClassName('disabled');}.bind(this.formSubmit);this.formSubmit.enable=function(){this.disabled=false;this.removeClassName('disabled');}.bind(this.formSubmit);},createAjaxUploader:function(item_name,auth){var url='/'+I18n.locale+'/upload_image';this.ajaxy_uploader=new Element('div',{'id':'ajaxy_uploader'}).hide();this.imagesContainer=$('thumbnails_container');this.iframe=new Element('iframe',{'name':'image_target','id':'image_target','class':'hidden-frame','style':'display:none'});this.asyncForm=new Element('form',{'target':'image_target','method':'post','id':'image_upload_form','encoding':'multipart/form-data','enctype':'multipart/form-data','action':url});this.imageFilename=new Element('input',{'type':'hidden','name':'image_filename','id':'image_file'});this.auth=new Element('input',{'type':'hidden','name':'authenticity_token','value':auth});this.errorMessage=new Element('div',{'id':'upload_error_message','class':'error_message','style':'display:none'});this.selectedImage=$('selected_image');this.formContainer=Builder.node('div',{'class':'upload_form_container'},[Builder.node('div',{className:'field'},[Builder.node('label',{'for':'image_file'},I18n.t('select_image',{scope:'common'})+': '),this.imageFilename,this.asyncForm])]);this.asyncForm.insert(this.auth);this.loadingImage=new Element('div',{'class':'loading_in_progress'});this.loadingImage.innerHTML=loadingHTML();this.loadingImage.hide();this.formContainer.insert({top:this.loadingImage});this.additionals=Builder.node('div',{'class':'additional'},[this.imagesContainer,this.errorMessage,this.formContainer]);this.addAjaxUploaderToPage();this.loadingImage.setOpacity(0.8);this.imagesContainer.observe('click',this.actionOnImage.bindAsEventListener(this));},addAjaxUploaderToPage:function(){this.ajaxy_uploader.insert({bottom:this.additionals});this.ajaxy_uploader.insert({bottom:this.iframe});this.createBrowseButton();},handleErrorMessage:function(errorString){errorString=(errorString||'');if(errorString==''){this.errorMessage.hide();this.browseButton.removeClassName('error');}else{var errors=errorString.split("###");var errorsContainer=new Element('ul');errors.each(function(e){errorsContainer.insert(Builder.node('li',{},[e]));});this.errorMessage.update(errorsContainer);this.browseButton.addClassName('error');this.errorMessage.show();}},createBrowseButton:function(){if(this.browseButton){this.browseButton.stopObserving();this.browseButton.remove();}
this.browseButton=new Element('input',{'type':'file','name':'uploaded_image','id':'browse_button','size':'30','value':''});this.browseButton.observe('change',this.uploadImage.bindAsEventListener(this));this.asyncForm.insert({bottom:this.browseButton});},actionOnImage:function(event){var element=event.element();var match=(element.className||'').match(/\bimage_(delete|select|crop)\b/);if(match){var index=this.imageIndex(element.up('.item_thumbnail'));switch(match[1]){case'select':this.selectImage(index);break;case'delete':this.deleteImage(index);break;case'crop':this.cropImage(index);}
cancel(event);return;}},imageIndex:function(element){return element.className.match(/\b\d+\b/)[0];},selectImage:function(selected_index){this.selectedImage.value=selected_index;this.updateSelectedImage();},deleteImage:function(imageToDelete){var image=this.imagesContainer.down('.item_thumbnail.'+imageToDelete);this.markForDeletion(image);this.updateAfterDelete(imageToDelete);this.checkUploadLimit();this.setFormAsModified();this.loadingImage.hide();return true;},markForDeletion:function(image){image.hide();image.down('.image_to_delete_field').value="1";image.className="";},updateAfterDelete:function(imageToDelete){if(imageToDelete==this.selectedImage.value){var firstThumbnail;if((firstThumbnail=this.imagesContainer.down('.item_thumbnail'))){this.selectedImage.value=this.imageIndex(firstThumbnail);this.updateSelectedImage(firstThumbnail);}else{this.selectedImage.value="";}}
this.imageCount--;},cropImage:function(index){if(!this.additionals.listeningThumbnailer){this.additionals.listeningThumbnailer=true;this.additionals.observe('thumbnailer:loaded',function(){this.loadingImage.hide();}.bindAsEventListener(this));this.additionals.observe('thumbnailer:loading',function(){this.loadingImage.show();}.bindAsEventListener(this));}
var img=this.imagesContainer.down('.item_thumbnail.'+index+' img.big_thumbnail');new Thumbnailer(img,index,this.imagesContainer);},updateSelectedImage:function(element){var selected=(element||this.imagesContainer.down('.item_thumbnail.'+this.selectedImage.value.toString()));if(selected){var previous=this.imagesContainer.down('.item_thumbnail.marked');if(previous){previous.removeClassName('marked');previous.down('.image_select').show();}
selected.addClassName('marked');selected.down('.image_select').hide();}},uploadImage:function(event){this.uploadingState(true);this.imageFilename.value=this.browseButton.value;this.asyncForm.submit();this.createBrowseButton();this.handleErrorMessage();},insertUpload:function(content){this.imagesContainer.insert({bottom:content});this.updateAfterUpload();},updateAfterUpload:function(){if(this.imagesContainer.select('.item_thumbnail').length==1){var lastImage=this.imagesContainer.down('.item_thumbnail');this.selectImage(this.imageIndex(lastImage));}
this.imageCount++;this.generateTooltips();this.checkUploadLimit();},updateImage:function(imageIndex){var image=this.imagesContainer.down('.item_thumbnail.'+imageIndex);var thumb=image.down('.big_thumbnail');thumb.src=thumb.src+"&reload";this.markAsUncroppable(image);},uploadingState:function(uploading){if(uploading==true){this.handleBrowseButton(false);this.loadingImage.show();}else{this.handleBrowseButton(true);this.loadingImage.hide();}},checkUploadLimit:function(){if(this.imageCount<10){this.formContainer.show();}else{this.formContainer.hide();}},handleBrowseButton:function(state){if(state){this.formSubmit.enable();this.asyncForm.show();}else{this.formSubmit.disable();this.asyncForm.hide();}},setFormAsModified:function(){var modified=new Element('input',{'type':'hidden','name':'modified'});this.form.insert(modified);},generateTooltips:function(){this.imagesContainer.select('.image_not_croppable','.image_select','.image_crop','.image_delete').each(function(node){this.createTooltip(node);}.bind(this));},createTooltip:function(element,title){if(element.tooltip){element.title=$(element.tooltip.tool_tip).innerHTML;element.tooltip.destroy();}
element.tooltip=new Tooltip(element,title||element.title);element.title="";},setUncroppable:function(){this.imagesContainer.select('.item_thumbnail').each(function(e){this.markAsUncroppable(e);}.bind(this));},markAsUncroppable:function(image){var crop=image.down('.image_crop');if(crop){crop.className='image_not_croppable';this.createTooltip(crop,I18n.t('cropping_only_new_images',{scope:'common.message'}));this.handleErrorMessage();}},unload:function(){this.browseButton.stopObserving('change');this.imagesContainer.stopObserving('click');this.additionals.stopObserving();}});var CropDraggable=Class.create();Object.extend(Object.extend(CropDraggable.prototype,Draggable.prototype),{initialize:function(element){this.options=Object.extend({drawMethod:function(){}},arguments[1]||{});this.element=$(element);this.handle=this.element;this.delta=this.currentDelta();this.dragging=false;this.eventMouseDown=this.initDrag.bindAsEventListener(this);Event.observe(this.handle,"mousedown",this.eventMouseDown);Draggables.register(this);},draw:function(point){var pos=Position.cumulativeOffset(this.element);var d=this.currentDelta();pos[0]-=d[0];pos[1]-=d[1];var p=[0,1].map(function(i){return(point[i]-pos[i]-this.offset[i]);}.bind(this));this.options.drawMethod(p);}});var Cropper={};Cropper.Img=Class.create();Cropper.Img.prototype={initialize:function(element,options){this.options=Object.extend({ratioDim:{x:0,y:0},minWidth:0,minHeight:0,displayOnInit:false,onEndCrop:Prototype.emptyFunction,captureKeys:true,onloadCoords:null,maxWidth:0,maxHeight:0},options||{});this.img=$(element);this.clickCoords={x:0,y:0};this.dragging=false;this.resizing=false;this.isWebKit=/Konqueror|Safari|KHTML/.test(navigator.userAgent);this.isIE=/MSIE/.test(navigator.userAgent);this.isOpera8=/Opera\s[1-8]/.test(navigator.userAgent);this.ratioX=0;this.ratioY=0;this.attached=false;this.fixedWidth=(this.options.maxWidth>0&&(this.options.minWidth>=this.options.maxWidth));this.fixedHeight=(this.options.maxHeight>0&&(this.options.minHeight>=this.options.maxHeight));if(typeof this.img=='undefined')return;$A(document.getElementsByTagName('script')).each(function(s){if(s.src.match(/cropper\.js/)){var path=s.src.replace(/cropper\.js(.*)?/,'');var style=document.createElement('link');style.rel='stylesheet';style.type='text/css';style.href=path+'cropper.css';style.media='screen';document.getElementsByTagName('head')[0].appendChild(style);}});if(this.options.ratioDim.x>0&&this.options.ratioDim.y>0){var gcd=this.getGCD(this.options.ratioDim.x,this.options.ratioDim.y);this.ratioX=this.options.ratioDim.x/gcd;this.ratioY=this.options.ratioDim.y/gcd;}
this.subInitialize();if(this.img.complete||this.isWebKit)this.onLoad();else Event.observe(this.img,'load',this.onLoad.bindAsEventListener(this));},getGCD:function(a,b){if(b==0)return a;return this.getGCD(b,a%b);},onLoad:function(){var cNamePrefix='imgCrop_';var insertPoint=this.img.parentNode;var fixOperaClass='';if(this.isOpera8)fixOperaClass=' opera8';this.imgWrap=Builder.node('div',{'class':cNamePrefix+'wrap'+fixOperaClass});this.north=Builder.node('div',{'class':cNamePrefix+'overlay '+cNamePrefix+'north'},[Builder.node('span')]);this.east=Builder.node('div',{'class':cNamePrefix+'overlay '+cNamePrefix+'east'},[Builder.node('span')]);this.south=Builder.node('div',{'class':cNamePrefix+'overlay '+cNamePrefix+'south'},[Builder.node('span')]);this.west=Builder.node('div',{'class':cNamePrefix+'overlay '+cNamePrefix+'west'},[Builder.node('span')]);var overlays=[this.north,this.east,this.south,this.west];this.dragArea=Builder.node('div',{'class':cNamePrefix+'dragArea'},overlays);this.handleN=Builder.node('div',{'class':cNamePrefix+'handle '+cNamePrefix+'handleN'});this.handleNE=Builder.node('div',{'class':cNamePrefix+'handle '+cNamePrefix+'handleNE'});this.handleE=Builder.node('div',{'class':cNamePrefix+'handle '+cNamePrefix+'handleE'});this.handleSE=Builder.node('div',{'class':cNamePrefix+'handle '+cNamePrefix+'handleSE'});this.handleS=Builder.node('div',{'class':cNamePrefix+'handle '+cNamePrefix+'handleS'});this.handleSW=Builder.node('div',{'class':cNamePrefix+'handle '+cNamePrefix+'handleSW'});this.handleW=Builder.node('div',{'class':cNamePrefix+'handle '+cNamePrefix+'handleW'});this.handleNW=Builder.node('div',{'class':cNamePrefix+'handle '+cNamePrefix+'handleNW'});this.selArea=Builder.node('div',{'class':cNamePrefix+'selArea'},[Builder.node('div',{'class':cNamePrefix+'marqueeHoriz '+cNamePrefix+'marqueeNorth'},[Builder.node('span')]),Builder.node('div',{'class':cNamePrefix+'marqueeVert '+cNamePrefix+'marqueeEast'},[Builder.node('span')]),Builder.node('div',{'class':cNamePrefix+'marqueeHoriz '+cNamePrefix+'marqueeSouth'},[Builder.node('span')]),Builder.node('div',{'class':cNamePrefix+'marqueeVert '+cNamePrefix+'marqueeWest'},[Builder.node('span')]),this.handleN,this.handleNE,this.handleE,this.handleSE,this.handleS,this.handleSW,this.handleW,this.handleNW,Builder.node('div',{'class':cNamePrefix+'clickArea'})]);this.imgWrap.appendChild(this.img);this.imgWrap.appendChild(this.dragArea);this.dragArea.appendChild(this.selArea);this.dragArea.appendChild(Builder.node('div',{'class':cNamePrefix+'clickArea'}));insertPoint.appendChild(this.imgWrap);this.startDragBind=this.startDrag.bindAsEventListener(this);Event.observe(this.dragArea,'mousedown',this.startDragBind);this.onDragBind=this.onDrag.bindAsEventListener(this);Event.observe(document,'mousemove',this.onDragBind);this.endCropBind=this.endCrop.bindAsEventListener(this);Event.observe(document,'mouseup',this.endCropBind);this.resizeBind=this.startResize.bindAsEventListener(this);this.handles=[this.handleN,this.handleNE,this.handleE,this.handleSE,this.handleS,this.handleSW,this.handleW,this.handleNW];this.registerHandles(true);if(this.options.captureKeys){this.keysBind=this.handleKeys.bindAsEventListener(this);Event.observe(document,'keypress',this.keysBind);}
new CropDraggable(this.selArea,{drawMethod:this.moveArea.bindAsEventListener(this)});this.setParams();},registerHandles:function(registration){for(var i=0;i<this.handles.length;i++){var handle=$(this.handles[i]);if(registration){var hideHandle=false;if(this.fixedWidth&&this.fixedHeight)hideHandle=true;else if(this.fixedWidth||this.fixedHeight){var isCornerHandle=handle.className.match(/([S|N][E|W])$/);var isWidthHandle=handle.className.match(/(E|W)$/);var isHeightHandle=handle.className.match(/(N|S)$/);if(isCornerHandle)hideHandle=true;else if(this.fixedWidth&&isWidthHandle)hideHandle=true;else if(this.fixedHeight&&isHeightHandle)hideHandle=true;}
if(hideHandle)handle.hide();else Event.observe(handle,'mousedown',this.resizeBind);}else{handle.show();Event.stopObserving(handle,'mousedown',this.resizeBind);}}},setParams:function(){this.imgW=this.img.width;this.imgH=this.img.height;$(this.north).setStyle({height:0});$(this.east).setStyle({width:0,height:0});$(this.south).setStyle({height:0});$(this.west).setStyle({width:0,height:0});$(this.imgWrap).setStyle({'width':this.imgW+'px','height':this.imgH+'px'});$(this.selArea).hide();var startCoords={x1:0,y1:0,x2:0,y2:0};var validCoordsSet=false;if(this.options.onloadCoords!=null){startCoords=this.cloneCoords(this.options.onloadCoords);validCoordsSet=true;}else if(this.options.ratioDim.x>0&&this.options.ratioDim.y>0){startCoords.x1=Math.ceil((this.imgW-this.options.ratioDim.x)/2);startCoords.y1=Math.ceil((this.imgH-this.options.ratioDim.y)/2);startCoords.x2=startCoords.x1+this.options.ratioDim.x;startCoords.y2=startCoords.y1+this.options.ratioDim.y;validCoordsSet=true;}
this.setAreaCoords(startCoords,false,false,1);if(this.options.displayOnInit&&validCoordsSet){this.selArea.show();this.drawArea();this.endCrop();}
this.attached=true;},remove:function(){if(this.attached){this.attached=false;this.imgWrap.parentNode.insertBefore(this.img,this.imgWrap);this.imgWrap.parentNode.removeChild(this.imgWrap);Event.stopObserving(this.dragArea,'mousedown',this.startDragBind);Event.stopObserving(document,'mousemove',this.onDragBind);Event.stopObserving(document,'mouseup',this.endCropBind);this.registerHandles(false);if(this.options.captureKeys)Event.stopObserving(document,'keypress',this.keysBind);}},reset:function(){if(!this.attached)this.onLoad();else this.setParams();this.endCrop();},handleKeys:function(e){var dir={x:0,y:0};if(!this.dragging){switch(e.keyCode){case(37):dir.x=-1;break;case(38):dir.y=-1;break;case(39):dir.x=1;break;case(40):dir.y=1;break;}
if(dir.x!=0||dir.y!=0){if(e.shiftKey){dir.x*=10;dir.y*=10;}
this.moveArea([this.areaCoords.x1+dir.x,this.areaCoords.y1+dir.y]);Event.stop(e);}}},calcW:function(){return(this.areaCoords.x2-this.areaCoords.x1);},calcH:function(){return(this.areaCoords.y2-this.areaCoords.y1);},moveArea:function(point){this.setAreaCoords({x1:point[0],y1:point[1],x2:point[0]+this.calcW(),y2:point[1]+this.calcH()},true,false);this.drawArea();},cloneCoords:function(coords){return{x1:coords.x1,y1:coords.y1,x2:coords.x2,y2:coords.y2};},setAreaCoords:function(coords,moving,square,direction,resizeHandle){if(moving){var targW=coords.x2-coords.x1;var targH=coords.y2-coords.y1;if(coords.x1<0){coords.x1=0;coords.x2=targW;}
if(coords.y1<0){coords.y1=0;coords.y2=targH;}
if(coords.x2>this.imgW){coords.x2=this.imgW;coords.x1=this.imgW-targW;}
if(coords.y2>this.imgH){coords.y2=this.imgH;coords.y1=this.imgH-targH;}}else{if(coords.x1<0)coords.x1=0;if(coords.y1<0)coords.y1=0;if(coords.x2>this.imgW)coords.x2=this.imgW;if(coords.y2>this.imgH)coords.y2=this.imgH;if(direction!=null){if(this.ratioX>0)this.applyRatio(coords,{x:this.ratioX,y:this.ratioY},direction,resizeHandle);else if(square)this.applyRatio(coords,{x:1,y:1},direction,resizeHandle);var mins=[this.options.minWidth,this.options.minHeight];var maxs=[this.options.maxWidth,this.options.maxHeight];if(mins[0]>0||mins[1]>0||maxs[0]>0||maxs[1]>0){var coordsTransX={a1:coords.x1,a2:coords.x2};var coordsTransY={a1:coords.y1,a2:coords.y2};var boundsX={min:0,max:this.imgW};var boundsY={min:0,max:this.imgH};if((mins[0]!=0||mins[1]!=0)&&square){if(mins[0]>0)mins[1]=mins[0];else if(mins[1]>0)mins[0]=mins[1];}
if((maxs[0]!=0||maxs[0]!=0)&&square){if(maxs[0]>0&&maxs[0]<=maxs[1])maxs[1]=maxs[0];else if(maxs[1]>0&&maxs[1]<=maxs[0])maxs[0]=maxs[1];}
if(mins[0]>0)this.applyDimRestriction(coordsTransX,mins[0],direction.x,boundsX,'min');if(mins[1]>1)this.applyDimRestriction(coordsTransY,mins[1],direction.y,boundsY,'min');if(maxs[0]>0)this.applyDimRestriction(coordsTransX,maxs[0],direction.x,boundsX,'max');if(maxs[1]>1)this.applyDimRestriction(coordsTransY,maxs[1],direction.y,boundsY,'max');coords={x1:coordsTransX.a1,y1:coordsTransY.a1,x2:coordsTransX.a2,y2:coordsTransY.a2};}}}
this.areaCoords=coords;},applyDimRestriction:function(coords,val,direction,bounds,type){var check;if(type=='min')check=((coords.a2-coords.a1)<val);else check=((coords.a2-coords.a1)>val);if(check){if(direction==1)coords.a2=coords.a1+val;else coords.a1=coords.a2-val;if(coords.a1<bounds.min){coords.a1=bounds.min;coords.a2=val;}else if(coords.a2>bounds.max){coords.a1=bounds.max-val;coords.a2=bounds.max;}}},applyRatio:function(coords,ratio,direction,resizeHandle){var newCoords;if(resizeHandle=='N'||resizeHandle=='S'){newCoords=this.applyRatioToAxis({a1:coords.y1,b1:coords.x1,a2:coords.y2,b2:coords.x2},{a:ratio.y,b:ratio.x},{a:direction.y,b:direction.x},{min:0,max:this.imgW});coords.x1=newCoords.b1;coords.y1=newCoords.a1;coords.x2=newCoords.b2;coords.y2=newCoords.a2;}else{newCoords=this.applyRatioToAxis({a1:coords.x1,b1:coords.y1,a2:coords.x2,b2:coords.y2},{a:ratio.x,b:ratio.y},{a:direction.x,b:direction.y},{min:0,max:this.imgH});coords.x1=newCoords.a1;coords.y1=newCoords.b1;coords.x2=newCoords.a2;coords.y2=newCoords.b2;}},applyRatioToAxis:function(coords,ratio,direction,bounds){var newCoords=Object.extend(coords,{});var calcDimA=newCoords.a2-newCoords.a1;var targDimB=Math.floor(calcDimA*ratio.b/ratio.a);var targB;var targDimA;var calcDimB=null;if(direction.b==1){targB=newCoords.b1+targDimB;if(targB>bounds.max){targB=bounds.max;calcDimB=targB-newCoords.b1;}
newCoords.b2=targB;}else{targB=newCoords.b2-targDimB;if(targB<bounds.min){targB=bounds.min;calcDimB=targB+newCoords.b2;}
newCoords.b1=targB;}
if(calcDimB!=null){targDimA=Math.floor(calcDimB*ratio.a/ratio.b);if(direction.a==1)newCoords.a2=newCoords.a1+targDimA;else newCoords.a1=newCoords.a1=newCoords.a2-targDimA;}
return newCoords;},drawArea:function(){var areaWidth=this.calcW();var areaHeight=this.calcH();var px='px';var params=[this.areaCoords.x1+px,this.areaCoords.y1+px,areaWidth+px,areaHeight+px,this.areaCoords.x2+px,this.areaCoords.y2+px,(this.img.width-this.areaCoords.x2)+px,(this.img.height-this.areaCoords.y2)+px];var areaStyle=this.selArea.style;areaStyle.left=params[0];areaStyle.top=params[1];areaStyle.width=params[2];areaStyle.height=params[3];var horizHandlePos=Math.ceil((areaWidth-6)/2)+px;var vertHandlePos=Math.ceil((areaHeight-6)/2)+px;this.handleN.style.left=horizHandlePos;this.handleE.style.top=vertHandlePos;this.handleS.style.left=horizHandlePos;this.handleW.style.top=vertHandlePos;this.north.style.height=params[1];var eastStyle=this.east.style;eastStyle.top=params[1];eastStyle.height=params[3];eastStyle.left=params[4];eastStyle.width=params[6];var southStyle=this.south.style;southStyle.top=params[5];southStyle.height=params[7];var westStyle=this.west.style;westStyle.top=params[1];westStyle.height=params[3];westStyle.width=params[0];this.subDrawArea();this.forceReRender();},forceReRender:function(){if(this.isIE||this.isWebKit){var n=document.createTextNode(' ');var d,el,fixEL,i;if(this.isIE)fixEl=this.selArea;else if(this.isWebKit){fixEl=document.getElementsByClassName('imgCrop_marqueeSouth',this.imgWrap)[0];d=Builder.node('div','');d.style.visibility='hidden';var classList=['SE','S','SW'];for(i=0;i<classList.length;i++){el=document.getElementsByClassName('imgCrop_handle'+classList[i],this.selArea)[0];if(el.childNodes.length)el.removeChild(el.childNodes[0]);el.appendChild(d);}}
fixEl.appendChild(n);fixEl.removeChild(n);}},startResize:function(e){this.startCoords=this.cloneCoords(this.areaCoords);this.resizing=true;this.resizeHandle=Event.element(e).classNames().toString().replace(/([^N|NE|E|SE|S|SW|W|NW])+/,'');Event.stop(e);},startDrag:function(e){this.selArea.show();this.clickCoords=this.getCurPos(e);this.setAreaCoords({x1:this.clickCoords.x,y1:this.clickCoords.y,x2:this.clickCoords.x,y2:this.clickCoords.y},false,false,null);this.dragging=true;this.onDrag(e);Event.stop(e);},getCurPos:function(e){var el=this.imgWrap,wrapOffsets=Position.cumulativeOffset(el);while(el.nodeName!='BODY'){wrapOffsets[1]-=el.scrollTop||0;wrapOffsets[0]-=el.scrollLeft||0;el=el.parentNode;}
return curPos={x:Event.pointerX(e)-wrapOffsets[0],y:Event.pointerY(e)-wrapOffsets[1]};},onDrag:function(e){if(this.dragging||this.resizing){var resizeHandle=null;var curPos=this.getCurPos(e);var newCoords=this.cloneCoords(this.areaCoords);var direction={x:1,y:1};if(this.dragging){if(curPos.x<this.clickCoords.x)direction.x=-1;if(curPos.y<this.clickCoords.y)direction.y=-1;this.transformCoords(curPos.x,this.clickCoords.x,newCoords,'x');this.transformCoords(curPos.y,this.clickCoords.y,newCoords,'y');}else if(this.resizing){resizeHandle=this.resizeHandle;if(resizeHandle.match(/E/)){this.transformCoords(curPos.x,this.startCoords.x1,newCoords,'x');if(curPos.x<this.startCoords.x1)direction.x=-1;}else if(resizeHandle.match(/W/)){this.transformCoords(curPos.x,this.startCoords.x2,newCoords,'x');if(curPos.x<this.startCoords.x2)direction.x=-1;}
if(resizeHandle.match(/N/)){this.transformCoords(curPos.y,this.startCoords.y2,newCoords,'y');if(curPos.y<this.startCoords.y2)direction.y=-1;}else if(resizeHandle.match(/S/)){this.transformCoords(curPos.y,this.startCoords.y1,newCoords,'y');if(curPos.y<this.startCoords.y1)direction.y=-1;}}
this.setAreaCoords(newCoords,false,e.shiftKey,direction,resizeHandle);this.drawArea();Event.stop(e);}},transformCoords:function(curVal,baseVal,coords,axis){var newVals=[curVal,baseVal];if(curVal>baseVal)newVals.reverse();coords[axis+'1']=newVals[0];coords[axis+'2']=newVals[1];},endCrop:function(){this.dragging=false;this.resizing=false;this.options.onEndCrop(this.areaCoords,{width:this.calcW(),height:this.calcH()});},subInitialize:function(){},subDrawArea:function(){}};Cropper.ImgWithPreview=Class.create();Object.extend(Object.extend(Cropper.ImgWithPreview.prototype,Cropper.Img.prototype),{subInitialize:function(){this.hasPreviewImg=false;if(typeof(this.options.previewWrap)!='undefined'&&this.options.minWidth>0&&this.options.minHeight>0){this.previewWrap=$(this.options.previewWrap);this.previewImg=this.img.cloneNode(false);this.previewImg.id='imgCrop_'+this.previewImg.id;this.options.displayOnInit=true;this.hasPreviewImg=true;this.previewWrap.addClassName('imgCrop_previewWrap');this.previewWrap.setStyle({width:this.options.minWidth+'px',height:this.options.minHeight+'px'});this.previewWrap.appendChild(this.previewImg);}},subDrawArea:function(){if(this.hasPreviewImg){var calcWidth=this.calcW();var calcHeight=this.calcH();var dimRatio={x:this.imgW/calcWidth,y:this.imgH/calcHeight};var posRatio={x:calcWidth/this.options.minWidth,y:calcHeight/this.options.minHeight};var calcPos={w:Math.ceil(this.options.minWidth*dimRatio.x)+'px',h:Math.ceil(this.options.minHeight*dimRatio.y)+'px',x:'-'+Math.ceil(this.areaCoords.x1/posRatio.x)+'px',y:'-'+Math.ceil(this.areaCoords.y1/posRatio.y)+'px'};var previewStyle=this.previewImg.style;previewStyle.width=calcPos.w;previewStyle.height=calcPos.h;previewStyle.left=calcPos.x;previewStyle.top=calcPos.y;}}});var Thumbnailer=Class.create({initialize:function(img,id,imagesContainer){this.img=$(img);this.imageId=id;this.imagesContainer=imagesContainer;this.imagesContainer.fire('thumbnailer:loading');this.create();},create:function(){var cropImageContainer;if((cropImageContainer=$('crop_image_container'))){cropImageContainer.remove();}
this.croppedImage=new Image();this.saveButton=Builder.node('button',{'id':'save_image','type':'submit'},[Builder.node('span',{'class':'i'},I18n.t('crop',{scope:'common'}))]);this.cancelButton=Builder.node('button',{'class':'cancel'},[Builder.node('span',{'class':'i'},I18n.t('cancel',{scope:'common'}))]);this.container=Builder.node('div',{'id':'crop_image_container',style:'display: none'},[Builder.node("h3",I18n.t('crop_image',{scope:'common'})),Builder.node('div',{'id':'crop_box'},[Builder.node('div',{id:'crop_image_wrapper'},[this.croppedImage])]),Builder.node('div',{'id':'crop_image_buttons'},[this.saveButton,this.cancelButton])]);this.imagesContainer.insert({after:this.container});this.attachEvents();this.loadImage();},attachEvents:function(){this.croppedImage.onload=function(){this.initializeCropper();this.container.scrollTo();}.bindAsEventListener(this);this.saveButton.observe('click',this.saveCrop.bindAsEventListener(this));this.cancelButton.observe('click',function(event){this.container.remove();this.imagesContainer.scrollTo();}.bindAsEventListener(this));},loadImage:function(){this.croppedImage.setAttribute('id','crop_image');this.croppedImage.src=this.img.src.gsub(/style=\w+/,'style=scaled');},initializeCropper:function(){new Cropper.Img('crop_image',{minWidth:384,minHeight:290,ratioDim:{x:4,y:3},displayOnInit:true,onEndCrop:this.onEndCrop.bind(this),onloadCoords:this.onLoadCoords()});this.container.show();this.container.fire('thumbnailer:loaded');},onEndCrop:function(coords,dimensions){this.coords=coords;this.dimensions=dimensions;},onLoadCoords:function(){var imgW=this.croppedImage.width;var imgH=this.croppedImage.height;var croppedW=imgW*0.75;var croppedH=imgH*0.75;var x1=Math.round((imgW-croppedW)/2);var y1=Math.round((imgH-croppedH)/2);return{x1:x1,x2:(x1+croppedW),y1:y1,y2:(y1+croppedH)};},saveCrop:function(event){var requestUrl;var urlReader=new ClassifiedsURLReader();if(urlReader.item()){requestUrl=urlReader.url.gsub("/edit","/save_thumbnail");}else{requestUrl='/'+I18n.locale+'/save_thumbnail';}
this.container.fire('thumbnailer:loading');new Ajax.Request(requestUrl,{method:'post',evalScripts:true,onComplete:function(request){this.container.fire('thumbnailer:loaded');this.container.remove();this.imagesContainer.scrollTo();return false;}.bind(this),parameters:{'crop_y':this.coords.y1,'crop_x':this.coords.x1,'crop_w':this.dimensions.width,'crop_h':this.dimensions.height,'image_id':this.imageId}});event.stop();}});var CategoryFilter=Class.create({initialize:function(select,triggers){this.select=$(select);this.visibleSet=null;this.initializeOptions();this.triggers=$A(triggers);this.triggers.each(function(trigger){trigger.object.observe('click',this.change.bind(this));}.bind(this));this.change();},initializeOptions:function(){this.groups=$A(this.select.getElementsByTagName('optgroup'));},fireEvent:function(eventName,value){this.select.fire('categoryFilter:'+eventName,value);},change:function(event){var checked=this.triggers.find(function(trigger){if(trigger.object.checked)return true;});if(checked&&checked.label==this.visibleSet)return;var selected=false;var groups=false;if(checked){this.visibleSet=checked.label;groups=this.show(checked.label);selected=true;}
this.fireEvent('change',{'selected':selected,'groups':groups,'selectedElement':(checked?checked.object:null)});},show:function(class_name){var visibleGroups=0;this.groups.each(function(group){if($(group).hasClassName(class_name)){visibleGroups++;group.show();}
else{group.hide();}}.bind(this));return visibleGroups>0;}});var CategoryFilterForIE=Class.create(CategoryFilter,{initializeOptions:function($super){this.originalOptions=$A();$A(this.select.childElements()).each(function(node){this.originalOptions.push(node.remove());}.bind(this));},show:function($super,class_name){var visibleGroups=0;var filtered=this.originalOptions.findAll(function(tag){if(tag.tagName.toLowerCase()=='optgroup'){if(tag.hasClassName(class_name)&&tag.childElements().length!=0){visibleGroups++;return true;}}
else{return true;}});this.select.innerHTML='';filtered.each(function(node){this.select.insert({bottom:node.cloneNode(true)});}.bind(this));return visibleGroups>0;}});var AreaSelector=Class.create({initialize:function(container,target){this.container=$(container);this.store=$H();this.target=$(target);this.container.observe('click',this.clickHandler.bind(this));},clickHandler:function(event){var element=event.element();if(element.nodeName.toLowerCase()=='a'){$(this.target).value=element.innerHTML;this.target.fire('areaSelector:selected',{'name':element.innerHTML});}
cancel(event,true);},show:function(){this.container.show();},hide:function(){this.container.hide();},display:function(location_id){if(location_id==false){this.hide();return;}
if(!this.loaded(location_id)){this.load(location_id);return;}
if(this.store.get(location_id).size()==0){this.hide();return;}
this.container.innerHTML=I18n.t('popular_areas',{scope:'common'})+': ';this.store.get(location_id).each(function(area){if(this.container.childElements().length>0){this.container.insert({bottom:', '});}
var areaLink=new Element('a',{href:'#'}).insert({bottom:area});this.container.insert({bottom:areaLink});}.bind(this));this.show();},load:function(location_id){this.container.innerHTML=loadingHTML();this.show();new Ajax.Request(this.requestURL(),{parameters:{'location_id':location_id},on500:insertIntoDebugWindow,method:'get',onComplete:function(){this.areaSelector.display(this.location_id);}.bind({areaSelector:this,'location_id':location_id}),onSuccess:function(transport){this.areaSelector.save(this.location_id,$A(eval('('+transport.responseText+')')));}.bind({areaSelector:this,'location_id':location_id}),onFailure:function(transport){this.areaSelector.save(this.location_id,[]);}.bind({areaSelector:this,'location_id':location_id})});},loaded:function(location_id){return this.store.keys().include(location_id);},requestURL:function(){return'/'+I18n.locale+'/areas';},save:function(location_id,options){this.store.set(location_id,options);}});var CurrencyWatch=Class.create({initialize:function(container_or_containers){if(!('each'in container_or_containers)){container_or_containers=$A([container_or_containers]);}
this.containers=container_or_containers.collect(function(container){return $(container)});this.currency=null;},change:function(country_id){if(Currencies){this.currency=Currencies[country_id.toString()];symbol=this.currency.symbol;}
else{this.currency=null;symbol='currencies.js not loaded?';}
this.containers.each(function(container){container.innerHTML=symbol;});}});var PliableForm=Class.create({initialize:function(form,update_block,reload_action){this.form=$(form);this.updateBlock=$(update_block);this.reloadAction=reload_action;this.elements=$A();},reload:function(){this.runUnload();this.fireEvent('query');new Ajax.Updater(this.updateBlock,this.reloadAction||this.form.action,{parameters:this.form.serialize(),onComplete:function(){this.runReload();}.bind(this)});},add:function(name,methods){var element=new PliableFormElement(name);element=Object.extend(element,methods);this.elements.push(element);},hide:function(){if(!this.coverPiece){this.coverPiece=new Element('div',{id:'pliable_form_cover'});this.coverPiece.hide();this.coverPiece.setOpacity(0.8);}
this.updateBlock.insert({bottom:this.coverPiece});this.coverPiece.setStyle({height:this.updateBlock.getHeight()+'px'});if(ie()){this.updateBlock.getElementsBySelector('select').each(function(select){select.hide();});}
this.coverPiece.show();},show:function(){this.updateBlock.insert({bottom:this.coverPiece});this.coverPiece.hide();},runInit:function(){this.run('init');},runUnload:function(){this.run('unload');},runReload:function(){this.run('reload');},run:function(eventName){this.fireEvent(eventName);this.elements.each(function(element,idx){element[eventName]();}.bind(this));this.fireEvent('end'+eventName.capitalize());},fireEvent:function(name){this.form.fire('pliableForm:'+name);}});var PliableFormElement=Class.create({initialize:function(name){this.name=name;},init:function(){},unload:function(){},reload:function(){}});var RootTreeNode=Class.create({initialize:function(){this.children=$A();this.parent=null;},addChild:function(node){this.children.push(node);node.parent=this;},pathToRoot:function(){return $A();},pathToRootWithoutThis:function(){return $A();},textPath:function(joiner){var path=[];this.pathToRootWithoutThis().each(function(n){path.push(n.name);});return path.join(joiner||this.defaultJoiner()).escapeHTML();},defaultJoiner:function(){return" &gt; ";},descendants:function(){var d=this.children.concat([]);for(var i=0;i<this.children.length;i++){d=d.concat(this.children[i].descendants());}
return d;}});var TreeNode=Class.create(RootTreeNode,{initialize:function($super,id,name){$super();this.id=id;this.name=name.unescapeHTML();this.nameLower=this.name.toLowerCase();},pathToRoot:function(){var a=this.pathToRootWithoutThis();a.push(this);return a;},pathToRootWithoutThis:function(){return this.parent.pathToRoot()},decoratedName:function(joiner){return'<span class="path">'+this.textPath(joiner)+
(joiner||this.defaultJoiner())+'</span> '+this.name;}});var CategoryTree=Class.create({initialize:function(treeParent,options){this.treeContainer=$(treeParent).down('.tree');this.element=treeParent.down('input.search-field');this.changed=false;this.hasFocus=false;this.index=false;var data=this.treeContainer.retrieve('metadata');if(!data){data="{}"
var m=/({.*})/.exec(this.treeContainer.getAttribute('class'));if(m){data=m[1];}
data=eval("("+data+")");this.treeContainer.store('metadata',data);}
this.options=Object.extend({frequency:0.1,minChars:1,ignoreCase:true,initiallyHidden:[]},Object.extend(data,options||{}));var label=this.options.label||function(node){return node.down().innerHTML;}
var parent=new RootTreeNode();var levels=$A([parent]);this.allNodes=$H();this.visibleValues=$A();this.domNodes=$H();this.tree={nodes:$A(),node_hash:$H(),root:parent}
this.treeContainer.select('li').each(function(node){var level=parseInt(node.className.match(/l_([0-9+])/)[1]);var value=parseInt(node.className.match(/v_([0-9]+)/)[1]);var name=label(node);var treeNode=new TreeNode(value,name);levels[level].addChild(treeNode);levels[level+1]=treeNode;this.tree.nodes.push(treeNode);this.tree.node_hash.set(value,treeNode)
this.allNodes.set(treeNode.id,false);this.visibleValues.push(treeNode.id);this.domNodes.set(value,node)}.bind(this));this.hiddenValues=[];this.options.initiallyHidden.each(function(value){this.hideValue(value);}.bind(this));this.offsetDifference=this.domNodes.values()[0].positionedOffset()[1];this.observe();},onKeyPress:function(event){switch(event.keyCode){case Event.KEY_TAB:this.selectEntry(event);return;case Event.KEY_RETURN:this.selectEntry(event);Event.stop(event);return;case Event.KEY_ESC:this.reset();Event.stop(event);return;case Event.KEY_LEFT:case Event.KEY_RIGHT:return;case Event.KEY_UP:this.markPrevious();this.render();Event.stop(event);return;case Event.KEY_DOWN:this.markNext();this.render();Event.stop(event);return;}
this.changed=true;this.hasFocus=true;if(this.observer)clearTimeout(this.observer);this.observer=setTimeout(this.onObserverEvent.bind(this),this.options.frequency*1000);},observe:function(){Event.observe(this.element,'keydown',this.onKeyPress.bindAsEventListener(this));},reset:function(){this.index=false;this.element.value='';this.showAll();},onObserverEvent:function(){this.changed=false;if(this.getToken().length>=this.options.minChars){this.updateChoices();this.render();}else{this.showAll();}
this.oldElementValue=this.element.value;},selectEntry:function(event){if(this.index!==false){this.updateElement(this.getCurrentTreeNode(),this.getCurrentDomNode());if(this.options.afterSelect){this.options.afterSelect(this,event);}}},getCurrentTreeNode:function(){return this.tree.node_hash.get(this.visibleValues[this.index]);},getCurrentDomNode:function(){return this.getDomNodeFromValue(this.visibleValues[this.index]);},updateElement:function(treeNode,domNode){if(this.options.updateElement){this.options.updateElement(this,treeNode,domNode);return;}
var value='';if(this.options.select){var nodes=$(selectedElement).select('.'+this.options.select)||[];if(nodes.length>0)value=Element.collectTextNodes(nodes[0],this.options.select);}else
value=treeNode.pathToRoot().collect(function(n){return n.name;}).join(" > ")
this.element.value=value;if(this.options.afterUpdateElement)
this.options.afterUpdateElement(this,treeNode,domNode);},markPrevious:function(){if(this.index===false)this.index=0;if(this.index>0){this.index--;}
else{this.index=this.visibleValues.length-1;}
this.scrollToSelected();},markNext:function(){if(this.index===false)this.index=-1;if(this.index<this.visibleValues.length-1){this.index++;}
else{this.index=0;}
this.scrollToSelected();},scrollToSelected:function(){var nodePos=this.getDomNodeFromValue(this.visibleValues[this.index]).positionedOffset()[1]-this.offsetDifference;var scrollTop=this.treeContainer.scrollTop;var treeHeight=this.treeContainer.getHeight()
if(nodePos+20>this.treeContainer.scrollTop+treeHeight||nodePos<this.treeContainer.scrollTop){this.treeContainer.scrollTop=nodePos-treeHeight/2;}},updateChoices:function(){var entry=this.getToken();if(entry==this.oldElementValue){return;}
if(this.options.ignoreCase)
entry=entry.toLowerCase();var nodes=this.tree.root.children;var newHidden=this.tree.nodes.inject($H(),function(acc,node){acc.set(node.id,true);return acc;});while(nodes.length>0){var futureNodes=[];for(var i=0;i<nodes.length;i++){var item=nodes[i];var foundPos=this.options.ignoreCase?item.nameLower.indexOf(entry,0):item.name.indexOf(entry,0);if(foundPos==-1){futureNodes=futureNodes.concat(item.children);}else if(this.hiddenValues.indexOf(item.id)==-1){var related=item.pathToRoot();related=related.concat(item.descendants());for(var j=0;j<related.length;j++){newHidden.set(related[j].id,false);}}}
nodes=futureNodes;}
this.visibleValues=[];newHidden.each(function(n){var node=this.getDomNodeFromValue(n[0]);if(n[1]){node.hide();}else{node.show();if(!node.hasClassName('l_0')){this.visibleValues.push(n[0]);}}}.bind(this));this.index=false;},onBlur:function(event){this.hasFocus=false;},render:function(){if(this.visibleValues.length>0){this.treeContainer.select('.selected').each(function(n){n.removeClassName('selected');});if(this.index!==false){this.getDomNodeFromValue(this.visibleValues[this.index]).down().addClassName('selected');}}},getDomNodeFromValue:function(value){return this.domNodes.get(value);},getToken:function(){return this.element.value.strip();},showAll:function(treeNode){treeNode=treeNode||this.tree.root;var path=treeNode.pathToRoot();if(path.find(function(n){return this.hiddenValues.indexOf(n.id)!=-1;}.bind(this))){return;}
var domNode=this.getDomNodeFromValue(treeNode.id)||this.treeContainer;Element.show(domNode);treeNode.descendants().each(function(n){if(this.hiddenValues.indexOf(n.id)==-1){Element.show(this.getDomNodeFromValue(n.id));}}.bind(this));while(domNode=domNode.up('li')){domNode.show();}
this.visibleValues=this.tree.root.children.collect(function(n){return n.descendants();}).flatten().collect(function(n){return n.id;}).reject(function(n){return this.hiddenValues.indexOf(n)!=-1;}.bind(this));},hideValue:function(value){if(this.hiddenValues.indexOf(value)!=-1){return;}
this.hiddenValues.push(value);this.visibleValues.splice(this.visibleValues.indexOf(value),1);this.getDomNodeFromValue(value).hide();},unhideValue:function(value){if(this.hiddenValues.indexOf(value)==-1){return;}
this.hiddenValues.splice(this.hiddenValues.indexOf(value),1);this.visibleValues.push(value);this.getDomNodeFromValue(value).show();}});var InputTree=Class.create(CategoryTree,{observe:function($super){$super();Event.observe(this.treeContainer,'click',this.onClick.bindAsEventListener(this));},onClick:function(event){var element=event.element();if(element.nodeName.toLowerCase()!='li')element=element.up('li')||element;this.index=false;var input=element.childElements().find(function(n){return n.nodeName.toString().toLowerCase()=='input';});if(!input){return;}
var value=input.value;for(var i=0;i<this.visibleValues.length;i++){if(this.visibleValues[i]==value){this.index=i;break;}}
this.selectEntry(event);this.render();var nodeName=event.element().nodeName.toLowerCase();switch(nodeName){case'label':Event.stop(event);break;}},render:function(){if(this.visibleValues.length>0){this.treeContainer.select('label.selected').each(function(n){n.removeClassName('selected');});if(this.index!==false){this.getDomNodeFromValue(this.visibleValues[this.index]).down('label').addClassName('selected');}}},reset:function($super){var current=this.getCurrentDomNode();if(current){current.down('input[type=radio]').checked=false;var currentLabel=current.down('label.selected');if(currentLabel){currentLabel.removeClassName('selected');}}
$super();}});var AddressParts=Class.create({initialize:function(){this.has_country=false;this.has_location=false;this.has_area=false;this.has_street=false;this.has_number=false;this.has_postal_code=false;this.street=$('street_name')&&$F('street_name');this.has_street=this.street&&!this.street.blank();this.number=$('street_number')&&$F('street_number');this.has_number=this.number&&!this.number.blank();this.area=$('area_field')&&$F('area_field');this.has_area=this.area&&!this.area.blank();if($('edit_item_location_id')){this.location=this.getNameFromSelect('edit_item_location_id')}else{this.location=this.getNameFromSelect('edit_item_address_location_id')}
this.has_location=!!this.location;this.country=this.getNameFromSelect('edit_item_country_id');this.has_country=!!this.country;this.postal_code=$('postal_code')&&$F('postal_code');this.has_postal_code=this.postal_code&&!this.postal_code.blank();},getNameFromSelect:function(e){var element=$(e);var value=$F(element);if(!value||value.toString()=='-1'){return null;}
return element.options[element.selectedIndex].innerHTML;}});var AddressReader=Class.create({initialize:function(){},read:function(){this.parts=new AddressParts();var addresses=[];if(this.parts.has_country){addresses.push(this.buildFrom('number_name','postal_code','country'));addresses.push(this.buildFrom('name_number','postal_code','country'));addresses.push(this.buildFrom('name','postal_code','country'));addresses.push(this.buildFrom('postal_code','country'));addresses.push(this.buildFrom('number_name','area','location','country'));addresses.push(this.buildFrom('name_number','area','location','country'));addresses.push(this.buildFrom('name','area','location','country'));addresses.push(this.buildFrom('number_name','location','country'));addresses.push(this.buildFrom('name_number','location','country'));addresses.push(this.buildFrom('name','location','country'));addresses.push(this.buildFrom('area','location','country'));addresses.push(this.buildFrom('location','country'));addresses.push(this.buildFrom('number_name','location'));addresses.push(this.buildFrom('name_number','location'));addresses.push(this.buildFrom('name','location'));addresses.push(this.buildFrom('number_name','country'));addresses.push(this.buildFrom('name_number','country'));addresses.push(this.buildFrom('name','country'));addresses.push(this.buildFrom('country'));addresses=addresses.compact().uniq();}
return addresses;},validateParts:function(pieces){this.valid=true;pieces.each(function(piece){if(!this.valid)return null;switch(piece){case'name':if(!this.parts.has_street){this.valid=false;}
break;case'number_name':if(!this.parts.has_street||!this.parts.has_number){this.valid=false;}
break;case'name_number':if(!this.parts.has_street||!this.parts.has_number){this.valid=false;}
break;case'postal_code':if(!this.parts.has_postal_code){this.valid=false;}
break;case'area':if(!this.parts.has_area){this.valid=false;}
break;case'location':if(!this.parts.has_location){this.valid=false;}
break;case'country':if(!this.parts.has_country){this.valid=false;}
break;default:return null;}}.bind(this));return this.valid;},buildFrom:function(){var pieces=$A(arguments);if(this.validateParts(pieces)){return this.buildCompiled(pieces);}
return null;},buildCompiled:function(pieces){var compiledParts=[];pieces.each(function(piece){switch(piece){case'name':compiledParts.push(this.parts.street);break;case'number_name':compiledParts.push(this.parts.number+' '+this.parts.street);break;case'name_number':compiledParts.push(this.parts.street+' '+this.parts.number);break;case'postal_code':compiledParts.push(this.parts.postal_code);break;case'area':compiledParts.push(this.parts.area);break;case'location':compiledParts.push(this.parts.location);break;case'country':compiledParts.push(this.parts.country);break;}}.bind(this));return compiledParts.compact().join(', ');}});var SimpleAsyncForm=Class.create({initialize:function(frmId){this.frm_=$(frmId);this.frm_.observe('submit',this._onSubmit.bind(this));this.waitImg_=this.frm_.down('img.wait');this.waitImg_.hide();},restart:function(){Form.Element.enable(this._submitButton());this._submitButton().removeClassName('disabled');this._errorContainer().childElements().each(Element.remove);if(this.waitImg_){this.waitImg_.hide();}},setOnSuccess:function(fn){this.onSuccess_=fn;},setOnFailure:function(fn){this.onFailure_=fn;},_onSubmit:function(evt){Form.Element.disable(this._submitButton());this._submitButton().addClassName('disabled');this._errorContainer().childElements().each(Element.remove);if(this.waitImg_){this.waitImg_.show();}
evt.stop();new Ajax.Request(this.frm_.action==""?"?":this.frm_.action,{parameters:Form.serialize(this.frm_),onSuccess:this._onSuccess.bind(this)});},_onSuccess:function(response){var results=response.responseText.evalJSON();this._errorContainer().childElements().each(Element.remove);Form.Element.enable(this._submitButton());this._submitButton().removeClassName('disabled');if(this.waitImg_){this.waitImg_.hide();}
if(results.simple_async_form&&results.simple_async_form.error_messages){this._errorContainer().insert({top:results.simple_async_form.error_messages});if(!Object.isUndefined(this.onFailure_)){this.onFailure_(this,results);}}else{if(!Object.isUndefined(this.onSuccess_)){this.onSuccess_(this,results);}}},_errorContainer:function(){if(Object.isUndefined(this.errorContainer_)){this.errorContainer_=this.frm_.down('.errorMessagesContainer');}
return this.errorContainer_;},_submitButton:function(){if(Object.isUndefined(this.submitButton_)){this.submitButton_=this.frm_.down('button[type=submit]');}
return this.submitButton_;}});var PasswordResetAsyncForm=Class.create(SimpleAsyncForm,{_onSuccess:function($super,response){var results=response.responseText.evalJSON();if(results.password_reset_form&&results.password_reset_form.success_message){this._passwordResetContainer().childElements().each(Element.remove);this._passwordResetContainer().replace(results.password_reset_form.success_message);}else if(results.password_reset_form&&results.password_reset_form.error_messages){this._errorContainer().childElements().each(Element.remove);Form.Element.enable(this._submitButton());this._submitButton().removeClassName('disabled');this._errorContainer().insert({top:results.password_reset_form.error_messages});if(!Object.isUndefined(this.onFailure_)){this.onFailure_(this,results);}}else{if(!Object.isUndefined(this.onSuccess_)){this.onSuccess_(this,results);}}},_passwordResetContainer:function(){if(Object.isUndefined(this.passwordResetContainer_)){this.passwordResetContainer_=$('inline_password_reset_container');}
return this.passwordResetContainer_;}});var NotLoggedItemEditForm=Class.create({initialize:function(frmId){this.frm_=$(frmId);this.formsAlreadyWired=false;this.frm_.observe('submit',this._onSubmit.bind(this));},setContent:function(content){this.content_=content;},_onSubmit:function(evt){evt.stop();if(!this.lightbox_){this.lightbox_=new ManualLightbox();this.lightbox_.onInsert=this._onInsert.bind(this);this.lightbox_.autosizeable();var deactivate_without_bossy_disable=this.lightbox_.deactivate;var theLightbox=this.lightbox_;this.lightbox_.deactivate=function($super){window._bossy_form.setEnabled(true);deactivate_without_bossy_disable.apply(theLightbox,[$super]);};}
this.lightbox_.activate(this._contentMethod.bind(this),{wide:true});},_contentMethod:function(){return this.content_;},_onInsert:function(){var login_or_register=$('login_or_register');if(login_or_register){if(!this.formsAlreadyWired){this.formsAlreadyWired=true;this.login_and_register=new LoginAndRegister('login_or_register');this.loginForm=new SimpleAsyncForm('inline_login_form'),this.registerForm=new SimpleAsyncForm('inline_register_form'),this.resetPasswordForm=new PasswordResetAsyncForm('inline_password_reset_form');this.loginForm.setOnSuccess(this._onSuccess.bind(this));this.registerForm.setOnSuccess(this._onSuccess.bind(this));this.resetPasswordForm.setOnSuccess(this._onSuccess.bind(this));this.loginForm.setOnFailure(this._onFailure.bind(this));this.registerForm.setOnFailure(this._onFailure.bind(this));this.resetPasswordForm.setOnFailure(this._onFailure.bind(this));$('register_account_password').setValue('');$('register_account_email').setValue('');}else{this.loginForm.restart();this.registerForm.restart();this.resetPasswordForm.restart();}}},_onSuccess:function(frm,response){var div;if((div=$('lbContent'))){div.remove();}
this.lightbox_.lightbox.removeClassName('done');this.lightbox_.processInfo("<h2>"+I18n.t('please_wait',{scope:'common'})+"</h2>");window._bossy_form.setEnabled(false);this.frm_.submit();},_onFailure:function(frm,response){this.lightbox_._autoSize();}});var VideoFieldController=Class.create({initialize:function(container){this.container=$(container);this.field=Element.select(container,'.video_url_field')[0];this.embedButton=Element.select(container,'.embed_video_button')[0];this.removeButton=Element.select(container,'.remove_video_button')[0];this.removeButton.hide();this.deleteField=Element.select(container,'.video_delete_field')[0];this.hiddenURL=$F(Element.select(container,'.embed_video_url')[0]);this.videoPreview=$('video_preview_embed');this.embedButton.observe('click',this._embedButtonClick.bind(this));this.removeButton.observe('click',this._removeButtonClicked.bind(this));this.field.observe('focus',this._unfocusIfReadOnly.bind(this));this.field.observe('change',this._undeleteIfChanged.bind(this));this._embedVideo();},_embedButtonClick:function(e){e.stop();this._embedVideo();},_embedVideo:function(){if($F(this.field)){var href=this.hiddenURL+'?url='+encodeURIComponent($F(this.field));Element.addClassName(this.field,'disabled');this.field.setAttribute('readonly',true);Form.Element.disable(this.embedButton);Element.addClassName(this.videoPreview,'with-spinner');Element.show(this.removeButton);this.deleteField.value=null;new Ajax.Request(href,{method:'GET',onSuccess:this._embedRequestSuccess.bind(this),onFailure:this._embedRequestFailure.bind(this)});}},_embedRequestSuccess:function(response){Element.removeClassName(this.videoPreview,'with-spinner');Element.update('video_preview_embed',response.responseText);},_embedRequestFailure:function(){Element.addClassName(this.videoPreview,'with-error');Element.removeClassName(this.videoPreview,'with-spinner');Element.update('video_preview_embed','Ooops');Element.removeClassName(this.field,'disabled');this.field.removeAttribute('readonly');Form.Element.enable(this.embedButton);Element.hide(this.removeButton);},_removeButtonClicked:function(){Element.removeClassName(this.field,'disabled');this.field.removeAttribute('readonly');Form.Element.enable(this.embedButton);Form.Element.clear(this.field);Element.hide(this.removeButton);Element.update(this.videoPreview,'');this.deleteField.value=1;},_unfocusIfReadOnly:function(e){if(e.target.readonly){e.target.blur();}},_undeleteIfChanged:function(e){if(this.field.value){this.deleteField.value=null;}}});function addLanguageTab(link,association,content){link=$(link);var new_id=new Date().getTime();var regexp=new RegExp("new_"+association,"g");content=content.replace(regexp,new_id);var content_container=new Element('div');content_container.insert(content);content_container.hide();$('multilingual-details-content').insert({bottom:content_container});window.editorController.findEditors();var phones=$('multilingual-details-content').select('input.phone');phones.last().value=phones.first().value;var new_location=$('multilingual-details-content').select('select.calling_code').last();var old_location=$('multilingual-details-content').select('input.hidden_calling_code').first()||$('multilingual-details-content').select('select.calling_code').first();new_location.value=old_location.value;var websites=$('multilingual-details-content').select('input.website');websites.last().value=websites.first().value;if(window.location.host.match(/^directory\./)){var company_names=$('multilingual-details-content').select('input.title')
company_names.last().value=company_names.first().value;}
window.languageTabController.addNewTabFromDetailUnit(content_container);}
var PreviouslySelectedLanguageTab=null;var MultilingualTabContainer=Class.create({initialize:function(tabContainer){this._tab_container=tabContainer;this._tabs=[];this._active_tab=null;this._add_tab=$('multilingual-details-add');this._tab_container.observe('click',this.clickHandler.bindAsEventListener(this));},unload:function(){this._tabs.each(function(t){t.unload();});this._tab_container.stopObserving('click');},clickHandler:function(event){var element=event.element();var tab=null;if(element.hasClassName('tab')){tab=element;}
else{tab=element.up('.tab');}
if(element.nodeName.toString().toLowerCase()=='a'){if(tab&&tab._tabs_index!=null){cancel(event);if(element.hasClassName('link')){this.setActiveTab(tab._tabs_index);}
else if(element.hasClassName('remove')){this.removeTab(tab._tabs_index);}}
element.blur();}},addNewTabFromDetailUnit:function(detail_unit){var tab=this.addTabFromDetailUnit(detail_unit);this.setActiveTab(tab);},addTabFromDetailUnit:function(detailUnit){var language_selector=detailUnit.down('select');var name=null;if(language_selector.selectedIndex>0){name=language_selector.options[language_selector.selectedIndex].innerHTML;}
else{name=I18n.t('new',{scope:'common'});}
var errors=detailUnit.hasClassName('tab-errors');var tab=new MultilingualTab(this,detailUnit,name,errors);var li=tab.create();li._tabs_index=this._tabs.length;this._tabs.push(tab);this._add_tab.insert({before:li});li.fire('MultilingualTab:created');this.setCanAdd();this.setCanDelete();return this._tabs.length-1;},setActiveTab:function(i){var new_tab=this._tabs[i];if(new_tab){var current_tab=this.activeTab();if(current_tab){current_tab.makeInactive();}
new_tab.makeActive();this._active_tab=i;PreviouslySelectedLanguageTab=i;}
return this._active_tab;},removeTab:function(i){if(!confirm(I18n.t('delete_confirm',{scope:'common.message'}))){return;}
var tab=this._tabs[i];tab.remove();this.setCanDelete();for(var j=i;j>=0;j--){if(!this._tabs[j].deleted){this.setActiveTab(j);return;}}
for(var j=i;j<this._tabs.length;j++){if(!this._tabs[j].deleted){this.setActiveTab(j);return;}}},setCanAdd:function(){if(this._canAdd){return;}
this._canAdd=this._tabs.length>1||this._tabs[0].hasLanguage();if(this._canAdd){this._tab_container.removeClassName('no-extras');}
else{this._tab_container.addClassName('no-extras');}},setCanDelete:function(){var count=0;for(var i=0;i<this._tabs.length;i++){if(!this._tabs[i].deleted){count+=1;if(count>1){this._tab_container.removeClassName('no-delete');return;}}}
this._tab_container.addClassName('no-delete');},activeTab:function(){if(this._active_tab==null){return null;}
return this._tabs[this._active_tab];},pickOpeningTab:function(){if(PreviouslySelectedLanguageTab!=null){this.setActiveTab(PreviouslySelectedLanguageTab);if(this.activeTab())return this._active_tab;}
for(var i=0;i<this._tabs.length;i++){if(this._tabs[i].errors()){this.setActiveTab(i);return this._active_tab;}}
this.setActiveTab(0);return 0;}});var MultilingualTab=Class.create({initialize:function(parent,content,name,errors){this._parent=parent;this._content=$(content);this._errors=errors||false;this._name=name||'No name';this._content.hide();this._content.observe('language:selected',this.renameFromEvent.bindAsEventListener(this));this.create();this.deleted=this._content.down('.remove-field').down('.remove').checked
if(this.deleted){this.remove();}},unload:function(){this._content.stopObserving('language:selected');},errors:function(){return this._errors;},remove:function(){this.deleted=true
this._content.down('.remove-field').down('.remove').checked=true;this._content.hide();this._li.hide();try{this._li.remove();}catch(e){};},rename:function(name){this._link.innerHTML=name;},renameFromEvent:function(event){this._parent.setCanAdd();this.rename(event.memo.name);this.setFlag(event.memo.language_id);},makeActive:function(){this._li.addClassName('active');this._content.show();this._li.fire('MultilingualTab:setActive');},makeInactive:function(){this._li.removeClassName('active');this._content.hide();},setFlag:function(language_id){var code=languageCodeFromID(language_id);if(this._flag){this._flag.remove();}
this._flag=new Element('img',{'src':assetHost.asset_src('/images/misc/blank_5639.gif'),'width':'16'});this._li.insert({top:this._flag});if(code){this._flag.addClassName('flag_sprite_standalone flag_sprite_'+code);}},create:function(){if(!this._li){this._li=new Element('li',{'class':'tab'});this._link=new Element('a',{'href':'#','class':'link will_not_be_intimidated'});this._link.innerHTML=this._name;this._remove_link=new Element('a',{'href':'#','class':'remove','title':I18n.t('remove',{scope:'common'})});this._remove_link.insert(I18n.t('remove',{scope:'common'}));this._li.insert(this._remove_link);this._li.insert(this._link);if(this._errors){this._li.addClassName('errors');}
var matches=this._content.className.toString().match(/language-id-([0-9]+)/);if(matches){this.setFlag(matches[1]);}}
return this._li;},hasLanguage:function(){var select=this._content.getElementsBySelector('select.post_auto_detect_language').first();var value=$F(select);if(value==''||value==null){return false;}
return true;}});function setupPliablePostForm(){var itemForm=$('edit_item');window.formController=new PliableForm(itemForm,'pliable','/'+I18n.locale+'/repost');var pliablePiece=$('pliable');itemForm.observe('pliableForm:unload',function(){this.hide();}.bind(window.formController));itemForm.observe('pliableForm:query',function(){if(!this.loadingPrompt){this.loadingPrompt=new Element('div');this.loadingPrompt.innerHTML=loadingHTML();}
$('pliable-loading').insert(this.loadingPrompt);}.bind(window.formController));itemForm.observe('pliableForm:endReload',function(){if(this.loadingPrompt){try{this.loadingPrompt.remove();}catch(e){};}
this.show();}.bind(window.formController));var categorySelector=$('edit_item_category_id');if(categorySelector){categorySelector.fireCustomChangeEvent=function(){this.fire('categorySelector:change',{'category_id':$F(this)});};categorySelector.observe('change',function(event){event.element().fireCustomChangeEvent();});}
var forceCategory=false;if((filter_container=$('category_filter'))){if(ie()){forceCategory=true;var forceCategoryValue=$F('edit_item_category_id');}
categorySelector=$('category_selector');categorySelector.hide();itemForm.observe('categoryFilter:change',function(event){if(event.memo.selected&&event.memo.groups){event.memo.selectedElement.up('div').insert({bottom:this});this.show();}
else{this.hide();}
this.toggleClassName('OneBrowserToRuleThemAll');}.bindAsEventListener(categorySelector));var triggers=$A(filter_container.getElementsBySelector('.category_filter_label')).collect(function(label){show=label.className.match(/\blabel_([a-z_-]+)\b/)[1];return{'object':$(label.htmlFor),'label':show};});CategoryFilterForIE.prototype.change=CategoryFilterForIE.prototype.change.wrap(function(){var ret,args=$A(arguments),proceed=args.shift();ret=proceed.apply(this,args);this.select.fireCustomChangeEvent();return ret;});CategoryFilterForIE.prototype.show=CategoryFilterForIE.prototype.show.wrap(function(){var visibleGroups,args=$A(arguments),show=args.shift();var class_name=args.first();visibleGroups=show.apply(this,args);if(visibleGroups){var optgroups=this.select.getElementsBySelector('optgroup.'+class_name);if(optgroups.length==1){var optgroup=optgroups.first();if(optgroup.childElements().length==1){for(var i=0;i<this.select.options.length;i++){var value=this.select.options[i].value.toString();if(!value.blank()&&value!='-1'){this.select.value=value;this.select.selectedIndex=i;try{this.select.options[i].selected="selected";}catch(e){}}
else{try{this.select.options[i].selected="";}catch(e){}}}
visibleGroups=false;}}}
return visibleGroups;});var filter=new CategoryFilterForIE($('category_selector').down('select'),triggers);}
window.formController.add('area selector',{init:function(){this.areaSelectorDiv=new Element('div',{id:'area_selector_drop','class':'textbox_small_font'});this.areaSelector=new AreaSelector(this.areaSelectorDiv,'area_field');this.reload();},reload:function(){var area=$('area');if(area){this.areaSelector.target=$('area_field');area.insert({bottom:this.areaSelectorDiv});this.observe();}},unload:function(){$('edit_item').stopObserving('locationSelector:locationSelected');},observe:function(){this.observer=$('edit_item').observe('locationSelector:locationSelected',function(event){if(event['memo']['location_id']!=false&&$F($('edit_item').down('.region_selector'))!=$F($('edit_item').down('.country_selector'))){this.display(event.memo.location_id);}}.bind(this.areaSelector));}});window.formController.add('area field',{init:function(){this.reload();},reload:function(){this.observe();},unload:function(){$('edit_item').stopObserving('locationSelector:locationSelected');},observe:function(){var item=$('edit_item');item.observe('locationSelector:locationSelected',function(event){var areaField=$('area_field');var areaSelectorDrop=$('area_selector_drop');var countrySelector=$('edit_item_country_id');var regionSelector=$('edit_item_location_id')||$('edit_item_address_location_id');var ev=event['memo'];if(!ev['location_id']||(ev['location_id']==$F(countrySelector)&&ev['countryHasRegions'])||$F(regionSelector)==$F(countrySelector)){areaField.value='';areaSelectorDrop.hide();}else{areaSelectorDrop.show();}}.bind(this));}});window.formController.add('map display',{init:function(){this.delayedObservers=$A();this.addressReader=new AddressReader();this.reload();},initOrUpdateMap:function(){var map_container=$('map_container');if(map_container){if(this.map){this.map.container=map_container;this.map.hideMapContainer();this.map.initMap();}
else{this.map=new ItemEditMap(map_container,this.addressReader.read.bind(this.addressReader));}
this.map.buttonHandler=new MapButtonHandler(this.map);if($F($('map_options'))!==""){this.map.buttonHandler.previewButtonClickHandler();}}},reload:function(){this.initOrUpdateMap();if(this.map){this.observe();}},unload:function(){if(this.map){this.map.map=null;this.map.point=null;this.unObserve();}},observe:function(){$('edit_item').observe('map:point',function(event){var point=event.memo;$('item_lat').value=point.lat||'';$('item_lng').value=point.lng||'';});$$('#step_details .title').each(function(e){e.observe('focus',function(event){if(!this.map.formLatLng())
this.map.locateAndDisplay(false,{overrideDisplay:true});}.bindAsEventListener(this));}.bind(this));},unObserve:function(){$('edit_item').stopObserving('map:point');if($('show_map')){$('show_map').stopObserving('change');}
$$('#step_details .title').each(function(e){e.stopObserving('focus');});this.map.buttonHandler.unObserve();if(this.map.optionsHandler)
this.map.optionsHandler.unObserve();}});window.formController.add('currency controller',{init:function(){this.initOrUpdate();},initOrUpdate:function(){this.currencyContainers=$('edit_item').getElementsBySelector('span.currency');if(this.currencyContainers.length>0){if(this.currencyWatcher){this.currencyWatcher.containers=this.currencyContainers;}
else{this.currencyWatcher=new CurrencyWatch(this.currencyContainers);}
this.observe();}},reload:function(){this.initOrUpdate();},observe:function(){$('edit_item').observe('locationSelector:countrySelected',function(event){this.change(event.memo.location_id);if(this.currency){if($('decimal_places_2')&&ThreeDecimalCurrencies.include(this.currency.id)){var threeZeros=new Element('span',{id:'decimal_places_3'}).update('000');$('decimal_places_2').replace(threeZeros);}
else if($('decimal_places_3')&&!ThreeDecimalCurrencies.include(this.currency.id)){var twoZeros=new Element('span',{id:'decimal_places_2'}).update('00');$('decimal_places_3').replace(twoZeros);}}}.bind(this.currencyWatcher));},unObserve:function(){$('edit_item').stopObserving('locationSelector:countrySelected');}});window.formController.add('price input watch',{init:function(){this.initOrUpdate();},initOrUpdate:function(){this.priceInput=$('edit_item_price');this.observe();},reload:function(){this.initOrUpdate();},observe:function(){if(this.priceInput){this.priceInput.observe('blur',function(event){var markersTag=$('currency_separator');if(markersTag){var separator=markersTag.innerHTML;var priceField=$('edit_item_price');var changed=false;var decimalPart=new RegExp('(\\'+separator+'[^\\'+separator+']*)$',"");if(decimalPart.test($F(priceField))){priceField.value=$F(priceField).replace(decimalPart,'');changed=true;}
var nonDigits=new RegExp('[^0-9]',"g");if(nonDigits.test($F(priceField))){priceField.value=$F(priceField).replace(nonDigits,'');changed=true;}
if(changed){alert(I18n.t('decimals_not_allowed',{scope:'common.message'}));}}}.bind(this));}},unObserve:function(){if(this.priceInput){this.priceInput.stopObserving('blur');}}});window.formController.add('location selector',{init:function(){this.locationSelector=false;var container=$('location_selector');if(container){this.initLocationSelector();}},unload:function(){if(this.locationSelector){this.locationSelector.unObserve();}},reload:function(){var container=$('location_selector');if(container){if(this.locationSelector){this.locationSelector.locationSelector=container.down('select.region_selector');this.locationSelector.countrySelector=container.down('select.country_selector');container.down('.hidden_region_list').show();this.locationSelector.init();}
else{this.initLocationSelector();}}},initLocationSelector:function(){this.locationSelector=locationSelectorFromContainer('location_selector');}});window.formController.add('image uploader',{init:function(){this.initOrUpdate();},reload:function(){this.initOrUpdate();},initOrUpdate:function(){var imageUploader=$('image_uploader');if(imageUploader){window.imageController=new ImageUploader('image_uploader',window.item_name,window.auth_token);}},unload:function(){if(window.imageController){window.imageController.unload();if(!ie()){delete window.imageController;}}}});window.formController.add('video embed',{init:function(){this.initOrReload();},reload:function(){this.initOrReload();},unload:function(){},initOrReload:function(){var containers=$$('.user_text_container');containers.each(function(container){if(!container.video_observed){new VideoFieldController(container);container.video_observed=true;}});}});window.formController.add('job details',{init:function(){this.initOrReload();},reload:function(){this.initOrReload();},unload:function(){},initOrReload:function(){this.salarySelector=$('salary_selector');if(!this.salarySelector||this.salarySelector.scriptified){return;}
var disable=Form.Element.Methods.disable,enable=Form.Element.Methods.enable;var groups=[[$('salary_type_range'),$('salary_type_figure')],[$('has_salary_text')]];var syncChecked=function(group){var stateSetter=group.checked?enable:disable;group.siblings().each(stateSetter);};groups.each(function(group){group.each(function(element){syncChecked(element);element.observe("change",function(){group.each(syncChecked);});});});window._bossy_form.form.observe("submit",function(){groups.flatten().map(Element.Methods.siblings).flatten().each(function(element){if(element.disabled){element.value=null;}});});$('has_salary_text').observe("change",function(){$('edit_item_salary_text').focus();});this.salarySelector.scriptified=true;}});window.formController.add('rich text editor',{init:function(){window.editorController=this;this.editors=[];this.editor_count=0;this.initOrReload();$('edit_item').observe('submit',this.updateValues.bind(this));},reload:function(){this.initOrReload();},initOrReload:function(){if(this.editor_count!=0){return;}
this.findEditors();},updateValues:function(){if(this.editors==0){return;}
this.editors.each(function(e){if(e.visualMode){e.textarea.value=e.editor.getData();}else{e.textarea.value=this.sourceToVisual(e.textarea.value);}}.bind(this));},unload:function(){if(this.editors_count==0){return;}
this.updateValues();this.editors.each(function(e){e.editor.destroy();});this.editors=[];this.editor_count=0;},findEditors:function(){$$('div.detail-unit').each(function(detail_unit){this.addEditor(detail_unit);}.bind(this));},addEditor:function(detail_unit){if(detail_unit.editored){return;}
detail_unit.editored=true;var textarea=detail_unit.down('textarea');var container=detail_unit.down('div.editor-container');var visualButton=Builder.node('span',{className:'editor-visual-button selected_mode'},I18n.t('visual',{scope:'common'}));var sourceButton=Builder.node('span',{className:'editor-source-button'},I18n.t('html',{scope:'common'}));container.insert({top:Builder.node('div',{className:'editor-button-container'},[visualButton,sourceButton])});textarea.hide();var config={toolbarCanCollapse:false,contentsCss:'/stylesheets/compiled/classifieds/rich_text_editor.css',customConfig:'',width:'600px',height:'350px',skin:'v2',language:I18n.locale,toolbar:[['Undo','Redo','-','Paste','PasteFromWord'],['Format'],['Bold','Italic','-','BulletedList','NumberedList','-','Superscript','Subscript']],format_tags:'p;h2'};var editor=CKEDITOR.appendTo(container,config,$F(textarea));var editor_unit={'detail_unit':detail_unit,'container':container,'textarea':textarea,'editor':editor,sourceButton:sourceButton,visualButton:visualButton,visualMode:true,fakeMenuBar:container.down('.fake-menu-bar')};sourceButton.observe('click',function(){this.showSource(editor_unit);}.bindAsEventListener(this));visualButton.observe('click',function(){this.showVisual(editor_unit);}.bindAsEventListener(this));editor.on('uiReady',function(event){this.editor.lang.format.tag_h2=this.editor.lang.format.tag_h2.gsub(/\s*2\s*/,'');if(this.textarea.hasClassName('error')){$('cke_'+this.editor.name).addClassName('error');}
document.body.fire('richTextEditor:loaded');}.bind(editor_unit));var selector=detail_unit.down('select.post_auto_detect_language');var empty_textarea=new Element('textarea');initAutoLanguageDetection(empty_textarea,selector);editor.on('blur',function(){var div=new Element('div');div.innerHTML=this.editor.getData();this.textarea.value=div.innerText||div.textContent;this.textarea.guessLanguage();}.bind({'textarea':empty_textarea,'editor':editor}));this.editors.push(editor_unit);this.editor_count++;},showSource:function(editor_unit){if(!editor_unit.visualMode){return;}
editor_unit.visualMode=false;editor_unit.textarea.value=this.visualToSource(editor_unit.editor.getData());this.switchMode(editor_unit);},showVisual:function(editor_unit){if(editor_unit.visualMode){return;}
editor_unit.visualMode=true;editor_unit.editor.setData(this.sourceToVisual(editor_unit.textarea.value),function(){this.switchMode(editor_unit);}.bind(this));},switchMode:function(editor_unit){editor_unit.visualButton.toggleClassName('selected_mode');editor_unit.sourceButton.toggleClassName('selected_mode');editor_unit.textarea.toggle();editor_unit.fakeMenuBar.toggle();Element.toggle(editor_unit.editor.container.$);},sourceToVisual:function(content){var blocklist='table|thead|tfoot|caption|col|colgroup|tbody|tr|td|th|div|dl|dd|dt|ul|ol|li|pre|select|form|blockquote|address|math|p|h[1-6]|fieldset|legend';if(content.indexOf('<object')!=-1){content=content.replace(/<object[\s\S]+?<\/object>/g,function(a){return a.replace(/[\r\n]+/g,'');});}
content=content.replace(/<[^<>]+>/g,function(a){return a.replace(/[\r\n]+/g,' ');});content=content+'\n\n';content=content.replace(/<br \/>\s*<br \/>/gi,'\n\n');content=content.replace(new RegExp('(<(?:'+blocklist+')[^>]*>)','gi'),'\n$1');content=content.replace(new RegExp('(</(?:'+blocklist+')>)','gi'),'$1\n\n');content=content.replace(/\r\n|\r/g,'\n');content=content.replace(/\n\s*\n+/g,'\n\n');content=content.replace(/([\s\S]+?)\n\n/g,'<p>$1</p>\n');content=content.replace(/<p>\s*?<\/p>/gi,'');content=content.replace(new RegExp('<p>\\s*(</?(?:'+blocklist+')[^>]*>)\\s*</p>','gi'),"$1");content=content.replace(/<p>(<li.+?)<\/p>/gi,'$1');content=content.replace(/<p>\s*<blockquote([^>]*)>/gi,'<blockquote$1><p>');content=content.replace(/<\/blockquote>\s*<\/p>/gi,'</p></blockquote>');content=content.replace(new RegExp('<p>\\s*(</?(?:'+blocklist+')[^>]*>)','gi'),"$1");content=content.replace(new RegExp('(</?(?:'+blocklist+')[^>]*>)\\s*</p>','gi'),"$1");content=content.replace(/\s*\n/gi,'<br />\n');content=content.replace(new RegExp('(</?(?:'+blocklist+')[^>]*>)\\s*<br />','gi'),"$1");content=content.replace(/<br \/>(\s*<\/?(?:p|li|div|dl|dd|dt|th|pre|td|ul|ol)>)/gi,'$1');content=content.replace(/(?:<p>|<br ?\/?>)*\s*\[caption([^\[]+)\[\/caption\]\s*(?:<\/p>|<br ?\/?>)*/gi,'[caption$1[/caption]');content=content.replace(/(<(?:div|th|td|form|fieldset|dd)[^>]*>)(.*?)<\/p>/g,function(a,b,c){if(c.match(/<p( [^>]+)?>/))
return a;return b+'<p>'+c+'</p>';});content=content.replace(/<(pre|script)[^>]*>[\s\S]+?<\/\1>/g,function(a){a=a.replace(/<br ?\/?>[\r\n]*/g,'\n');return a.replace(/<\/?p( [^>]*)?>[\r\n]*/g,'\n');});return content;},visualToSource:function(content){var blocklist1,blocklist2;content=content.replace(/<(pre|script)[^>]*>[\s\S]+?<\/\1>/g,function(a){a=a.replace(/<br ?\/?>[\r\n]*/g,'<wp_temp>');return a.replace(/<\/?p( [^>]*)?>[\r\n]*/g,'<wp_temp>');});blocklist1='blockquote|ul|ol|li|table|thead|tbody|tfoot|tr|th|td|div|h[1-6]|p|fieldset';content=content.replace(new RegExp('\\s*</('+blocklist1+')>\\s*','g'),'</$1>\n');content=content.replace(new RegExp('\\s*<(('+blocklist1+')[^>]*)>','g'),'\n<$1>');content=content.replace(/(<p [^>]+>.*?)<\/p>/g,'$1</p#>');content=content.replace(/<div([^>]*)>\s*<p>/gi,'<div$1>\n\n');content=content.replace(/\s*<p>/gi,'');content=content.replace(/\s*<\/p>\s*/gi,'\n\n');content=content.replace(/\n[\s\u00a0]+\n/g,'\n\n');content=content.replace(/\s*<br ?\/?>\s*/gi,'\n');content=content.replace(/\s*<div/g,'\n<div');content=content.replace(/<\/div>\s*/g,'</div>\n');content=content.replace(/\s*\[caption([^\[]+)\[\/caption\]\s*/gi,'\n\n[caption$1[/caption]\n\n');content=content.replace(/caption\]\n\n+\[caption/g,'caption]\n\n[caption');blocklist2='blockquote|ul|ol|li|table|thead|tbody|tfoot|tr|th|td|h[1-6]|pre|fieldset';content=content.replace(new RegExp('\\s*<(('+blocklist2+') ?[^>]*)\\s*>','g'),'\n<$1>');content=content.replace(new RegExp('\\s*</('+blocklist2+')>\\s*','g'),'</$1>\n');content=content.replace(/<li([^>]*)>/g,'\t<li$1>');if(content.indexOf('<object')!=-1){content=content.replace(/<object[\s\S]+?<\/object>/g,function(a){return a.replace(/[\r\n]+/g,'');});}
content=content.replace(/<\/p#>/g,'</p>\n');content=content.replace(/\s*(<p [^>]+>[\s\S]*?<\/p>)/g,'\n$1');content=content.replace(/^\s+/,'');content=content.replace(/[\s\u00a0]+$/,'');content=content.replace(/<wp_temp>/g,'\n');return content;}});window.formController.add('multiple language tabs',{init:function(){this.reload();},unload:function(){if(window.languageTabController){window.languageTabController.unload();}},reload:function(){var tab_container=$('multilingual-details-tabs');if(tab_container){window.languageTabController=new MultilingualTabContainer(tab_container);$('multilingual-details-content').getElementsBySelector('.detail-unit').each(function(detail_unit){window.languageTabController.addTabFromDetailUnit(detail_unit);});window.languageTabController.pickOpeningTab();}}});window.formController.add('phone number selector',{init:function(){window.phoneController=this;this.phoneSelectors=[];this.initOrReload();},reload:function(){this.initOrReload();},initOrReload:function(){if(ie_lte_6()||this.phoneSelectors.length!=0){return;}
this.findPhoneSelectors();this.observe();},unload:function(){if(this.phoneSelectors.length==0){return;}
this.phoneSelectors.each(function(e){e.unload();});this.phoneSelectors=[];this.unObserve();},findPhoneSelectors:function(){$$('select.calling_code').each(function(e){this.addPhoneSelector(e);}.bind(this));},addPhoneSelector:function(select){if(select.phoneWidget){return;}else{this.phoneSelectors.push(new PhoneNumberWidget(select,{dynamicPosition:true}));}},observe:function(){document.body.observe('MultilingualTab:created',function(){this.findPhoneSelectors();}.bindAsEventListener(this));},unObserve:function(){document.body.stopObserving('richTextEditor:loaded');document.body.stopObserving('MultilingualTab:created');document.body.stopObserving('MultilingualTab:setActive');}});window.formController.add('website input',{init:function(){window.websiteInputController=this;this.inputs=[];this.initOrReload();},reload:function(){this.initOrReload();},initOrReload:function(){this.findWebsiteInputs();this.observe();},unload:function(){if(this.inputs.length==0){return;}
this.inputs.each(function(e){e.extended=false;e.stopObserving('blur');});this.inputs=[];this.unObserve();},findWebsiteInputs:function(){$$('input.website').each(function(e){this.extend(e);}.bind(this));},extend:function(element){if(element.extended){return;}else{Object.extend(element,LinkChecker).initialize();this.extended=true;}},observe:function(){document.body.observe('MultilingualTab:created',function(){this.findWebsiteInputs();}.bindAsEventListener(this));},unObserve:function(){document.body.stopObserving('MultilingualTab:created');}});window.formController.add('surface area',{init:function(){this.reload();this.mimicError();},unload:function(){if(this.surface_area){this.surface_area.unobserve();}
if(this.fields){this.fields.getElementsBySelector('input').each(function(item){item.stopObserving('change');});}},reload:function(){this.fields=$$('.edit_surface_area').first();if(this.fields){this.surface_area=new SurfaceArea(this.fields);this.surface_area.link.addClassName('will_not_be_intimidated');this.fields.getElementsBySelector('input').each(function(input){input.observe('change',this._update.bindAsEventListener(this));}.bind(this));}},mimicError:function(){if(this.fields){var m2Field=this.fields.down('#edit_item_size_in_m2');var ft2Field=this.fields.down('#edit_item_size_in_ft2');if(m2Field&&ft2Field&&m2Field.hasClassName('error')){ft2Field.addClassName('error');}}},_update:function(event){var item=event.target;var unit_changed=item.id.toString().match(/_([^_]+)$/)[1];var new_value='';switch(unit_changed){case'm2':if(!item.value.blank()){new_value=this.surface_area.convert_to_ft2(item.value);}
this.fields.down('#edit_item_size_in_ft2').value=new_value;break;case'ft2':if(!item.value.blank()){new_value=this.surface_area.convert_to_m2(item.value);}
this.fields.down('#edit_item_size_in_m2').value=new_value;break;}}});window.formController.add('searchable categories',{init:function(){this.reload();},unload:function(){},reload:function(){var inputTree=$('input-tree');if(inputTree){this.inputTree=new InputTree(inputTree.down('.tree-container'),{updateElement:function(instance,treeNode,domNode){domNode.down('input').checked=true;$('initial_category_name').innerHTML=treeNode.decoratedName();},label:function(node){return node.childElements().detect(function(child){var name=child.nodeName.toString().toLowerCase();return name=='label'||name=='span';}).innerHTML;}});}}});window.formController.runInit();if(forceCategory&&!forceCategoryValue.blank()&&forceCategoryValue!='-1'){$('edit_item_category_id').value=forceCategoryValue;}
itemForm.observe('categorySelector:change',function(event){if(event.memo['category_id']){var value=event.memo['category_id'].toString();}
else{var value='';}
if(value.blank()||value=='-1'){this.fireEvent('unload');}
else{this.reload();}}.bind(window.formController));window._bossy_form.reload();}
MagicLinker.addSystem('classifieds',function(){if($('edit_item')){setupPliablePostForm();}});function addDirectoryLocation(context,locationId,plus,children,locationKind){if(window.placementController){window.placementController.addDirectoryLocation(context,locationId,plus,children,locationKind);}}
function addDirectoryCategory(treeNode){if(window.placementController){window.placementController.addDirectoryCategory(treeNode);}}
var PlacementController=Class.create({initialize:function(form){this._form=form;this._locationOptionsContainer=$('location-options');this._complicatedLocations=$('complicated-location-selector');this._simpleLocations=$('simple-location-selector');this._categorySelector=$('category-selector');this._categoryAddContainer=$('category-add-container');this._pricingContainer=$('pricing');this._locationSelectorContainer=$('location-selector');this._locationsContainer=$('locations');this._categoriesContainer=$('categories');this._addAnotherLocationButton=$('add-another-location-button');this._countrySelectorContainer=$('country-selector-container');this._categoryAddButton=$('multiple-category-trigger');this._categoryTree=$('input-tree');this._categoryPrice=$('category-price');this._categoryTree.hide();this._locationSelector=this._locationSelectorContainer.down('select');this._categoryTreeController=new InputTree(this._categoryTree.down('.tree-container'),{updateElement:function(instance,treeNode,domNode){this.addDirectoryCategory(treeNode);this.resetCategoryForm();instance.hideValue(treeNode.id);instance.reset();}.bind(this),label:function(node){return node.childElements().detect(function(child){var name=child.nodeName.toString().toLowerCase();return name=='label'||name=='span';}).innerHTML;}});this._setObservers();if(this._simpleLocations){var selectedElement=this._simpleLocations.select('input[type=radio]').find(function(r){return r.checked;});if(selectedElement){this._simpleLocationClicked(selectedElement);}}},addDirectoryLocation:function(context,locationId,plus,children,locationKind){var new_id=new Date().getTime();var regexp=new RegExp("new_directory_locations","g");var content=newLocationAssociation().replace(regexp,new_id);var container=this._locationsContainer;container.insert({bottom:content});$("placement_directory_locations_attributes_"+new_id+"_location_id").value=locationId;$("placement_directory_locations_attributes_"+new_id+"_with_children").value=plus?'1':'0';container=$(context).up('div.location');var new_container=$("placement_directory_locations_attributes_"+new_id+"_location_id").up('li');new_container.addClassName(locationKind);new_container.down('.name').innerHTML=container.down('.name').innerHTML;new_container.down('.description').innerHTML=container.down('.description').innerHTML;this.resetOtherLocationSelected();this._setDisableAddCategoryButton(false);this._setDisableRemoval(this._categoriesContainer,false);if(children){this._removeLocations(locationId,children);}else{this._setDisableCountryOption(locationId,true);}
var optionsList=this._locationOptionsContainer.down('.placement-list');if(optionsList&&optionsList.getHeight()<300){this._locationOptionsContainer.removeClassName('scrollable');}
this.resetPricing();},addDirectoryCategory:function(treeNode){var new_id=new Date().getTime();var regexp=new RegExp("new_directory_categories","g");var content=newCategoryAssociation().replace(regexp,new_id);var container=this._categoriesContainer;container.insert({bottom:content});$("placement_directory_categories_attributes_"+new_id+"_category_id").value=treeNode.id;var new_container=$("placement_directory_categories_attributes_"+new_id+"_category_id").up('li');new_container.down('.name').innerHTML=treeNode.name;new_container.down('.description').innerHTML=treeNode.pathToRootWithoutThis().collect(function(n){return n.name;}).join(" &gt; ");this._setDisableAddLocationButtons(false);this._setDisableRemoval(this._locationsContainer,false);this.resetPricing();},_setObservers:function(){if(this._simpleLocations){this._simpleLocations.select('input[type=radio]').each(function(el){el.observe('click',function(event){this._simpleLocationClicked(event.element());}.bindAsEventListener(this));}.bind(this));this._simpleLocations.select('button').first().observe('click',function(event){cancel(event,true);if(!event.element().disabled){if(!this.otherLocationSelected){this.addDirectoryLocation(this.simpleLocationTarget,this.simpleLocationId,this.simpleLocationWithChildren,false,'country');}
this.showComplication();}}.bindAsEventListener(this));}
this._addAnotherLocationButton.observe('click',function(e){e.stop();this._setDisableAddAnotherLocationForm(false);}.bindAsEventListener(this));$('hide-country-selector').observe('click',function(e){e.stop();this._setDisableAddAnotherLocationForm(true);}.bindAsEventListener(this));this._locationSelector.observe('change',function(event){this._setLocationPrompt({locationId:$F(event.element())});}.bindAsEventListener(this));this._locationsContainer.observe('click',this._removeLocationClicked.bindAsEventListener(this));this._categoriesContainer.observe('click',this._removeCategoryClicked.bindAsEventListener(this));if(this._categoryTreeController){this._categoryAddButton.observe('click',function(event){this._categoryAddContainer.hide();this._categoryTree.show();Event.stop(event);}.bind(this));}},_simpleLocationClicked:function(target){var name=target.nodeName.toString().toLowerCase();var button=this._simpleLocations.down('button');var id=target.value;var match=id.match(/([0-9]+)(_p)?/);$('locations').select('li').each(function(n){this.removeEntryFromPlacementList(n);}.bind(this));if(match[1]!="0"){this.simpleLocationTarget=target;this.simpleLocationId=match[1];this.simpleLocationWithChildren=(match[2]=="_p");}else{this.otherLocationSelected=true;}
button.disabled=false;button.removeClassName('disabled');},_removeLocationClicked:function(event){var element=event.element();if(element.hasClassName('remove_link')){cancel(event);var container=element.up('li');this.removeEntryFromPlacementList(container);if(container.hasClassName('country')){this._setDisableCountryOption($F(element.up('li').down('.location-id')),false);}else if(container.hasClassName('world')){this._locationSelector.enable();this._locationSelector.selectedIndex=0}
if(this._emptyContainer(this._locationsContainer)){this._setDisableAddCategoryButton(true);this._setDisableRemoval(this._categoriesContainer,true);this._pricingContainer.hide();}else{this.resetPricing();}}},_removeLocations:function(location,children){children.each(function(e){var location=this._locationsContainer.down('input.location-id[value="'+e+'"]');if(location){this.removeEntryFromPlacementList(location.up('li'));}
var option=this._getLocationOption(e);if(option){option.hide();}}.bind(this));var currentLocation=this._getLocationOption(location);currentLocation.hide();if(currentLocation.hasClassName('country')){this._locationSelector.selectedIndex=0;this._setDisableCountryOption(location,true);}else if(currentLocation.hasClassName('world')){this._locationSelector.disable();}},_getLocationOption:function(id){return this._locationOptionsContainer.down('li.location-'+id);},_getCountryOption:function(id){return this._locationSelector.down('option[value='+id+']');},_removeCategoryClicked:function(event){var element=event.element();if(element.hasClassName('remove_link')){var li=element.up('li');var id=parseInt(li.select('input.category_id').first().getValue(),10);this._categoryTreeController.unhideValue(id);this.removeEntryFromPlacementList(li);if(this._emptyContainer(this._categoriesContainer)){this._setDisableAddLocationButtons(true);this._setDisableRemoval(this._locationsContainer,true);this._pricingContainer.hide();this._categoryPrice.hide();}else{this.resetPricing();}
cancel(event);}},resetPricing:function(){this.resetCategoryForm();this._getPrices();},resetCategoryForm:function(){this._categoryTree.hide();this._categoryAddContainer.show();},resetOtherLocationSelected:function(){this.otherLocationSelected=false;this._categorySelector.show();this._pricingContainer.show();},showComplication:function(){this._simpleLocations.hide();this._complicatedLocations.show();if(this.otherLocationSelected){this._setDisableAddAnotherLocationForm(false);}else{this._categorySelector.show();this._pricingContainer.show();}},removeEntryFromPlacementList:function(li){li.down('input.remove').value=1;li.addClassName('removed');li.hide();},_getPrices:function(){new Ajax.Updater(this._pricingContainer,'/'+I18n.locale+'/action/placement_pricing',{parameters:this._form.serialize(),method:'post',evalScripts:true,onCreate:this._setPricesLoading.bind(this)});},_setPricesLoading:function(){this._pricingContainer.update(loadingHTML());this._pricingContainer.show();this._categoryPrice.update(loadingHTML());this._categoryPrice.show();},_setDisableAddCategoryButton:function(disable){if(disable){this._categoryAddButton.addClassName('disabled');}else{this._categoryAddButton.removeClassName('disabled');}
this._categoryAddButton.disabled=disable;},_setDisableAddLocationButtons:function(disable){if(disable){this._locationSelector.disable();}else{this._locationSelector.enable();}},_setDisableRemoval:function(container,disable){if(disable){container.removeClassName('show-remove');}else{container.addClassName('show-remove');}},_setDisableCountryOption:function(id,disabled){var countryOption=this._getCountryOption(id);if(countryOption){countryOption.disabled=disabled;}},_setDisableAddAnotherLocationForm:function(value){if(value){this._addAnotherLocationButton.show();this._countrySelectorContainer.hide();this._locationOptionsContainer.hide();}else{this._addAnotherLocationButton.hide();this._countrySelectorContainer.show();this._locationOptionsContainer.show();}},_setLocationPrompt:function(memo){if(memo.locationId==false||memo.locationId=='-1'){return;}
var container=this._locationOptionsContainer;new Ajax.Updater(container,'/'+I18n.locale+'/action/placement_location/'+memo.locationId,{parameters:this._form.serialize(),method:'post',evalScripts:true,onCreate:function(){container.removeClassName('scrollable');container.innerHTML=loadingHTML();container.show();},onComplete:function(){if(container.down('ul').getHeight()>300){container.addClassName('scrollable');}}});},_emptyContainer:function(container){return this._containerLength(container)==0;},_containerLength:function(container){return container.select('li:not([class~=removed])').length;}});var ProgressBar=Class.create({initialize:function(bar){this._bar=$(bar);this.observe();},observe:function(){this._bar.observe('click',this.clickHandler.bindAsEventListener(this));},clickHandler:function(event){var element=event.element();var step=element.up('.step')||element;if(!step.hasClassName('step')){return;}
var link=element;if(link.nodeName.toString().toLowerCase()!='a'){link=step.down('a');}
if(!step.hasClassName('linked')){cancel(event,true);}}});function onPaypalFormSubmit(e){cancel(e);var url=window.actionableLinker.actionableLink('create_paypal_transaction',{item:e.target.getAttribute('data-item-name')});new Ajax.Request(url,{asynchronous:true,method:'post',on401:function(transport){var newLocation=transport.getHeader('Location');if(newLocation){window.location=newLocation+'?return_to='+encodeURIComponent(window.location);}else{e.target.submit();}},onSuccess:function(transport){e.target.submit();}});}
MagicLinker.addSystem('classifieds',function(){var bar=$('directory_steps');if(bar){window.progressBar=new ProgressBar(bar);}});MagicLinker.addSystem('classifieds',function(){var form=$('placement');if(form){if($('categories-and-locations')){window.placementController=new PlacementController(form);}}});MagicLinker.addSystem('classifieds',function(){$$('#checkout .paypal_form').each(function(item){item.observe('submit',onPaypalFormSubmit);});});Positioner={items:[],addItem:function(set_position,name,object){this.items.push([object,set_position,name]);this.update(this.items.last());},update:function(p){p[1](p[0]);},updateSpecific:function(name){q=this.items.find(function(p){return p[2]==name;});if(q)this.update(q);},updateAll:function(){this.items.each(function(i){this.update(i);}.bind(this));}}
InputResizer={magic:function(item){item=$(item);classes=item.classNames().toString();if((klass=classes.match(/resize_to_class_(.*)/))){item.removeClassName(klass[0]);item.addClassName(klass[1]);}
if((width=classes.match(/resize_to_width_(.*)/))){item.removeClassName(height[0]);if(width[1].match(/^[0-9]+$/))width[1]+='px';item.setStyle({'width':width[1]});}
if((height=classes.match(/resize_to_height_(.*)/))){item.removeClassName(height[0]);if(height[1].match(/^[0-9]+$/))height[1]+='px';item.setStyle({'height':height[1]});}
if((trigger=classes.match(/resize_trigger_([a-z_]+)/))){item.removeClassName(trigger[0]);InputResizer.magic(trigger[1]);}}}
HeaderLanguageError={timeout:null,initialise:function(message){this.message=$(message);this.message.setStyle({'width':this.getWidth()+10+'px'});this.observe('mouseover',function(event){this.showError();}.bindAsEventListener(this));this.observe('mouseout',function(event){this.hideError();}.bindAsEventListener(this));},showError:function(){clearTimeout(this.timeout);if(!this.message.visible()){this.timeout=setTimeout(function(){new Effect.Appear(this.message,{duration:0.2});}.bind(this),200);}},hideError:function(){if(!this.message.visible()){clearTimeout(this.timeout);}
else{this.timeout=setTimeout(function(){new Effect.Fade(this.message,{duration:0.2});}.bind(this),200);}}}
Prompt={elements:[],initialize:function(text,prompt_class,ties,last_in_set){this.prompt_text=text;this.prompt_class=prompt_class;if(ties){this.elements=ties;}
with($(this)){if(this.can_set_prompt()){set_prompt_without_checking();}
observe('focus',function(){this.clear_prompt();}.bindAsEventListener(this));observe('blur',function(){this.set_prompt();}.bindAsEventListener(this));}
if(last_in_set){if(!(this.can_set_other_prompts()&&this.can_set_prompt())){this.clear_prompt_on_load();this.elements.each(function(i){$(i).clear_prompt_on_load();});}}
if((form=this.up('form'))){form.observe('submit',function(){this.clear_prompt();}.bindAsEventListener(this));}},can_set_prompt:function(){return(this.value.blank()||this.value==this.prompt_text);},can_clear_prompt:function(){return(this.hasClassName(this.prompt_class));},can_set_other_prompts:function(){return this.can_something_other_prompts(function(i){return(!$(i).can_set_prompt());});},can_clear_other_prompts:function(){return this.can_something_other_prompts(function(i){return(!$(i).can_clear_prompt());});},can_something_other_prompts:function(callback){if(this.elements.find(callback)){return false;}
return true;},set_prompt:function(){if(this.can_set_prompt()&&this.can_set_other_prompts()){this.set_prompt_without_checking();this.elements.each(function(i){$(i).set_prompt_without_checking();});}},set_prompt_without_checking:function(){this.addClassName(this.prompt_class);this.value=this.prompt_text;},clear_prompt:function(){if(this.can_clear_prompt()&&this.can_clear_other_prompts()){this.clear_prompt_without_checking();this.elements.each(function(i){$(i).clear_prompt_without_checking();});}},clear_prompt_without_checking:function(){this.removeClassName(this.prompt_class);this.value='';},clear_prompt_on_load:function(){if(this.can_clear_prompt()){this.clear_prompt_without_checking();}}}
AJAXError={show:function(message){if(!$('ajax_error')){$('header').insert({after:new Element('div',{'id':'ajax_error'}).setStyle({display:'none'})});}
div=$('ajax_error');if(div.visible()){new Effect.Parallel([new Effect.Fade(div,{sync:true}),new Effect.BlindUp(div,{sync:true})],{duration:1.5,queue:{position:'end',scope:'ae'}});}
new Effect.BlindDown(div,{duration:0.5,queue:{position:'end',scope:'ae'},beforeStart:function(){div.update(message);}});},hide:function(){div=$('ajax_error');new Effect.Parallel([new Effect.Fade(div,{sync:true}),new Effect.BlindUp(div,{sync:true})],{duration:0.3,queue:{position:'end',scope:'ae'}});}}
function updateAllBySelector(selector,text){$$(selector).each(function(element){element.update(text);});}
function replaceAllBySelector(selector,text){$$(selector).each(function(element){element.replace(text);});}
MagicLinker.addSystem('community',function(){this.accountType=$('business_account_account_type');if(this.accountType){this.changeLabel=function(element){var labelField=$$("label[for='business_account_account_name']").first();if(element.value==0){labelField.update(I18n.t('company_name',{scope:'common'})+':');}else if(element.value==1){labelField.update(I18n.t('profession',{scope:'common'})+':');}else{labelField.update(I18n.t('organisation_name',{scope:'common'})+':');}};this.changeLabel(this.accountType);this.accountType.observe('change',function(event){this.changeLabel(event.target);}.bind(this));}});MagicLinker.addSystem('community',function(){this.website=$('business_account_website');if(this.website){Object.extend(this.website,LinkChecker).initialize();}});var CountryConstants={spain:156,euMembers:[10,17,27,45,46,63,47,54,58,59,173,76,82,84,99,100,93,108,122,137,138,142,161,152,151,66]};var CompanyNumberSelector=Class.create({initialize:function(element){this.select=$(element);this.label=$$('label[for=company_number]').first();this.hint=this.label.next(".textbox_small_font");this.change();this.select.observe('change',this.change.bindAsEventListener(this));},change:function(){var value=parseInt($F(this.select));if(value===CountryConstants.spain){this.label.update(I18n.t('cif_nif',{scope:'common'})+':');this.hint.update(I18n.t('cif_nif_hint',{scope:'common.message'}));this.hint.show();}else if(CountryConstants.euMembers.indexOf(value)!==-1){this.label.update(I18n.t('vat_number',{scope:'common'})+':');this.hint.update(this.vatHint());this.hint.show();}else{this.label.update(I18n.t('company_number',{scope:'common'})+':');this.hint.hide();}},vatHint:function(){var link='<a href="http://ec.europa.eu/taxation_customs/vies/faqvies.do#item11" rel="external">'+
I18n.t('click_here',{scope:'common'})+'</a>';return I18n.t('vat_number_hint',{scope:'common.message',interps:{'country_code':"DE",'link':link}});}});MagicLinker.addSystem('community',function(){if($('billing_information_form')){new CompanyNumberSelector('billing_information_country_id');}});Positioner={items:[],addItem:function(set_position,name,object){this.items.push([object,set_position,name]);this.update(this.items.last());},update:function(p){p[1](p[0]);},updateSpecific:function(name){q=this.items.find(function(p){return p[2]==name;});if(q)this.update(q);},updateAll:function(){this.items.each(function(i){this.update(i);}.bind(this));}}
InputResizer={magic:function(item){item=$(item);classes=item.classNames().toString();if((klass=classes.match(/resize_to_class_(.*)/))){item.removeClassName(klass[0]);item.addClassName(klass[1]);}
if((width=classes.match(/resize_to_width_(.*)/))){item.removeClassName(height[0]);if(width[1].match(/^[0-9]+$/))width[1]+='px';item.setStyle({'width':width[1]});}
if((height=classes.match(/resize_to_height_(.*)/))){item.removeClassName(height[0]);if(height[1].match(/^[0-9]+$/))height[1]+='px';item.setStyle({'height':height[1]});}
if((trigger=classes.match(/resize_trigger_([a-z_]+)/))){item.removeClassName(trigger[0]);InputResizer.magic(trigger[1]);}}}
HeaderLanguageError={timeout:null,initialise:function(message){this.message=$(message);this.message.setStyle({'width':this.getWidth()+10+'px'});this.observe('mouseover',function(event){this.showError();}.bindAsEventListener(this));this.observe('mouseout',function(event){this.hideError();}.bindAsEventListener(this));},showError:function(){clearTimeout(this.timeout);if(!this.message.visible()){this.timeout=setTimeout(function(){new Effect.Appear(this.message,{duration:0.2});}.bind(this),200);}},hideError:function(){if(!this.message.visible()){clearTimeout(this.timeout);}
else{this.timeout=setTimeout(function(){new Effect.Fade(this.message,{duration:0.2});}.bind(this),200);}}}
Prompt={elements:[],initialize:function(text,prompt_class,ties,last_in_set){this.prompt_text=text;this.prompt_class=prompt_class;if(ties){this.elements=ties;}
with($(this)){if(this.can_set_prompt()){set_prompt_without_checking();}
observe('focus',function(){this.clear_prompt();}.bindAsEventListener(this));observe('blur',function(){this.set_prompt();}.bindAsEventListener(this));}
if(last_in_set){if(!(this.can_set_other_prompts()&&this.can_set_prompt())){this.clear_prompt_on_load();this.elements.each(function(i){$(i).clear_prompt_on_load();});}}
if((form=this.up('form'))){form.observe('submit',function(){this.clear_prompt();}.bindAsEventListener(this));}},can_set_prompt:function(){return(this.value.blank()||this.value==this.prompt_text);},can_clear_prompt:function(){return(this.hasClassName(this.prompt_class));},can_set_other_prompts:function(){return this.can_something_other_prompts(function(i){return(!$(i).can_set_prompt());});},can_clear_other_prompts:function(){return this.can_something_other_prompts(function(i){return(!$(i).can_clear_prompt());});},can_something_other_prompts:function(callback){if(this.elements.find(callback)){return false;}
return true;},set_prompt:function(){if(this.can_set_prompt()&&this.can_set_other_prompts()){this.set_prompt_without_checking();this.elements.each(function(i){$(i).set_prompt_without_checking();});}},set_prompt_without_checking:function(){this.addClassName(this.prompt_class);this.value=this.prompt_text;},clear_prompt:function(){if(this.can_clear_prompt()&&this.can_clear_other_prompts()){this.clear_prompt_without_checking();this.elements.each(function(i){$(i).clear_prompt_without_checking();});}},clear_prompt_without_checking:function(){this.removeClassName(this.prompt_class);this.value='';},clear_prompt_on_load:function(){if(this.can_clear_prompt()){this.clear_prompt_without_checking();}}}
AJAXError={show:function(message){if(!$('ajax_error')){$('header').insert({after:new Element('div',{'id':'ajax_error'}).setStyle({display:'none'})});}
div=$('ajax_error');if(div.visible()){new Effect.Parallel([new Effect.Fade(div,{sync:true}),new Effect.BlindUp(div,{sync:true})],{duration:1.5,queue:{position:'end',scope:'ae'}});}
new Effect.BlindDown(div,{duration:0.5,queue:{position:'end',scope:'ae'},beforeStart:function(){div.update(message);}});},hide:function(){div=$('ajax_error');new Effect.Parallel([new Effect.Fade(div,{sync:true}),new Effect.BlindUp(div,{sync:true})],{duration:0.3,queue:{position:'end',scope:'ae'}});}}
function updateAllBySelector(selector,text){$$(selector).each(function(element){element.update(text);});}
function replaceAllBySelector(selector,text){$$(selector).each(function(element){element.replace(text);});}
UserLanguageList={initialize:function(inputId,ids,removeTxt,selector){this.inputId=inputId;this.ids=ids;this.removeTxt=removeTxt;if(!this.ids){this.ids=[];}
this.ids.find=function(x){for(var i=0;i<this.length;i++){if(x==this[i]){return i;}}
return false;}.bind(this.ids);this.update();selector=$(selector);if(selector){var old_action=selector.onchange||function(){};selector.onchange=function(){};selector.observe('keypress',function(event){var key=event.which||event.keyCode;if(!(key==Event.KEY_RETURN||key==32))return;this.addFromSelect(selector);old_action();Event.stop(event);}.bindAsEventListener(this));selector.observe('click',function(event){this.addFromSelect(selector);old_action();Event.stop(event);}.bindAsEventListener(this));}},add:function(id,text){if(this.ids.find(id)!==false){return;}
text=text.replace(/(&nbsp;)+/,'');this.ids.push(id);listItem=document.createElement('li');listItem.id='item_'+id;remLink=document.createElement('a');remLink.value=id;remLink.innerHTML='('+this.removeTxt+')';remLink.delegate=this;remLink.onclick=function(){this.delegate.remove(this.value);};listItem.appendChild(document.createTextNode(text+' '));listItem.appendChild(remLink);this.appendChild(listItem);this.update(true);},addFromSelect:function(select){if(select.value!=''){this.add(select.value,select.options[select.selectedIndex].innerHTML);select.options[0].selected=true;}},remove:function(id){i=this.ids.find(id);if(i===false){return;}
this.ids.splice(i,1);listItem=$('item_'+id);this.removeChild(listItem);this.update(true);},update:function(){$(this.inputId).value=this.ids.join(',');}};Wall={initialize:function(show_wall_posts,earlier_post_url){this.show_wall_posts=show_wall_posts;this.earlier_post_url=earlier_post_url;},show_new:function(id_or_object,earlier_post_url){children=this.childElements();if(children.length>this.show_wall_posts)this.graceful_hide(children.last());this.earlier_post_url=earlier_post_url;},show_old:function(id_or_object,earlier_post_url){this.earlier_post_url=earlier_post_url;obj=$(id_or_object);obj.setStyle({'opacity':'0'});obj.slideDown({transition:Effect.Transitions.sinoidal,duration:0.5,queue:{position:'end',scope:'wallpost'}});obj.appear({duration:0.5,queue:{position:'end',scope:'wallpost'}});},get_earlier_post:function(){if(this.earlier_post_url)new Ajax.Request(this.earlier_post_url,{asynchronous:true,evalScripts:true,method:'get'});},graceful_hide:function(id_or_object){obj=$(id_or_object);obj.fade({duration:0.5,queue:{position:'end',scope:'wallpost'}});obj.slideUp({transition:Effect.Transitions.sinoidal,duration:0.5,queue:{position:'end',scope:'wallpost',afterFinish:function(){this.remove();}.bind(obj)}});},remove_post:function(id_or_object){obj=$(id_or_object);if(obj){obj.fade({duration:0.5,queue:{position:'end',scope:obj.id},afterFinish:function(){this.remove();}.bind(obj)});}}}
SmartUserDisplay={covered:false,initialize:function(){this.removeClassName('smart_user_display');this.addClassName('smarter_user_display');},cover:function(){if(this.covered){return;}
this.covered=true;this.initDisplay();new Effect.Parallel([new Effect.Appear(this.div_image,{sync:true,to:0.8}),new Effect.Appear(this.div_text,{sync:true,to:0.8})],{duration:1});},reveal:function(){if(!this.covered){return;}
this.covered=false;this.initDisplay();new Effect.Parallel([new Effect.Fade(this.div_image,{sync:true,from:0.8}),new Effect.Fade(this.div_text,{sync:true,from:0.8})],{duration:1});},toggle:function(){if(this.covered){this.reveal();}
else{this.cover();}},initDisplay:function(){if(this.div_image){return;}
this.div_image=new Element('div').setStyle({'backgroundColor':'white','position':'absolute'}).hide();this.div_text=new Element('div').setStyle({'backgroundColor':'white','position':'absolute'}).hide();this.insert({bottom:this.div_image});this.insert({bottom:this.div_text});this.div_image.clonePosition(this.getElementsBySelector('.image').first());this.div_text.clonePosition(this.getElementsBySelector('.details').first());},initAllSmartUserDisplays:function(){$$('.smart_user_display').each(function(element){Object.extend(element,SmartUserDisplay).initialize();});},coverAllByClass:function(klass){$$('.smarter_user_display.sud_'+klass).each(function(element){element.cover();});},revealAllByClass:function(klass){$$('.smarter_user_display.sud_'+klass).each(function(element){element.reveal();});}}
var FriendsPlusDisabler=Class.create();FriendsPlusDisabler.prototype={initialize:function(inputs_in_id_or_object,array_of_enabling_triggers,array_of_triggers){this.inputs_in=$(inputs_in_id_or_object);this.enabling=array_of_enabling_triggers.collect(function(i){return($(i));});this.all_triggers=array_of_triggers.collect(function(i){return($(i));});(this.enabling.concat(this.all_triggers)).uniq().each(function(i){i.observe('click',function(e){this.update_state();}.bind(this),false);}.bind(this));this.update_state();},update_state:function(){enabled=this.enabling.any(function(i){return!(i.getValue());});if(enabled)
this.enable();else
this.disable();},enable:function(){this.inputs_in.getElementsBySelector('input').each(function(i){i.disable();});},disable:function(){this.inputs_in.getElementsBySelector('input').each(function(i){i.enable();});}}
function disablePhotoButton(){if((obj=$('profile_menu_photo'))){obj.hide();}}
InterestSelector={initialize:function(target,new_name,remove_string){this.target=$(target);this.new_name=new_name;this.remove_string=remove_string;this.target.getElementsBySelector('a').each(function(link){this.attachAction(link);}.bind(this));this.observe('change',function(){if(this.selectedIndex!=0){this.smartClone(this.value,this.options[this.selectedIndex].innerHTML);this.selectedIndex=0;}}.bindAsEventListener(this));},smartClone:function(id,name){input=new Element('input',{name:this.new_name,value:id,type:'hidden'});action=this.attachAction(new Element('a',{href:'#','class':'will_not_be_intimidated'}).update(this.remove_string));this.target.insert({bottom:new Element('li').update(new Element('span').update(name.strip())).insert({bottom:input}).insert({bottom:' ('}).insert({bottom:action}).insert({bottom:')'}).insert({bottom:new Element('div',{'class':'clear'})})});},attachAction:function(link){if(link.hasClassName('remove')){return;}
link.onclick=cancel;link.addClassName('remove');link.observe('click',function(){this.up('li').remove();}.bindAsEventListener(link));return link;}};NoticeList={initialize:function(){this.container=this.getElementsBySelector('ul.notices').first();},cleanlyRemove:function(id_or_object){link_set=$(id_or_object);li=link_set.up('li');if(this.container.childElements().length==1){this.timelyFade(this);}
else{this.timelyFade(li);}},timelyFade:function(object){object.fade({duration:0.5,delay:0.5,afterFinish:function(){this.remove();}.bind(object)});},makeNoticeList:function(object){Object.extend(object,NoticeList).initialize();}};Disabler={initialize:function(id_or_object,callback){this.callback=callback;this.target=$(id_or_object);this.observe('click',function(){this.controlTarget();}.bind(this));this.controlTarget();},controlTarget:function(){if(this.callback(this)){this.target.removeClassName('bossy_disabled');this.target.enable();}
else{if(!this.target.hasClassName('bossy_disabled')){this.target.addClassName('bossy_disabled');}
this.target.disable();}}};NotifyActivity={initialize:function(id_or_object){this.target=$(id_or_object);this.observe('click',function(){this.controlTarget();}.bind(this));this.controlTarget();},controlTarget:function(){if(this.checked){this.target.enable();}
else{this.target.disable();}}};var AgeSelectHelper=Class.create();AgeSelectHelper.prototype={initialize:function(lower_element,upper_element){this.lower=$(lower_element);this.upper=$(upper_element);this.lower.opposite_element=function(){return this.upper}.bind(this);this.upper.opposite_element=function(){return this.lower}.bind(this);reset=function(){this.value=this.select('option').first().value;};this.lower.reset=reset;this.upper.reset=reset;this.lower.observe('change',this.handle_change.bind(this));this.upper.observe('change',this.handle_change.bind(this));},is_out_of_range:function(){lower_val=parseInt(this.lower.value);upper_val=parseInt(this.upper.value);if(isNaN(lower_val)||isNaN(upper_val)){return false;}else{return lower_val>=upper_val;}},handle_change:function(event){if(this.is_out_of_range()){event.findElement().opposite_element().reset();}}};RecipientListEmail={initialize:function(drop,add_button){this.drop=$(drop);this.add_button=$(add_button);this.add_button.observe('click',function(){this.add_button.hide();this.drop.add_email(this.value,function(){this.value='';}.bind(this));}.bindAsEventListener(this));this.observe('keyup',function(){if(this.value.match(/^([^@\s]+)@((?:[-a-z0-9]{2,}\.)+[a-z]{2,})$/i)){this.add_button.show();}
else{this.add_button.hide();}});}};Working={initialize:function(){},reveal:function(){if(!this.cover_object.visible()||this.cover_object.fading){return;}
this.cover_object.fading=true;Element.clonePosition(this.cover_object,this);this.cover_object.fade({duration:0.5,from:0.8,to:0,queue:{position:'end',scope:'forum'},afterFinish:function(){this.cover_object.fading=false;}.bind(this)});},updateCoverPosition:function(){Element.clonePosition(this.cover_object,this);},cover:function(){if(!this.cover_object){this.cover_object=new Element('div',{'class':'forum_loading'});this.cover_object.setStyle({position:'absolute',opacity:'0','backgroundColor':'white'});this.insert({'after':this.cover_object});this.cover_object.fading=false;}
this.cover_object.clonePosition(this);this.cover_object.appear({duration:0.5,from:0,to:0.8,queue:{position:'end',scope:'forum'}});}};MessageForm={initialize:function(){this.select_none();},select_specific:function(id){this.set_checked('input[type=checkbox][value='+id+']',true);},select_all:function(){this.set_checked('input[type=checkbox]',false);},select_none:function(){this.set_checked('input[type=checkbox]',false,function(i){i.checked=false;});},select_unread:function(){this.set_checked('input.chk_unread',true);},select_read_adjective:function(){this.set_checked('input.chk_read',true);},source:function(){if(this._source)return(this._source);this._source=$$('table.messages').first();return(this._source);},set_checked:function(selector,reset,action){if(!action)action=function(i){i.checked="checked";};if(reset)this.source().select('input[type=checkbox]').each(function(c){c.checked=false;});this.source().select(selector).each(function(c){action(c);});$('conversation_action_selector').update_disabled();},smart_submit:function(action){$('conversation_action').value=action;this.source().up('form').inline_submit();}};MessageBoxActions={initialize:function(form){this.form_element=$(form);disable=true;this.selectedIndex=0;this.observe('change',function(e){this.smart_submit();}.bindAsEventListener(this));this.form_element.getElementsBySelector('input[type=checkbox]').each(function(check){check.observe('click',function(){this.update_disabled();}.bindAsEventListener(this));if(check.checked){disable=false;}}.bind(this));if(disable)
this.disable();else
this.enable();},update_disabled:function(){disable=true;this.form_element.getElementsBySelector('input[type=checkbox]').each(function(check){if(check.checked){disable=false;}});if(disable){this.disable();$$('input.message_action').each(function(i){i.removeClassName('active');i.disable();});}
else{this.enable();$$('input.message_action').each(function(i){i.addClassName('active');i.enable();});}},smart_submit:function(){this.form_element.smart_submit(this.value);this.disable();}};InviteForm={initialize:function(action,conversation,token,redirect_url){this.options={action:action,redirect_url:redirect_url||action,conversation:conversation,token:token};},submit:function(decision){var form=new Element('form',{action:this.options.action,method:'post','class':'inline'});form.insert(new Element('input',{type:'hidden',name:'conversation',value:this.options.conversation}));form.insert(new Element('input',{type:'hidden',name:'invite',value:'true'}));form.insert(new Element('input',{type:'hidden',name:'redirect_url',value:this.options.redirect_url}));form.insert(new Element('input',{type:'hidden',name:'invitation',value:decision}));form.insert(new Element('input',{type:'hidden',name:'authenticity_token',value:window.auth_token}));var comment_body=$('comment_body');if(comment_body){if(!comment_body.value.blank()){form.insert(new Element('input',{type:'hidden',name:'body',value:comment_body.value}));}}
this.insert(form);form.submit();}};var RecipientList=Class.create();RecipientList.prototype={initialize:function(recipient_container,possible_container,input_name){this.recipient_container=$(recipient_container);this.recipient_list=this.recipient_container.down('ol');this.possible_container=$(possible_container);this.possible_list=this.possible_container.down('ol');this.input_name=input_name;this.recipient_container.getElementsBySelector('li').each(function(element){this.makeSortable(element);}.bind(this));this.possible_container.getElementsBySelector('li').each(function(element){this.makeSortable(element);}.bind(this));this.recipient_list.getElementsBySelector('a').each(function(element){this.makeLinkWork(element);}.bind(this));this.possible_list.getElementsBySelector('a').each(function(element){this.makeLinkWork(element);}.bind(this));this.remove_all=this.recipient_container.getElementsBySelector('a.remove_all').first();this.remove_all.onclick=cancel;this.remove_all.observe('click',function(){this.removeAll();}.bind(this));this.select_all=this.possible_container.getElementsBySelector('a.select_all').first();this.select_all.onclick=cancel;this.select_all.observe('click',function(){this.selectAll();}.bind(this));this.linkSanity();},selectAll:function(){this.possible_list.getElementsBySelector('li').each(function(li){this.toggleQuickly(li);}.bind(this));this.linkSanity();},removeAll:function(){this.recipient_list.getElementsBySelector('li').each(function(li){this.toggleQuickly(li);}.bind(this));this.sort(this.possible_list);this.linkSanity();},toggleQuickly:function(li){if(li.hasClassName('RLRecipient')){this.unmakeRecipient(li);this.possible_list.insert({bottom:li});}
else{this.makeRecipient(li);this.recipient_list.insert({bottom:li});}},toggle:function(li){li.fade({duration:0.15,afterFinish:function(){this.toggleQuickly(li);this.sort(this.possible_list);this.linkSanity();li.appear({duration:0.15});}.bind(this)});},makeLinkWork:function(link){link.onclick=cancel;link.observe('click',function(){this.toggle(link.up('li'));}.bind(this));},makeRecipient:function(li){li.addClassName('RLRecipient');li.down('input').writeAttribute({name:this.input_name});},unmakeRecipient:function(li){li.removeClassName('RLRecipient');li.down('input').writeAttribute({name:null});},linkSanity:function(){if(this.recipient_list.childElements().length==0){this.remove_all.hide();}
else{this.remove_all.show();}
if(this.possible_list.childElements().length==0){this.select_all.hide();}
else{this.select_all.show();}},makeSortable:function(li){li.sortOrder='';if((match=li.className.toString().match(/sort_([a-z_-]+)/))){li.sortOrder=match[1];}},sort:function(container){list=container.childElements();list.each(function(i){i.remove();});list.sort(function(a,b){return(a.sortOrder==b.sortOrder?0:(a.sortOrder<b.sortOrder?-1:1));});list.each(function(item){container.insert({bottom:item});});}};function enableConversation(enable){if(enable){$('conversation_reply_field').show();$('conversation_disabled').hide();}
else{$('conversation_reply_field').hide();$('conversation_disabled').show();}};var IFrameShim=Class.create({option_list:{},run:false,initialize:function(obj_or_id,position_on_init,options){this.source_object=$(obj_or_id);this.run=this.ie_lte_6()&&this.source_object;if(!this.run)return;if(options)this.option_list=options;this.iframe=new Element('iframe',{'class':'shim','src':'javascript:;'});this.source_object.insert({'top':this.iframe});if(position_on_init)this.position();},position:function(){if(!this.run)return;if(this.option_list.positioner)
this.option_list.positioner(this.source_object,this.iframe);else{this.iframe.clonePosition(this.source_object,{offsetLeft:-2,offsetTop:-2});}},show:function(){if(!this.run)return;this.iframe.show();},hide:function(){if(!this.run)return;this.iframe.hide();},ie_lte_6:function(){var rv=10;var ua=navigator.userAgent;var re=new RegExp("MSIE ([0-9]{1,}[\.0-9]{0,})");if(re.exec(ua)!=null)rv=parseFloat(RegExp.$1);return(rv<=6);}});Forum={initialize:function(){},reveal:function(){if(!this.cover_object.visible()||this.cover_object.fading){return;}
this.cover_object.fading=true;Element.clonePosition(this.cover_object,this);this.cover_object.fade({duration:0.5,from:0.8,to:0,queue:{position:'end',scope:'forum'},afterFinish:function(){this.cover_object.fading=false;}.bind(this)});},cover:function(){if(!this.cover_object){this.cover_object=new Element('div',{'class':'forum_loading'});this.cover_object.setStyle({position:'absolute',opacity:'0','backgroundColor':'white'});this.insert({'after':this.cover_object});this.cover_object.fading=false;}
this.cover_object.clonePosition(this);this.cover_object.appear({duration:0.5,from:0,to:0.8,queue:{position:'end',scope:'forum'}});},eventWasEnterKey:function(event){if(typeof event=="undefined")event=window.event;return(event.keyCode==13);}}
BlockLoader={initialize:function(loading_class,scope){this.loading_class=loading_class;this.scope=scope;},reveal:function(){if(!this.cover_object.visible()||this.cover_object.fading){return;}
Element.clonePosition(this.cover_object,this);this.cover_object.fade({duration:0.5,from:0.8,to:0,queue:{position:'end',scope:this.scope},afterFinish:function(){this.cover_object.fading=false;}.bind(this)});},cover:function(){if(!this.cover_object){this.cover_object=new Element('div',{'class':this.loading_class});this.cover_object.setStyle({position:'absolute',opacity:'0','backgroundColor':'white'});this.insert({'after':this.cover_object});this.cover_object.fading=false;}
Element.clonePosition(this.cover_object,this);this.cover_object.appear({duration:0.5,from:0,to:0.8,queue:{position:'end',scope:this.scope}});}}
var CalloutIFrameShim=null;var Callout=Class.create();Callout.prototype={duration:0.3,quick_duration:0.15,callout_id:'callout',timer:null,callback:null,hiding:false,initialize:function(element){element.observe('click',function(event){this.show(event);}.bindAsEventListener(this),false);this.raw_href=element.href;element.onclick=cancel;this.bindTimers(element);},bindTimers:function(element){element.observe('mouseover',function(){if(this.timer){clearTimeout(this.timer);}}.bindAsEventListener(this));element.observe('mouseout',function(){this.timer=setTimeout(function(){this.hide();}.bind(this),500);}.bindAsEventListener(this));},clearTimers:function(element){element.stopObserving('mouseover');element.stopObserving('mouseout');},show:function(event,pointerX,target){if(window._callout==this){this.hide();}
else if(window._callout){if(event){callback=function(){this.callout.show(false,this.eventX,this.target);}.bind({'callout':this,'eventX':event.pointerX(),'target':Event.element(event)});window._callout.hideAndShow(callback);}}
else{window._callout=this;$(this.callout_id+'_links').getElementsBySelector('a.calloutReturn').each(function(element){element.href=element.href+'?return_to='+this.raw_href;}.bind(this));if(event){pointerX=event.pointerX();target=Event.element(event);}
dimensions=this.callout().getDimensions();this.callout().setStyle({top:target.cumulativeOffset()[1]-dimensions.height+'px',left:pointerX+'px'});if(ie_lte_6()){this.callout().show();}
else{this.callout().appear({'duration':this.duration});}
this.bindTimers(this.callout());}},hide:function(duration){if(window._callout==this){if(this.hiding){return};this.hiding=true;clearTimeout(this.timer);this.clearTimers(this.callout());if(ie_lte_6()){this.callout().hide();this.afterFinish();}
else{this.callout().fade({'duration':duration||this.duration,afterFinish:this.afterFinish.bind(this)});}}},hideAndShow:function(callback){this.callback=callback;this.hide(this.quick_duration);},afterFinish:function(){if(window._callout==this){window._callout=null;this.hiding=false;if(this.callback){this.callback();this.callback=null;}}},callout:function(){if(this._callout){return this._callout;}
return this._callout=$(this.callout_id);}}
var PrivacyCallout=Class.create(Callout,{callout_id:'privacy_callout',initialize:function($super,element){$super(element);this.alt_text=element.readAttribute('title');element.observe('mouseover',function(event){this.show(event);}.bindAsEventListener(this),false);element.onmouseover=cancel;},show:function($super,event,pointerX,target){this.displayed_to().update(this.alt_text);$super(event,pointerX,target);},displayed_to:function(){return this._displayed_to?this._displayed_to:this._displayed_to=this.callout().select('#privacy_diplayed_to').first();}});var ReportCallout=Class.create(Callout,{callout_id:'report_callout'});function findCalloutTriggers(){$$('.callout').each(function(element){new Callout(element);});$$('.privacycallout').each(function(element){new PrivacyCallout(element);});$$('.reportcallout').each(function(element){new ReportCallout(element);});}
function prepareCallout(callout_id){if((link_set=$(callout_id+'_links'))){link_set.getElementsBySelector('a').each(function(element){element.raw_href=element.href;});}
CalloutIFrameShim=new IFrameShim(callout_id,true,{positioner:function(source,iframe){dim=source.getDimensions();iframe.setStyle({top:0,left:0,width:dim.width+'px',height:dim.height+'px'});}});}
Timezone={formats:{'long':'%d %b %Y, %H:%M','short':'%d %b %Y','time':'%H:%M'},findAll:function(){$$('.tstamp_active').each(function(element){this.convert(element);}.bind(this));},convert:function(element){element.removeClassName('tstamp_active');var elementFormat=this.formats[element.className.toString().match(/tstamp_(long|short|time)/)[1]];if(elementFormat.blank()){return;}
var stamp=element.className.toString().match(/tstamp_([0-9_]+)/)[1].split('_').collect(function(i){return parseInt(Timezone.removeLeadingZeroes(i));});var time=new Date();time.setUTCFullYear(stamp[0]);time.setUTCMonth(stamp[1]-1);time.setUTCDate(stamp[2]);time.setUTCHours(stamp[3]);time.setUTCMinutes(stamp[4]);element.update(time.strftime(elementFormat));},removeLeadingZeroes:function(i){return i.match(/^0?([0-9]*)$/)[1];}};MagicLinker.addSystem('community',function(){if((obj=$('header_language_error'))){Object.extend(obj.up('span'),HeaderLanguageError).initialise(obj);};});MagicLinker.addSystem('community',function(){if((obj=$('community_quick_list'))){action=function(){Effect.toggle(this,'appear',{'duration':0.2,afterUpdate:function(){this.position();}.bind(this.shim)});}.bind(obj);obj.shim=new IFrameShim(obj,false);$$('#header a.communities').first().observe('click',action);obj.getElementsBySelector('a.close').first().observe('click',action);}});MagicLinker.addSystem('community',function(){var obj=$('update_forum_thread_view_count');if(obj)new Ajax.Request(obj.value);});MagicLinker.addSystem('community',function(){$$('.find_filter a.title').each(function(i){i.observe('click',function(){div=this.up('div');if(div.hasClassName('closed')){div.removeClassName('closed');}
else{div.addClassName('closed');}}.bindAsEventListener(i));});});MagicLinker.addSystem('community',function(){getBrowserInfo();addLightboxMarkup();});MagicLinker.addSystem('community',function(){prepareCallout('callout');prepareCallout('report_callout');prepareCallout('privacy_callout');});MagicLinker.addSystem('community',function(){$$('.communities_list_container').each(function(element){Object.extend(element,BlockLoader).initialize('forum_loading','communities');});});MagicLinker.addSystem('community',function(){$$('.notice_list').each(function(element){NoticeList.makeNoticeList(element);});});MagicLinker.addSystem('community',function(){$$('form').each(function(form){form.observe('submit',function(){form.getInputs('submit').each(function(submit){submit.removeClassName('active');submit.disable();});});form.getInputs('button','cancel').each(function(cancel){cancel.observe('click',function(){cancel.disable();});});});});MagicLinker.add('community',function(){setTimeout('SubmitController.init()',5);});MagicLinker.add('community',function(){Timezone.findAll();});MagicLinker.add('community',findLightboxTriggers);MagicLinker.add('community',findCalloutTriggers);MagicLinker.add('community',SmartUserDisplay.initAllSmartUserDisplays);MagicLinker.add('community',function(){$$('.resize_on_focus').each(function(item){item.removeClassName('resize_on_focus');item.observe('focus',function(e){InputResizer.magic(e.target);});});});MagicLinker.addSystem('community',function(){if(window._scroll_to){$(window._scroll_to).scrollTo();}});
