var Prototype={Version:"1.7",Browser:(function(){var b=navigator.userAgent;var a=Object.prototype.toString.call(window.opera)=="[object Opera]";return{IE:!!window.attachEvent&&!a,Opera:a,WebKit:b.indexOf("AppleWebKit/")>-1,Gecko:b.indexOf("Gecko")>-1&&b.indexOf("KHTML")===-1,MobileSafari:/Apple.*Mobile/.test(b)}})(),BrowserFeatures:{XPath:!!document.evaluate,SelectorsAPI:!!document.querySelector,ElementExtensions:(function(){var a=window.Element||window.HTMLElement;return !!(a&&a.prototype)})(),SpecificElementExtensions:(function(){if(typeof window.HTMLDivElement!=="undefined"){return true}var c=document.createElement("div"),b=document.createElement("form"),a=false;if(c.__proto__&&(c.__proto__!==b.__proto__)){a=true}c=b=null;return a})()},ScriptFragment:"<script[^>]*>([\\S\\s]*?)<\/script>",JSONFilter:/^\/\*-secure-([\s\S]*)\*\/\s*$/,emptyFunction:function(){},K:function(a){return a}};if(Prototype.Browser.MobileSafari){Prototype.BrowserFeatures.SpecificElementExtensions=false}var Abstract={};var Try={these:function(){var c;for(var b=0,d=arguments.length;b<d;b++){var a=arguments[b];try{c=a();break}catch(f){}}return c}};var Class=(function(){var d=(function(){for(var e in {toString:1}){if(e==="toString"){return false}}return true})();function a(){}function b(){var h=null,g=$A(arguments);if(Object.isFunction(g[0])){h=g.shift()}function e(){this.initialize.apply(this,arguments)}Object.extend(e,Class.Methods);e.superclass=h;e.subclasses=[];if(h){a.prototype=h.prototype;e.prototype=new a;h.subclasses.push(e)}for(var f=0,j=g.length;f<j;f++){e.addMethods(g[f])}if(!e.prototype.initialize){e.prototype.initialize=Prototype.emptyFunction}e.prototype.constructor=e;return e}function c(l){var g=this.superclass&&this.superclass.prototype,f=Object.keys(l);if(d){if(l.toString!=Object.prototype.toString){f.push("toString")}if(l.valueOf!=Object.prototype.valueOf){f.push("valueOf")}}for(var e=0,h=f.length;e<h;e++){var k=f[e],j=l[k];if(g&&Object.isFunction(j)&&j.argumentNames()[0]=="$super"){var m=j;
j=(function(i){return function(){return g[i].apply(this,arguments)}})(k).wrap(m);j.valueOf=m.valueOf.bind(m);j.toString=m.toString.bind(m)}this.prototype[k]=j}return this}return{create:b,Methods:{addMethods:c}}})();(function(){var C=Object.prototype.toString,B="Null",o="Undefined",v="Boolean",f="Number",s="String",H="Object",t="[object Function]",y="[object Boolean]",g="[object Number]",l="[object String]",h="[object Array]",x="[object Date]",i=window.JSON&&typeof JSON.stringify==="function"&&JSON.stringify(0)==="0"&&typeof JSON.stringify(Prototype.K)==="undefined";function k(J){switch(J){case null:return B;case (void 0):return o}var I=typeof J;switch(I){case"boolean":return v;case"number":return f;case"string":return s}return H}function z(I,K){for(var J in K){I[J]=K[J]}return I}function G(I){try{if(c(I)){return"undefined"}if(I===null){return"null"}return I.inspect?I.inspect():String(I)}catch(J){if(J instanceof RangeError){return"..."}throw J}}function D(I){return F("",{"":I},[])}function F(R,O,P){var Q=O[R],N=typeof Q;if(k(Q)===H&&typeof Q.toJSON==="function"){Q=Q.toJSON(R)}var K=C.call(Q);switch(K){case g:case y:case l:Q=Q.valueOf()}switch(Q){case null:return"null";case true:return"true";case false:return"false"}N=typeof Q;switch(N){case"string":return Q.inspect(true);case"number":return isFinite(Q)?String(Q):"null";case"object":for(var J=0,I=P.length;J<I;J++){if(P[J]===Q){throw new TypeError()}}P.push(Q);var M=[];if(K===h){for(var J=0,I=Q.length;J<I;J++){var L=F(J,Q,P);M.push(typeof L==="undefined"?"null":L)}M="["+M.join(",")+"]"}else{var S=Object.keys(Q);for(var J=0,I=S.length;J<I;J++){var R=S[J],L=F(R,Q,P);if(typeof L!=="undefined"){M.push(R.inspect(true)+":"+L)}}M="{"+M.join(",")+"}"}P.pop();return M}}function w(I){return JSON.stringify(I)}function j(I){return $H(I).toQueryString()}function p(I){return I&&I.toHTML?I.toHTML():String.interpret(I)}function r(I){if(k(I)!==H){throw new TypeError()}var J=[];for(var K in I){if(I.hasOwnProperty(K)){J.push(K)}}return J}function d(I){var J=[];
for(var K in I){J.push(I[K])}return J}function A(I){return z({},I)}function u(I){return !!(I&&I.nodeType==1)}function m(I){return C.call(I)===h}var b=(typeof Array.isArray=="function")&&Array.isArray([])&&!Array.isArray({});if(b){m=Array.isArray}function e(I){return I instanceof Hash}function a(I){return C.call(I)===t}function n(I){return C.call(I)===l}function q(I){return C.call(I)===g}function E(I){return C.call(I)===x}function c(I){return typeof I==="undefined"}z(Object,{extend:z,inspect:G,toJSON:i?w:D,toQueryString:j,toHTML:p,keys:Object.keys||r,values:d,clone:A,isElement:u,isArray:m,isHash:e,isFunction:a,isString:n,isNumber:q,isDate:E,isUndefined:c})})();Object.extend(Function.prototype,(function(){var k=Array.prototype.slice;function d(o,l){var n=o.length,m=l.length;while(m--){o[n+m]=l[m]}return o}function i(m,l){m=k.call(m,0);return d(m,l)}function g(){var l=this.toString().match(/^[\s\(]*function[^(]*\(([^)]*)\)/)[1].replace(/\/\/.*?[\r\n]|\/\*(?:.|[\r\n])*?\*\//g,"").replace(/\s+/g,"").split(",");return l.length==1&&!l[0]?[]:l}function h(n){if(arguments.length<2&&Object.isUndefined(arguments[0])){return this}var l=this,m=k.call(arguments,1);return function(){var o=i(m,arguments);return l.apply(n,o)}}function f(n){var l=this,m=k.call(arguments,1);return function(p){var o=d([p||window.event],m);return l.apply(n,o)}}function j(){if(!arguments.length){return this}var l=this,m=k.call(arguments,0);return function(){var n=i(m,arguments);return l.apply(this,n)}}function e(n){var l=this,m=k.call(arguments,1);n=n*1000;return window.setTimeout(function(){return l.apply(l,m)},n)}function a(){var l=d([0.01],arguments);return this.delay.apply(this,l)}function c(m){var l=this;return function(){var n=d([l.bind(this)],arguments);return m.apply(this,n)}}function b(){if(this._methodized){return this._methodized}var l=this;return this._methodized=function(){var m=d([this],arguments);return l.apply(null,m)}}return{argumentNames:g,bind:h,bindAsEventListener:f,curry:j,delay:e,defer:a,wrap:c,methodize:b}
})());(function(c){function b(){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"}function a(){return this.toISOString()}if(!c.toISOString){c.toISOString=b}if(!c.toJSON){c.toJSON=a}})(Date.prototype);RegExp.prototype.match=RegExp.prototype.test;RegExp.escape=function(a){return String(a).replace(/([.*+?^=!:${}()|[\]\/\\])/g,"\\$1")};var PeriodicalExecuter=Class.create({initialize:function(b,a){this.callback=b;this.frequency=a;this.currentlyExecuting=false;this.registerCallback()},registerCallback:function(){this.timer=setInterval(this.onTimerEvent.bind(this),this.frequency*1000)},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(a){this.currentlyExecuting=false;throw a}}}});Object.extend(String,{interpret:function(a){return a==null?"":String(a)},specialChar:{"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r","\\":"\\\\"}});Object.extend(String.prototype,(function(){var NATIVE_JSON_PARSE_SUPPORT=window.JSON&&typeof JSON.parse==="function"&&JSON.parse('{"test": true}').test;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"),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()),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(){return this.replace(/-+(.)?/g,function(match,chr){return chr?chr.toUpperCase():""})}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 unfilterJSON(filter){return this.replace(filter||Prototype.JSONFilter,"$1")}function isJSON(){var str=this;if(str.blank()){return false}str=str.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@");str=str.replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]");str=str.replace(/(?:^|:|,)(?:\s*\[)+/g,"");return(/^[\],:{}\s]*$/).test(str)}function evalJSON(sanitize){var json=this.unfilterJSON(),cx=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g;if(cx.test(json)){json=json.replace(cx,function(a){return"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)})}try{if(!sanitize||json.isJSON()){return eval("("+json+")")}}catch(e){}throw new SyntaxError("Badly formed JSON string: "+this.inspect())}function parseJSON(){var json=this.unfilterJSON();return JSON.parse(json)}function include(pattern){return this.indexOf(pattern)>-1}function startsWith(pattern){return this.lastIndexOf(pattern,0)===0}function endsWith(pattern){var d=this.length-pattern.length;return d>=0&&this.indexOf(pattern,d)===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||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,unfilterJSON:unfilterJSON,isJSON:isJSON,evalJSON:NATIVE_JSON_PARSE_SUPPORT?parseJSON:evalJSON,include:include,startsWith:startsWith,endsWith:endsWith,empty:empty,blank:blank,interpolate:interpolate}})());var Template=Class.create({initialize:function(a,b){this.template=a.toString();this.pattern=b||Template.Pattern},evaluate:function(a){if(a&&Object.isFunction(a.toTemplateReplacements)){a=a.toTemplateReplacements()}return this.template.gsub(this.pattern,function(d){if(a==null){return(d[1]+"")}var f=d[1]||"";if(f=="\\"){return d[2]}var b=a,g=d[3],e=/^([^.[]+|\[((?:.*?[^\\])?)\])(\.|\[|$)/;d=e.exec(g);if(d==null){return f}while(d!=null){var c=d[1].startsWith("[")?d[2].replace(/\\\\]/g,"]"):d[1];b=b[c];if(null==b||""==d[3]){break}g=g.substring("["==d[3]?d[1].length:d[0].length);d=e.exec(g)}return f+String.interpret(b)})}});Template.Pattern=/(^|.|\r|\n)(#\{(.*?)\})/;var $break={};var Enumerable=(function(){function c(y,x){var w=0;try{this._each(function(A){y.call(x,A,w++)})}catch(z){if(z!=$break){throw z}}return this}function r(z,y,x){var w=-z,A=[],B=this.toArray();if(z<1){return B}while((w+=z)<B.length){A.push(B.slice(w,w+z))}return A.collect(y,x)}function b(y,x){y=y||Prototype.K;var w=true;this.each(function(A,z){w=w&&!!y.call(x,A,z);if(!w){throw $break}});return w}function i(y,x){y=y||Prototype.K;var w=false;this.each(function(A,z){if(w=!!y.call(x,A,z)){throw $break}});return w}function j(y,x){y=y||Prototype.K;var w=[];this.each(function(A,z){w.push(y.call(x,A,z))});return w}function t(y,x){var w;this.each(function(A,z){if(y.call(x,A,z)){w=A;throw $break
}});return w}function h(y,x){var w=[];this.each(function(A,z){if(y.call(x,A,z)){w.push(A)}});return w}function g(z,y,x){y=y||Prototype.K;var w=[];if(Object.isString(z)){z=new RegExp(RegExp.escape(z))}this.each(function(B,A){if(z.match(B)){w.push(y.call(x,B,A))}});return w}function a(w){if(Object.isFunction(this.indexOf)){if(this.indexOf(w)!=-1){return true}}var x=false;this.each(function(y){if(y==w){x=true;throw $break}});return x}function q(x,w){w=Object.isUndefined(w)?null:w;return this.eachSlice(x,function(y){while(y.length<x){y.push(w)}return y})}function l(w,y,x){this.each(function(A,z){w=y.call(x,w,A,z)});return w}function v(x){var w=$A(arguments).slice(1);return this.map(function(y){return y[x].apply(y,w)})}function p(y,x){y=y||Prototype.K;var w;this.each(function(A,z){A=y.call(x,A,z);if(w==null||A>=w){w=A}});return w}function n(y,x){y=y||Prototype.K;var w;this.each(function(A,z){A=y.call(x,A,z);if(w==null||A<w){w=A}});return w}function e(z,x){z=z||Prototype.K;var y=[],w=[];this.each(function(B,A){(z.call(x,B,A)?y:w).push(B)});return[y,w]}function f(x){var w=[];this.each(function(y){w.push(y[x])});return w}function d(y,x){var w=[];this.each(function(A,z){if(!y.call(x,A,z)){w.push(A)}});return w}function m(x,w){return this.map(function(z,y){return{value:z,criteria:x.call(w,z,y)}}).sort(function(B,A){var z=B.criteria,y=A.criteria;return z<y?-1:z>y?1:0}).pluck("value")}function o(){return this.map()}function s(){var x=Prototype.K,w=$A(arguments);if(Object.isFunction(w.last())){x=w.pop()}var y=[this].concat(w).map($A);return this.map(function(A,z){return x(y.pluck(z))})}function k(){return this.toArray().length}function u(){return"#<Enumerable:"+this.toArray().inspect()+">"}return{each:c,eachSlice:r,all:b,every:b,any:i,some:i,collect:j,map:j,detect:t,findAll:h,select:h,filter:h,grep:g,include:a,member:a,inGroupsOf:q,inject:l,invoke:v,max:p,min:n,partition:e,pluck:f,reject:d,sortBy:m,toArray:o,entries:o,zip:s,size:k,inspect:u,find:t}})();function $A(c){if(!c){return[]
}if("toArray" in Object(c)){return c.toArray()}var b=c.length||0,a=new Array(b);while(b--){a[b]=c[b]}return a}function $w(a){if(!Object.isString(a)){return[]}a=a.strip();return a?a.split(/\s+/):[]}Array.from=$A;(function(){var r=Array.prototype,m=r.slice,o=r.forEach;function b(w,v){for(var u=0,x=this.length>>>0;u<x;u++){if(u in this){w.call(v,this[u],u,this)}}}if(!o){o=b}function l(){this.length=0;return this}function d(){return this[0]}function g(){return this[this.length-1]}function i(){return this.select(function(u){return u!=null})}function t(){return this.inject([],function(v,u){if(Object.isArray(u)){return v.concat(u.flatten())}v.push(u);return v})}function h(){var u=m.call(arguments,0);return this.select(function(v){return !u.include(v)})}function f(u){return(u===false?this.toArray():this)._reverse()}function k(u){return this.inject([],function(x,w,v){if(0==v||(u?x.last()!=w:!x.include(w))){x.push(w)}return x})}function p(u){return this.uniq().findAll(function(v){return u.detect(function(w){return v===w})})}function q(){return m.call(this,0)}function j(){return this.length}function s(){return"["+this.map(Object.inspect).join(", ")+"]"}function a(w,u){u||(u=0);var v=this.length;if(u<0){u=v+u}for(;u<v;u++){if(this[u]===w){return u}}return -1}function n(v,u){u=isNaN(u)?this.length:(u<0?this.length+u:u)+1;var w=this.slice(0,u).reverse().indexOf(v);return(w<0)?w:u-w-1}function c(){var z=m.call(this,0),x;for(var v=0,w=arguments.length;v<w;v++){x=arguments[v];if(Object.isArray(x)&&!("callee" in x)){for(var u=0,y=x.length;u<y;u++){z.push(x[u])}}else{z.push(x)}}return z}Object.extend(r,Enumerable);if(!r._reverse){r._reverse=r.reverse}Object.extend(r,{_each:o,clear:l,first:d,last:g,compact:i,flatten:t,without:h,reverse:f,uniq:k,intersect:p,clone:q,toArray:q,size:j,inspect:s});var e=(function(){return[].concat(arguments)[0][0]!==1})(1,2);if(e){r.concat=c}if(!r.indexOf){r.indexOf=a}if(!r.lastIndexOf){r.lastIndexOf=n}})();function $H(a){return new Hash(a)}var Hash=Class.create(Enumerable,(function(){function e(p){this._object=Object.isHash(p)?p.toObject():Object.clone(p)
}function f(q){for(var p in this._object){var r=this._object[p],s=[p,r];s.key=p;s.value=r;q(s)}}function j(p,q){return this._object[p]=q}function c(p){if(this._object[p]!==Object.prototype[p]){return this._object[p]}}function m(p){var q=this._object[p];delete this._object[p];return q}function o(){return Object.clone(this._object)}function n(){return this.pluck("key")}function l(){return this.pluck("value")}function g(q){var p=this.detect(function(r){return r.value===q});return p&&p.key}function i(p){return this.clone().update(p)}function d(p){return new Hash(p).inject(this,function(q,r){q.set(r.key,r.value);return q})}function b(p,q){if(Object.isUndefined(q)){return p}return p+"="+encodeURIComponent(String.interpret(q))}function a(){return this.inject([],function(t,w){var s=encodeURIComponent(w.key),q=w.value;if(q&&typeof q=="object"){if(Object.isArray(q)){var v=[];for(var r=0,p=q.length,u;r<p;r++){u=q[r];v.push(b(s,u))}return t.concat(v)}}else{t.push(b(s,q))}return t}).join("&")}function k(){return"#<Hash:{"+this.map(function(p){return p.map(Object.inspect).join(": ")}).join(", ")+"}>"}function h(){return new Hash(this)}return{initialize:e,_each:f,set:j,get:c,unset:m,toObject:o,toTemplateReplacements:o,keys:n,values:l,index:g,merge:i,update:d,toQueryString:a,inspect:k,toJSON:o,clone:h}})());Hash.from=$H;Object.extend(Number.prototype,(function(){function d(){return this.toPaddedString(2,16)}function b(){return this+1}function h(j,i){$R(0,this,true).each(j,i);return this}function g(k,j){var i=this.toString(j||10);return"0".times(k-i.length)+i}function a(){return Math.abs(this)}function c(){return Math.round(this)}function e(){return Math.ceil(this)}function f(){return Math.floor(this)}return{toColorPart:d,succ:b,times:h,toPaddedString:g,abs:a,round:c,ceil:e,floor:f}})());function $R(c,a,b){return new ObjectRange(c,a,b)}var ObjectRange=Class.create(Enumerable,(function(){function b(f,d,e){this.start=f;this.end=d;this.exclusive=e}function c(d){var e=this.start;while(this.include(e)){d(e);
e=e.succ()}}function a(d){if(d<this.start){return false}if(this.exclusive){return d<this.end}return d<=this.end}return{initialize:b,_each:c,include:a}})());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(a){this.responders._each(a)},register:function(a){if(!this.include(a)){this.responders.push(a)}},unregister:function(a){this.responders=this.responders.without(a)},dispatch:function(d,b,c,a){this.each(function(f){if(Object.isFunction(f[d])){try{f[d].apply(f,[b,c,a])}catch(g){}}})}};Object.extend(Ajax.Responders,Enumerable);Ajax.Responders.register({onCreate:function(){Ajax.activeRequestCount++},onComplete:function(){Ajax.activeRequestCount--}});Ajax.Base=Class.create({initialize:function(a){this.options={method:"post",asynchronous:true,contentType:"application/x-www-form-urlencoded",encoding:"UTF-8",parameters:"",evalJSON:true,evalJS:true};Object.extend(this.options,a||{});this.options.method=this.options.method.toLowerCase();if(Object.isHash(this.options.parameters)){this.options.parameters=this.options.parameters.toObject()}}});Ajax.Request=Class.create(Ajax.Base,{_complete:false,initialize:function($super,b,a){$super(a);this.transport=Ajax.getTransport();this.request(b)},request:function(b){this.url=b;this.method=this.options.method;var d=Object.isString(this.options.parameters)?this.options.parameters:Object.toQueryString(this.options.parameters);if(!["get","post"].include(this.method)){d+=(d?"&":"")+"_method="+this.method;this.method="post"}if(d&&this.method==="get"){this.url+=(this.url.include("?")?"&":"?")+d}this.parameters=d.toQueryParams();try{var a=new Ajax.Response(this);if(this.options.onCreate){this.options.onCreate(a)}Ajax.Responders.dispatch("onCreate",this,a);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||d):null;this.transport.send(this.body);if(!this.options.asynchronous&&this.transport.overrideMimeType){this.onStateChange()}}catch(c){this.dispatchException(c)}},onStateChange:function(){var a=this.transport.readyState;if(a>1&&!((a==4)&&this._complete)){this.respondToReadyState(this.transport.readyState)}},setRequestHeaders:function(){var e={"X-Requested-With":"XMLHttpRequest","X-Prototype-Version":Prototype.Version,Accept:"text/javascript, text/html, application/xml, text/xml, */*"};if(this.method=="post"){e["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){e.Connection="close"}}if(typeof this.options.requestHeaders=="object"){var c=this.options.requestHeaders;if(Object.isFunction(c.push)){for(var b=0,d=c.length;b<d;b+=2){e[c[b]]=c[b+1]}}else{$H(c).each(function(f){e[f.key]=f.value})}}for(var a in e){this.transport.setRequestHeader(a,e[a])}},success:function(){var a=this.getStatus();return !a||(a>=200&&a<300)||a==304},getStatus:function(){try{if(this.transport.status===1223){return 204}return this.transport.status||0}catch(a){return 0}},respondToReadyState:function(a){var c=Ajax.Request.Events[a],b=new Ajax.Response(this);if(c=="Complete"){try{this._complete=true;(this.options["on"+b.status]||this.options["on"+(this.success()?"Success":"Failure")]||Prototype.emptyFunction)(b,b.headerJSON)}catch(d){this.dispatchException(d)}var f=b.getHeader("Content-type");if(this.options.evalJS=="force"||(this.options.evalJS&&this.isSameOrigin()&&f&&f.match(/^\s*(text|application)\/(x-)?(java|ecma)script(;.*)?\s*$/i))){this.evalResponse()}}try{(this.options["on"+c]||Prototype.emptyFunction)(b,b.headerJSON);Ajax.Responders.dispatch("on"+c,this,b,b.headerJSON)
}catch(d){this.dispatchException(d)}if(c=="Complete"){this.transport.onreadystatechange=Prototype.emptyFunction}},isSameOrigin:function(){var a=this.url.match(/^\s*https?:\/\/[^\/]*/);return !a||(a[0]=="#{protocol}//#{domain}#{port}".interpolate({protocol:location.protocol,domain:document.domain,port:location.port?":"+location.port:""}))},getHeader:function(a){try{return this.transport.getResponseHeader(a)||null}catch(b){return null}},evalResponse:function(){try{return eval((this.transport.responseText||"").unfilterJSON())}catch(e){this.dispatchException(e)}},dispatchException:function(a){(this.options.onException||Prototype.emptyFunction)(this,a);Ajax.Responders.dispatch("onException",this,a)}});Ajax.Request.Events=["Uninitialized","Loading","Loaded","Interactive","Complete"];Ajax.Response=Class.create({initialize:function(c){this.request=c;var d=this.transport=c.transport,a=this.readyState=d.readyState;if((a>2&&!Prototype.Browser.IE)||a==4){this.status=this.getStatus();this.statusText=this.getStatusText();this.responseText=String.interpret(d.responseText);this.headerJSON=this._getHeaderJSON()}if(a==4){var b=d.responseXML;this.responseXML=Object.isUndefined(b)?null:b;this.responseJSON=this._getResponseJSON()}},status:0,statusText:"",getStatus:Ajax.Request.prototype.getStatus,getStatusText:function(){try{return this.transport.statusText||""}catch(a){return""}},getHeader:Ajax.Request.prototype.getHeader,getAllHeaders:function(){try{return this.getAllResponseHeaders()}catch(a){return null}},getResponseHeader:function(a){return this.transport.getResponseHeader(a)},getAllResponseHeaders:function(){return this.transport.getAllResponseHeaders()},_getHeaderJSON:function(){return null;var a=this.getHeader("X-JSON");if(!a){return null}a=decodeURIComponent(escape(a));try{return a.evalJSON(this.request.options.sanitizeJSON||!this.request.isSameOrigin())}catch(b){this.request.dispatchException(b)}},_getResponseJSON:function(){var a=this.request.options;if(!a.evalJSON||(a.evalJSON!="force"&&!(this.getHeader("Content-type")||"").include("application/json"))||this.responseText.blank()){return null
}try{return this.responseText.evalJSON(a.sanitizeJSON||!this.request.isSameOrigin())}catch(b){this.request.dispatchException(b)}}});Ajax.Updater=Class.create(Ajax.Request,{initialize:function($super,a,c,b){this.container={success:(a.success||a),failure:(a.failure||(a.success?null:a))};b=Object.clone(b);var d=b.onComplete;b.onComplete=(function(e,f){this.updateContent(e.responseText);if(Object.isFunction(d)){d(e,f)}}).bind(this);$super(c,b)},updateContent:function(d){var c=this.container[this.success()?"success":"failure"],a=this.options;if(!a.evalScripts){d=d.stripScripts()}if(c=$(c)){if(a.insertion){if(Object.isString(a.insertion)){var b={};b[a.insertion]=d;c.insert(b)}else{a.insertion(c,d)}}else{c.update(d)}}}});Ajax.PeriodicalUpdater=Class.create(Ajax.Base,{initialize:function($super,a,c,b){$super(b);this.onComplete=this.options.onComplete;this.frequency=(this.options.frequency||2);this.decay=(this.options.decay||1);this.updater={};this.container=a;this.url=c;this.start()},start:function(){this.options.onComplete=this.updateComplete.bind(this);this.onTimerEvent()},stop:function(){this.updater.options.onComplete=undefined;clearTimeout(this.timer);(this.onComplete||Prototype.emptyFunction).apply(this,arguments)},updateComplete:function(a){if(this.options.decay){this.decay=(a.responseText==this.lastText?this.decay*this.options.decay:1);this.lastText=a.responseText}this.timer=this.onTimerEvent.bind(this).delay(this.decay*this.frequency)},onTimerEvent:function(){this.updater=new Ajax.Updater(this.container,this.url,this.options)}});function $(b){if(arguments.length>1){for(var a=0,d=[],c=arguments.length;a<c;a++){d.push($(arguments[a]))}return d}if(Object.isString(b)){b=document.getElementById(b)}return Element.extend(b)}if(Prototype.BrowserFeatures.XPath){document._getElementsByXPath=function(f,a){var c=[];var e=document.evaluate(f,$(a)||document,null,XPathResult.ORDERED_NODE_SNAPSHOT_TYPE,null);for(var b=0,d=e.snapshotLength;b<d;b++){c.push(Element.extend(e.snapshotItem(b)))
}return c}}if(!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(c){function d(f,e){if(f==="select"){return false}if("type" in e){return false}return true}var b=(function(){try{var e=document.createElement('<input name="x">');return e.tagName.toLowerCase()==="input"&&e.name==="x"}catch(f){return false}})();var a=c.Element;c.Element=function(g,f){f=f||{};g=g.toLowerCase();var e=Element.cache;if(b&&f.name){g="<"+g+' name="'+f.name+'">';delete f.name;return Element.writeAttribute(document.createElement(g),f)}if(!e[g]){e[g]=Element.extend(document.createElement(g))}var h=d(g,f)?e[g].cloneNode(false):document.createElement(g);return Element.writeAttribute(h,f)};Object.extend(c.Element,a||{});if(a){c.Element.prototype=a.prototype}})(this);Element.idCounter=1;Element.cache={};Element._purgeElement=function(b){var a=b._prototypeUID;if(a){Element.stopObserving(b);b._prototypeUID=void 0;delete Element.Storage[a]}};Element.Methods={visible:function(a){return $(a).style.display!="none"},toggle:function(a){a=$(a);Element[Element.visible(a)?"hide":"show"](a);return a},hide:function(a){a=$(a);a.style.display="none";return a},show:function(a){a=$(a);a.style.display="";return a},remove:function(a){a=$(a);a.parentNode.removeChild(a);return a},update:(function(){var d=(function(){var g=document.createElement("select"),h=true;g.innerHTML='<option value="test">test</option>';if(g.options&&g.options[0]){h=g.options[0].nodeName.toUpperCase()!=="OPTION"}g=null;return h})();var b=(function(){try{var g=document.createElement("table");if(g&&g.tBodies){g.innerHTML="<tbody><tr><td>test</td></tr></tbody>";var i=typeof g.tBodies[0]=="undefined";g=null;return i}}catch(h){return true}})();var a=(function(){try{var g=document.createElement("div");g.innerHTML="<link>";
var i=(g.childNodes.length===0);g=null;return i}catch(h){return true}})();var c=d||b||a;var f=(function(){var g=document.createElement("script"),i=false;try{g.appendChild(document.createTextNode(""));i=!g.firstChild||g.firstChild&&g.firstChild.nodeType!==3}catch(h){i=true}g=null;return i})();function e(l,m){l=$(l);var g=Element._purgeElement;var n=l.getElementsByTagName("*"),k=n.length;while(k--){g(n[k])}if(m&&m.toElement){m=m.toElement()}if(Object.isElement(m)){return l.update().insert(m)}m=Object.toHTML(m);var j=l.tagName.toUpperCase();if(j==="SCRIPT"&&f){l.text=m;return l}if(c){if(j in Element._insertionTranslations.tags){while(l.firstChild){l.removeChild(l.firstChild)}Element._getContentFromAnonymousElement(j,m.stripScripts()).each(function(i){l.appendChild(i)})}else{if(a&&Object.isString(m)&&m.indexOf("<link")>-1){while(l.firstChild){l.removeChild(l.firstChild)}var h=Element._getContentFromAnonymousElement(j,m.stripScripts(),true);h.each(function(i){l.appendChild(i)})}else{l.innerHTML=m.stripScripts()}}}else{l.innerHTML=m.stripScripts()}m.evalScripts.bind(m).defer();return l}return e})(),replace:function(b,c){b=$(b);if(c&&c.toElement){c=c.toElement()}else{if(!Object.isElement(c)){c=Object.toHTML(c);var a=b.ownerDocument.createRange();a.selectNode(b);c.evalScripts.bind(c).defer();c=a.createContextualFragment(c.stripScripts())}}b.parentNode.replaceChild(c,b);return b},insert:function(c,e){c=$(c);if(Object.isString(e)||Object.isNumber(e)||Object.isElement(e)||(e&&(e.toElement||e.toHTML))){e={bottom:e}}var d,f,b,g;for(var a in e){d=e[a];a=a.toLowerCase();f=Element._insertionTranslations[a];if(d&&d.toElement){d=d.toElement()}if(Object.isElement(d)){f(c,d);continue}d=Object.toHTML(d);b=((a=="before"||a=="after")?c.parentNode:c).tagName.toUpperCase();g=Element._getContentFromAnonymousElement(b,d.stripScripts());if(a=="top"||a=="after"){g.reverse()}g.each(f.curry(c));d.evalScripts.bind(d).defer()}return c},wrap:function(b,c,a){b=$(b);if(Object.isElement(c)){$(c).writeAttribute(a||{})
}else{if(Object.isString(c)){c=new Element(c,a)}else{c=new Element("div",c)}}if(b.parentNode){b.parentNode.replaceChild(c,b)}c.appendChild(b);return c},inspect:function(b){b=$(b);var a="<"+b.tagName.toLowerCase();$H({id:"id",className:"class"}).each(function(f){var e=f.first(),c=f.last(),d=(b[e]||"").toString();if(d){a+=" "+c+"="+d.inspect(true)}});return a+">"},recursivelyCollect:function(a,c,d){a=$(a);d=d||-1;var b=[];while(a=a[c]){if(a.nodeType==1){b.push(Element.extend(a))}if(b.length==d){break}}return b},ancestors:function(a){return Element.recursivelyCollect(a,"parentNode")},descendants:function(a){return Element.select(a,"*")},firstDescendant:function(a){a=$(a).firstChild;while(a&&a.nodeType!=1){a=a.nextSibling}return $(a)},immediateDescendants:function(b){var a=[],c=$(b).firstChild;while(c){if(c.nodeType===1){a.push(Element.extend(c))}c=c.nextSibling}return a},previousSiblings:function(a,b){return Element.recursivelyCollect(a,"previousSibling")},nextSiblings:function(a){return Element.recursivelyCollect(a,"nextSibling")},siblings:function(a){a=$(a);return Element.previousSiblings(a).reverse().concat(Element.nextSiblings(a))},match:function(b,a){b=$(b);if(Object.isString(a)){return Prototype.Selector.match(b,a)}return a.match(b)},up:function(b,d,a){b=$(b);if(arguments.length==1){return $(b.parentNode)}var c=Element.ancestors(b);return Object.isNumber(d)?c[d]:Prototype.Selector.find(c,d,a)},down:function(b,c,a){b=$(b);if(arguments.length==1){return Element.firstDescendant(b)}return Object.isNumber(c)?Element.descendants(b)[c]:Element.select(b,c)[a||0]},previous:function(b,c,a){b=$(b);if(Object.isNumber(c)){a=c,c=false}if(!Object.isNumber(a)){a=0}if(c){return Prototype.Selector.find(b.previousSiblings(),c,a)}else{return b.recursivelyCollect("previousSibling",a+1)[a]}},next:function(b,d,a){b=$(b);if(Object.isNumber(d)){a=d,d=false}if(!Object.isNumber(a)){a=0}if(d){return Prototype.Selector.find(b.nextSiblings(),d,a)}else{var c=Object.isNumber(a)?a+1:1;return b.recursivelyCollect("nextSibling",a+1)[a]
}},select:function(a){a=$(a);var b=Array.prototype.slice.call(arguments,1).join(", ");return Prototype.Selector.select(b,a)},adjacent:function(a){a=$(a);var b=Array.prototype.slice.call(arguments,1).join(", ");return Prototype.Selector.select(b,a.parentNode).without(a)},identify:function(a){a=$(a);var b=Element.readAttribute(a,"id");if(b){return b}do{b="anonymous_element_"+Element.idCounter++}while($(b));Element.writeAttribute(a,"id",b);return b},readAttribute:function(c,a){c=$(c);if(Prototype.Browser.IE){var b=Element._attributeTranslations.read;if(b.values[a]){return b.values[a](c,a)}if(b.names[a]){a=b.names[a]}if(a.include(":")){return(!c.attributes||!c.attributes[a])?null:c.attributes[a].value}}return c.getAttribute(a)},writeAttribute:function(e,c,f){e=$(e);var b={},d=Element._attributeTranslations.write;if(typeof c=="object"){b=c}else{b[c]=Object.isUndefined(f)?true:f}for(var a in b){c=d.names[a]||a;f=b[a];if(d.values[a]){c=d.values[a](e,f)}if(f===false||f===null){e.removeAttribute(c)}else{if(f===true){e.setAttribute(c,c)}else{e.setAttribute(c,f)}}}return e},getHeight:function(a){return Element.getDimensions(a).height},getWidth:function(a){return Element.getDimensions(a).width},classNames:function(a){return new Element.ClassNames(a)},hasClassName:function(a,b){if(!(a=$(a))){return}var c=a.className;return(c.length>0&&(c==b||new RegExp("(^|\\s)"+b+"(\\s|$)").test(c)))},addClassName:function(a,b){if(!(a=$(a))){return}if(!Element.hasClassName(a,b)){a.className+=(a.className?" ":"")+b}return a},removeClassName:function(a,b){if(!(a=$(a))){return}a.className=a.className.replace(new RegExp("(^|\\s+)"+b+"(\\s+|$)")," ").strip();return a},toggleClassName:function(a,b){if(!(a=$(a))){return}return Element[Element.hasClassName(a,b)?"removeClassName":"addClassName"](a,b)},cleanWhitespace:function(b){b=$(b);var c=b.firstChild;while(c){var a=c.nextSibling;if(c.nodeType==3&&!/\S/.test(c.nodeValue)){b.removeChild(c)}c=a}return b},empty:function(a){return $(a).innerHTML.blank()},descendantOf:function(b,a){b=$(b),a=$(a);
if(b.compareDocumentPosition){return(b.compareDocumentPosition(a)&8)===8}if(a.contains){return a.contains(b)&&a!==b}while(b=b.parentNode){if(b==a){return true}}return false},scrollTo:function(a){a=$(a);var b=Element.cumulativeOffset(a);window.scrollTo(b[0],b[1]);return a},getStyle:function(b,c){b=$(b);c=c=="float"?"cssFloat":c.camelize();var d=b.style[c];if(!d||d=="auto"){var a=document.defaultView.getComputedStyle(b,null);d=a?a[c]:null}if(c=="opacity"){return d?parseFloat(d):1}return d=="auto"?null:d},getOpacity:function(a){return $(a).getStyle("opacity")},setStyle:function(b,c){b=$(b);var e=b.style,a;if(Object.isString(c)){b.style.cssText+=";"+c;return c.include("opacity")?b.setOpacity(c.match(/opacity:\s*(\d?\.?\d*)/)[1]):b}for(var d in c){if(d=="opacity"){b.setOpacity(c[d])}else{e[(d=="float"||d=="cssFloat")?(Object.isUndefined(e.styleFloat)?"cssFloat":"styleFloat"):d]=c[d]}}return b},setOpacity:function(a,b){a=$(a);a.style.opacity=(b==1||b==="")?"":(b<0.00001)?0:b;return a},makePositioned:function(a){a=$(a);var b=Element.getStyle(a,"position");if(b=="static"||!b){a._madePositioned=true;a.style.position="relative";if(Prototype.Browser.Opera){a.style.top=0;a.style.left=0}}return a},undoPositioned:function(a){a=$(a);if(a._madePositioned){a._madePositioned=undefined;a.style.position=a.style.top=a.style.left=a.style.bottom=a.style.right=""}return a},makeClipping:function(a){a=$(a);if(a._overflow){return a}a._overflow=Element.getStyle(a,"overflow")||"auto";if(a._overflow!=="hidden"){a.style.overflow="hidden"}return a},undoClipping:function(a){a=$(a);if(!a._overflow){return a}a.style.overflow=a._overflow=="auto"?"":a._overflow;a._overflow=null;return a},clonePosition:function(b,d){var a=Object.extend({setLeft:true,setTop:true,setWidth:true,setHeight:true,offsetTop:0,offsetLeft:0},arguments[2]||{});d=$(d);var e=Element.viewportOffset(d),f=[0,0],c=null;b=$(b);if(Element.getStyle(b,"position")=="absolute"){c=Element.getOffsetParent(b);f=Element.viewportOffset(c)}if(c==document.body){f[0]-=document.body.offsetLeft;
f[1]-=document.body.offsetTop}if(a.setLeft){b.style.left=(e[0]-f[0]+a.offsetLeft)+"px"}if(a.setTop){b.style.top=(e[1]-f[1]+a.offsetTop)+"px"}if(a.setWidth){b.style.width=d.offsetWidth+"px"}if(a.setHeight){b.style.height=d.offsetHeight+"px"}return b}};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(d,b,c){switch(c){case"height":case"width":if(!Element.visible(b)){return null}var e=parseInt(d(b,c),10);if(e!==b["offset"+c.capitalize()]){return e+"px"}var a;if(c==="height"){a=["border-top-width","padding-top","padding-bottom","border-bottom-width"]}else{a=["border-left-width","padding-left","padding-right","border-right-width"]}return a.inject(e,function(f,g){var h=d(b,g);return h===null?f:f-parseInt(h,10)})+"px";default:return d(b,c)}});Element.Methods.readAttribute=Element.Methods.readAttribute.wrap(function(c,a,b){if(b==="title"){return a.title}return c(a,b)})}else{if(Prototype.Browser.IE){Element.Methods.getStyle=function(a,b){a=$(a);b=(b=="float"||b=="cssFloat")?"styleFloat":b.camelize();var c=a.style[b];if(!c&&a.currentStyle){c=a.currentStyle[b]}if(b=="opacity"){if(c=(a.getStyle("filter")||"").match(/alpha\(opacity=(.*)\)/)){if(c[1]){return parseFloat(c[1])/100}}return 1}if(c=="auto"){if((b=="width"||b=="height")&&(a.getStyle("display")!="none")){return a["offset"+b.capitalize()]+"px"}return null}return c};Element.Methods.setOpacity=function(b,e){function f(g){return g.replace(/alpha\([^\)]*\)/gi,"")}b=$(b);var a=b.currentStyle;if((a&&!a.hasLayout)||(!a&&b.style.zoom=="normal")){b.style.zoom=1}var d=b.getStyle("filter"),c=b.style;if(e==1||e===""){(d=f(d))?c.filter=d:c.removeAttribute("filter");return b}else{if(e<0.00001){e=0}}c.filter=f(d)+"alpha(opacity="+(e*100)+")";return b};Element._attributeTranslations=(function(){var b="className",a="for",c=document.createElement("div");
c.setAttribute(b,"x");if(c.className!=="x"){c.setAttribute("class","x");if(c.className==="x"){b="class"}}c=null;c=document.createElement("label");c.setAttribute(a,"x");if(c.htmlFor!=="x"){c.setAttribute("htmlFor","x");if(c.htmlFor==="x"){a="htmlFor"}}c=null;return{read:{names:{"class":b,className:b,"for":a,htmlFor:a},values:{_getAttr:function(d,e){return d.getAttribute(e)},_getAttr2:function(d,e){return d.getAttribute(e,2)},_getAttrNode:function(d,f){var e=d.getAttributeNode(f);return e?e.value:""},_getEv:(function(){var d=document.createElement("div"),g;d.onclick=Prototype.emptyFunction;var e=d.getAttribute("onclick");if(String(e).indexOf("{")>-1){g=function(f,h){h=f.getAttribute(h);if(!h){return null}h=h.toString();h=h.split("{")[1];h=h.split("}")[0];return h.strip()}}else{if(e===""){g=function(f,h){h=f.getAttribute(h);if(!h){return null}return h.strip()}}}d=null;return g})(),_flag:function(d,e){return $(d).hasAttribute(e)?e:null},style:function(d){return d.style.cssText.toLowerCase()},title:function(d){return d.title}}}}})();Element._attributeTranslations.write={names:Object.extend({cellpadding:"cellPadding",cellspacing:"cellSpacing"},Element._attributeTranslations.read.names),values:{checked:function(a,b){a.checked=!!b},style:function(a,b){a.style.cssText=b?b:""}}};Element._attributeTranslations.has={};$w("colSpan rowSpan vAlign dateTime accessKey tabIndex encType maxLength readOnly longDesc frameBorder").each(function(a){Element._attributeTranslations.write.names[a.toLowerCase()]=a;Element._attributeTranslations.has[a.toLowerCase()]=a});(function(a){Object.extend(a,{href:a._getAttr2,src:a._getAttr2,type:a._getAttr,action:a._getAttrNode,disabled:a._flag,checked:a._flag,readonly:a._flag,multiple:a._flag,onload:a._getEv,onunload:a._getEv,onclick:a._getEv,ondblclick:a._getEv,onmousedown:a._getEv,onmouseup:a._getEv,onmouseover:a._getEv,onmousemove:a._getEv,onmouseout:a._getEv,onfocus:a._getEv,onblur:a._getEv,onkeypress:a._getEv,onkeydown:a._getEv,onkeyup:a._getEv,onsubmit:a._getEv,onreset:a._getEv,onselect:a._getEv,onchange:a._getEv})
})(Element._attributeTranslations.read.values);if(Prototype.BrowserFeatures.ElementExtensions){(function(){function a(e){var b=e.getElementsByTagName("*"),d=[];for(var c=0,f;f=b[c];c++){if(f.tagName!=="!"){d.push(f)}}return d}Element.Methods.down=function(c,d,b){c=$(c);if(arguments.length==1){return c.firstDescendant()}return Object.isNumber(d)?a(c)[d]:Element.select(c,d)[b||0]}})()}}else{if(Prototype.Browser.Gecko&&/rv:1\.8\.0/.test(navigator.userAgent)){Element.Methods.setOpacity=function(a,b){a=$(a);a.style.opacity=(b==1)?0.999999:(b==="")?"":(b<0.00001)?0:b;return a}}else{if(Prototype.Browser.WebKit){Element.Methods.setOpacity=function(a,b){a=$(a);a.style.opacity=(b==1||b==="")?"":(b<0.00001)?0:b;if(b==1){if(a.tagName.toUpperCase()=="IMG"&&a.width){a.width++;a.width--}else{try{var d=document.createTextNode(" ");a.appendChild(d);a.removeChild(d)}catch(c){}}}return a}}}}}if("outerHTML" in document.documentElement){Element.Methods.replace=function(c,e){c=$(c);if(e&&e.toElement){e=e.toElement()}if(Object.isElement(e)){c.parentNode.replaceChild(e,c);return c}e=Object.toHTML(e);var d=c.parentNode,b=d.tagName.toUpperCase();if(Element._insertionTranslations.tags[b]){var f=c.next(),a=Element._getContentFromAnonymousElement(b,e.stripScripts());d.removeChild(c);if(f){a.each(function(g){d.insertBefore(g,f)})}else{a.each(function(g){d.appendChild(g)})}}else{c.outerHTML=e.stripScripts()}e.evalScripts.bind(e).defer();return c}}Element._returnOffset=function(b,c){var a=[b,c];a.left=b;a.top=c;return a};Element._getContentFromAnonymousElement=function(e,d,f){var g=new Element("div"),c=Element._insertionTranslations.tags[e];var a=false;if(c){a=true}else{if(f){a=true;c=["","",0]}}if(a){g.innerHTML="&nbsp;"+c[0]+d+c[1];g.removeChild(g.firstChild);for(var b=c[2];b--;){g=g.firstChild}}else{g.innerHTML=d}return $A(g.childNodes)};Element._insertionTranslations={before:function(a,b){a.parentNode.insertBefore(b,a)},top:function(a,b){a.insertBefore(b,a.firstChild)},bottom:function(a,b){a.appendChild(b)
},after:function(a,b){a.parentNode.insertBefore(b,a.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 a=Element._insertionTranslations.tags;Object.extend(a,{THEAD:a.TBODY,TFOOT:a.TBODY,TH:a.TD})})();Element.Methods.Simulated={hasAttribute:function(a,c){c=Element._attributeTranslations.has[c]||c;var b=$(a).getAttributeNode(c);return !!(b&&b.specified)}};Element.Methods.ByTag={};Object.extend(Element,Element.Methods);(function(a){if(!Prototype.BrowserFeatures.ElementExtensions&&a.__proto__){window.HTMLElement={};window.HTMLElement.prototype=a.__proto__;Prototype.BrowserFeatures.ElementExtensions=true}a=null})(document.createElement("div"));Element.extend=(function(){function c(g){if(typeof window.Element!="undefined"){var i=window.Element.prototype;if(i){var k="_"+(Math.random()+"").slice(2),h=document.createElement(g);i[k]="x";var j=(h[k]!=="x");delete i[k];h=null;return j}}return false}function b(h,g){for(var j in g){var i=g[j];if(Object.isFunction(i)&&!(j in h)){h[j]=i.methodize()}}}var d=c("object");if(Prototype.BrowserFeatures.SpecificElementExtensions){if(d){return function(h){if(h&&typeof h._extendedByPrototype=="undefined"){var g=h.tagName;if(g&&(/^(?:object|applet|embed)$/i.test(g))){b(h,Element.Methods);b(h,Element.Methods.Simulated);b(h,Element.Methods.ByTag[g.toUpperCase()])}}return h}}return Prototype.K}var a={},e=Element.Methods.ByTag;var f=Object.extend(function(i){if(!i||typeof i._extendedByPrototype!="undefined"||i.nodeType!=1||i==window){return i}var g=Object.clone(a),h=i.tagName.toUpperCase();if(e[h]){Object.extend(g,e[h])}b(i,g);i._extendedByPrototype=Prototype.emptyFunction;return i},{refresh:function(){if(!Prototype.BrowserFeatures.ElementExtensions){Object.extend(a,Element.Methods);Object.extend(a,Element.Methods.Simulated)}}});f.refresh();
return f})();if(document.documentElement.hasAttribute){Element.hasAttribute=function(a,b){return a.hasAttribute(b)}}else{Element.hasAttribute=Element.Methods.Simulated.hasAttribute}Element.addMethods=function(c){var i=Prototype.BrowserFeatures,d=Element.Methods.ByTag;if(!c){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),BUTTON:Object.clone(Form.Element.Methods)})}if(arguments.length==2){var b=c;c=arguments[1]}if(!b){Object.extend(Element.Methods,c||{})}else{if(Object.isArray(b)){b.each(g)}else{g(b)}}function g(k){k=k.toUpperCase();if(!Element.Methods.ByTag[k]){Element.Methods.ByTag[k]={}}Object.extend(Element.Methods.ByTag[k],c)}function a(m,l,k){k=k||false;for(var o in m){var n=m[o];if(!Object.isFunction(n)){continue}if(!k||!(o in l)){l[o]=n.methodize()}}}function e(n){var k;var m={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(m[n]){k="HTML"+m[n]+"Element"}if(window[k]){return window[k]}k="HTML"+n+"Element";if(window[k]){return window[k]}k="HTML"+n.capitalize()+"Element";if(window[k]){return window[k]}var l=document.createElement(n),o=l.__proto__||l.constructor.prototype;l=null;return o}var h=window.HTMLElement?HTMLElement.prototype:Element.prototype;if(i.ElementExtensions){a(Element.Methods,h);a(Element.Methods.Simulated,h,true)}if(i.SpecificElementExtensions){for(var j in Element.Methods.ByTag){var f=e(j);if(Object.isUndefined(f)){continue
}a(d[j],f.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(b){var g=Prototype.Browser,e=document,c,d={};function a(){if(g.WebKit&&!e.evaluate){return document}if(g.Opera&&window.parseFloat(window.opera.version())<9.5){return document.body}return document.documentElement}function f(h){if(!c){c=a()}d[h]="client"+h;b["get"+h]=function(){return c[d[h]]};return b["get"+h]()}b.getWidth=f.curry("Width");b.getHeight=f.curry("Height")})(document.viewport);Element.Storage={UID:1};Element.addMethods({getStorage:function(b){if(!(b=$(b))){return}var a;if(b===window){a=0}else{if(typeof b._prototypeUID==="undefined"){b._prototypeUID=Element.Storage.UID++}a=b._prototypeUID}if(!Element.Storage[a]){Element.Storage[a]=$H()}return Element.Storage[a]},store:function(b,a,c){if(!(b=$(b))){return}if(arguments.length===2){Element.getStorage(b).update(a)}else{Element.getStorage(b).set(a,c)}return b},retrieve:function(c,b,a){if(!(c=$(c))){return}var e=Element.getStorage(c),d=e.get(b);if(Object.isUndefined(d)){e.set(b,a);d=a}return d},clone:function(c,a){if(!(c=$(c))){return}var e=c.cloneNode(a);e._prototypeUID=void 0;if(a){var d=Element.select(e,"*"),b=d.length;while(b--){d[b]._prototypeUID=void 0}}return Element.extend(e)},purge:function(c){if(!(c=$(c))){return}var a=Element._purgeElement;a(c);var d=c.getElementsByTagName("*"),b=d.length;while(b--){a(d[b])}return null}});(function(){function h(v){var u=v.match(/^(\d+)%?$/i);if(!u){return null}return(Number(u[1])/100)}function o(F,G,v){var y=null;if(Object.isElement(F)){y=F;F=y.getStyle(G)}if(F===null){return null}if((/^(?:-)?\d+(\.\d+)?(px)?$/i).test(F)){return window.parseFloat(F)
}var A=F.include("%"),w=(v===document.viewport);if(/\d/.test(F)&&y&&y.runtimeStyle&&!(A&&w)){var u=y.style.left,E=y.runtimeStyle.left;y.runtimeStyle.left=y.currentStyle.left;y.style.left=F||0;F=y.style.pixelLeft;y.style.left=u;y.runtimeStyle.left=E;return F}if(y&&A){v=v||y.parentNode;var x=h(F);var B=null;var z=y.getStyle("position");var D=G.include("left")||G.include("right")||G.include("width");var C=G.include("top")||G.include("bottom")||G.include("height");if(v===document.viewport){if(D){B=document.viewport.getWidth()}else{if(C){B=document.viewport.getHeight()}}}else{if(D){B=$(v).measure("width")}else{if(C){B=$(v).measure("height")}}}return(B===null)?0:B*x}return 0}function g(u){if(Object.isString(u)&&u.endsWith("px")){return u}return u+"px"}function j(v){var u=v;while(v&&v.parentNode){var w=v.getStyle("display");if(w==="none"){return false}v=$(v.parentNode)}return true}var d=Prototype.K;if("currentStyle" in document.documentElement){d=function(u){if(!u.currentStyle.hasLayout){u.style.zoom=1}return u}}function f(u){if(u.include("border")){u=u+"-width"}return u.camelize()}Element.Layout=Class.create(Hash,{initialize:function($super,v,u){$super();this.element=$(v);Element.Layout.PROPERTIES.each(function(w){this._set(w,null)},this);if(u){this._preComputing=true;this._begin();Element.Layout.PROPERTIES.each(this._compute,this);this._end();this._preComputing=false}},_set:function(v,u){return Hash.prototype.set.call(this,v,u)},set:function(v,u){throw"Properties of Element.Layout are read-only."},get:function($super,v){var u=$super(v);return u===null?this._compute(v):u},_begin:function(){if(this._prepared){return}var y=this.element;if(j(y)){this._prepared=true;return}var A={position:y.style.position||"",width:y.style.width||"",visibility:y.style.visibility||"",display:y.style.display||""};y.store("prototype_original_styles",A);var B=y.getStyle("position"),u=y.getStyle("width");if(u==="0px"||u===null){y.style.display="block";u=y.getStyle("width")}var v=(B==="fixed")?document.viewport:y.parentNode;
y.setStyle({position:"absolute",visibility:"hidden",display:"block"});var w=y.getStyle("width");var x;if(u&&(w===u)){x=o(y,"width",v)}else{if(B==="absolute"||B==="fixed"){x=o(y,"width",v)}else{var C=y.parentNode,z=$(C).getLayout();x=z.get("width")-this.get("margin-left")-this.get("border-left")-this.get("padding-left")-this.get("padding-right")-this.get("border-right")-this.get("margin-right")}}y.setStyle({width:x+"px"});this._prepared=true},_end:function(){var v=this.element;var u=v.retrieve("prototype_original_styles");v.store("prototype_original_styles",null);v.setStyle(u);this._prepared=false},_compute:function(v){var u=Element.Layout.COMPUTATIONS;if(!(v in u)){throw"Property not found."}return this._set(v,u[v].call(this,this.element))},toObject:function(){var u=$A(arguments);var v=(u.length===0)?Element.Layout.PROPERTIES:u.join(" ").split(" ");var w={};v.each(function(x){if(!Element.Layout.PROPERTIES.include(x)){return}var y=this.get(x);if(y!=null){w[x]=y}},this);return w},toHash:function(){var u=this.toObject.apply(this,arguments);return new Hash(u)},toCSS:function(){var u=$A(arguments);var w=(u.length===0)?Element.Layout.PROPERTIES:u.join(" ").split(" ");var v={};w.each(function(x){if(!Element.Layout.PROPERTIES.include(x)){return}if(Element.Layout.COMPOSITE_PROPERTIES.include(x)){return}var y=this.get(x);if(y!=null){v[f(x)]=y+"px"}},this);return v},inspect:function(){return"#<Element.Layout>"}});Object.extend(Element.Layout,{PROPERTIES:$w("height width top left right bottom border-left border-right border-top border-bottom padding-left padding-right padding-top padding-bottom margin-top margin-bottom margin-left margin-right padding-box-width padding-box-height border-box-width border-box-height margin-box-width margin-box-height"),COMPOSITE_PROPERTIES:$w("padding-box-width padding-box-height margin-box-width margin-box-height border-box-width border-box-height"),COMPUTATIONS:{height:function(w){if(!this._preComputing){this._begin()}var u=this.get("border-box-height");
if(u<=0){if(!this._preComputing){this._end()}return 0}var x=this.get("border-top"),v=this.get("border-bottom");var z=this.get("padding-top"),y=this.get("padding-bottom");if(!this._preComputing){this._end()}return u-x-v-z-y},width:function(w){if(!this._preComputing){this._begin()}var v=this.get("border-box-width");if(v<=0){if(!this._preComputing){this._end()}return 0}var z=this.get("border-left"),u=this.get("border-right");var x=this.get("padding-left"),y=this.get("padding-right");if(!this._preComputing){this._end()}return v-z-u-x-y},"padding-box-height":function(v){var u=this.get("height"),x=this.get("padding-top"),w=this.get("padding-bottom");return u+x+w},"padding-box-width":function(u){var v=this.get("width"),w=this.get("padding-left"),x=this.get("padding-right");return v+w+x},"border-box-height":function(v){if(!this._preComputing){this._begin()}var u=v.offsetHeight;if(!this._preComputing){this._end()}return u},"border-box-width":function(u){if(!this._preComputing){this._begin()}var v=u.offsetWidth;if(!this._preComputing){this._end()}return v},"margin-box-height":function(v){var u=this.get("border-box-height"),w=this.get("margin-top"),x=this.get("margin-bottom");if(u<=0){return 0}return u+w+x},"margin-box-width":function(w){var v=this.get("border-box-width"),x=this.get("margin-left"),u=this.get("margin-right");if(v<=0){return 0}return v+x+u},top:function(u){var v=u.positionedOffset();return v.top},bottom:function(u){var x=u.positionedOffset(),v=u.getOffsetParent(),w=v.measure("height");var y=this.get("border-box-height");return w-y-x.top},left:function(u){var v=u.positionedOffset();return v.left},right:function(w){var y=w.positionedOffset(),x=w.getOffsetParent(),u=x.measure("width");var v=this.get("border-box-width");return u-v-y.left},"padding-top":function(u){return o(u,"paddingTop")},"padding-bottom":function(u){return o(u,"paddingBottom")},"padding-left":function(u){return o(u,"paddingLeft")},"padding-right":function(u){return o(u,"paddingRight")},"border-top":function(u){return o(u,"borderTopWidth")
},"border-bottom":function(u){return o(u,"borderBottomWidth")},"border-left":function(u){return o(u,"borderLeftWidth")},"border-right":function(u){return o(u,"borderRightWidth")},"margin-top":function(u){return o(u,"marginTop")},"margin-bottom":function(u){return o(u,"marginBottom")},"margin-left":function(u){return o(u,"marginLeft")},"margin-right":function(u){return o(u,"marginRight")}}});if("getBoundingClientRect" in document.documentElement){Object.extend(Element.Layout.COMPUTATIONS,{right:function(v){var w=d(v.getOffsetParent());var x=v.getBoundingClientRect(),u=w.getBoundingClientRect();return(u.right-x.right).round()},bottom:function(v){var w=d(v.getOffsetParent());var x=v.getBoundingClientRect(),u=w.getBoundingClientRect();return(u.bottom-x.bottom).round()}})}Element.Offset=Class.create({initialize:function(v,u){this.left=v.round();this.top=u.round();this[0]=this.left;this[1]=this.top},relativeTo:function(u){return new Element.Offset(this.left-u.left,this.top-u.top)},inspect:function(){return"#<Element.Offset left: #{left} top: #{top}>".interpolate(this)},toString:function(){return"[#{left}, #{top}]".interpolate(this)},toArray:function(){return[this.left,this.top]}});function r(v,u){return new Element.Layout(v,u)}function b(u,v){return $(u).getLayout().get(v)}function n(v){v=$(v);var z=Element.getStyle(v,"display");if(z&&z!=="none"){return{width:v.offsetWidth,height:v.offsetHeight}}var w=v.style;var u={visibility:w.visibility,position:w.position,display:w.display};var y={visibility:"hidden",display:"block"};if(u.position!=="fixed"){y.position="absolute"}Element.setStyle(v,y);var x={width:v.offsetWidth,height:v.offsetHeight};Element.setStyle(v,u);return x}function l(u){u=$(u);if(e(u)||c(u)||m(u)||k(u)){return $(document.body)}var v=(Element.getStyle(u,"display")==="inline");if(!v&&u.offsetParent){return $(u.offsetParent)}while((u=u.parentNode)&&u!==document.body){if(Element.getStyle(u,"position")!=="static"){return k(u)?$(document.body):$(u)}}return $(document.body)
}function t(v){v=$(v);var u=0,w=0;if(v.parentNode){do{u+=v.offsetTop||0;w+=v.offsetLeft||0;v=v.offsetParent}while(v)}return new Element.Offset(w,u)}function p(v){v=$(v);var w=v.getLayout();var u=0,y=0;do{u+=v.offsetTop||0;y+=v.offsetLeft||0;v=v.offsetParent;if(v){if(m(v)){break}var x=Element.getStyle(v,"position");if(x!=="static"){break}}}while(v);y-=w.get("margin-top");u-=w.get("margin-left");return new Element.Offset(y,u)}function a(v){var u=0,w=0;do{u+=v.scrollTop||0;w+=v.scrollLeft||0;v=v.parentNode}while(v);return new Element.Offset(w,u)}function s(y){v=$(v);var u=0,x=0,w=document.body;var v=y;do{u+=v.offsetTop||0;x+=v.offsetLeft||0;if(v.offsetParent==w&&Element.getStyle(v,"position")=="absolute"){break}}while(v=v.offsetParent);v=y;do{if(v!=w){u-=v.scrollTop||0;x-=v.scrollLeft||0}}while(v=v.parentNode);return new Element.Offset(x,u)}function q(u){u=$(u);if(Element.getStyle(u,"position")==="absolute"){return u}var y=l(u);var x=u.viewportOffset(),v=y.viewportOffset();var z=x.relativeTo(v);var w=u.getLayout();u.store("prototype_absolutize_original_styles",{left:u.getStyle("left"),top:u.getStyle("top"),width:u.getStyle("width"),height:u.getStyle("height")});u.setStyle({position:"absolute",top:z.top+"px",left:z.left+"px",width:w.get("width")+"px",height:w.get("height")+"px"});return u}function i(v){v=$(v);if(Element.getStyle(v,"position")==="relative"){return v}var u=v.retrieve("prototype_absolutize_original_styles");if(u){v.setStyle(u)}return v}if(Prototype.Browser.IE){l=l.wrap(function(w,v){v=$(v);if(e(v)||c(v)||m(v)||k(v)){return $(document.body)}var u=v.getStyle("position");if(u!=="static"){return w(v)}v.setStyle({position:"relative"});var x=w(v);v.setStyle({position:u});return x});p=p.wrap(function(x,v){v=$(v);if(!v.parentNode){return new Element.Offset(0,0)}var u=v.getStyle("position");if(u!=="static"){return x(v)}var w=v.getOffsetParent();if(w&&w.getStyle("position")==="fixed"){d(w)}v.setStyle({position:"relative"});var y=x(v);v.setStyle({position:u});return y
})}else{if(Prototype.Browser.Webkit){t=function(v){v=$(v);var u=0,w=0;do{u+=v.offsetTop||0;w+=v.offsetLeft||0;if(v.offsetParent==document.body){if(Element.getStyle(v,"position")=="absolute"){break}}v=v.offsetParent}while(v);return new Element.Offset(w,u)}}}Element.addMethods({getLayout:r,measure:b,getDimensions:n,getOffsetParent:l,cumulativeOffset:t,positionedOffset:p,cumulativeScrollOffset:a,viewportOffset:s,absolutize:q,relativize:i});function m(u){return u.nodeName.toUpperCase()==="BODY"}function k(u){return u.nodeName.toUpperCase()==="HTML"}function e(u){return u.nodeType===Node.DOCUMENT_NODE}function c(u){return u!==document.body&&!Element.descendantOf(u,document.body)}if("getBoundingClientRect" in document.documentElement){Element.addMethods({viewportOffset:function(u){u=$(u);if(c(u)){return new Element.Offset(0,0)}var v=u.getBoundingClientRect(),w=document.documentElement;return new Element.Offset(v.left-w.clientLeft,v.top-w.clientTop)}})}})();window.$$=function(){var a=$A(arguments).join(", ");return Prototype.Selector.select(a,document)};Prototype.Selector=(function(){function a(){throw new Error('Method "Prototype.Selector.select" must be defined.')}function c(){throw new Error('Method "Prototype.Selector.match" must be defined.')}function d(l,m,h){h=h||0;var g=Prototype.Selector.match,k=l.length,f=0,j;for(j=0;j<k;j++){if(g(l[j],m)&&h==f++){return Element.extend(l[j])}}}function e(h){for(var f=0,g=h.length;f<g;f++){Element.extend(h[f])}return h}var b=Prototype.K;return{select:a,match:c,find:d,extendElements:(Element.extend===b)?b:e,extendElement:Element.extend}})();Prototype._original_property=window.Sizzle;
/*
 * Sizzle CSS Selector Engine - v1.0
 *  Copyright 2009, The Dojo Foundation
 *  Released under the MIT, BSD, and GPL Licenses.
 *  More information: http://sizzlejs.com/
 */
(function(){var q=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,j=0,d=Object.prototype.toString,o=false,i=true;
[0,0].sort(function(){i=false;return 0});var b=function(E,u,B,w){B=B||[];var e=u=u||document;if(u.nodeType!==1&&u.nodeType!==9){return[]}if(!E||typeof E!=="string"){return B}var C=[],D,z,I,H,A,t,s=true,x=p(u),G=E;while((q.exec(""),D=q.exec(G))!==null){G=D[3];C.push(D[1]);if(D[2]){t=D[3];break}}if(C.length>1&&k.exec(E)){if(C.length===2&&f.relative[C[0]]){z=g(C[0]+C[1],u)}else{z=f.relative[C[0]]?[u]:b(C.shift(),u);while(C.length){E=C.shift();if(f.relative[E]){E+=C.shift()}z=g(E,z)}}}else{if(!w&&C.length>1&&u.nodeType===9&&!x&&f.match.ID.test(C[0])&&!f.match.ID.test(C[C.length-1])){var J=b.find(C.shift(),u,x);u=J.expr?b.filter(J.expr,J.set)[0]:J.set[0]}if(u){var J=w?{expr:C.pop(),set:a(w)}:b.find(C.pop(),C.length===1&&(C[0]==="~"||C[0]==="+")&&u.parentNode?u.parentNode:u,x);z=J.expr?b.filter(J.expr,J.set):J.set;if(C.length>0){I=a(z)}else{s=false}while(C.length){var v=C.pop(),y=v;if(!f.relative[v]){v=""}else{y=C.pop()}if(y==null){y=u}f.relative[v](I,y,x)}}else{I=C=[]}}if(!I){I=z}if(!I){throw"Syntax error, unrecognized expression: "+(v||E)}if(d.call(I)==="[object Array]"){if(!s){B.push.apply(B,I)}else{if(u&&u.nodeType===1){for(var F=0;I[F]!=null;F++){if(I[F]&&(I[F]===true||I[F].nodeType===1&&h(u,I[F]))){B.push(z[F])}}}else{for(var F=0;I[F]!=null;F++){if(I[F]&&I[F].nodeType===1){B.push(z[F])}}}}}else{a(I,B)}if(t){b(t,e,B,w);b.uniqueSort(B)}return B};b.uniqueSort=function(s){if(c){o=i;s.sort(c);if(o){for(var e=1;e<s.length;e++){if(s[e]===s[e-1]){s.splice(e--,1)}}}}return s};b.matches=function(e,s){return b(e,null,null,s)};b.find=function(y,e,z){var x,v;if(!y){return[]}for(var u=0,t=f.order.length;u<t;u++){var w=f.order[u],v;if((v=f.leftMatch[w].exec(y))){var s=v[1];v.splice(1,1);if(s.substr(s.length-1)!=="\\"){v[1]=(v[1]||"").replace(/\\/g,"");x=f.find[w](v,e,z);if(x!=null){y=y.replace(f.match[w],"");break}}}}if(!x){x=e.getElementsByTagName("*")}return{set:x,expr:y}};b.filter=function(B,A,E,u){var t=B,G=[],y=A,w,e,x=A&&A[0]&&p(A[0]);while(B&&A.length){for(var z in f.filter){if((w=f.match[z].exec(B))!=null){var s=f.filter[z],F,D;
e=false;if(y==G){G=[]}if(f.preFilter[z]){w=f.preFilter[z](w,y,E,G,u,x);if(!w){e=F=true}else{if(w===true){continue}}}if(w){for(var v=0;(D=y[v])!=null;v++){if(D){F=s(D,w,v,y);var C=u^!!F;if(E&&F!=null){if(C){e=true}else{y[v]=false}}else{if(C){G.push(D);e=true}}}}}if(F!==undefined){if(!E){y=G}B=B.replace(f.match[z],"");if(!e){return[]}break}}}if(B==t){if(e==null){throw"Syntax error, unrecognized expression: "+B}else{break}}t=B}return y};var f=b.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF-]|\\.)+)/,CLASS:/\.((?:[\w\u00c0-\uFFFF-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\((even|odd|[\dn+-]*)\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF-]|\\.)+)(?:\((['"]*)((?:\([^\)]+\)|[^\2\(\)]*)+)\2\))?/},leftMatch:{},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(e){return e.getAttribute("href")}},relative:{"+":function(y,e,x){var v=typeof e==="string",z=v&&!/\W/.test(e),w=v&&!z;if(z&&!x){e=e.toUpperCase()}for(var u=0,t=y.length,s;u<t;u++){if((s=y[u])){while((s=s.previousSibling)&&s.nodeType!==1){}y[u]=w||s&&s.nodeName===e?s||false:s===e}}if(w){b.filter(e,y,true)}},">":function(x,s,y){var v=typeof s==="string";if(v&&!/\W/.test(s)){s=y?s:s.toUpperCase();for(var t=0,e=x.length;t<e;t++){var w=x[t];if(w){var u=w.parentNode;x[t]=u.nodeName===s?u:false}}}else{for(var t=0,e=x.length;t<e;t++){var w=x[t];if(w){x[t]=v?w.parentNode:w.parentNode===s}}if(v){b.filter(s,x,true)}}},"":function(u,s,w){var t=j++,e=r;if(!/\W/.test(s)){var v=s=w?s:s.toUpperCase();e=n}e("parentNode",s,t,u,v,w)},"~":function(u,s,w){var t=j++,e=r;if(typeof s==="string"&&!/\W/.test(s)){var v=s=w?s:s.toUpperCase();e=n}e("previousSibling",s,t,u,v,w)}},find:{ID:function(s,t,u){if(typeof t.getElementById!=="undefined"&&!u){var e=t.getElementById(s[1]);
return e?[e]:[]}},NAME:function(t,w,x){if(typeof w.getElementsByName!=="undefined"){var s=[],v=w.getElementsByName(t[1]);for(var u=0,e=v.length;u<e;u++){if(v[u].getAttribute("name")===t[1]){s.push(v[u])}}return s.length===0?null:s}},TAG:function(e,s){return s.getElementsByTagName(e[1])}},preFilter:{CLASS:function(u,s,t,e,x,y){u=" "+u[1].replace(/\\/g,"")+" ";if(y){return u}for(var v=0,w;(w=s[v])!=null;v++){if(w){if(x^(w.className&&(" "+w.className+" ").indexOf(u)>=0)){if(!t){e.push(w)}}else{if(t){s[v]=false}}}}return false},ID:function(e){return e[1].replace(/\\/g,"")},TAG:function(s,e){for(var t=0;e[t]===false;t++){}return e[t]&&p(e[t])?s[1]:s[1].toUpperCase()},CHILD:function(e){if(e[1]=="nth"){var s=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(e[2]=="even"&&"2n"||e[2]=="odd"&&"2n+1"||!/\D/.test(e[2])&&"0n+"+e[2]||e[2]);e[2]=(s[1]+(s[2]||1))-0;e[3]=s[3]-0}e[0]=j++;return e},ATTR:function(v,s,t,e,w,x){var u=v[1].replace(/\\/g,"");if(!x&&f.attrMap[u]){v[1]=f.attrMap[u]}if(v[2]==="~="){v[4]=" "+v[4]+" "}return v},PSEUDO:function(v,s,t,e,w){if(v[1]==="not"){if((q.exec(v[3])||"").length>1||/^\w/.test(v[3])){v[3]=b(v[3],null,null,s)}else{var u=b.filter(v[3],s,t,true^w);if(!t){e.push.apply(e,u)}return false}}else{if(f.match.POS.test(v[0])||f.match.CHILD.test(v[0])){return true}}return v},POS:function(e){e.unshift(true);return e}},filters:{enabled:function(e){return e.disabled===false&&e.type!=="hidden"},disabled:function(e){return e.disabled===true},checked:function(e){return e.checked===true},selected:function(e){e.parentNode.selectedIndex;return e.selected===true},parent:function(e){return !!e.firstChild},empty:function(e){return !e.firstChild},has:function(t,s,e){return !!b(e[3],t).length},header:function(e){return/h\d/i.test(e.nodeName)},text:function(e){return"text"===e.type},radio:function(e){return"radio"===e.type},checkbox:function(e){return"checkbox"===e.type},file:function(e){return"file"===e.type},password:function(e){return"password"===e.type},submit:function(e){return"submit"===e.type
},image:function(e){return"image"===e.type},reset:function(e){return"reset"===e.type},button:function(e){return"button"===e.type||e.nodeName.toUpperCase()==="BUTTON"},input:function(e){return/input|select|textarea|button/i.test(e.nodeName)}},setFilters:{first:function(s,e){return e===0},last:function(t,s,e,u){return s===u.length-1},even:function(s,e){return e%2===0},odd:function(s,e){return e%2===1},lt:function(t,s,e){return s<e[3]-0},gt:function(t,s,e){return s>e[3]-0},nth:function(t,s,e){return e[3]-0==s},eq:function(t,s,e){return e[3]-0==s}},filter:{PSEUDO:function(x,t,u,y){var s=t[1],v=f.filters[s];if(v){return v(x,u,t,y)}else{if(s==="contains"){return(x.textContent||x.innerText||"").indexOf(t[3])>=0}else{if(s==="not"){var w=t[3];for(var u=0,e=w.length;u<e;u++){if(w[u]===x){return false}}return true}}}},CHILD:function(e,u){var x=u[1],s=e;switch(x){case"only":case"first":while((s=s.previousSibling)){if(s.nodeType===1){return false}}if(x=="first"){return true}s=e;case"last":while((s=s.nextSibling)){if(s.nodeType===1){return false}}return true;case"nth":var t=u[2],A=u[3];if(t==1&&A==0){return true}var w=u[0],z=e.parentNode;if(z&&(z.sizcache!==w||!e.nodeIndex)){var v=0;for(s=z.firstChild;s;s=s.nextSibling){if(s.nodeType===1){s.nodeIndex=++v}}z.sizcache=w}var y=e.nodeIndex-A;if(t==0){return y==0}else{return(y%t==0&&y/t>=0)}}},ID:function(s,e){return s.nodeType===1&&s.getAttribute("id")===e},TAG:function(s,e){return(e==="*"&&s.nodeType===1)||s.nodeName===e},CLASS:function(s,e){return(" "+(s.className||s.getAttribute("class"))+" ").indexOf(e)>-1},ATTR:function(w,u){var t=u[1],e=f.attrHandle[t]?f.attrHandle[t](w):w[t]!=null?w[t]:w.getAttribute(t),x=e+"",v=u[2],s=u[4];return e==null?v==="!=":v==="="?x===s:v==="*="?x.indexOf(s)>=0:v==="~="?(" "+x+" ").indexOf(s)>=0:!s?x&&e!==false:v==="!="?x!=s:v==="^="?x.indexOf(s)===0:v==="$="?x.substr(x.length-s.length)===s:v==="|="?x===s||x.substr(0,s.length+1)===s+"-":false},POS:function(v,s,t,w){var e=s[2],u=f.setFilters[e];if(u){return u(v,t,s,w)
}}}};var k=f.match.POS;for(var m in f.match){f.match[m]=new RegExp(f.match[m].source+/(?![^\[]*\])(?![^\(]*\))/.source);f.leftMatch[m]=new RegExp(/(^(?:.|\r|\n)*?)/.source+f.match[m].source)}var a=function(s,e){s=Array.prototype.slice.call(s,0);if(e){e.push.apply(e,s);return e}return s};try{Array.prototype.slice.call(document.documentElement.childNodes,0)}catch(l){a=function(v,u){var s=u||[];if(d.call(v)==="[object Array]"){Array.prototype.push.apply(s,v)}else{if(typeof v.length==="number"){for(var t=0,e=v.length;t<e;t++){s.push(v[t])}}else{for(var t=0;v[t];t++){s.push(v[t])}}}return s}}var c;if(document.documentElement.compareDocumentPosition){c=function(s,e){if(!s.compareDocumentPosition||!e.compareDocumentPosition){if(s==e){o=true}return 0}var t=s.compareDocumentPosition(e)&4?-1:s===e?0:1;if(t===0){o=true}return t}}else{if("sourceIndex" in document.documentElement){c=function(s,e){if(!s.sourceIndex||!e.sourceIndex){if(s==e){o=true}return 0}var t=s.sourceIndex-e.sourceIndex;if(t===0){o=true}return t}}else{if(document.createRange){c=function(u,s){if(!u.ownerDocument||!s.ownerDocument){if(u==s){o=true}return 0}var t=u.ownerDocument.createRange(),e=s.ownerDocument.createRange();t.setStart(u,0);t.setEnd(u,0);e.setStart(s,0);e.setEnd(s,0);var v=t.compareBoundaryPoints(Range.START_TO_END,e);if(v===0){o=true}return v}}}}(function(){var s=document.createElement("div"),t="script"+(new Date).getTime();s.innerHTML="<a name='"+t+"'/>";var e=document.documentElement;e.insertBefore(s,e.firstChild);if(!!document.getElementById(t)){f.find.ID=function(v,w,x){if(typeof w.getElementById!=="undefined"&&!x){var u=w.getElementById(v[1]);return u?u.id===v[1]||typeof u.getAttributeNode!=="undefined"&&u.getAttributeNode("id").nodeValue===v[1]?[u]:undefined:[]}};f.filter.ID=function(w,u){var v=typeof w.getAttributeNode!=="undefined"&&w.getAttributeNode("id");return w.nodeType===1&&v&&v.nodeValue===u}}e.removeChild(s);e=s=null})();(function(){var e=document.createElement("div");e.appendChild(document.createComment(""));
if(e.getElementsByTagName("*").length>0){f.find.TAG=function(s,w){var v=w.getElementsByTagName(s[1]);if(s[1]==="*"){var u=[];for(var t=0;v[t];t++){if(v[t].nodeType===1){u.push(v[t])}}v=u}return v}}e.innerHTML="<a href='#'></a>";if(e.firstChild&&typeof e.firstChild.getAttribute!=="undefined"&&e.firstChild.getAttribute("href")!=="#"){f.attrHandle.href=function(s){return s.getAttribute("href",2)}}e=null})();if(document.querySelectorAll){(function(){var e=b,t=document.createElement("div");t.innerHTML="<p class='TEST'></p>";if(t.querySelectorAll&&t.querySelectorAll(".TEST").length===0){return}b=function(x,w,u,v){w=w||document;if(!v&&w.nodeType===9&&!p(w)){try{return a(w.querySelectorAll(x),u)}catch(y){}}return e(x,w,u,v)};for(var s in e){b[s]=e[s]}t=null})()}if(document.getElementsByClassName&&document.documentElement.getElementsByClassName){(function(){var e=document.createElement("div");e.innerHTML="<div class='test e'></div><div class='test'></div>";if(e.getElementsByClassName("e").length===0){return}e.lastChild.className="e";if(e.getElementsByClassName("e").length===1){return}f.order.splice(1,0,"CLASS");f.find.CLASS=function(s,t,u){if(typeof t.getElementsByClassName!=="undefined"&&!u){return t.getElementsByClassName(s[1])}};e=null})()}function n(s,x,w,B,y,A){var z=s=="previousSibling"&&!A;for(var u=0,t=B.length;u<t;u++){var e=B[u];if(e){if(z&&e.nodeType===1){e.sizcache=w;e.sizset=u}e=e[s];var v=false;while(e){if(e.sizcache===w){v=B[e.sizset];break}if(e.nodeType===1&&!A){e.sizcache=w;e.sizset=u}if(e.nodeName===x){v=e;break}e=e[s]}B[u]=v}}}function r(s,x,w,B,y,A){var z=s=="previousSibling"&&!A;for(var u=0,t=B.length;u<t;u++){var e=B[u];if(e){if(z&&e.nodeType===1){e.sizcache=w;e.sizset=u}e=e[s];var v=false;while(e){if(e.sizcache===w){v=B[e.sizset];break}if(e.nodeType===1){if(!A){e.sizcache=w;e.sizset=u}if(typeof x!=="string"){if(e===x){v=true;break}}else{if(b.filter(x,[e]).length>0){v=e;break}}}e=e[s]}B[u]=v}}}var h=document.compareDocumentPosition?function(s,e){return s.compareDocumentPosition(e)&16
}:function(s,e){return s!==e&&(s.contains?s.contains(e):true)};var p=function(e){return e.nodeType===9&&e.documentElement.nodeName!=="HTML"||!!e.ownerDocument&&e.ownerDocument.documentElement.nodeName!=="HTML"};var g=function(e,y){var u=[],v="",w,t=y.nodeType?[y]:y;while((w=f.match.PSEUDO.exec(e))){v+=w[0];e=e.replace(f.match.PSEUDO,"")}e=f.relative[e]?e+"*":e;for(var x=0,s=t.length;x<s;x++){b(e,t[x],u)}return b.filter(v,u)};window.Sizzle=b})();(function(c){var d=Prototype.Selector.extendElements;function a(e,f){return d(c(e,f||document))}function b(f,e){return c.matches(e,[f]).length==1}Prototype.Selector.engine=c;Prototype.Selector.select=a;Prototype.Selector.match=b})(Sizzle);window.Sizzle=Prototype._original_property;delete Prototype._original_property;var Form={reset:function(a){a=$(a);a.reset();return a},serializeElements:function(h,d){if(typeof d!="object"){d={hash:!!d}}else{if(Object.isUndefined(d.hash)){d.hash=true}}var e,g,a=false,f=d.submit,b,c;if(d.hash){c={};b=function(i,j,k){if(j in i){if(!Object.isArray(i[j])){i[j]=[i[j]]}i[j].push(k)}else{i[j]=k}return i}}else{c="";b=function(i,j,k){return i+(i?"&":"")+encodeURIComponent(j)+"="+encodeURIComponent(k)}}return h.inject(c,function(i,j){if(!j.disabled&&j.name){e=j.name;g=$(j).getValue();if(g!=null&&j.type!="file"&&(j.type!="submit"||(!a&&f!==false&&(!f||e==f)&&(a=true)))){i=b(i,e,g)}}return i})}};Form.Methods={serialize:function(b,a){return Form.serializeElements(Form.getElements(b),a)},getElements:function(e){var f=$(e).getElementsByTagName("*"),d,a=[],c=Form.Element.Serializers;for(var b=0;d=f[b];b++){a.push(d)}return a.inject([],function(g,h){if(c[h.tagName.toLowerCase()]){g.push(Element.extend(h))}return g})},getInputs:function(g,c,d){g=$(g);var a=g.getElementsByTagName("input");if(!c&&!d){return $A(a).map(Element.extend)}for(var e=0,h=[],f=a.length;e<f;e++){var b=a[e];if((c&&b.type!=c)||(d&&b.name!=d)){continue}h.push(Element.extend(b))}return h},disable:function(a){a=$(a);Form.getElements(a).invoke("disable");
return a},enable:function(a){a=$(a);Form.getElements(a).invoke("enable");return a},findFirstElement:function(b){var c=$(b).getElements().findAll(function(d){return"hidden"!=d.type&&!d.disabled});var a=c.findAll(function(d){return d.hasAttribute("tabIndex")&&d.tabIndex>=0}).sortBy(function(d){return d.tabIndex}).first();return a?a:c.find(function(d){return/^(?:input|select|textarea)$/i.test(d.tagName)})},focusFirstElement:function(b){b=$(b);var a=b.findFirstElement();if(a){a.activate()}return b},request:function(b,a){b=$(b),a=Object.clone(a||{});var d=a.parameters,c=b.readAttribute("action")||"";if(c.blank()){c=window.location.href}a.parameters=b.serialize(true);if(d){if(Object.isString(d)){d=d.toQueryParams()}Object.extend(a.parameters,d)}if(b.hasAttribute("method")&&!a.method){a.method=b.method}return new Ajax.Request(c,a)}};Form.Element={focus:function(a){$(a).focus();return a},select:function(a){$(a).select();return a}};Form.Element.Methods={serialize:function(a){a=$(a);if(!a.disabled&&a.name){var b=a.getValue();if(b!=undefined){var c={};c[a.name]=b;return Object.toQueryString(c)}}return""},getValue:function(a){a=$(a);var b=a.tagName.toLowerCase();return Form.Element.Serializers[b](a)},setValue:function(a,b){a=$(a);var c=a.tagName.toLowerCase();Form.Element.Serializers[c](a,b);return a},clear:function(a){$(a).value="";return a},present:function(a){return $(a).value!=""},activate:function(a){a=$(a);try{a.focus();if(a.select&&(a.tagName.toLowerCase()!="input"||!(/^(?:button|reset|submit)$/i.test(a.type)))){a.select()}}catch(b){}return a},disable:function(a){a=$(a);a.disabled=true;return a},enable:function(a){a=$(a);a.disabled=false;return a}};var Field=Form.Element;var $F=Form.Element.Methods.getValue;Form.Element.Serializers=(function(){function b(h,i){switch(h.type.toLowerCase()){case"checkbox":case"radio":return f(h,i);default:return e(h,i)}}function f(h,i){if(Object.isUndefined(i)){return h.checked?h.value:null}else{h.checked=!!i}}function e(h,i){if(Object.isUndefined(i)){return h.value
}else{h.value=i}}function a(k,n){if(Object.isUndefined(n)){return(k.type==="select-one"?c:d)(k)}var j,l,o=!Object.isArray(n);for(var h=0,m=k.length;h<m;h++){j=k.options[h];l=this.optionValue(j);if(o){if(l==n){j.selected=true;return}}else{j.selected=n.include(l)}}}function c(i){var h=i.selectedIndex;return h>=0?g(i.options[h]):null}function d(l){var h,m=l.length;if(!m){return null}for(var k=0,h=[];k<m;k++){var j=l.options[k];if(j.selected){h.push(g(j))}}return h}function g(h){return Element.hasAttribute(h,"value")?h.value:h.text}return{input:b,inputSelector:f,textarea:e,select:a,selectOne:c,selectMany:d,optionValue:g,button:e}})();Abstract.TimedObserver=Class.create(PeriodicalExecuter,{initialize:function($super,a,b,c){$super(c,b);this.element=$(a);this.lastValue=this.getValue()},execute:function(){var a=this.getValue();if(Object.isString(this.lastValue)&&Object.isString(a)?this.lastValue!=a:String(this.lastValue)!=String(a)){this.callback(this.element,a);this.lastValue=a}}});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(a,b){this.element=$(a);this.callback=b;this.lastValue=this.getValue();if(this.element.tagName.toLowerCase()=="form"){this.registerFormCallbacks()}else{this.registerCallback(this.element)}},onElementEvent:function(){var a=this.getValue();if(this.lastValue!=a){this.callback(this.element,a);this.lastValue=a}},registerFormCallbacks:function(){Form.getElements(this.element).each(this.registerCallback,this)},registerCallback:function(a){if(a.type){switch(a.type.toLowerCase()){case"checkbox":case"radio":Event.observe(a,"click",this.onElementEvent.bind(this));break;default:Event.observe(a,"change",this.onElementEvent.bind(this));break}}}});Form.Element.EventObserver=Class.create(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 C={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 f=document.documentElement;var D="onmouseenter" in f&&"onmouseleave" in f;var a=function(E){return false};if(window.attachEvent){if(window.addEventListener){a=function(E){return !(E instanceof window.Event)}}else{a=function(E){return true}}}var r;function A(F,E){return F.which?(F.which===E+1):(F.button===E)}var o={0:1,1:4,2:2};function y(F,E){return F.button===o[E]}function B(F,E){switch(E){case 0:return F.which==1&&!F.metaKey;case 1:return F.which==2||(F.which==1&&F.metaKey);case 2:return F.which==3;default:return false}}if(window.attachEvent){if(!window.addEventListener){r=y}else{r=function(F,E){return a(F)?y(F,E):A(F,E)}}}else{if(Prototype.Browser.WebKit){r=B}else{r=A}}function v(E){return r(E,0)}function t(E){return r(E,1)}function n(E){return r(E,2)}function d(G){G=C.extend(G);var F=G.target,E=G.type,H=G.currentTarget;if(H&&H.tagName){if(E==="load"||E==="error"||(E==="click"&&H.tagName.toLowerCase()==="input"&&H.type==="radio")){F=H}}if(F.nodeType==Node.TEXT_NODE){F=F.parentNode}return Element.extend(F)}function p(F,G){var E=C.element(F);if(!G){return E}while(E){if(Object.isElement(E)&&Prototype.Selector.match(E,G)){return Element.extend(E)}E=E.parentNode}}function s(E){return{x:c(E),y:b(E)}}function c(G){var F=document.documentElement,E=document.body||{scrollLeft:0};return G.pageX||(G.clientX+(F.scrollLeft||E.scrollLeft)-(F.clientLeft||0))}function b(G){var F=document.documentElement,E=document.body||{scrollTop:0};return G.pageY||(G.clientY+(F.scrollTop||E.scrollTop)-(F.clientTop||0))}function q(E){C.extend(E);E.preventDefault();E.stopPropagation();E.stopped=true}C.Methods={isLeftClick:v,isMiddleClick:t,isRightClick:n,element:d,findElement:p,pointer:s,pointerX:c,pointerY:b,stop:q};
var x=Object.keys(C.Methods).inject({},function(E,F){E[F]=C.Methods[F].methodize();return E});if(window.attachEvent){function i(F){var E;switch(F.type){case"mouseover":case"mouseenter":E=F.fromElement;break;case"mouseout":case"mouseleave":E=F.toElement;break;default:return null}return Element.extend(E)}var u={stopPropagation:function(){this.cancelBubble=true},preventDefault:function(){this.returnValue=false},inspect:function(){return"[object Event]"}};C.extend=function(F,E){if(!F){return false}if(!a(F)){return F}if(F._extendedByPrototype){return F}F._extendedByPrototype=Prototype.emptyFunction;var G=C.pointer(F);Object.extend(F,{target:F.srcElement||E,relatedTarget:i(F),pageX:G.x,pageY:G.y});Object.extend(F,x);Object.extend(F,u);return F}}else{C.extend=Prototype.K}if(window.addEventListener){C.prototype=window.Event.prototype||document.createEvent("HTMLEvents").__proto__;Object.extend(C.prototype,x)}function m(I,H,J){var G=Element.retrieve(I,"prototype_event_registry");if(Object.isUndefined(G)){e.push(I);G=Element.retrieve(I,"prototype_event_registry",$H())}var E=G.get(H);if(Object.isUndefined(E)){E=[];G.set(H,E)}if(E.pluck("handler").include(J)){return false}var F;if(H.include(":")){F=function(K){if(Object.isUndefined(K.eventName)){return false}if(K.eventName!==H){return false}C.extend(K,I);J.call(I,K)}}else{if(!D&&(H==="mouseenter"||H==="mouseleave")){if(H==="mouseenter"||H==="mouseleave"){F=function(L){C.extend(L,I);var K=L.relatedTarget;while(K&&K!==I){try{K=K.parentNode}catch(M){K=I}}if(K===I){return}J.call(I,L)}}}else{F=function(K){C.extend(K,I);J.call(I,K)}}}F.handler=J;E.push(F);return F}function h(){for(var E=0,F=e.length;E<F;E++){C.stopObserving(e[E]);e[E]=null}}var e=[];if(Prototype.Browser.IE){window.attachEvent("onunload",h)}if(Prototype.Browser.WebKit){window.addEventListener("unload",Prototype.emptyFunction,false)}var l=Prototype.K,g={mouseenter:"mouseover",mouseleave:"mouseout"};if(!D){l=function(E){return(g[E]||E)}}function w(H,G,I){H=$(H);var F=m(H,G,I);
if(!F){return H}if(G.include(":")){if(H.addEventListener){H.addEventListener("dataavailable",F,false)}else{H.attachEvent("ondataavailable",F);H.attachEvent("onlosecapture",F)}}else{var E=l(G);if(H.addEventListener){H.addEventListener(E,F,false)}else{H.attachEvent("on"+E,F)}}return H}function k(K,H,L){K=$(K);var G=Element.retrieve(K,"prototype_event_registry");if(!G){return K}if(!H){G.each(function(N){var M=N.key;k(K,M)});return K}var I=G.get(H);if(!I){return K}if(!L){I.each(function(M){k(K,H,M.handler)});return K}var J=I.length,F;while(J--){if(I[J].handler===L){F=I[J];break}}if(!F){return K}if(H.include(":")){if(K.removeEventListener){K.removeEventListener("dataavailable",F,false)}else{K.detachEvent("ondataavailable",F);K.detachEvent("onlosecapture",F)}}else{var E=l(H);if(K.removeEventListener){K.removeEventListener(E,F,false)}else{K.detachEvent("on"+E,F)}}G.set(H,I.without(F));return K}function z(H,G,F,E){H=$(H);if(Object.isUndefined(E)){E=true}if(H==document&&document.createEvent&&!H.dispatchEvent){H=document.documentElement}var I;if(document.createEvent){I=document.createEvent("HTMLEvents");I.initEvent("dataavailable",E,true)}else{I=document.createEventObject();I.eventType=E?"ondataavailable":"onlosecapture"}I.eventName=G;I.memo=F||{};if(document.createEvent){H.dispatchEvent(I)}else{H.fireEvent(I.eventType,I)}return C.extend(I)}C.Handler=Class.create({initialize:function(G,F,E,H){this.element=$(G);this.eventName=F;this.selector=E;this.callback=H;this.handler=this.handleEvent.bind(this)},start:function(){C.observe(this.element,this.eventName,this.handler);return this},stop:function(){C.stopObserving(this.element,this.eventName,this.handler);return this},handleEvent:function(F){var E=C.findElement(F,this.selector);if(E){this.callback.call(this.element,F,E)}}});function j(G,F,E,H){G=$(G);if(Object.isFunction(E)&&Object.isUndefined(H)){H=E,E=null}return new C.Handler(G,F,E,H).start()}Object.extend(C,C.Methods);Object.extend(C,{fire:z,observe:w,stopObserving:k,on:j});Element.addMethods({fire:z,observe:w,stopObserving:k,on:j});
Object.extend(document,{fire:z.methodize(),observe:w.methodize(),stopObserving:k.methodize(),on:j.methodize(),loaded:false});if(window.Event){Object.extend(window.Event,C)}else{window.Event=C}})();(function(){var d;function a(){if(document.loaded){return}if(d){window.clearTimeout(d)}document.loaded=true;document.fire("dom:loaded")}function c(){if(document.readyState==="complete"){document.stopObserving("readystatechange",c);a()}}function b(){try{document.documentElement.doScroll("left")}catch(f){d=b.defer();return}a()}if(document.addEventListener){document.addEventListener("DOMContentLoaded",a,false)}else{document.observe("readystatechange",c);if(window==top){d=b.defer()}}Event.observe(window,"load",a)})();Element.addMethods();Hash.toQueryString=Object.toQueryString;var Toggle={display:Element.toggle};Element.Methods.childOf=Element.Methods.descendantOf;var Insertion={Before:function(a,b){return Element.insert(a,{before:b})},Top:function(a,b){return Element.insert(a,{top:b})},Bottom:function(a,b){return Element.insert(a,{bottom:b})},After:function(a,b){return Element.insert(a,{after:b})}};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(b,a,c){if(this.includeScrollOffsets){return this.withinIncludingScrolloffsets(b,a,c)}this.xcomp=a;this.ycomp=c;this.offset=Element.cumulativeOffset(b);return(c>=this.offset[1]&&c<this.offset[1]+b.offsetHeight&&a>=this.offset[0]&&a<this.offset[0]+b.offsetWidth)},withinIncludingScrolloffsets:function(b,a,d){var c=Element.cumulativeScrollOffset(b);this.xcomp=a+c[0]-this.deltaX;this.ycomp=d+c[1]-this.deltaY;this.offset=Element.cumulativeOffset(b);return(this.ycomp>=this.offset[1]&&this.ycomp<this.offset[1]+b.offsetHeight&&this.xcomp>=this.offset[0]&&this.xcomp<this.offset[0]+b.offsetWidth)
},overlap:function(b,a){if(!b){return 0}if(b=="vertical"){return((this.offset[1]+a.offsetHeight)-this.ycomp)/a.offsetHeight}if(b=="horizontal"){return((this.offset[0]+a.offsetWidth)-this.xcomp)/a.offsetWidth}},cumulativeOffset:Element.Methods.cumulativeOffset,positionedOffset:Element.Methods.positionedOffset,absolutize:function(a){Position.prepare();return Element.absolutize(a)},relativize:function(a){Position.prepare();return Element.relativize(a)},realOffset:Element.Methods.cumulativeScrollOffset,offsetParent:Element.Methods.getOffsetParent,page:Element.Methods.viewportOffset,clone:function(b,c,a){a=a||{};return Element.clonePosition(c,b,a)}};if(!document.getElementsByClassName){document.getElementsByClassName=function(b){function a(c){return c.blank()?null:"[contains(concat(' ', @class, ' '), ' "+c+" ')]"}b.getElementsByClassName=Prototype.BrowserFeatures.XPath?function(c,e){e=e.toString().strip();var d=/\s/.test(e)?$w(e).map(a).join(""):a(e);return d?document._getElementsByXPath(".//*"+d,c):[]}:function(e,f){f=f.toString().strip();var g=[],h=(/\s/.test(f)?$w(f):null);if(!h&&!f){return g}var c=$(e).getElementsByTagName("*");f=" "+f+" ";for(var d=0,k,j;k=c[d];d++){if(k.className&&(j=" "+k.className+" ")&&(j.include(f)||(h&&h.all(function(i){return !i.toString().blank()&&j.include(" "+i+" ")})))){g.push(Element.extend(k))}}return g};return function(d,c){return $(c||document.body).getElementsByClassName(d)}}(Element.Methods)}Element.ClassNames=Class.create();Element.ClassNames.prototype={initialize:function(a){this.element=$(a)},_each:function(a){this.element.className.split(/\s+/).select(function(b){return b.length>0})._each(a)},set:function(a){this.element.className=a},add:function(a){if(this.include(a)){return}this.set($A(this).concat(a).join(" "))},remove:function(a){if(!this.include(a)){return}this.set($A(this).without(a).join(" "))},toString:function(){return $A(this).join(" ")}};Object.extend(Element.ClassNames.prototype,Enumerable);(function(){window.Selector=Class.create({initialize:function(a){this.expression=a.strip()
},findElements:function(a){return Prototype.Selector.select(this.expression,a)},match:function(a){return Prototype.Selector.match(a,this.expression)},toString:function(){return this.expression},inspect:function(){return"#<Selector: "+this.expression+">"}});Object.extend(Selector,{matchElements:function(f,g){var a=Prototype.Selector.match,d=[];for(var c=0,e=f.length;c<e;c++){var b=f[c];if(a(b,g)){d.push(Element.extend(b))}}return d},findElement:function(f,g,b){b=b||0;var a=0,d;for(var c=0,e=f.length;c<e;c++){d=f[c];if(Prototype.Selector.match(d,g)&&b===a++){return Element.extend(d)}}},findChildElements:function(b,c){var a=c.toArray().join(", ");return Prototype.Selector.select(a,b||document)}})})();(function(Window){var rescueError=function(ex){neteck.reportError(ex)};var interceptError=function(ex){neteck.reportError(ex);throw $ex};var gettext=function(str){if("gettext" in window){return window.gettext(str)}return str};Window=window.Window=Class.create({initialize:function(){},observe:function(name,fn){this.wnd.observe(name,fn)},_make_url:function(url){if(this.frameWindow){return url+(url.match(/\?/)?"&":"?")+"_nh_layout_=frame"}return url},observeAjaxEvents:function(container){try{var _this=this;container.observe("container:loadstart",function(){try{_this.wnd.select("[data-ntid=loader]").invoke("show")}catch(err){rescueError(err)}});container.observe("container:loadstop",function(){try{_this.wnd.select("[data-ntid=loader]").invoke("hide")}catch(err){rescueError(err)}});container.observe("container:flushHistory",function(event){try{_this.urlStack=[]}catch(err){rescueError(err)}});container.observe("container:loadURL",function(event){try{_this.urlStack.push({url:_this.url,content:container.childElements()});neteck.ajax.loadHTML(_this._make_url(event.memo.url),container,{updateMethod:"update",afterSuccess:function(){_this.url=event.memo.url}});console.log("container:loadURL")}catch(err){rescueError(err)}});var restoreHistoryState=function(state){try{if(state.content){container.update("");
state.content.each(function(e){container.insert(e)})}else{neteck.ajax.loadHTML(_this._make_url(state.url),container,{updateMethod:"update",afterSuccess:function(){_this.url=state.url}})}}catch(err){rescueError(err)}};container.observe("container:reset",function(event){try{_this.closed=new Date().getTime();var last,prev;while(last=_this.urlStack.pop()){prev=last}if(prev){restoreHistoryState(prev)}}catch(err){rescueError(err)}});container.observe("container:backHistory",function(event){try{var prev=_this.urlStack.pop();if(prev){_this.url=prev.url;restoreHistoryState(prev)}else{container.fire("container:remove")}}catch(err){rescueError(err)}});container.observe("container:remove",function(){try{_this.close()}catch(err){rescueError(err)}});container.observe("container:updated",function(){_this.setPosDim()});var ajaxHandler=this._listeners.ajaxHandler={onclick:function(event,a,url){if(event&&url.match(/\/wnd_/)){var wnd=Event.findElement(event,"[data-container=window]");wnd.fire("container:loadURL",{url:url});return true}},onpopstate:function(event,url){}};neteck.ajax.addClickObserver(ajaxHandler);this._listeners.onKeyPress=function(event){try{if(Event.KEY_ESC==event.keyCode){_this.close()}}catch(err){rescueError(err)}};neteck.ajax.onUnLoadOnce(function(){if(!_this.closed||(new Date().getTime()-this.closed>5000)){container.fire("container:remove")}})}catch(err){rescueError(err)}},initWindow:function(url){this.frameWindow=false;this.url=url||null;this.urlStack=[];this.closed=false;this._listeners={};try{$(document).fire("window:open")}catch(err){rescueError(err)}},openFrameWindow:function(wnd){this.initWindow();this.frameWindow=true;this.observeAjaxEvents(wnd);this.wnd=wnd;Event.observe(document,"keyup",this._listeners.onKeyPress)},setPosDim:function(){try{var scroll=document.viewport.getScrollOffsets();var vh=document.viewport.getHeight();var win=this.wnd.down();if(win.hasAttribute("data-original-height")){win.select("[data-overflow=1]").invoke("setStyle",{height:win.readAttribute("data-original-height")+"px"})
}var h=win.getHeight();var y=scroll.top;if(h<vh){y+=(vh-h)/2}else{var ov=win.select("[data-overflow=1]").first();if(ov){var oh;if(win.hasAttribute("data-original-height")){oh=win.readAttribute("data-original-height")}else{oh=ov.getHeight();win.writeAttribute("data-original-height",oh)}ov.setStyle({height:(oh-(h-vh))+"px"})}}win.setStyle({top:y+"px"})}catch(ex){if(neteck&&neteck.reportError){neteck.reportError(ex)}}},openWindow:function(url,pParameters,method){var container=this.wnd=new Element("div",{"data-container":"window"});this.initWindow();this.url=url;var _this=this;this.observeAjaxEvents(container);windowStack.push(inst);if(pParameters){_this.url+=(_this.url.match(/\?/)?"&":"?")+pParameters}neteck.ajax.loadHTML(_this.url,container,{beforeSuccess:function(){neteck.ui.enableBodyScroll();$(document.body).insert(container);if(_this.closed){return false}},afterSuccess:function(){Event.observe(document,"keyup",_this._listeners.onKeyPress);_this.wnd.fire("container:updated")}})},close:function(){try{Event.stopObserving(document,"keyup",this._listeners.onKeyPress);if(!this.closed||(new Date().getTime()-this.closed>5000)){this.closed=new Date().getTime();if(this.frameWindow){if(this.wnd){this.wnd.fire("container:reset")}}else{if(this.wnd&&this.wnd.up()){this.wnd.remove()}neteck.ui.disableBodyScroll();neteck.ajax.removeClickObserver(this._listeners.ajaxHandler);windowStack.pop();if(windowStack.length>0){Window.current=windowStack[windowStack.length-1]}}}}catch(err){rescueError(err)}}});var windowStack=[];Event.observe(window,"resize",function(){windowStack.each(function(e){if(e){e.setPosDim()}})});Window.checkIfCloseAction=function(event){try{if(Event.findElement(event,"*").readAttribute("data-close-trigger")=="true"){var containers=neteck.evf(event,"[#container=window]").each(function(e){e.fire("container:remove")})}}catch(err){rescueError(err)}};var startLoading=function(wnd){wnd.addClassName("loading")};var stopLoading=function(wnd){wnd.removeClassName("loading")};var lock=function(wnd){wnd.addClassName("locked")
};var unlock=function(wnd){wnd.removeClassName("locked");wnd.fire("Window:enable")};var ajaxOptionsForRH=function(responseHandler,terminate){return{parameters:responseHandler.parameters,onSuccess:function(xhr){if(responseHandler.onSuccess){responseHandler.onSuccess(xhr)}},onFailure:function(xhr){if(responseHandler.onFailure){responseHandler.onFailure(xhr)}if(terminate){terminate(xhr)}},onComplete:function(xhr){if(responseHandler.onComplete){responseHandler.onComplete(xhr)}if(terminate){terminate(xhr)}}}};var getResponseHandler=function(event,element,wnd){if(element.hasAttribute("data-response-handler")){var responseHandler=eval(element.readAttribute("data-response-handler"));return new responseHandler(event,wnd)}return{}};Window.submitForm=function(event,wnd,form){try{if(!wnd){var responseHandler=getResponseHandler(event,form);form.request(ajaxOptionsForRH(responseHandler))}else{if(form&&wnd&&!wnd.hasClassName("locked")){lock(wnd);var submit=function(){var responseHandler=getResponseHandler(event,form,wnd);startLoading(wnd);form.request(ajaxOptionsForRH(responseHandler,function(xhr){stopLoading(wnd);unlock(wnd)}))};submit()}}}catch(err){rescueError(err)}};Window.submit=function(event,evfSelector,skipOnSubmit){try{var form=neteck.evf(event,evfSelector||"form").first();if(jQuery&&!form.hasAttribute("data-response-handler")){jQuery(form).submit();return}if(form.readAttribute("data-response-handler")=="Window.JSONResponse"){var wnd=neteck.evf(event,"[#container=window]").first();if(form&&wnd&&!wnd.hasClassName("locked")){lock(wnd);var submit=function(){var responseHandler=getResponseHandler(event,form,wnd);startLoading(wnd);form.request(ajaxOptionsForRH(responseHandler,function(){stopLoading(wnd);unlock(wnd)}))};submit()}return}var submitButton=form.select("#submitButton").first();if(!submitButton){submitButton=new Element("input",{type:"submit",id:"submitButton"});form.insert(submitButton)}submitButton.simulate("click")}catch(err){rescueError(err)}return};var inst=null;
var evalDeletable=function(options){if((typeof options.deletable=="string")&&options.event){options.deletable=neteck.evf(options.event,options.deletable)}};var deletableApply=function(options,action){if(options.deletable){evalDeletable(options);if(options.deletable.invoke){console.log(action);if(jQuery){options.deletable.each(function(e){jQuery(e).queue(function(){try{jQuery(e)[action]();jQuery(e).dequeue()}catch(err){rescueError(err)}}).dequeue()})}else{options.deletable.invoke(action)}}}};Window.JSONResponse=function(event,wnd,options){options=options||{};if(!event&&options.event){event=options.event}if(!wnd&&options.wnd){wnd=options.wnd}if(!wnd&&event){wnd=neteck.evf(event,"[#container=window]").first()}this.parameters={ResponseFormat:"WindowJSONResponse"};var onFailure=function(){deletableApply(options,"show");if(options.onFailure){options.onFailure()}};this.onFailure=function(xhr){if(Window.useDocumentErrorHandler){$(document).fire("http:error",{xhr:xhr,options:options})}else{if(!options.noPrintFailure){neteck.flash.error(xhr.statusText)}}onFailure()};this.onSuccess=function(xhr){try{var json=xhr.responseText.evalJSON()}catch(ex){neteck.flash.error(gettext("Une erreur est survenue."));neteck.reportError(ex,false,"fail to decode json data starting with "+xhr.responseText.substr(0,30));onFailure();return}try{if("errors" in json&&neteck&&neteck.flash){var errorMessages=[];json.errors.each(function(e){errorMessages.push(e.message)});if(errorMessages.length>0){neteck.flash.error(errorMessages.join("<br />"))}}if("flashError" in json&&neteck&&neteck.flash){neteck.flash.error(json.flashError)}if("flashInfo" in json&&neteck&&neteck.flash){neteck.flash.info(json.flashInfo)}if("documentEvents" in json){json.documentEvents.each(function(e){try{$(document).fire(e.name,e.memo||{})}catch(ex){rescueError(ex)}})}if("redirect" in json){if(json.redirect.match(/\/wnd_/)){wnd.fire("container:flushHistory");wnd.fire("container:loadURL",{url:json.redirect})}else{neteck.ajax.loadPage(json.redirect)
}}if("reloadPage" in json&&json.reloadPage){neteck.ajax.reload();if("redirect2window" in json){window.Window.openWindow(json.redirect2window)}}else{if("redirect2window" in json){window.Window.openWindow(json.redirect2window)}}if("reloadDocument" in json&&json.reloadDocument){window.location.reload(true)}if("windowAction" in json&&json.windowAction=="close"){if(wnd){wnd.fire("container:remove")}}if(json.status=="ok"){try{if(options.onOk){options.onOk(json)}if(options.onOK){options.onOK(json)}}catch(ex){rescueError(ex)}if(!json.cancelable&&!options.deletableOnlyHide){deletableApply(options,"remove")}return}}catch(ex){neteck.flash.error(gettext("Une erreur est survenue."));rescueError(ex)}onFailure()}};Window.openWindow=function(url,parameters,method){var lc=window.LANGUAGE_CODE||"fr";url+=(url.match(/\?/)?"&":"?")+"&_wuid="+(User.id||0)+"&_wlc="+lc;var w=new Window();Window.current=w;windowStack.push(w);w.openWindow(url,parameters,method)};Window.openWindowAsV1=function(url,parameters,method){var lc=window.LANGUAGE_CODE||"fr";url+=(url.match(/\?/)?"&":"?")+"&_wuid="+(User.id||0)+"&_wlc="+lc;var w=new Window();if(Window.current&&!Window.current.closed){Window.current.close()}Window.current=w;windowStack.push(w);Window.current.openWindow(url,parameters,method)};Window.confirm=function(message,url,options){if(confirm(message)){if(options&&options.ifYes){options.ifYes()}Window.JSONHRequest(url,options)}};document.observe("JSONHRequest:undelete",function(event){$(event.memo.id).show()});Window.JSONHRequest=function(url,options){options=options||{};url+=(url.match(/\?/)?"&":"?")+"ResponseFormat=WindowJSONResponse";if(options&&options.deletable){evalDeletable(options);if(options.deletable.invoke){if(jQuery){options.deletable.each(function(e){url+="&deletables[]="+e.identify();jQuery(e).queue(function(){jQuery(e)[e.getStyle("float")!="none"||e.getStyle("display")=="inline-block"?"fadeOut":"slideUp"]("fast",function(){try{jQuery(e).dequeue()}catch(err){rescueError(err)}})})})}else{options.deletable.invoke("hide")
}}}neteck.ajax.Request(url,ajaxOptionsForRH(new Window.JSONResponse(null,null,options)),{noPrintFailure:true})};Window.useDocumentErrorHandler=false})();window.WindowV3=window.Window;if(eval("typeof(gettext) == 'undefined';")){eval("var gettext = function (str) { return str; };")}var Window=Class.create({default_options:{id:"wnd",isDraggable:false,top:150,onCreate:function(){},onSubmit:function(){return true},onDestroy:function(){return true}},initialize:function(b){this.options={};Object.extend(this.options,this.default_options);this.setOptions(b);var a=this;this.onAjaxLoad=function(){if(a.wnd){a.destroy()}}},setTitle:function(a){Selector.findChildElements(this.wnd,[".Window-title"]).first().update(a)},setOptions:function(a){Object.extend(this.options,a||{})},openWindow:function(c,a,e){var b=this;document.observe("ajax:load",this.onAjaxLoad);if(this.isLocked()){return false}var d=a||"";Object.isString(d)?d+="&h="+new Date().getTime():d.h=new Date().getTime();new Ajax.Request(c,{method:e||"get",parameters:d,onException:function(f){alert("openWindow.onException: "+f.dispatchException())},onCreate:function(){b.lock();b._createWindow()},onSuccess:function(g){b.options.htmlMode=(g.getHeader("Content-Type")!="application/json");if(b.options.htmlMode){if(g.responseText==""){b.destroy()}else{b.response=g.responseText;b._generateContents();b._initializeEvents()}}else{var f=g.responseText.isJSON()?g.responseText.evalJSON():{errno:99};b.response={title:"",body:"",toolbar:"",styles:{},classes:"",errno:0,errstr:false,ev_destroy:false,ev_create:false,ev_response:false};Object.extend(b.response,f||{});if("flashInfo" in f&&neteck&&neteck.flash){neteck.flash.info(f.flashInfo)}if("flashError" in f&&neteck&&neteck.flash){neteck.flash.error(f.flashError)}if(b.response.errno==0){if("windowAction" in f&&f.windowAction=="close"){b.destroy()}else{if(!f.body){b.unlock();b.loading.remove();b.loading=null}else{b._generateContents()}}}else{b._generateContentsError()}b._initializeEvents()}b.unlock()
},onFailure:function(f){if(f.status==403&&f.statusText=="No abo"){b.destroy();neteck.ajax.loadPage("/abonnement?ChooseAbo=1")}if(f.status==403&&f.statusText=="You are blacklisted"){b.destroy();neteck.flash.info(gettext("Vous êtes blacklisté."))}if(f.status==401&&f.statusText=="Not logged"){setTimeout(function(){b.options.onConnect=function(){Window.openWindow(c,a,e)};b.openWindow("/nologin/window")},500);b.unlock()}else{setTimeout(function(){b.response={title:"",body:"",toolbar:"",styles:{},classes:"",errno:0,errstr:false,ev_destroy:false,ev_create:false,ev_response:false};b._generateContentsError();b._initializeEvents()},500);b.unlock()}}})},destroy:function(){if(this.wnd){this.wnd.remove()}this.wnd=null;document.stopObserving("ajax:load",this.onAjaxLoad)},disable:function(a){this.wnd.select(".Window-"+a).each(function(b){b.disable()})},enable:function(a){this.wnd.select(".Window-"+a).each(function(b){b.enable()})},_initializeEvents:function(){if(this.wnd){this.wnd.select(".Window-destroy").each(function(element){Event.observe(element,"click",function(event){var destroy=true;if(this.response.ev_destroy){eval(this.response.ev_destroy)}destroy&=this.options.onDestroy(this);if(destroy){this.destroy()}}.bind(this))}.bind(this));this.wnd.select(".Window-response").each(function(element){Event.observe(element,"click",function(ev){var targetSelector=element.readAttribute("data-target");if(targetSelector){var form=this.wnd.select(targetSelector).first();if(typeof form.onsubmit=="function"){try{this._createLoading();var m=navigator.userAgent.match(/MSIE ([0-9]+)/);if(m&&parseInt(m[1])<9){if(form.onsubmit()){form.submit()}else{this.unlock()}}else{try{if(form.onsubmit(ev)){form.submit()}else{this.unlock()}}catch(ex){if(form.onsubmit()){form.submit()}else{this.unlock()}}}}catch(e){this._generateContentsError();this._initializeEvents();this.unlock()}}else{this.openWindow(form.action,form.serialize(),form.method)}}else{var destroy=true;if(this.response.ev_response){eval(this.response.ev_response)
}destroy&=this.options.onSubmit(this);if(destroy){this.destroy()}}}.bind(this))}.bind(this));this.wnd.select(".Window-toolbar").each(function(element){var elements=element.immediateDescendants();elements.each(function(el){el.observe("click",function(){elements.each(function(el2){if(!el2.hasClassName("Window-destroy")){el2.addClassName("disabled-on-click");if(el2.disable){el2.disable()}}})}.bind(this))}.bind(this))}.bind(this));document.observe("Window:enable",function(event){this.enable(event.memo.type)}.bind(this));document.observe("Window:disable",function(event){this.disable(event.memo.type)}.bind(this));var self=this;this.wnd.observe("Window:enable",function(){self.wnd.select(".disabled-on-click").each(function(e){e.removeClassName("disabled-on-click");if(e.enable){e.enable()}})});this.wnd.observe("Window:close",function(){self.destroy()});this.wnd.observe("container:remove",function(){self.destroy()});this.wnd.observe("container:loadstop",function(){if(self.loading){self.loading.remove();self.loading=null}});this.wnd.observe("session:connected",function(){if(self.options.onConnect){self.options.onConnect()}else{self.destroy()}});var firstInput=this.wnd.select("input[type=text], input[type=password], textarea").first();if(firstInput){firstInput.focus()}}},_getScrollTop:function(){return(window.pageYOffset)?window.pageYOffset:(document.documentElement&&document.documentElement.scrollTop)?document.documentElement.scrollTop:document.body.scrollTop},_createWindow:function(){if(!this.wnd){this.wnd=new Element("div",{id:this.options.id,"class":"Window-contener"});this.wnd.update('<h2 class="chargement">'+gettext("Chargement...")+"</h2>");this.wnd.setOpacity(0);$(document.body).insert(this.wnd)}else{this._createLoading()}this.wnd.fadeIn();var a=this;this.wnd.observe("ui:refresh",function(){a.setPosDim()});a.setPosDim()},setPosDim:function(){try{if(this.wnd==null){return}var a=document.viewport.getScrollOffsets();var f=document.viewport.getHeight();var d=this.wnd.getHeight();
var c=this.wnd;var e=a.top;if(d<f){e+=(f-d)/2}c.setStyle({top:e+"px"})}catch(b){if(neteck&&neteck.reportError){neteck.reportError(b)}}},_generateContentsError:function(){this.response.title="Oups, ...";this.response.body=new Element("h3").update(this.response.errstr||gettext("Erreur indéterminée,<br/>veuillez réessayer plus tard."));this.response.toolbar='<input type="button" class="Window-destroy" value="'+gettext("Annuler/Fermer")+'"/>';this._generateContents()},_createLoading:function(){if(this.title){this.title.insert(this.loading=new Element("p",{style:"position:absolute; top:10px; right:6px;"}).update(gettext("Chargement...")))}},_generateContents:function(){var self=this;if(this.options.htmlMode){var tmpdiv=new Element("div",{id:"_windowTmpContainer"});tmpdiv.insert(this.response);var newWnd=tmpdiv.down();this.wnd.replace(newWnd);this.wnd=newWnd;var _this=this;this.wnd.observe("ui:refresh",function(){self.setPosDim()});this.title=this.wnd.select(".Window-title").first();this.body=this.wnd.select(".Window-body").first();this.toolbar=this.wnd.select(".Window-toolbar").first();this.wnd.fire("ui:refresh")}else{this.wnd.setStyle(this.response.styles);$A(this.response.classes.split(" ")).each(function(e){self.wnd.addClassName(e)});var centerDiv=this.centerDiv=new Element("div",{"class":"Window-center"});this.title=new Element("div",{"class":"Window-title"}).update(this.response.title);this.body=new Element("div",{"class":"Window-body"}).update(this.response.body);this.toolbar=new Element("div",{"class":"Window-toolbar"}).update(this.response.toolbar);this.wnd.update(this.centerDiv);centerDiv.insert(this.title);centerDiv.insert(this.body);centerDiv.insert(this.toolbar);this.wnd.fire("ui:refresh");if(this.options.isDraggable){this.draggable()}if(this.response.ev_create){eval(this.response.ev_create)}this.options.onCreate(this)}},lock:function(){this.locked=true},unlock:function(){this.locked=false},isLocked:function(){if(!this.locked){return false}return true},draggable:function(){new Draggable(this.options.id,{scroll:window,handle:"Window-title"});
this.title.setStyle({cursor:"move"})}});(function(){var a=null;Window.openWindow=function(b,c,d){if(a==null){a=new Window()}Window.current=a;a.openWindow(b,c,d)}})();Event.observe(window,"resize",function(){if(Window.current){Window.current.setPosDim()}});Window.useDocumentErrorHandler=false;if(window.WindowV3){(function(b,a){b.submit=a.submit;b.confirm=a.confirm;b.submitForm=a.submitForm;b.JSONHRequest=a.JSONHRequest;b.JSONResponse=a.JSONResponse;b.checkIfCloseAction=a.checkIfCloseAction})(Window,window.WindowV3)}Element.addMethods({fadeIn:function(e,b){var c={begin:e.getOpacity(),end:1,delay:8};Object.extend(c,b||{});var d=parseFloat(c.begin);e.setOpacity(d);if(Object.isUndefined(e.fadeInCreate)||!e.fadeInCreate){e.fire("fadeIn:onCreate");e.fadeInCreate=false}if(d<c.end){setTimeout(function(){e.fadeIn({begin:c.begin+(0.1),end:c.end,delay:c.delay})},c.delay)}else{e.fire("fadeIn:onComplete");e.fadeInCreate=true}return e},fadeOut:function(e,b){var c={begin:e.getOpacity(),end:0,delay:8};Object.extend(c,b||{});var d=parseFloat(c.begin);e.setOpacity(d);if(Object.isUndefined(e.fadeOutCreate)||!e.fadeOutCreate){e.fire("fadeOut:onCreate");e.fadeOutCreate=true}if(d>c.end){setTimeout(function(){e.fadeOut({begin:c.begin-(0.1),end:c.end,delay:c.delay})},c.delay)}else{e.fire("fadeOut:onComplete");e.fadeOutCreate=false}return e}});var myStorage=Class.create({initialize:function(){this.Version="1.0.0";this.h=new Hash()},add:function(b,d,a){if(!a){a=0}else{a+=this.time()}if(this.get(b)){return false}var c={data:d,expire:a};this.h.set(b,c)},set:function(b,d,a){if(!a){a=0}else{a+=this.time()}var c={data:d,expire:a};this.h.set(b,c)},get:function(a){var b=this.h.get(a);if(!b){return false}if((b.expire>0)&&(b.expire<this.time())){this.del(a);return false}return b.data},del:function(a){this.h.unset(a)},time:function(){return Math.floor((new Date()).getTime()/1000)}});var preload=window.preload=function(e,c,a,d){var b=new Image();b.onload=function(){e.onload=null;if(a){e.width=a}if(d){e.height=d
}e.src=b.src};b.src=c};if(typeof deconcept=="undefined"){var deconcept=new Object()}if(typeof deconcept.util=="undefined"){deconcept.util=new Object()}if(typeof deconcept.SWFObjectUtil=="undefined"){deconcept.SWFObjectUtil=new Object()}deconcept.SWFObject=function(m,b,n,e,j,k,g,f,d,l){if(!document.getElementById){return}this.DETECT_KEY=l?l:"detectflash";this.skipDetect=deconcept.util.getRequestParameter(this.DETECT_KEY);this.params=new Object();this.variables=new Object();this.attributes=new Array();if(m){this.setAttribute("swf",m)}if(b){this.setAttribute("id",b)}if(n){this.setAttribute("width",n)}if(e){this.setAttribute("height",e)}if(j){this.setAttribute("version",new deconcept.PlayerVersion(j.toString().split(".")))}this.installedVer=deconcept.SWFObjectUtil.getPlayerVersion();if(!window.opera&&document.all&&this.installedVer.major>7){deconcept.SWFObject.doPrepUnload=true}if(k){this.addParam("bgcolor",k)}var a=g?g:"high";this.addParam("quality",a);this.setAttribute("useExpressInstall",false);this.setAttribute("doExpressInstall",false);var i=(f)?f:window.location;this.setAttribute("xiRedirectUrl",i);this.setAttribute("redirectUrl","");if(d){this.setAttribute("redirectUrl",d)}};deconcept.SWFObject.prototype={useExpressInstall:function(a){this.xiSWFPath=!a?"expressinstall.swf":a;this.setAttribute("useExpressInstall",true)},setAttribute:function(a,b){this.attributes[a]=b},getAttribute:function(a){return this.attributes[a]},addParam:function(b,a){this.params[b]=a},getParams:function(){return this.params},addVariable:function(b,a){this.variables[b]=a},getVariable:function(a){return this.variables[a]},getVariables:function(){return this.variables},getVariablePairs:function(){var c=new Array();var b;var a=this.getVariables();for(b in a){c[c.length]=b+"="+a[b]}return c},getSWFHTML:function(){var b="";if(navigator.plugins&&navigator.mimeTypes&&navigator.mimeTypes.length){if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","PlugIn");this.setAttribute("swf",this.xiSWFPath)
}b='<embed type="application/x-shockwave-flash" src="'+this.getAttribute("swf")+'" width="'+this.getAttribute("width")+'" height="'+this.getAttribute("height")+'" style="'+this.getAttribute("style")+'"';b+=' id="'+this.getAttribute("id")+'" name="'+this.getAttribute("id")+'" ';var f=this.getParams();for(var e in f){b+=[e]+'="'+f[e]+'" '}var d=this.getVariablePairs().join("&");if(d.length>0){b+='flashvars="'+d+'"'}b+="/>"}else{if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","ActiveX");this.setAttribute("swf",this.xiSWFPath)}b='<object id="'+this.getAttribute("id")+'" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="'+this.getAttribute("width")+'" height="'+this.getAttribute("height")+'" style="'+this.getAttribute("style")+'">';b+='<param name="movie" value="'+this.getAttribute("swf")+'" />';var c=this.getParams();for(var e in c){b+='<param name="'+e+'" value="'+c[e]+'" />'}var a=this.getVariablePairs().join("&");if(a.length>0){b+='<param name="flashvars" value="'+a+'" />'}b+="</object>"}return b},write:function(b){if(this.getAttribute("useExpressInstall")){var a=new deconcept.PlayerVersion([6,0,65]);if(this.installedVer.versionIsValid(a)&&!this.installedVer.versionIsValid(this.getAttribute("version"))){this.setAttribute("doExpressInstall",true);this.addVariable("MMredirectURL",escape(this.getAttribute("xiRedirectUrl")));document.title=document.title.slice(0,47)+" - Flash Player Installation";this.addVariable("MMdoctitle",document.title)}}if(this.skipDetect||this.getAttribute("doExpressInstall")||this.installedVer.versionIsValid(this.getAttribute("version"))){var c=(typeof b=="string")?document.getElementById(b):b;c.innerHTML=this.getSWFHTML();return true}else{if(this.getAttribute("redirectUrl")!=""){document.location.replace(this.getAttribute("redirectUrl"))}}return false}};deconcept.SWFObjectUtil.getPlayerVersion=function(){var f=new deconcept.PlayerVersion([0,0,0]);if(navigator.plugins&&navigator.mimeTypes.length){var a=navigator.plugins["Shockwave Flash"];
if(a&&a.description){f=new deconcept.PlayerVersion(a.description.replace(/([a-zA-Z]|\s)+/,"").replace(/(\s+r|\s+b[0-9]+)/,".").split("."))}}else{if(navigator.userAgent&&navigator.userAgent.indexOf("Windows CE")>=0){var b=1;var c=3;while(b){try{c++;b=new ActiveXObject("ShockwaveFlash.ShockwaveFlash."+c);f=new deconcept.PlayerVersion([c,0,0])}catch(d){b=null}}}else{try{var b=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7")}catch(d){try{var b=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");f=new deconcept.PlayerVersion([6,0,21]);b.AllowScriptAccess="always"}catch(d){if(f.major==6){return f}}try{b=new ActiveXObject("ShockwaveFlash.ShockwaveFlash")}catch(d){}}if(b!=null){f=new deconcept.PlayerVersion(b.GetVariable("$version").split(" ")[1].split(","))}}}return f};deconcept.PlayerVersion=function(a){this.major=a[0]!=null?parseInt(a[0]):0;this.minor=a[1]!=null?parseInt(a[1]):0;this.rev=a[2]!=null?parseInt(a[2]):0};deconcept.PlayerVersion.prototype.versionIsValid=function(a){if(this.major<a.major){return false}if(this.major>a.major){return true}if(this.minor<a.minor){return false}if(this.minor>a.minor){return true}if(this.rev<a.rev){return false}return true};deconcept.util={getRequestParameter:function(c){var d=document.location.search||document.location.hash;if(c==null){return d}if(d){var b=d.substring(1).split("&");for(var a=0;a<b.length;a++){if(b[a].substring(0,b[a].indexOf("="))==c){return b[a].substring((b[a].indexOf("=")+1))}}}return""}};deconcept.SWFObjectUtil.cleanupSWFs=function(){var b=document.getElementsByTagName("OBJECT");for(var c=b.length-1;c>=0;c--){b[c].style.display="none";for(var a in b[c]){if(typeof b[c][a]=="function"){b[c][a]=function(){}}}}};if(deconcept.SWFObject.doPrepUnload){if(!deconcept.unloadSet){deconcept.SWFObjectUtil.prepUnload=function(){__flash_unloadHandler=function(){};__flash_savedUnloadHandler=function(){};window.attachEvent("onunload",deconcept.SWFObjectUtil.cleanupSWFs)};window.attachEvent("onbeforeunload",deconcept.SWFObjectUtil.prepUnload);
deconcept.unloadSet=true}}if(!document.getElementById&&document.all){document.getElementById=function(a){return document.all[a]}}var getQueryParamValue=deconcept.util.getRequestParameter;var FlashObject=deconcept.SWFObject;var SWFObject=deconcept.SWFObject;function getCookieVal(b){var a=document.cookie.indexOf(";",b);if(a==-1){a=document.cookie.length}return unescape(document.cookie.substring(b,a))}function LireCookie(c){var b=c+"=";var f=b.length;var a=document.cookie.length;var e=0;while(e<a){var d=e+f;if(document.cookie.substring(e,d)==b){return getCookieVal(d)}e=document.cookie.indexOf(" ",e)+1;if(e==0){break}}return null}netehash=LireCookie("netesession");function restoreNavFrame(){if(parent&&("frames" in parent)&&("nav" in parent.frames)&&!("isVisitor" in parent.frames.nav)&&!("openDialogue" in parent.frames.nav)){var b=parent.location;var a=parent.frames.nav.document.location;if(a.pathname!="/maintenance.php"&&a.pathname.match(/nav/)){parent.frames.nav.document.location=a.pathname+"?tt="+new Date().getTime()}else{if(a.href.match(/ajax/)){parent.frames.nav.document.location="/nav/ajaxchat?tt="+new Date().getTime()}else{parent.frames.nav.document.location="/nav?tt="+new Date().getTime()}}}}function openchatv2(a,b,c){if(window.opener&&window.opener.openchatv2&&!window.opener.openDialogue){window.opener.openchatv2(a,b,c)}else{if(parent.frames.nav){if(!("openDialogue" in parent.frames.nav)){restoreNavFrame()}parent.frames.nav.openDialogue(a,b,c)}else{if(window.opener){window.opener.openDialogue(a,b,c)}else{alert("Aucune connexion au chat trouvée.")}}}}function openfichev2(a,b){ffiche=window.open("/fiche/"+a+"?hash="+b,"fichenetech","width=700,height=650,toolbar=no,location=no,scrollbars=yes");if(ffiche){ffiche.focus()}}function opencontactv2(a,b){fcontact=window.open("/addcontact?aspidf="+a+"&hash="+b,"contactnetech","width=575,height=300,toolbar=no,location=no,scrollbars=no");if(fcontact){fcontact.focus()}}function openalbumsv2(b,a,c,d){falbums=window.open("/albumshowphotos?aspidf="+b+"&album_id="+a+"&hash="+c+(d?"&show_photo="+d:""),"albumnetech","width=780,height=640,toolbar=no,location=no,scrollbars=yes");
if(falbums){falbums.focus()}}(function(){window.jsRedirect2Abonnement=function(){parent.frames.TopDesk.location="?tpl=abonnement"}})();(function(){var b=this.Store=function(d,e,g){var h=this;this.name=d;this.listeners={};if(e){for(var i in e){if(e.hasOwnProperty(i)&&this.get(i)===undefined){this.set(i,e[i])}}}var j=function(l,m){([l,"*"]).each(function(n){if(h.listeners[n]){h.listeners[n].each(function(o){o(m,l,h.name)})}})};var c=this.toObject();var f=function(){k(true)};var k=function(n){if(Object.keys(h.listeners).length!==0){var l=h.toObject();if(!n){for(var m in l){if(l.hasOwnProperty(m)&&l[m]!==c[m]){j(m,l[m])}}for(var m in c){if(c.hasOwnProperty(m)&&!l.hasOwnProperty(m)){j(m,l[m])}}}c=l;setTimeout(k,(g||300))}else{setTimeout(f,1000)}};f()};b.__proto__=function a(){};b.__proto__.clear=function(){localStorage.clear()};b.prototype.get=function(c){var d=localStorage.getItem("store."+this.name+"."+c);if(d===null){return}try{return JSON.parse(d)}catch(f){return null}};b.prototype.set=function(c,d){if(d===undefined){this.remove(c)}else{if(typeof d==="function"){d=null}else{try{d=JSON.stringify(d)}catch(f){d=null}}localStorage.setItem("store."+this.name+"."+c,d)}return this};b.prototype.remove=function(c){localStorage.removeItem("store."+this.name+"."+c);return this};b.prototype.removeAll=function(){var c="store."+this.name+".";for(var d=(localStorage.length-1);d>=0;d--){if(localStorage.key(d).substring(0,c.length)===c){localStorage.removeItem(localStorage.key(d))}}return this};b.prototype.toObject=function(){var c={};var d="store."+this.name+".";for(var f=(localStorage.length-1);f>=0;f--){if(localStorage.key(f).substring(0,d.length)===d){var e=localStorage.key(f).substring(d.length);var g=this.get(e);if(g!==undefined){c[e]=g}}}return c};b.prototype.fromObject=function(c,e){if(!e){this.removeAll()}for(var d in c){if(c.hasOwnProperty(d)){this.set(d,c[d])}}return this};b.prototype.addEvent=function(c,d){if(!this.listeners[c]){this.listeners[c]=[]}this.listeners[c].push(d);
return this};b.prototype.removeEvent=function(c,e){for(var d=(this.listeners[c].length-1);d>=0;d--){if(this.listeners[c][d]===e){this.listeners[c].splice(d,1)}}if(this.listeners[c].length===0){delete this.listeners[c]}return this}})();if(!("localStorage" in window)){window.Store=function(){this.get=function(){return};this.set=function(){};this.removeAll=function(){};this.addEvent=function(){};this.removeEvent=function(){}}}(function(){var b={HTMLEvents:/^(?:load|unload|abort|error|select|change|submit|reset|focus|blur|resize|scroll)$/,MouseEvents:/^(?:click|mouse(?:down|up|over|move|out))$/};var a={pointerX:0,pointerY:0,button:0,ctrlKey:false,altKey:false,shiftKey:false,metaKey:false,bubbles:true,cancelable:true};Event.simulate=function(h,d){var f=Object.extend(a,arguments[2]||{});var c,g=null;h=$(h);for(var e in b){if(b[e].test(d)){g=e;break}}if(!g){throw new SyntaxError("Only HTMLEvents and MouseEvents interfaces are supported")}if(document.createEvent){c=document.createEvent(g);if(g=="HTMLEvents"){c.initEvent(d,f.bubbles,f.cancelable)}else{c.initMouseEvent(d,f.bubbles,f.cancelable,document.defaultView,f.button,f.pointerX,f.pointerY,f.pointerX,f.pointerY,f.ctrlKey,f.altKey,f.shiftKey,f.metaKey,f.button,h)}h.dispatchEvent(c)}else{f.clientX=f.pointerX;f.clientY=f.pointerY;c=Object.extend(document.createEventObject(),f);h.fireEvent("on"+d,c)}return h};Element.addMethods({simulate:Event.simulate})})();if(typeof InputSaver=="undefined"){var InputSaver={};(function(){var d=0,a=1,b=2;var f=function(g,h){if(typeof h=="undefined"){}else{if(h.name!=g.name){}else{if(g.nodeName=="SELECT"&&h.type==d){g.value=h.value;g.simulate("change")}else{if(g.type=="checkbox"&&h.type==a){g.checked=h.checked;g.simulate("change")}else{if(g.type=="text"&&h.type==b){g.value=h.value;g.simulate("change")}}}}}};var c=function(g){var h=false;if(g.nodeName=="SELECT"){h={type:d}}else{if(g.type=="checkbox"){h={type:a,checked:g.checked}}else{if(g.type=="text"){h={type:b}}}}if(h){h.name=g.name;h.value=g.value
}return h};var e=function(j,h){var g=0;j.select("input, select").each(function(i){(function(k){try{h.oninit(k,i)}catch(l){if("console" in window&&"stack" in l){console.error(l.stack)}}i.observe("change",function(){try{h.onchange(k,i)}catch(m){if("console" in window&&"stack" in m){console.error(m)}}})})(g);g+=1})};if("Store" in window){InputSaver.setPersistent=function(k){var i=k.getAttribute("data-storename");if(!i){i="savedInput_"+k.id}var g=new Store(i);var j=MD5("v6_"+k.innerHTML);var h=false;if(g.get("html_hash")==j){h=true}else{g.removeAll()}g.set("html_hash",j);e(k,{oninit:function(m,l){if(h){var n=g.get("fe_"+m);f(l,n)}},onchange:function(n,m){var l=c(m);if(l){g.set("fe_"+n,l)}}})}}else{if("localStorage" in window){InputSaver.setPersistent=function(l){var i=l.getAttribute("data-storename");if(!i){i="savedInput_"+l.id}var k={hashed:null,form:{}};if("myLocalStorage" in window){if(myLocalStorage.get(i)!=null){k=myLocalStorage.get(i).evalJSON()}}else{if(localStorage[i]!=null){k=localStorage[i].evalJSON()}}var j=MD5("v6_"+l.innerHTML);var g=function(){if("myLocalStorage" in window){myLocalStorage.set(i,Object.toJSON(k))}else{localStorage[i]=Object.toJSON(k)}};var h=true;if(k.hashed!=null&&j!=k.hashed){h=false;g()}k.hashed=j;e(l,{oninit:function(n,m){if(h){var o=k.form[n];f(m,o)}},onchange:function(n,m){var o=c(m);if(o){k.form[n]=o;g()}}})}}else{InputSaver.setPersistent=function(){}}}InputSaver.getLocationHash=function(){var g=document.location.hash.match(/#?(.+)$/);var h=g?g[1].toQueryParams():{};return h};(function(){var g=null;var h={};InputSaver.changeLocationHash=function(i,j){if(g!=document.location.hash){h=InputSaver.getLocationHash()}h[i]=j;document.location.hash="#"+Object.toQueryString(h);g=document.location.hash}})();InputSaver.syncWithLocationHash=function(i){var h=InputSaver.getLocationHash();var g=function(j){if(j.nodeName=="SELECT"){j.value=h[j.name]}else{if(j.type=="checkbox"){j.value=h[j.name]=="on"}else{if(j.type=="text"){j.value=h[j.name]}}}if(j.nodeName=="SELECT"){j.observe("change",function(){InputSaver.changeLocationHash(j.name,j.value)
});j.observe("keypress",function(){InputSaver.changeLocationHash(j.name,j.value)})}else{j.observe("change",function(){if(j.nodeName=="SELECT"){InputSaver.changeLocationHash(j.name,j.value)}else{if(j.type=="checkbox"){InputSaver.changeLocationHash(j.name,j.checked?"on":"")}else{if(j.type=="text"){InputSaver.changeLocationHash(j.name,j.value)}}}})}};if(i){if(i.nodeName=="SELECT"||i.nodeName=="INPUT"){g(i)}else{i.select("input, select").each(function(j){g(j)})}}}})()}window.MD5=window.md5=function(s){var L=function(b,a){return(b<<a)|(b>>>(32-a))};var K=function(k,b){var F,a,d,x,c;d=(k&2147483648);x=(b&2147483648);F=(k&1073741824);a=(b&1073741824);c=(k&1073741823)+(b&1073741823);if(F&a){return(c^2147483648^d^x)}if(F|a){if(c&1073741824){return(c^3221225472^d^x)}else{return(c^1073741824^d^x)}}else{return(c^d^x)}};var r=function(a,c,b){return(a&c)|((~a)&b)};var q=function(a,c,b){return(a&b)|(c&(~b))};var p=function(a,c,b){return(a^c^b)};var n=function(a,c,b){return(c^(a|(~b)))};var u=function(G,F,aa,Z,k,H,I){G=K(G,K(K(r(F,aa,Z),k),I));return K(L(G,H),F)};var f=function(G,F,aa,Z,k,H,I){G=K(G,K(K(q(F,aa,Z),k),I));return K(L(G,H),F)};var D=function(G,F,aa,Z,k,H,I){G=K(G,K(K(p(F,aa,Z),k),I));return K(L(G,H),F)};var t=function(G,F,aa,Z,k,H,I){G=K(G,K(K(n(F,aa,Z),k),I));return K(L(G,H),F)};var e=function(k){var G;var d=k.length;var c=d+8;var b=(c-(c%64))/64;var F=(b+1)*16;var H=Array(F-1);var a=0;var x=0;while(x<d){G=(x-(x%4))/4;a=(x%4)*8;H[G]=(H[G]|(k.charCodeAt(x)<<a));x++}G=(x-(x%4))/4;a=(x%4)*8;H[G]=H[G]|(128<<a);H[F-2]=d<<3;H[F-1]=d>>>29;return H};var B=function(c){var b="",d="",k,a;for(a=0;a<=3;a++){k=(c>>>(a*8))&255;d="0"+k.toString(16);b=b+d.substr(d.length-2,2)}return b};var J=function(b){b=b.replace(/\r\n/g,"\n");var a="";for(var k=0;k<b.length;k++){var d=b.charCodeAt(k);if(d<128){a+=String.fromCharCode(d)}else{if((d>127)&&(d<2048)){a+=String.fromCharCode((d>>6)|192);a+=String.fromCharCode((d&63)|128)}else{a+=String.fromCharCode((d>>12)|224);a+=String.fromCharCode(((d>>6)&63)|128);
a+=String.fromCharCode((d&63)|128)}}}return a};var C=Array();var P,h,E,v,g,Y,X,W,V;var S=7,Q=12,N=17,M=22;var A=5,z=9,y=14,w=20;var o=4,m=11,l=16,j=23;var U=6,T=10,R=15,O=21;s=J(s);C=e(s);Y=1732584193;X=4023233417;W=2562383102;V=271733878;for(P=0;P<C.length;P+=16){h=Y;E=X;v=W;g=V;Y=u(Y,X,W,V,C[P+0],S,3614090360);V=u(V,Y,X,W,C[P+1],Q,3905402710);W=u(W,V,Y,X,C[P+2],N,606105819);X=u(X,W,V,Y,C[P+3],M,3250441966);Y=u(Y,X,W,V,C[P+4],S,4118548399);V=u(V,Y,X,W,C[P+5],Q,1200080426);W=u(W,V,Y,X,C[P+6],N,2821735955);X=u(X,W,V,Y,C[P+7],M,4249261313);Y=u(Y,X,W,V,C[P+8],S,1770035416);V=u(V,Y,X,W,C[P+9],Q,2336552879);W=u(W,V,Y,X,C[P+10],N,4294925233);X=u(X,W,V,Y,C[P+11],M,2304563134);Y=u(Y,X,W,V,C[P+12],S,1804603682);V=u(V,Y,X,W,C[P+13],Q,4254626195);W=u(W,V,Y,X,C[P+14],N,2792965006);X=u(X,W,V,Y,C[P+15],M,1236535329);Y=f(Y,X,W,V,C[P+1],A,4129170786);V=f(V,Y,X,W,C[P+6],z,3225465664);W=f(W,V,Y,X,C[P+11],y,643717713);X=f(X,W,V,Y,C[P+0],w,3921069994);Y=f(Y,X,W,V,C[P+5],A,3593408605);V=f(V,Y,X,W,C[P+10],z,38016083);W=f(W,V,Y,X,C[P+15],y,3634488961);X=f(X,W,V,Y,C[P+4],w,3889429448);Y=f(Y,X,W,V,C[P+9],A,568446438);V=f(V,Y,X,W,C[P+14],z,3275163606);W=f(W,V,Y,X,C[P+3],y,4107603335);X=f(X,W,V,Y,C[P+8],w,1163531501);Y=f(Y,X,W,V,C[P+13],A,2850285829);V=f(V,Y,X,W,C[P+2],z,4243563512);W=f(W,V,Y,X,C[P+7],y,1735328473);X=f(X,W,V,Y,C[P+12],w,2368359562);Y=D(Y,X,W,V,C[P+5],o,4294588738);V=D(V,Y,X,W,C[P+8],m,2272392833);W=D(W,V,Y,X,C[P+11],l,1839030562);X=D(X,W,V,Y,C[P+14],j,4259657740);Y=D(Y,X,W,V,C[P+1],o,2763975236);V=D(V,Y,X,W,C[P+4],m,1272893353);W=D(W,V,Y,X,C[P+7],l,4139469664);X=D(X,W,V,Y,C[P+10],j,3200236656);Y=D(Y,X,W,V,C[P+13],o,681279174);V=D(V,Y,X,W,C[P+0],m,3936430074);W=D(W,V,Y,X,C[P+3],l,3572445317);X=D(X,W,V,Y,C[P+6],j,76029189);Y=D(Y,X,W,V,C[P+9],o,3654602809);V=D(V,Y,X,W,C[P+12],m,3873151461);W=D(W,V,Y,X,C[P+15],l,530742520);X=D(X,W,V,Y,C[P+2],j,3299628645);Y=t(Y,X,W,V,C[P+0],U,4096336452);V=t(V,Y,X,W,C[P+7],T,1126891415);W=t(W,V,Y,X,C[P+14],R,2878612391);X=t(X,W,V,Y,C[P+5],O,4237533241);
Y=t(Y,X,W,V,C[P+12],U,1700485571);V=t(V,Y,X,W,C[P+3],T,2399980690);W=t(W,V,Y,X,C[P+10],R,4293915773);X=t(X,W,V,Y,C[P+1],O,2240044497);Y=t(Y,X,W,V,C[P+8],U,1873313359);V=t(V,Y,X,W,C[P+15],T,4264355552);W=t(W,V,Y,X,C[P+6],R,2734768916);X=t(X,W,V,Y,C[P+13],O,1309151649);Y=t(Y,X,W,V,C[P+4],U,4149444226);V=t(V,Y,X,W,C[P+11],T,3174756917);W=t(W,V,Y,X,C[P+2],R,718787259);X=t(X,W,V,Y,C[P+9],O,3951481745);Y=K(Y,h);X=K(X,E);W=K(W,v);V=K(V,g)}var i=B(Y)+B(X)+B(W)+B(V);return i.toLowerCase()};if(typeof(AjaxMobile)=="undefined"){var AjaxMobile=Class.create({});AjaxMobile.getTokenLogin=function(b){var a={method:"post"};Object.extend(a,b||{});new Ajax.Request("/ajaxv1/Mobile/getTokenLogin",a)};AjaxMobile.secureLogin=function(c,e,f){var d={asynchronous:true};var g;Object.extend(d,f||{});var b=10;var a=function(){var h=new Date().getTime();AjaxMobile.getTokenLogin({parameters:{expire:b},asynchronous:d.asynchronous,onSuccess:function(j){var i=j.responseText.evalJSON();d.parameters={};Object.extend(d.parameters,f.parameters||{});d.parameters.md5TokenLoginId=i.tokenLoginId;g=md5(i.tokenLoginSigner+e);d.onFailure=function(){if(f.onFailure){f.onFailure(j)}};AjaxMobile.login(c,g,{parameters:d.parameters,onSuccess:function(l){var k=l.responseText.evalJSON();if(k.status=="error"&&k.error=="TOKEN_EXPIRED"){b=Math.round((new Date().getTime()-h)/1000*1.5)+2;a()}else{if(f.onSuccess){f.onSuccess(l)}}},onFailure:function(k){if(f.onFailure){f.onFailure(k)}}})},onFailure:function(i){if(f.onFailure){f.onFailure(i)}}})};a()};AjaxMobile.login=function(a,c,d){var b={method:"post"};Object.extend(b,d||{});b.parameters={login:a,password:c};Object.extend(b.parameters,d.parameters||{});b.parameters._nh_tt_=new Date().getTime();new Ajax.Request("/ajaxv1/Mobile/login",b)};AjaxMobile.getConnInfos=function(b){var a={method:"post",parameters:{}};Object.extend(a,b||{});Object.extend(a.parameters,b.parameters||{});a.parameters._nh_tt_=new Date().getTime();new Ajax.Request("/ajaxv1/Mobile/getConnInfos",a)};AjaxMobile.getInfoUpdates=function(b){var a={method:"post",parameters:{}};
Object.extend(a,b||{});Object.extend(a.parameters,b.parameters||{});a.parameters._nh_tt_=new Date().getTime();new Ajax.Request("/ajaxv1/Mobile/getInfoUpdates",a)};AjaxMobile.reportUASpoof=function(b){var a={method:"post"};Object.extend(a,b||{});new Ajax.Request("/ajaxv1/Mobile/reportUASpoof",a)}}if(typeof(AjaxUser)=="undefined"){var AjaxUser=Class.create({});AjaxUser.get=function(c,b){var a={method:"get"};Object.extend(a,b||{});new Ajax.Request("/ajaxv1/User/get?id="+c,a)};AjaxUser.getMyself=function(b){var a={method:"post",parameters:{}};Object.extend(a,b||{});Object.extend(a.parameters,b.parameters||{});a.parameters.fields=b.fields||"";a.parameters._nh_tt_=new Date().getTime();new Ajax.Request("/ajaxv1/User/getMyself",a)};AjaxUser.isConnected=function(b){var a={method:"post"};Object.extend(a,b||{});new Ajax.Request("/ajaxv1/User/isConnected",a)};AjaxUser.ignore=function(c,b){var a={method:"post",parameters:{aspid:c}};Object.extend(a,b||{});new Ajax.Request("/ajaxv1/User/ignore",a)};AjaxUser.unIgnore=function(c,b){var a={method:"post",parameters:{aspid:c}};Object.extend(a,b||{});new Ajax.Request("/ajaxv1/User/unIgnore",a)};AjaxUser.authAlbum=function(c,b){var a={method:"post",parameters:{aspid:c}};Object.extend(a,b||{});new Ajax.Request("/ajaxv1/User/authAlbum",a)};AjaxUser.getChatAuthToken=function(b){var a={method:"post"};Object.extend(a,b||{});new Ajax.Request("/ajaxv1/User/getChatAuthToken",a)};AjaxUser.getMyChatConf=function(b){var a={method:"post",parameters:{}};Object.extend(a,b||{});Object.extend(a.parameters,b.parameters||{});a.parameters._nh_tt_=new Date().getTime();a.onFailure=function(c){};new Ajax.Request("/ajaxv1/User/getMyChatConf",a)};AjaxUser.sendAlertAdmin=function(c,b){var a={method:"post",parameters:{id:c,commentaire:b}};Object.extend(a,aOptions||{});new Ajax.Request("/ajaxv1/User/sendAlertAdmin",a)};AjaxUser.getFiche=function(c,b){var a={method:"get"};Object.extend(a,b||{});new Ajax.Request("/ajaxv1/User/getFiche?id="+c,a)};AjaxUser.isDispo=function(b){var a={method:"get"};
Object.extend(a,b||{});new Ajax.Request("/ajaxv1/User/isDispo",a)};AjaxUser.setDispo=function(a,c){var b={method:"post",parameters:{status:a}};Object.extend(b,c||{});new Ajax.Request("/ajaxv1/User/setDispo",b)}}(function(){var a=false;if(a||navigator.userAgent.match(/iPhone|iPad|iPod|Android|iTouch/)){(function(){var e=[];var b="_antiCopyLayer";var i=a;var g=function(o){var n="position:absolute; background:transparent;";if(i){n="position:absolute; border:1px solid red; background:rgba(150,150,255,0.6);"}var q=o[b].div=new Element("img",{src:"/images/pxlT.gif",style:n});o.insert({before:q});var p=o[b].setSize=function(){o[b].src=o.src;var u={width:o.clientWidth,height:o.clientHeight};var w=o.positionedOffset();var s=function(x){if(x.nodeName!="BODY"){x=x.parentNode;if(x&&(x.getStyle("overflow")=="visible"||(x.clientWidth==0&&x.clientHeight==0))){return s(x)}}return x};var t=s(o);var r={width:t.clientWidth,height:t.clientHeight};var v="normal";if(t.getStyle("position")=="relative"||(r.width>u.width&&r.height>u.height)){}else{v="overflow";u=r;w=t.positionedOffset()}q.style.width=u.width+"px";q.style.height=u.height+"px";if(o.hasClassName("scrollerMaxSized")){q.style.left=(o.getStyle("margin-left").replace("px","")*1+o.getStyle("border-left-width").replace("px","")*1+w[0])+"px";q.style.top=(o.getStyle("margin-top").replace("px","")*1+o.getStyle("border-top-width").replace("px","")*1+w[1])+"px"}else{q.style.left=o.positionedOffset().left;q.style.top=o.positionedOffset().top}};p();q.addEventListener("click",function(r){o.dispatchEvent(r)},true)};var c=function(o){var n="position:relative; background:transparent;";if(i){n="position:relative; background:red;"}var s=o[b].div=new Element("div",{style:n,"class":"antiCopyLayer"});var r="position:absolute; background:transparent;";if(i){r="position:absolute; border:1px solid red; background:rgba(150,150,255,0.6);"}var p=new Element("div",{style:r,"class":"antiCopyLayer"});s.insert({top:p});o.wrap(s);var q=o[b].setSize=function(){o[b].src=o.src;
var u={width:o.clientWidth,height:o.clientHeight};var t=function(v){v.style.left="0px";v.style.top="0px";v.style.width=(o.getStyle("margin-left").replace("px","")*1+u.width)+"px";v.style.height=(o.getStyle("margin-top").replace("px","")*1+u.height)+"px"};t(s);t(p)};q();p.addEventListener("click",function(t){o.dispatchEvent(t)},true)};var h=function(n){try{n[b]={};e.push(n);n.addEventListener("touchstart",function(p){p.preventDefault()},false);g(n);n.addEventListener("load",function(){n[b].setSize()},false)}catch(o){console.error(o)}};var k=function(n){try{if(!n.hasClassName("nocopy")){return}if(n.nodeName=="IMG"&&n.hasClassName("protect")){return true}if(n.nodeName=="IMG"&&n.src.match(/\/liveshow\/pics\/|\/showing\/stream\//)){return Selector.matchElements(n.ancestors(),".BlocPhoto.hideplay").length!=0}return n.nodeName=="IMG"&&n.src.match(/members\/[0-9]+|videos\/|photos\/|public\/actor\//)}catch(n){return false}};var d=function(){$$("img").each(function(n){if(k(n)&&!(b in n)){h(n)}})};var j=function(){e.each(function(n){n[b].setSize()})};var m=function(){$$("img").each(function(n){if(k(n)){if(b in n){n[b].setSize()}else{h(n)}}})};document.addEventListener("click",function(o){var n;if(o.target.nodeName=="B"&&(n=Event.findElement(o,"a"))&&n.hasClassName("ongl")){setTimeout(function(){m()},100)}else{j()}},false);if(!("ontouchstart" in document)){document.addEventListener("mousedown",function(o){if(k(o.target)){var n=o.target;if(b in n){e.each(function(p){p[b].setSize()})}else{d()}}},false)}document.addEventListener("touchstart",function(o){if(k(o.target)){o.preventDefault();var n=o.target;if(b in n){e.each(function(p){p[b].setSize()})}else{d()}}},false);document.addEventListener("DOMNodeInserted",function(n){if(k(n.target)&&!(b in n.target)){h(n.target)}});var l=0;var f=setInterval(function(){d();if(l++>10*5){clearInterval(f)}},200);window.addEventListener("load",function(){m()},false);document.addEventListener("DOMContentLoaded",function(){m()},false);setInterval(function(){m()
},5000)})()}})();if(typeof(AjaxUserSearch)=="undefined"){var AjaxUserSearch=Class.create({});AjaxUserSearch.getAnnonces=function(b){var a={method:"GET"};Object.extend(a,b||{});new Ajax.Request("/ajaxv1/UserSearch/getAnnonces",a)};AjaxUserSearch.getSavedSearchs=function(b){var a={method:"POST"};Object.extend(a,b||{});new Ajax.Request("/ajaxv1/UserSearch/getSavedSearchs?rd="+new Date().getTime(),a)};AjaxUserSearch.initSavedSearchSelect=function(a,b){if(b&&b.type=="mouseover"&&navigator.userAgent.match(/Firefox/)){return}if(a==null){return}if(a.initialized){return}a.initialized=true;AjaxUserSearch.getSavedSearchs({onSuccess:function(d){var c=d.responseText.evalJSON();c.searchs.each(function(f){$(a).insert(new Element("option",{value:f.id,"data-ajax-params":"mute_loc=1"}).update(f.name))})}})}}var Bulles=Class.create({initialize:function(c,b,a){this._id=c;this._subscriber;this._items_per_page;this._img_server;this._pages;this._more=false;this._name=a;this._url="/"+a+"?";this._page=b;this._items={previous:[],current:[],next:[]};this.pagination(b)},getTpl:function(b,c,a){if(b){return'				<p class="minFiche2 floatL #{online} #{tonight} #{new} '+c+'">					<a class="info" href="/fiche2/#{id}?pagination='+encodeURI(a)+"&back="+this._name+'">						<b class="mauve">#{nickname}</b><br />						<#{hidecert1}img class="floatR" src="'+this._img_server+'/images/certif.gif" alt="annonce certifié"/#{hidecert2}>						<#{hidebl1}img class="floatR" src="'+this._img_server+'/images/bliste.gif" alt="annonce black listé"/#{hidebl2}>						#{dispoPuce}						<span class="sexetxt">#{sexe_txt}</span> (<span title="#{postal_address}">#{geo_code3}</span>)<br />						<b class="time">#{ts}</b>					</a>						<a name="annonce_#{id}" class="vignBulleBig" href="/fiche2/#{id}?pagination='+encodeURI(a)+"&back="+this._name+'">						<img src="#{main_pic}" alt="#{nickname}"/>					</a>				</p>'}else{return'				<p class="minFicheNoAbo floatL #{online} #{tonight} #{new} '+c+'">					<b name="annonce" class="vignBulleBig" href="javascript:void(0);">						<img src="#{main_pic}" />					</b>				</p>'
}},bulles:function(k,m){var c=0;var f=m[this._name];var b={prev:"",next:""};var h=[];var l=[];var d="",a="";this._img_server=this._img_server||f.img_server;this._subscriber=this._subscriber||m.subscriber;this._items_per_page=this._items_per_page||f.items_per_page;this._items.previous=this._items.previous.concat(this._items.current);this._items.next=this._items.next.concat(f.users);this._items.current.clear();for(var e=0;e<this._items.next.length;e++){if(!this._items.next[e]){continue}if(this._items.next[e].id&&e<this._items_per_page){l.push(this._items.next[e].id)}}for(var e=0;e<this._items.next.length;e++){if(!this._items.next[e]){continue}if(e<f.items_per_page){c++;a="";if(c==4&&this._subscriber){a="bulleBr";c=0}b.prev=(e>0)?this._items.next[e-1].id:"";b.next=(e<this._items.next.length-1)?this._items.next[e+1].id:"";b.users=l;var g=this.getTpl(this._subscriber,a,JSON.stringify(b));var j=new Template(g);if(typeof this._items.next[e]=="object"){if("online" in this._items.next[e]){this._items.next[e].onlinePuce='<span class="onlinePuce"><img src="/images/fiche/puce-'+(this._items.next[e].online=="online"?"on":"off")+'.gif" /></span>'}if("tonight" in this._items.next[e]&&this._items.next[e].tonight){this._items.next[e].tonight="dispo";this._items.next[e].dispoPuce='<img class="floatR" src="/images/tchat/lcesoir.gif"/>'}}d=d+j.evaluate(this._items.next[e]);this._items.current.unshift(this._items.next[e])}else{h.push(this._items.next[e])}}this._items.next=h;$("ajax_contener").update(d+"");new Effect.Appear($("ajax_contener"))},displayPrevious:function(){var d=0;var j=[];var c={prev:"",next:""};var e="",a="";var b=this._items.previous.length;var k=this._items.previous.slice();for(var f=b-1;f>=(b-this._items_per_page);f--){if(!k[f]){continue}if(k[f].id){j.push(k[f].id)}}this._items.current.reverse();this._items.next=this._items.current.concat(this._items.next);this._items.current.clear();for(var f=b-1;f>=(b-this._items_per_page);f--){if(!this._items.previous[f]){continue}d++;
a="";if(d==4){a="bulleBr";d=0}c.next=(k[f-1])?k[f-1].id:"";c.prev=(k[f+1])?k[f+1].id:"";c.users=j;var g=this.getTpl(this._subscriber,a,JSON.stringify(c));var h=new Template(g);if(typeof this._items.previous[f]=="object"){if("online" in this._items.previous[f]){this._items.previous[f].onlinePuce='<span class="onlinePuce"><img src="/images/fiche/puce-'+(this._items.previous[f].online=="online"?"on":"off")+'.gif" /></span>'}if("tonight" in this._items.previous[f]&&this._items.previous[f].tonight){this._items.previous[f].tonight="dispo";this._items.previous[f].dispoPuce='<img class="floatR" src="/images/tchat/lcesoir.gif"/>'}}e=e+h.evaluate(this._items.previous[f]);this._items.current.unshift(this._items.previous[f]);this._items.previous.splice(f)}if(this._pages.next!="null"){var h=new Template('<a href="#page-#{next}" onclick="bulles.pagination (\'#{next}\')">Suivante</a>');$("next").update(h.evaluate(this._pages));new Effect.Appear($("next"))}else{if(this._items.next.length>0){var h=new Template('<a href="#page-1" onclick="bulles.displayExtra ()">Suivante</a>');$("next").update(h.evaluate(this._pages));new Effect.Appear($("next"))}}if(this._items.previous.length==0){$("prev").hide()}$("ajax_contener").update(e+"");new Effect.Appear($("ajax_contener"))},displayCurrent:function(){var c=0;var h=[];var b={prev:"",next:""};var d="",a="";var j=this._items.current.slice();j.reverse();for(var e=0;e<j.length;e++){if(!j[e]){continue}if(j[e].id&&e<this._items_per_page){h.push(j[e].id)}}for(var e=0;e<j.length;e++){if(!j[e]){continue}if(e<this._items_per_page){c++;a="";if(c==4){a="bulleBr";c=0}b.prev=(e>0)?j[e-1].id:"";b.next=(e<j.length-1)?j[e+1].id:"";b.users=h;var f=this.getTpl(this._subscriber,a,JSON.stringify(b));var g=new Template(f);if(typeof j[e]=="object"){if("online" in j[e]){j[e].onlinePuce='<span class="onlinePuce"><img src="/images/fiche/puce-'+(j[e].online=="online"?"on":"off")+'.gif" /></span>'}if("tonight" in j[e]&&j[e].tonight){j[e].tonight="dispo";j[e].dispoPuce='<img class="floatR" src="/images/tchat/lcesoir.gif"/>'
}}d=d+g.evaluate(j[e])}}if(this._items.previous.length>0){var g=new Template('<a href="#page-0" onclick="bulles.displayPrevious ()">Précédente</a>');$("prev").update(g.evaluate());new Effect.Appear($("prev"))}else{$("prev").hide()}if(this._pages.next!="null"&&this._subscriber){var g=new Template('<a href="#page-#{next}" onclick="bulles.pagination (\'#{next}\')">Suivante</a>');$("next").update(g.evaluate(this._pages));new Effect.Appear($("next"))}else{if(this._items.next.length>0){var g=new Template('<a href="#page-1" onclick="bulles.displayExtra ()">Suivante</a>');$("next").update(g.evaluate());new Effect.Appear($("next"))}else{$("next").hide()}}$("ajax_contener").update(d+"");new Effect.Appear($("ajax_contener"))},displayExtra:function(){var c=0;var g=[];var k=[];var b={prev:"",next:""};var d="",a="";this._items.previous=this._items.previous.concat(this._items.current);this._items.current.clear();for(var e=0;e<this._items.next.length;e++){if(!this._items.next[e]){continue}if(this._items.next[e].id&&e<this._items_per_page){k.push(this._items.next[e].id)}}for(var e=0;e<this._items.next.length;e++){if(!this._items.next[e]){continue}if(e<this._items_per_page){c++;a="";if(c==4){a="bulleBr";c=0}b.prev=(e>0)?this._items.next[e-1].id:"";b.next=(e<this._items.next.length-1)?this._items.next[e+1].id:"";b.users=k;var f=this.getTpl(this._subscriber,a,JSON.stringify(b));var h=new Template(f);if(typeof this._items.next[e]=="object"){if("online" in this._items.next[e]){this._items.next[e].onlinePuce='<span class="onlinePuce"><img src="/images/fiche/puce-'+(this._items.next[e].online=="online"?"on":"off")+'.gif" /></span>'}if("tonight" in this._items.next[e]&&this._items.next[e].tonight){this._items.next[e].tonight="dispo";this._items.next[e].dispoPuce='<img class="floatR" src="/images/tchat/lcesoir.gif"/>'}}d=d+h.evaluate(this._items.next[e]);this._items.current.unshift(this._items.next[e])}else{g.push(this._items.next[e])}}this._items.next=g;if(this._items.previous.length>0){var h=new Template('<a href="#page-0" onclick="bulles.displayPrevious ()">Précédente</a>');
$("prev").update(h.evaluate());new Effect.Appear($("prev"))}else{$("prev").hide()}if(this._items.next.length>0){var j=new Template('<a href="#page-0" onclick="bulles.displayExtra ()">Suivante</a>');$("next").update(j.evaluate());new Effect.Appear($("next"))}else{$("next").hide()}$("ajax_contener").update(d+"");new Effect.Appear($("ajax_contener"))},pagination:function(d){if(d==this._page){var c=window.location.hash.match(/page\-([0-9]+)/);if(c){d=c[1]}}var a=0;var b=Form.serializeElements($("trie").getInputs());if(b==""){b="filtres="}this.getUsers(d,b)},filtres:function(a){var b=this;this._items={previous:[],current:[],next:[]};a.request({onSuccess:function(d){var c=d.responseText.evalJSON();window.location.hash="#page-1";b.pagination(1)}})},getUsers:function(c,b,a){new Ajax.Request(this._url+"&do=AJAX_RESPONSE&page="+c,{self:this,parameters:{filtres:b,users:JSON.stringify(a)},onCreate:function(){$("load").show()},onSuccess:function(g){var f=g.responseText.evalJSON();var h=g.request.options.self;h._pages=f.pages;h._more=((f[h._name].users.length+h._items.next.length<f[h._name].items_per_page)&&f.pages.next!="null"&&!h._more&&f.subscriber);if(h._more){return h.getUsers(f.pages.next,g.request.parameters.filters,f[h._name].users)}else{if(g.request.parameters.users){var d=JSON.parse(g.request.parameters.users);f[h._name].users=d.concat(f[h._name].users)}h._more=false}if(f.pages.prev!="null"){var e=new Template('<a href="#page-0" onclick="bulles.displayPrevious ()">Précédente</a>');$("prev").update(e.evaluate());new Effect.Appear($("prev"))}else{$("prev").hide()}if(f.pages.next!="null"&&f.subscriber){var e=new Template('<a href="#page-#{next}" onclick="bulles.pagination (\'#{next}\')">Suivante</a>');$("next").update(e.evaluate(f.pages));new Effect.Appear($("next"))}else{if(f[h._name].users.length+h._items.next.length>f[h._name].items_per_page){var e=new Template('<a href="#page-1" onclick="bulles.displayExtra ()">Suivante</a>');$("next").update(e.evaluate());new Effect.Appear($("next"))
}else{$("next").hide()}}h.bulles(c,f);$("load").hide()}})},});window.Select=Class.create({initialize:function(d,a,b){this.header_=d;this.contents_=a;this.checkboxs_=this.contents_.select("input[type=checkbox]");this.empty_=b;this.expended_=false;var c=this;this.updatePreview();this.checkboxs_.each(function(e){e.observe("click",function(f){if(!e.hasClassName("select-reset")){c.contents_.select(".select-reset").each(function(g){g.checked=false;c.updateOne_(g)});c.updatePreview(e)}});if(e.hasClassName("select-reset")){e.observe("click",function(){c.reset(e)})}});this.contents_.hide()},onCreate:function(){},updatePreview:function(a){if(!a){this.updateAll_()}else{this.updateOne_(a)}this.updateCommas_();if(this.empty_){this.cleanEmpty_();this.checkEmpty_()}},updateCommas_:function(){this.header_.select(".select-comma").each(function(b){b.show()});var a=this.header_.lastChild;if(a&&a.lastChild){a.lastChild.hide()}},checkEmpty_:function(){if(this.header_.innerHTML==""){var a=new Element("span",{"class":"select-empty"});a.innerHTML=this.empty_;this.header_.insert({top:a})}},cleanEmpty_:function(){this.header_.select(".select-empty").each(function(a){a.remove()})},cleanHeader_:function(){this.header_.innerHTML=""},boxClassName_:function(a){return"value-"+a.value},createNode_:function(b){var a=new Element("b",{"class":this.boxClassName_(b)});a.innerHTML=b.nextSiblings()[0].innerHTML+'<span class="select-comma">, </span>';return a},boxExists_:function(a){return this.checkboxs_.select("."+classname).length()>0},addToHeader_:function(a){this.header_.insert({bottom:a})},removeToHeader_:function(a){this.header_.select("."+this.boxClassName_(a)).each(function(b){b.remove()})},updateOne_:function(a){if(a.checked){this.addToHeader_(this.createNode_(a))}else{this.removeToHeader_(a)}},reset:function(a){this.checkboxs_.each(function(c){if(a!=c){c.checked=false}});this.updatePreview()},updateAll_:function(){var b=[];var c=this;var a=0;c.cleanHeader_();this.checkboxs_.each(function(d){if(d.checked){c.addToHeader_(c.createNode_(d))
}})},setExpanded:function(a){var b=this;if(a){b.zippy_(this.contents_,!b.expanded_);b.expanded_=!b.expanded_}else{b.zippy_(this.contents_,a);b.expanded_=a}},zippy_:function(b,a){if(a){neteck.effects.slideDown(b)}else{neteck.effects.slideUp(b)}}});var Autocomplete=function(b,a){this.el=$(b);this.id=this.el.identify();this.el.setAttribute("autocomplete","off");this.suggestions=[];this.data=[];this.badQueries=[];this.selectedIndex=-1;this.currentValue=this.el.value;this.intervalId=0;this.cachedResponse=[];this.instanceId=null;this.onChangeInterval=null;this.ignoreValueChange=false;this.serviceUrl=a.serviceUrl;this.options={autoSubmit:false,minChars:1,maxHeight:300,deferRequestBy:0,width:0,container:null};if(a){Object.extend(this.options,a)}if(Autocomplete.isDomLoaded){this.initialize()}else{Event.observe(document,"dom:loaded",this.initialize.bind(this),false)}};Autocomplete.instances=[];Autocomplete.isDomLoaded=false;Autocomplete.getInstance=function(c){var b=Autocomplete.instances;var a=b.length;while(a--){if(b[a].id===c){return b[a]}}};Autocomplete.highlight=function(b,a){return b.replace(a,function(c){return"<strong>"+c+"</strong>"})};Autocomplete.prototype={killerFn:null,initialize:function(){var a=this;this.killerFn=function(c){if(!$(Event.element(c)).up(".autocomplete")){a.killSuggestions();a.disableKillerFn()}}.bindAsEventListener(this);if(!this.options.width){this.options.width=this.el.getWidth()}var b=new Element("div",{style:"position:fixed;"});b.update('<div class="autocomplete-w1"><div class="autocomplete-w2"><div class="autocomplete" id="Autocomplete_'+this.id+'" style="display:none; width:'+this.options.width+'px;"></div></div></div>');this.options.container=$(this.options.container);if(this.options.container){this.options.container.appendChild(b);this.fixPosition=function(){}}else{document.body.appendChild(b)}this.mainContainerId=b.identify();this.container=$("Autocomplete_"+this.id);this.fixPosition();Event.observe(this.el,window.opera?"keypress":"keydown",this.onKeyPress.bind(this));
Event.observe(this.el,"keyup",this.onKeyUp.bind(this));Event.observe(this.el,"blur",this.enableKillerFn.bind(this));Event.observe(this.el,"focus",this.fixPosition.bind(this));Event.observe(document,"scroll",function(c){a.fixPosition()});this.container.setStyle({maxHeight:this.options.maxHeight+"px"});this.instanceId=Autocomplete.instances.push(this)-1},fixPosition:function(){var a=this.el.viewportOffset();$(this.mainContainerId).setStyle({top:(a.top+this.el.getHeight())+"px",left:a.left+"px"})},enableKillerFn:function(){Event.observe(document.body,"click",this.killerFn)},disableKillerFn:function(){Event.stopObserving(document.body,"click",this.killerFn)},killSuggestions:function(){this.stopKillSuggestions();this.intervalId=window.setInterval(function(){this.hide();this.stopKillSuggestions()}.bind(this),300)},stopKillSuggestions:function(){window.clearInterval(this.intervalId)},onKeyPress:function(a){if(!this.enabled){return}switch(a.keyCode){case Event.KEY_ESC:this.el.value=this.currentValue;this.hide();break;case Event.KEY_TAB:case Event.KEY_RETURN:if(this.selectedIndex===-1){this.hide();return}this.select(this.selectedIndex);if(a.keyCode===Event.KEY_TAB){return}break;case Event.KEY_UP:this.moveUp();break;case Event.KEY_DOWN:this.moveDown();break;default:return}Event.stop(a)},onKeyUp:function(a){switch(a.keyCode){case Event.KEY_UP:case Event.KEY_DOWN:return}clearInterval(this.onChangeInterval);if(this.currentValue!==this.el.value){if(this.options.deferRequestBy>0){this.onChangeInterval=setInterval((function(){this.onValueChange()}).bind(this),this.options.deferRequestBy)}else{this.onValueChange()}}},onValueChange:function(){clearInterval(this.onChangeInterval);this.currentValue=this.el.value;this.selectedIndex=-1;if(this.ignoreValueChange){this.ignoreValueChange=false;return}if(this.currentValue===""||this.currentValue.length<this.options.minChars){this.hide()}else{this.getSuggestions()}},getSuggestions:function(){var a=this.cachedResponse[this.currentValue];if(a&&Object.isArray(a.suggestions)){this.suggestions=a.suggestions;
this.data=a.data;this.suggest()}else{if(!this.isBadQuery(this.currentValue)){new Ajax.Request(this.serviceUrl,{parameters:{query:this.currentValue},onComplete:this.processResponse.bind(this),method:"get"})}}},isBadQuery:function(b){var a=this.badQueries.length;while(a--){if(b.indexOf(this.badQueries[a])===0){return true}}return false},hide:function(){this.enabled=false;this.selectedIndex=-1;this.container.hide()},suggest:function(){if(this.suggestions.length===0){this.hide();return}var b=[];var a=new RegExp("\\b"+this.currentValue.match(/\w+/g).join("|\\b"),"gi");this.suggestions.each(function(d,c){b.push((this.selectedIndex===c?'<div class="selected"':"<div"),' title="',d,'" onclick="Autocomplete.instances[',this.instanceId,"].select(",c,');" onmouseover="Autocomplete.instances[',this.instanceId,"].activate(",c,');">',Autocomplete.highlight(d,a),"</div>")}.bind(this));this.enabled=true;this.container.update(b.join("")).show()},processResponse:function(c){var a;try{a=c.responseText.evalJSON();if(!Object.isArray(a.data)){a.data=[]}}catch(b){return}this.suggestions=a.suggestions;this.data=a.data;this.cachedResponse[a.query]=a;if(a.suggestions.length===0){this.badQueries.push(a.query)}if(a.query===this.currentValue){this.suggest()}},activate:function(a){var b=this.container.childNodes;var c;if(this.selectedIndex!==-1&&b.length>this.selectedIndex){b[this.selectedIndex].className=""}this.selectedIndex=a;if(this.selectedIndex!==-1&&b.length>this.selectedIndex){c=b[this.selectedIndex];c.className="selected"}return c},deactivate:function(b,a){b.className="";if(this.selectedIndex===a){this.selectedIndex=-1}},select:function(b){var a=this.suggestions[b];if(a){this.el.value=a;if(this.options.autoSubmit&&this.el.form){this.el.form.submit()}this.ignoreValueChange=true;this.hide();this.onSelect(b)}},moveUp:function(){if(this.selectedIndex===-1){return}if(this.selectedIndex===0){this.container.childNodes[0].className="";this.selectedIndex=-1;this.el.value=this.currentValue;return}this.adjustScroll(this.selectedIndex-1)
},moveDown:function(){if(this.selectedIndex===(this.suggestions.length-1)){return}this.adjustScroll(this.selectedIndex+1)},adjustScroll:function(b){var a=this.container;var f=this.activate(b);var c=f.offsetTop;var d=a.scrollTop;var e=d+this.options.maxHeight-25;if(c<d){a.scrollTop=c}else{if(c>e){a.scrollTop=c-this.options.maxHeight+25}}this.el.value=this.suggestions[b]},onSelect:function(a){(this.options.onSelect||Prototype.emptyFunction)(this.suggestions[a],this.data[a])}};Event.observe(document,"dom:loaded",function(){Autocomplete.isDomLoaded=true},false);if(typeof(LocationGeocoder)=="undefined"){Element.addMethods({findClosest:function(c,a){var b=function(g){var f=g.next(a);if(!f){var d=g.up();if(d){return b(d)}}return f};return b(c)}});var LocationGeocoder=Class.create({initialize:function(p){if(typeof(Autocomplete)=="undefined"){throw ("Autocomplete is not defined")}var l=$(p);if(!this.serviceUrl){this.serviceUrl="/ajaxv1/Geocoder/search?v=2"}if(l.hasAttribute("data-min-accuracy")){this.serviceUrl+="&frRegionFilter=0&min_accuracy="+l.readAttribute("data-min-accuracy")}var b=false;if(l.hasAttribute("data-only-geodb")){b=l.readAttribute("data-only-geodb")=="true";this.serviceUrl+="&noGMaps=1"}if(l.hasAttribute("data-no-detail")){this.serviceUrl+="&noDataDetail=1"}if(document.location.href.match(/hlLocationGeocoder=1/)){l.style.borderColor="red"}var i=new Element("input",{type:"hidden",value:""});var a=false;l.disabled=false;["id","name"].each(function(q){if(l[q]){i[q]=l[q];l[q]="autocomplete_"+l[q]}});l.insert({after:i});var d=Autocomplete;var m;var f=new Element("img",{src:"/images/ajax-loader.gif"});f.hide();var k;d.prototype.getSuggestions=d.prototype.getSuggestions.wrap(function(q){f.show();k=this.currentValue;a=true;return q()});d.prototype.suggestmore=function(){delete m.cachedResponse[k];m.serviceUrl=o+"&more=1";l.value=k;m.currentValue=k;m.getSuggestions();m.serviceUrl=o};[l,i].invoke("observe","location:reset",function(){i.value="";l.value=""});d.prototype.select=d.prototype.select.wrap(function(q,s){var r=this.suggestions[s];
var t=this.data[s];if(r){if(t=="others"){this.suggestmore();return}else{if(t!="none"){i.value=t;l.value=this.suggestions[s];l.fire("location:select",{data:t,value:this.suggestions[s]})}}this.ignoreValueChange=true;this.hide()}});var n=Class.create({count:0,initialize:function(){this.enabled=false},start:function(s,q,r){this.count=s+1;this.atStep=q;this.atEnd=r;if(!this.enabled){this.enabled=true;this.throttle()}},throttle:function(){this.count-=1;this.atStep(this.count);if(this.count>0){var q=this;this.enabled=true;window.setTimeout(function(){q.throttle()},1000)}else{this.atEnd();this.enabled=false}}});d.prototype.suggest=d.prototype.suggest.wrap(function(q){if(typeof(this.suggestIE6Patched)!="undefined"){this.suggestIE6Patched()}if(this.suggestions.length===0){this.hide();return}var r=this;var t=[];var s=new RegExp("\\b"+this.currentValue.match(/\w+/g).join("|\\b"),"gi");other=false;this.suggestions.each(function(B,w){var A="";var v="";var z="";if(this.suggestions.length<10){if(this.data[w]=="others"){if(!b){if(typeof(r.autoSuggestMoreTimer)=="undefined"){r.autoSuggestMoreTimer=new n()}z=(' (<span id="autosuggesttimer"></span>)');r.autoSuggestMoreTimer.start(8,function(D){if(typeof r.container.select("#autosuggesttimer").first()!="undefined"){r.container.select("#autosuggesttimer").first().update(D+" "+gettext("secondes"));return}},function(){if(m.enabled){m.suggestmore()}})}else{return}}try{var C=unescape(this.data[w]).evalJSON();if(C.latitude){if(C.type=="GMaps"){}if(C.latitude!=null){A=('<br/><img src="http://maps.google.com/maps/api/staticmap?center='+C.latitude+","+C.longitude+"&zoom=10&size=250x100&sensor=false&markers=color:red|color:red|label:A|"+C.latitude+","+C.longitude+'" />')}}}catch(y){}}var u=(this.selectedIndex===w?" selected":"");var x=(w%2==0?"even":"odd");t.push('<div class="',u,'"><div class="item ',x,'"',' title="',B,'" onclick="Autocomplete.instances[',this.instanceId,"].select(",w,');" onmouseover="Autocomplete.instances[',this.instanceId,"].activate(",w,');">',Autocomplete.highlight(B,s),v,A,z,"</div></div>")
}.bind(this));this.enabled=true;this.container.update(t.join("")).show();f.hide()});var j=false;var g=function(){i.value=e;l.value=c};d.prototype.hide=d.prototype.hide.wrap(function(q){q();if(i.value=="none"&&!j){g()}});var h=true;var o=this.serviceUrl;m=new d(l,{serviceUrl:o,minChars:1,maxHeight:400,width:300,deferRequestBy:300});var e;var c;l.observe("focus",function(){e=i.value;c=l.value;i.value="none";l.value="";j=true;if(!m.container.empty()){m.container.show();if(typeof(m.suggestIE6Patched)!="undefined"){m.suggestIE6Patched()}}h=false});l.observe("blur",function(){j=false;if(i.value=="none"&&!m.enabled){g()}});l.addClassName("autocomplete");l.insert({after:f});this._li}});var AjaxGeoCity=Class.create(LocationGeocoder,{initialize:function($super,a){this.serviceUrl="/ajaxv1/Geocoder/searchCity?";$super(a)}});(function(){var a="AjaxGeoCity";var b=function(c){new AjaxGeoCity(c)};if(typeof(AjaxUI)=="undefined"){Event.observe(window,"load",function(){$$("."+a).each(function(c){b(c)})})}else{AjaxUI.subscribe(a,b)}})();(function(){var a="LocationGeocoder";var b=function(c){new LocationGeocoder(c)};if(typeof(AjaxUI)=="undefined"){Event.observe(window,"load",function(){$$("."+a).each(function(c){b(c)})})}else{AjaxUI.subscribe(a,b)}})()}if(typeof(FRDeptSelector)=="undefined"){function similar_text(c,b){function d(k,f,j,e){function g(n,r,m,p){var v=0,t=0,u=0,s,q,o;for(s=0;s<r;++s){for(q=0;q<p;++q){for(o=0;(s+o<r)&&(q+o<p)&&(n.charAt(s+o)==m.charAt(q+o));++o){}if(o>u){u=o;v=s;t=q}}}return{pos1:v,pos2:t,max:u}}var i=g(k,f,j,e);var h=i.max;if(h){if(i.pos1&&i.pos2){h+=d(k,i.pos1,j,i.pos2)}if((i.pos1+i.max<f)&&(i.pos2+i.max<e)){h+=d(k.substr(i.pos1+i.max),f-i.pos1-i.max,j.substr(i.pos2+i.max),e-i.pos2-i.max)}}return h}var a=d(c,c.length,b,b.length);return{similar:a,percent:a*200/(c.length+b.length)}}var FRDeptSelector=Class.create({observe:function(c,a,b){a.each(function(d){Event.observe(c,d,b)})},initialize:function(B){var B=$(B);var s=B;var p=B.select("[id=regions]").first();
var b=B.select("[id=pays]").first();var m=B.select("[id=region]").first();var i=B.select("[id=dept]").first();var x=B.select("[id=villeSelector]").first();var r=" - "+gettext("Choisissez")+" - ";var d=gettext("Chargement...");var f=" - "+gettext("Vide")+" - ";var a=null;var v={pays:"",region:"",dept:""};var n=16;var w=n;var C=new Store("FRDeptSelector");var z=function(e){e.update("");e.insert((new Element("option",{value:""})).update(r));e.value="";e.disabled=false};var o=function(e){z(e);e.disabled=true};var u=function(e){e.disabled=true;e.update("");e.insert((new Element("option",{value:""})).update(d))};var y=function(e){if(e.childElements().size()==1){e.disabled=true;e.update("");e.insert((new Element("option",{value:""})).update(f))}};var g=function(e){u(b);AjaxGeocoder.getSubAreas(AjaxGeocoder.NO_REGION,{onSuccess:function(F){var E=F.responseText.evalJSON();var D=[];z(b);E.items.each(function(H){var G=new Element("option",{value:H.id});if(H.label=="separator"){G.update("-----------------")}else{G.update(H.label)}b.insert(G)});if(e){e()}l()}})};var l=function(){if(typeof(AjaxStorage)!="undefined"){}};var c=function(){u(m);u(i);AjaxGeocoder.getFRData({onSuccess:function(D){var e=D.responseText.evalJSON();a=e.fr_id;z(m);z(i);e.regions.each(function(E){m.insert((new Element("option",{value:E.id})).update(E.label))});e.depts.each(function(E){i.insert((new Element("option",{value:E.id})).update(E.label))});m.fire(":updated");i.fire(":updated");l()}})};var h=false;var k=function(){p.value="";$A([b,m,i]).each(function(D){if(D.value!=""){p.value=D.value}});C.set("pays",b.value);C.set("region",m.value);C.set("dept",i.value);if(x){x.fire("location:reset")}h=true};var q=function(){v.pays=b.value;o(m);o(i);k();if(b.value==""){return}if(b.select("option").toArray()[b.selectedIndex].value==n){c()}else{u(m);u(i);AjaxGeocoder.getDescendantsByAccuracy(b.value,AjaxGeocoder.REGION_ACCURACY,{onSuccess:function(D){var e=D.responseText.evalJSON();z(m);e.items.each(function(F){if(F.oldpays=="0"){return
}if(typeof m.childElements().last()!="undefined"){var E=similar_text(m.childElements().last().innerHTML,F.label);if(E.percent>=95){m.childElements().last().value+=","+F.id;return}}m.insert((new Element("option",{value:F.id})).update(F.label))});y(m);l()}});AjaxGeocoder.getDescendantsByAccuracy(b.value,AjaxGeocoder.SUBREGION_ACCURACY,{onSuccess:function(D){var e=D.responseText.evalJSON();z(i);e.items.each(function(F){if(F.oldpays=="0"){return}if(typeof i.childElements().last()!="undefined"){var E=similar_text(i.childElements().last().innerHTML,F.label);if(E.percent>=95){i.childElements().last().value+=","+F.id;return}}i.insert((new Element("option",{value:F.id})).update(F.label))});y(i);l()}})}};var t=function(){if(b.value==""){b.value=w}i.value="";k()};var A=function(){if(b.value==""){b.value=w}m.value="";k()};this.observe(b,["change","keyup"],q);this.observe(m,["change"],t);this.observe(i,["change"],A);if(!b.empty()){g=function(e){if(e){e()}}}if(C.get("pays")){var j=function(){if(C.get("pays")){if(h){return}var e=C.get("pays");if(e==""){return}b.value=e;if(b.value!=w||m.select("option").size()==1){q()}k()}};g(j)}else{if(m.empty()||i.empty()){c();g()}}if(x){new LocationGeocoder(x);x.observe("location:select",function(e){b.value="";p.value=unescape(e.memo.data);o(m);o(i)})}}});(function(){var a="FRDeptSelector";var b=function(c){new FRDeptSelector(c)};if(typeof(AjaxUI)=="undefined"){Event.observe(window,"load",function(){$$("."+a).each(function(c){b(c)})})}else{AjaxUI.subscribe(a,b)}})()};