var Prototype=window.Prototype?window.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(!window.Prototype){window.Prototype=Prototype;}if(Prototype.Browser.MobileSafari){Prototype.BrowserFeatures.SpecificElementExtensions=false;}
var Abstract={};var Try={these:function(){var returnValue;for(var i=0,length=arguments.length;i<length;i++){var lambda=arguments[i];try{returnValue=lambda();break}catch(e){}}return returnValue}};var Class=(function(){var IS_DONTENUM_BUGGY=(function(){for(var p in {toString:1}){if(p==="toString"){return false}}return true})();function subclass(){}function create(){var parent=null,properties=$A(arguments);if(Object.isFunction(properties[0])){parent=properties.shift()}function klass(){this.initialize.apply(this,arguments)}Object.extend(klass,Class.Methods);klass.superclass=parent;klass.subclasses=[];if(parent){subclass.prototype=parent.prototype;klass.prototype=new subclass;parent.subclasses.push(klass)}for(var i=0,length=properties.length;i<length;i++){klass.addMethods(properties[i])}if(!klass.prototype.initialize){klass.prototype.initialize=Prototype.emptyFunction}klass.prototype.constructor=klass;return klass}function addMethods(source){var ancestor=this.superclass&&this.superclass.prototype,properties=Object.keys(source);if(IS_DONTENUM_BUGGY){if(source.toString!=Object.prototype.toString){properties.push("toString")}if(source.valueOf!=Object.prototype.valueOf){properties.push("valueOf")}}for(var i=0,length=properties.length;i<length;i++){var property=properties[i],value=source[property];if(ancestor&&Object.isFunction(value)&&value.argumentNames()[0]=="$super"){var method=value;value=(function(m){return function(){return ancestor[m].apply(this,arguments)}})(property).wrap(method);value.valueOf=method.valueOf.bind(method);value.toString=method.toString.bind(method)}this.prototype[property]=value}return this}return{create:create,Methods:{addMethods:addMethods}}})();(function(){var _toString=Object.prototype.toString,NULL_TYPE="Null",UNDEFINED_TYPE="Undefined",BOOLEAN_TYPE="Boolean",NUMBER_TYPE="Number",STRING_TYPE="String",OBJECT_TYPE="Object",FUNCTION_CLASS="[object Function]",BOOLEAN_CLASS="[object Boolean]",NUMBER_CLASS="[object Number]",STRING_CLASS="[object String]",ARRAY_CLASS="[object Array]",DATE_CLASS="[object Date]",NATIVE_JSON_STRINGIFY_SUPPORT=window.JSON&&typeof JSON.stringify==="function"&&JSON.stringify(0)==="0"&&typeof JSON.stringify(Prototype.K)==="undefined";function Type(o){switch(o){case null:return NULL_TYPE;case (void 0):return UNDEFINED_TYPE}var type=typeof o;switch(type){case"boolean":return BOOLEAN_TYPE;case"number":return NUMBER_TYPE;case"string":return STRING_TYPE}return OBJECT_TYPE}function extend(destination,source){for(var property in source){destination[property]=source[property]}return destination}function inspect(object){try{if(isUndefined(object)){return"undefined"}if(object===null){return"null"}return object.inspect?object.inspect():String(object)}catch(e){if(e instanceof RangeError){return"..."}throw e}}function toJSON(value){return Str("",{"":value},[])}function Str(key,holder,stack){var value=holder[key],type=typeof value;if(Type(value)===OBJECT_TYPE&&typeof value.toJSON==="function"){value=value.toJSON(key)}var _class=_toString.call(value);switch(_class){case NUMBER_CLASS:case BOOLEAN_CLASS:case STRING_CLASS:value=value.valueOf()}switch(value){case null:return"null";case true:return"true";case false:return"false"}type=typeof value;switch(type){case"string":return value.inspect(true);case"number":return isFinite(value)?String(value):"null";case"object":for(var i=0,length=stack.length;i<length;i++){if(stack[i]===value){throw new TypeError()}}stack.push(value);var partial=[];if(_class===ARRAY_CLASS){for(var i=0,length=value.length;i<length;i++){var str=Str(i,value,stack);partial.push(typeof str==="undefined"?"null":str)}partial="["+partial.join(",")+"]"}else{var keys=Object.keys(value);for(var i=0,length=keys.length;i<length;i++){var key=keys[i],str=Str(key,value,stack);if(typeof str!=="undefined"){partial.push(key.inspect(true)+":"+str)}}partial="{"+partial.join(",")+"}"}stack.pop();return partial}}function stringify(object){return JSON.stringify(object)}function toQueryString(object){return $H(object).toQueryString()}function toHTML(object){return object&&object.toHTML?object.toHTML():String.interpret(object)}function keys(object){if(Type(object)!==OBJECT_TYPE){throw new TypeError()}var results=[];for(var property in object){if(object.hasOwnProperty(property)){results.push(property)}}return results}function values(object){var results=[];for(var property in object){results.push(object[property])}return results}function clone(object){return extend({},object)}function isElement(object){return !!(object&&object.nodeType==1)}function isArray(object){return _toString.call(object)===ARRAY_CLASS}var hasNativeIsArray=(typeof Array.isArray=="function")&&Array.isArray([])&&!Array.isArray({});if(hasNativeIsArray){isArray=Array.isArray}function isHash(object){return object instanceof Hashtable}function isFunction(object){return _toString.call(object)===FUNCTION_CLASS}function isString(object){return _toString.call(object)===STRING_CLASS}function isNumber(object){return _toString.call(object)===NUMBER_CLASS}function isDate(object){return _toString.call(object)===DATE_CLASS}function isUndefined(object){return typeof object==="undefined"}extend(Object,{extend:extend,inspect:inspect,toJSON:NATIVE_JSON_STRINGIFY_SUPPORT?stringify:toJSON,toQueryString:toQueryString,toHTML:toHTML,keys:Object.keys||keys,values:values,clone:clone,isElement:isElement,isArray:isArray,isHash:isHash,isFunction:isFunction,isString:isString,isNumber:isNumber,isDate:isDate,isUndefined:isUndefined})})();Object.extend(Function.prototype,(function(){var slice=Array.prototype.slice;function update(array,args){var arrayLength=array.length,length=args.length;while(length--){array[arrayLength+length]=args[length]}return array}function merge(array,args){array=slice.call(array,0);return update(array,args)}function argumentNames(){var names=this.toString().match(/^[\s\(]*function[^(]*\(([^)]*)\)/)[1].replace(/\/\/.*?[\r\n]|\/\*(?:.|[\r\n])*?\*\//g,"").replace(/\s+/g,"").split(",");return names.length==1&&!names[0]?[]:names}function bind(context){if(arguments.length<2&&Object.isUndefined(arguments[0])){return this}var __method=this,args=slice.call(arguments,1);return function(){var a=merge(args,arguments);return __method.apply(context,a)}}function bindAsEventListener(context){var __method=this,args=slice.call(arguments,1);return function(event){var a=update([event||window.event],args);return __method.apply(context,a)}}function curry(){if(!arguments.length){return this}var __method=this,args=slice.call(arguments,0);return function(){var a=merge(args,arguments);return __method.apply(this,a)}}function delay(timeout){var __method=this,args=slice.call(arguments,1);timeout=timeout*1000;return window.setTimeout(function(){return __method.apply(__method,args)},timeout)}function defer(){var args=update([0.01],arguments);return this.delay.apply(this,args)}function wrap(wrapper){var __method=this;return function(){var a=update([__method.bind(this)],arguments);return wrapper.apply(this,a)}}function methodize(){if(this._methodized){return this._methodized}var __method=this;return this._methodized=function(){var a=update([this],arguments);return __method.apply(null,a)}}return{argumentNames:argumentNames,bind:bind,bindAsEventListener:bindAsEventListener,curry:curry,delay:delay,defer:defer,wrap:wrap,methodize:methodize}})());(function(proto){function toISOString(){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 toJSON(){return this.toISOString()}if(!proto.toISOString){proto.toISOString=toISOString}if(!proto.toJSON){proto.toJSON=toJSON}})(Date.prototype);RegExp.prototype.match=RegExp.prototype.test;RegExp.escape=function(str){return String(str).replace(/([.*+?^=!:${}()|[\]\/\\])/g,"\\$1")};var PeriodicalExecuter=Class.create({initialize:function(callback,frequency){this.callback=callback;this.frequency=frequency;this.currentlyExecuting=false;this.registerCallback()},registerCallback:function(){this.timer=setInterval(this.onTimerEvent.bind(this),this.frequency*1000)},execute:function(){this.callback(this)},stop:function(){if(!this.timer){return }clearInterval(this.timer);this.timer=null},onTimerEvent:function(){if(!this.currentlyExecuting){try{this.currentlyExecuting=true;this.execute();this.currentlyExecuting=false}catch(e){this.currentlyExecuting=false;throw e}}}});Object.extend(String,{interpret:function(value){return value==null?"":String(value)},specialChar:{"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r","\\":"\\\\"}});Object.extend(String.prototype,(function(){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(template,pattern){this.template=template.toString();this.pattern=pattern||Template.Pattern},evaluate:function(object){if(object&&Object.isFunction(object.toTemplateReplacements)){object=object.toTemplateReplacements()}return this.template.gsub(this.pattern,function(match){if(object==null){return(match[1]+"")}var before=match[1]||"";if(before=="\\"){return match[2]}var ctx=object,expr=match[3],pattern=/^([^.[]+|\[((?:.*?[^\\])?)\])(\.|\[|$)/;match=pattern.exec(expr);if(match==null){return before}while(match!=null){var comp=match[1].startsWith("[")?match[2].replace(/\\\\]/g,"]"):match[1];ctx=ctx[comp];if(null==ctx||""==match[3]){break}expr=expr.substring("["==match[3]?match[1].length:match[0].length);match=pattern.exec(expr)}return before+String.interpret(ctx)})}});Template.Pattern=/(^|.|\r|\n)(#\{(.*?)\})/;var $break={};var Enumerable=(function(){function each(iterator,context){var index=0;try{this._each(function(value){iterator.call(context,value,index++)})}catch(e){if(e!=$break){throw e}}return this}function eachSlice(number,iterator,context){var index=-number,slices=[],array=this.toArray();if(number<1){return array}while((index+=number)<array.length){slices.push(array.slice(index,index+number))}return slices.collect(iterator,context)}function all(iterator,context){iterator=iterator||Prototype.K;var result=true;this.each(function(value,index){result=result&&!!iterator.call(context,value,index);if(!result){throw $break}});return result}function any(iterator,context){iterator=iterator||Prototype.K;var result=false;this.each(function(value,index){if(result=!!iterator.call(context,value,index)){throw $break}});return result}function collect(iterator,context){iterator=iterator||Prototype.K;var results=[];this.each(function(value,index){results.push(iterator.call(context,value,index))});return results}function detect(iterator,context){var result;this.each(function(value,index){if(iterator.call(context,value,index)){result=value;throw $break}});return result}function findAll(iterator,context){var results=[];this.each(function(value,index){if(iterator.call(context,value,index)){results.push(value)}});return results}function grep(filter,iterator,context){iterator=iterator||Prototype.K;var results=[];if(Object.isString(filter)){filter=new RegExp(RegExp.escape(filter))}this.each(function(value,index){if(filter.match(value)){results.push(iterator.call(context,value,index))}});return results}function include(object){if(Object.isFunction(this.indexOf)){if(this.indexOf(object)!=-1){return true}}var found=false;this.each(function(value){if(value==object){found=true;throw $break}});return found}function inGroupsOf(number,fillWith){fillWith=Object.isUndefined(fillWith)?null:fillWith;return this.eachSlice(number,function(slice){while(slice.length<number){slice.push(fillWith)}return slice})}function inject(memo,iterator,context){this.each(function(value,index){memo=iterator.call(context,memo,value,index)});return memo}function invoke(method){var args=$A(arguments).slice(1);return this.map(function(value){return value[method].apply(value,args)})}function max(iterator,context){iterator=iterator||Prototype.K;var result;this.each(function(value,index){value=iterator.call(context,value,index);if(result==null||value>=result){result=value}});return result}function min(iterator,context){iterator=iterator||Prototype.K;var result;this.each(function(value,index){value=iterator.call(context,value,index);if(result==null||value<result){result=value}});return result}function partition(iterator,context){iterator=iterator||Prototype.K;var trues=[],falses=[];this.each(function(value,index){(iterator.call(context,value,index)?trues:falses).push(value)});return[trues,falses]}function pluck(property){var results=[];this.each(function(value){results.push(value[property])});return results}function reject(iterator,context){var results=[];this.each(function(value,index){if(!iterator.call(context,value,index)){results.push(value)}});return results}function sortBy(iterator,context){return this.map(function(value,index){return{value:value,criteria:iterator.call(context,value,index)}}).sort(function(left,right){var a=left.criteria,b=right.criteria;return a<b?-1:a>b?1:0}).pluck("value")}function toArray(){return this.map()}function zip(){var iterator=Prototype.K,args=$A(arguments);if(Object.isFunction(args.last())){iterator=args.pop()}var collections=[this].concat(args).map($A);return this.map(function(value,index){return iterator(collections.pluck(index))})}function size(){return this.toArray().length}function inspect(){return"#<Enumerable:"+this.toArray().inspect()+">"}return{each:each,eachSlice:eachSlice,all:all,every:all,any:any,some:any,collect:collect,map:collect,detect:detect,findAll:findAll,select:findAll,filter:findAll,grep:grep,include:include,member:include,inGroupsOf:inGroupsOf,inject:inject,invoke:invoke,max:max,min:min,partition:partition,pluck:pluck,reject:reject,sortBy:sortBy,toArray:toArray,entries:toArray,zip:zip,size:size,inspect:inspect,find:detect}})();function $A(iterable){if(!iterable){return[]}if("toArray" in Object(iterable)){return iterable.toArray()}var length=iterable.length||0,results=new Array(length);while(length--){results[length]=iterable[length]}return results}function $w(string){if(!Object.isString(string)){return[]}string=string.strip();return string?string.split(/\s+/):[]}Array.from=$A;(function(){var arrayProto=Array.prototype,slice=arrayProto.slice,_each=arrayProto.forEach;function each(iterator,context){for(var i=0,length=this.length>>>0;i<length;i++){if(i in this){iterator.call(context,this[i],i,this)}}}if(!_each){_each=each}function clear(){this.length=0;return this}function first(){return this[0]}function last(){return this[this.length-1]}function compact(){return this.select(function(value){return value!=null})}function flatten(){return this.inject([],function(array,value){if(Object.isArray(value)){return array.concat(value.flatten())}array.push(value);return array})}function without(){var values=slice.call(arguments,0);return this.select(function(value){return !values.include(value)})}function reverse(inline){return(inline===false?this.toArray():this)._reverse()}function uniq(sorted){return this.inject([],function(array,value,index){if(0==index||(sorted?array.last()!=value:!array.include(value))){array.push(value)}return array})}function intersect(array){return this.uniq().findAll(function(item){return array.detect(function(value){return item===value})})}function clone(){return slice.call(this,0)}function size(){return this.length}function inspect(){return"["+this.map(Object.inspect).join(", ")+"]"}function indexOf(item,i){i||(i=0);var length=this.length;if(i<0){i=length+i}for(;i<length;i++){if(this[i]===item){return i}}return -1}function lastIndexOf(item,i){i=isNaN(i)?this.length:(i<0?this.length+i:i)+1;var n=this.slice(0,i).reverse().indexOf(item);return(n<0)?n:i-n-1}function concat(){var array=slice.call(this,0),item;for(var i=0,length=arguments.length;i<length;i++){item=arguments[i];if(Object.isArray(item)&&!("callee" in item)){for(var j=0,arrayLength=item.length;j<arrayLength;j++){array.push(item[j])}}else{array.push(item)}}return array}Object.extend(arrayProto,Enumerable);if(!arrayProto._reverse){arrayProto._reverse=arrayProto.reverse}Object.extend(arrayProto,{_each:_each,clear:clear,first:first,last:last,compact:compact,flatten:flatten,without:without,reverse:reverse,uniq:uniq,intersect:intersect,clone:clone,toArray:clone,size:size,inspect:inspect});var CONCAT_ARGUMENTS_BUGGY=(function(){return[].concat(arguments)[0][0]!==1})(1,2);if(CONCAT_ARGUMENTS_BUGGY){arrayProto.concat=concat}if(!arrayProto.indexOf){arrayProto.indexOf=indexOf}if(!arrayProto.lastIndexOf){arrayProto.lastIndexOf=lastIndexOf}})();function $H(object){return new Hashtable(object)}var Hashtable=Class.create(Enumerable,(function(){function initialize(object){this._object=Object.isHash(object)?object.toObject():Object.clone(object)}function _each(iterator){for(var key in this._object){var value=this._object[key],pair=[key,value];pair.key=key;pair.value=value;iterator(pair)}}function set(key,value){return this._object[key]=value}function get(key){if(this._object[key]!==Object.prototype[key]){return this._object[key]}}function unset(key){var value=this._object[key];delete this._object[key];return value}function toObject(){return Object.clone(this._object)}function keys(){return this.pluck("key")}function values(){return this.pluck("value")}function index(value){var match=this.detect(function(pair){return pair.value===value});return match&&match.key}function merge(object){return this.clone().update(object)}function update(object){return new Hashtable(object).inject(this,function(result,pair){result.set(pair.key,pair.value);return result})}function toQueryPair(key,value){if(Object.isUndefined(value)){return key}return key+"="+encodeURIComponent(String.interpret(value))}function toQueryString(){return this.inject([],function(results,pair){var key=encodeURIComponent(pair.key),values=pair.value;if(values&&typeof values=="object"){if(Object.isArray(values)){var queryValues=[];for(var i=0,len=values.length,value;i<len;i++){value=values[i];queryValues.push(toQueryPair(key,value))}return results.concat(queryValues)}}else{results.push(toQueryPair(key,values))}return results}).join("&")}function inspect(){return"#<Hash:{"+this.map(function(pair){return pair.map(Object.inspect).join(": ")}).join(", ")+"}>"}function clone(){return new Hashtable(this)}return{initialize:initialize,_each:_each,set:set,get:get,unset:unset,toObject:toObject,toTemplateReplacements:toObject,keys:keys,values:values,index:index,merge:merge,update:update,toQueryString:toQueryString,inspect:inspect,toJSON:toObject,clone:clone}})());Hashtable.from=$H;Object.extend(Number.prototype,(function(){function toColorPart(){return this.toPaddedString(2,16)}function succ(){return this+1}function times(iterator,context){$R(0,this,true).each(iterator,context);return this}function toPaddedString(length,radix){var string=this.toString(radix||10);return"0".times(length-string.length)+string}function abs(){return Math.abs(this)}function round(){return Math.round(this)}function ceil(){return Math.ceil(this)}function floor(){return Math.floor(this)}return{toColorPart:toColorPart,succ:succ,times:times,toPaddedString:toPaddedString,abs:abs,round:round,ceil:ceil,floor:floor}})());function $R(start,end,exclusive){return new ObjectRange(start,end,exclusive)}var ObjectRange=Class.create(Enumerable,(function(){function initialize(start,end,exclusive){this.start=start;this.end=end;this.exclusive=exclusive}function _each(iterator){var value=this.start;while(this.include(value)){iterator(value);value=value.succ()}}function include(value){if(value<this.start){return false}if(this.exclusive){return value<this.end}return value<=this.end}return{initialize:initialize,_each:_each,include:include}})());
if (!window.Ice) {
    window.Ice = new Object();

Object.methods=function(A){for(property in A){this.prototype[property]=A[property];}};Object.subclass=function(A){var B=function(){this.initialize.apply(this,arguments);};B.methods=this.methods;B.subclass=this.subclass;B.prototype.initialize=Function.NOOP;B.methods(this.prototype);B.prototype.initializeSuperclass=this.prototype.initialize?this.prototype.initialize:Function.NOOP;B.methods(A||{});return B;};
Boolean.prototype.ifTrue=function(A){if(this==true){A();}return this;};Boolean.prototype.ifFalse=function(A){if(this==false){A();}return this;};
Number.prototype.asZeroPrefixedString=function(){return this<9?("0"+this):this.toString();};Date.prototype.toTimestamp=function(){return this.toLocaleTimeString().substr(0,8);};
Object.extend(String.prototype,{asBoolean:function(){return"true"==this||"yes"==this;},asNumber:function(){return this*1;},asElement:function(){return document.getElementById(this);},asExtendedElement:function(){var A=this.asElement();if(!A){throw"cannot find element with id: '"+this+"'";}return Ice.ElementModel.Element.adaptToElement(A);},asRegexp:function(){return new RegExp(this);},contains:function(A){return this.indexOf(A)>=0;},containsWords:function(){return/(\w+)/.test(this);}});
Object.extend(Array.prototype,{eachWithGuard:function(A){this.each(function(B){try{A(B);}catch(C){}});},intersect:function(A){return this.select(function(B){return A.include(B);});},complement:function(A){return this.reject(function(B){return A.include(B);});},isEmpty:function(){return this.length==0;},isNotEmpty:function(){return this.length>0;},as:function(A){A.apply(A,this);},copy:function(){return this.collect(function(A){return A;});},copyFrom:function(E,C){var D=[];var A=E+C;for(var B=E;B<A;B++){D.push(this[B]);}return D;},broadcast:function(){var A=arguments;this.each(function(B){B.apply(B,A);});},broadcaster:function(){return function(){this.broadcast.apply(this,arguments);}.bind(this);},asSet:function(){var A=[];this.each(function(B){if(!A.include(B)){A.push(B);}});return A;}});
Function.prototype.delayFor=function(A){var B=this;return function(){var D=this;var E=arguments;var C=function(){try{B.apply(D,E);}finally{clearInterval(E.id);E.id=null;}};var F=E.id=setInterval(C,A);arguments.callee.cancel=function(){clearInterval(F);E.id=null;};};};Function.prototype.delayExecutionFor=function(A){var B=this.delayFor(A);B.apply();return B;};Function.prototype.repeatEvery=function(A){var B=this;return function(){var D=this;var E=arguments;var C=function(){B.apply(D,E);};var F=setInterval(C,A);arguments.callee.cancel=function(){clearInterval(F);};};};Function.prototype.repeatExecutionEvery=function(A){var B=this.repeatEvery(A);B.apply(this);return B;};Function.NOOP=function(){};
window.width=function(){return window.innerWidth?window.innerWidth:(document.documentElement&&document.documentElement.clientWidth)?document.documentElement.clientWidth:document.body.clientWidth;};window.height=function(){return window.innerHeight?window.innerHeight:(document.documentElement&&document.documentElement.clientHeight)?document.documentElement.clientHeight:document.body.clientHeight;};["onLoad","onUnload","onBeforeUnload","onResize","onScroll"].each(function(A){if(!window[A]){window[A]=function(D){var B=A.toLowerCase();var E=window[B];var C=E?[E,D]:[D];window[B]=C.broadcaster();window[A]=function(F){if(!C.detect(function(G){return G.toString()==F.toString();})){C.push(F);}};};}});if(typeof OpenAjax!="undefined"){if(typeof OpenAjax.addOnLoad!="undefined"){var current=window.onLoad;window.onLoad=OpenAjax.addOnLoad;OpenAjax.addOnLoad(current);}if(typeof OpenAjax.addOnUnLoad!="undefined"){var current=window.onUnload;window.onUnload=OpenAjax.addOnUnLoad;OpenAjax.addOnLoad(current);}}window.onKeyPress=function(A){var B=document.onkeypress;document.onkeypress=B?function(C){A(Ice.EventModel.Event.adaptToEvent(C));B(C);}:function(C){A(Ice.EventModel.Event.adaptToKeyEvent(C));};};window.onKeyUp=function(A){var B=document.onkeyup;document.onkeyup=B?function(C){A(Ice.EventModel.Event.adaptToEvent(C));B(C);}:function(C){A(Ice.EventModel.Event.adaptToKeyEvent(C));};};window.onUnload(function(){document.onkeypress=null;document.onKeyPress=null;document.onkeyup=null;document.onKeyUp=null;window.width=null;window.height=null;window.onresize=null;window.onResize=null;window.onscroll=null;window.onScroll=null;window.onbeforeunload=null;window.onBeforeUnload=null;window.onunload=null;window.onUnload=null;window.onload=null;window.onLoad=null;});
[Ice].as(function(A){A.Enumerator=Object.subclass({initialize:function(B){this.indexedObject=B;},_each:function(C){var D=this.indexedObject.length;for(var B=0;B<D;B++){C(this.indexedObject[B],B);}},reverse:function(){return new A.ReverseEnumerator(this.indexedObject);}});A.Enumerator.methods(Enumerable);A.ReverseEnumerator=A.Enumerator.subclass({_each:function(C){var D=this.indexedObject.length-1;for(var B=D;B>=0;B--){C(this.indexedObject[B],B);}},reverse:function(){return new A.Enumerator(this.indexedObject);}});window.$enumerate=function(B){return new A.Enumerator(B);};});
[Ice.Log=new Object].as(function(A){A.Priority=Object.subclass({debug:function(C,E,D,B){C.debug(E,D,B);},info:function(C,E,D,B){C.info(E,D,B);},warn:function(C,E,D,B){C.warn(E,D,B);},error:function(C,E,D,B){C.error(E,D,B);}});A.Debug=A.Priority.subclass({asString:function(){return"Debug";}});A.Info=A.Debug.subclass({debug:Function.NOOP,asString:function(){return"Info";}});A.Warn=A.Info.subclass({info:Function.NOOP,asString:function(){return"Warn";}});A.Error=A.Warn.subclass({warn:Function.NOOP,asString:function(){return"Error";}});A.Priority.DEBUG=new A.Debug;A.Priority.INFO=new A.Info;A.Priority.WARN=new A.Warn;A.Priority.ERROR=new A.Error;A.Priority.Levels=[A.Priority.DEBUG,A.Priority.INFO,A.Priority.WARN,A.Priority.ERROR];A.Logger=Object.subclass({initialize:function(D,C,B){this.handler=C||{debug:Function.NOOP,info:Function.NOOP,warn:Function.NOOP,error:Function.NOOP};this.category=D;this.children=[];this.priority=B||A.Priority.ERROR;},debug:function(C,B){this.priority.debug(this.handler,this.category,C,B);},info:function(C,B){this.priority.info(this.handler,this.category,C,B);},warn:function(C,B){this.priority.warn(this.handler,this.category,C,B);},error:function(C,B){this.priority.error(this.handler,this.category,C,B);},child:function(C){var B=this.category.copy();B.push(C);var D=new A.Logger(B,this.handler,this.priority);this.children.push(D);return D;},threshold:function(B){this.priority=B;this.children.each(function(C){C.threshold(B);});},handleWith:function(B){this.handler=B;}});A.WindowLogHandler=Object.subclass({initialize:function(D,B,C){this.lineOptions=[25,50,100,200,400];this.logger=D;this.logger.handleWith(this);this.lines=B||this.lineOptions[3];this.thresholdPriority=C||A.Priority.DEBUG;this.categoryMatcher=/.*/;this.closeOnExit=true;this.toggle();window.onKeyUp(function(F){var E=F.keyCode();if((E==20||E==84)&&(F.isCtrlPressed()||F.isAltPressed())&&F.isShiftPressed()){this.enable();}}.bind(this));window.onUnload(function(){window.logger.info("page unloaded!");this.disable();}.bind(this));},enable:function(){try{this.window=window.open("","log"+window.identifier,"scrollbars=1,width=800,height=680");var D=this.window.document;this.log=this.window.document.getElementById("log-window");this.toggle();if(this.log){return ;}D.body.appendChild(D.createTextNode(" Close on exit "));var I=D.createElement("input");I.style.margin="2px";I.setAttribute("type","checkbox");I.defaultChecked=true;I.checked=true;I.onclick=function(){this.closeOnExit=I.checked;}.bind(this);D.body.appendChild(I);D.body.appendChild(D.createTextNode(" Lines "));var C=D.createElement("select");C.style.margin="2px";this.lineOptions.each(function(L,J){var K=C.appendChild(D.createElement("option"));if(this.lines==L){C.selectedIndex=J;}K.appendChild(D.createTextNode(L.toString()));}.bind(this));C.onchange=function(J){this.lines=this.lineOptions[C.selectedIndex];this.clearPreviousEvents();}.bind(this);D.body.appendChild(C);D.body.appendChild(D.createTextNode(" Category "));var H=D.createElement("input");H.style.margin="2px";H.setAttribute("type","text");H.setAttribute("value",this.categoryMatcher.source);H.onchange=function(){this.categoryMatcher=H.value.asRegexp();}.bind(this);D.body.appendChild(H);D.body.appendChild(D.createTextNode(" Level "));var B=D.createElement("select");B.style.margin="2px";A.Priority.Levels.each(function(K,J){var L=B.appendChild(D.createElement("option"));if(this.thresholdPriority==K){B.selectedIndex=J;}L.appendChild(D.createTextNode(K.asString()));}.bind(this));this.logger.threshold(this.thresholdPriority);B.onchange=function(J){this.thresholdPriority=A.Priority.Levels[B.selectedIndex];this.logger.threshold(this.thresholdPriority);}.bind(this);D.body.appendChild(B);var F=D.createElement("input");F.style.margin="2px";F.setAttribute("type","button");F.setAttribute("value","Stop");F.onclick=function(){F.setAttribute("value",this.toggle()?"Stop":"Start");}.bind(this);D.body.appendChild(F);var G=D.createElement("input");G.style.margin="2px";G.setAttribute("type","button");G.setAttribute("value","Clear");G.onclick=function(){this.clearAllEvents();}.bind(this);D.body.appendChild(G);this.log=D.body.appendChild(D.createElement("pre"));this.log.id="log-window";this.log.style.width="100%";this.log.style.minHeight="0";this.log.style.maxHeight="550px";this.log.style.borderWidth="1px";this.log.style.borderStyle="solid";this.log.style.borderColor="#999";this.log.style.backgroundColor="#ddd";this.log.style.overflow="scroll";this.window.onunload=function(){this.disable();}.bind(this);}catch(E){this.disable();}},disable:function(){this.logger.threshold(A.Priority.ERROR);this.handle=Function.NOOP;if(this.closeOnExit&&this.window){this.window.close();}this.window=null;},toggle:function(){if(this.handle==Function.NOOP){delete this.handle;return true;}else{this.handle=Function.NOOP;return false;}},debug:function(D,C,B){this.handle("#333","debug",D,C,B);},info:function(D,C,B){this.handle("green","info",D,C,B);},warn:function(D,C,B){this.handle("orange","warn",D,C,B);},error:function(D,C,B){this.handle("red","error",D,C,B);},handle:function(I,E,B,J,C){try{if(this.categoryMatcher.test(B.join("."))){var F=this.log.ownerDocument;var H=(new Date()).toTimestamp();var D=B.join(".");("["+D+"] : "+J+(C?("\n[ "+C.name+" ] "+C.message):"")).split("\n").each(function(K){if(K.containsWords()){var L=F.createElement("div");L.style.padding="3px";L.style.color=I;L.setAttribute("title",H+" | "+E);this.log.appendChild(L).appendChild(F.createTextNode(K));}}.bind(this));this.log.scrollTop=this.log.scrollHeight;}this.clearPreviousEvents();}catch(G){this.disable();}},clearPreviousEvents:function(){var B=$A(this.log.childNodes);B.copyFrom(0,B.length-this.lines).each(function(C){this.log.removeChild(C);}.bind(this));},clearAllEvents:function(){$A(this.log.childNodes).each(function(B){this.log.removeChild(B);}.bind(this));}});A.NOOPConsole={debug:Function.NOOP,info:Function.NOOP,warn:Function.NOOP,error:Function.NOOP};A.FirebugLogHandler=Object.subclass({initialize:function(B){B.handleWith(this);this.logger=B;this.console=A.NOOPConsole;this.enable();},enable:function(){this.console=window.console;this.logger.threshold(A.Priority.DEBUG);this.logger.warn("Firebug (version < 1.2) logging can cause increased memory consumption when running for a long period of time!");},disable:function(){this.console=A.NOOPConsole;this.logger.threshold(A.Priority.ERROR);},toggle:Function.NOOP,debug:function(D,C,B){B?this.console.debug(this.format(D,C),B):this.console.debug(this.format(D,C));},info:function(D,C,B){B?this.console.info(this.format(D,C),B):this.console.info(this.format(D,C));},warn:function(D,C,B){B?this.console.warn(this.format(D,C),B):this.console.warn(this.format(D,C));},error:function(D,C,B){B?this.console.error(this.format(D,C),B):this.console.error(this.format(D,C));},format:function(C,B){return"["+C.join(".")+"] "+B;}});});
[Ice.Ajax=new Object].as(function(A){A.Client=Object.subclass({initialize:function(B){this.logger=B;this.cookies=new Object;document.cookie.split("; ").each(function(E){var D=E.split("=");this.cookies[D.first()]=D.last();}.bind(this));try{if(window.createRequest){this.createRequest=function(){var D=new A.RequestProxy(window.createRequest(),this.logger);D.post=function(E,H,F,G){this.get(E,H,F,G);};return D;}.bind(this);}else{if(window.XMLHttpRequest){this.createRequest=function(){return new A.RequestProxy(new XMLHttpRequest(),this.logger);}.bind(this);}else{if(window.ActiveXObject){this.createRequest=function(){return new A.RequestProxy(new ActiveXObject("Microsoft.XMLHTTP"),this.logger);}.bind(this);}}}}catch(C){this.logger.error("failed to create factory request",C);}},getAsynchronously:function(D,B,C){return this.createRequest().getAsynchronously(D,B,C);},getSynchronously:function(D,B,C){return this.createRequest().getSynchronously(D,B,C);},postAsynchronously:function(D,B,C){return this.createRequest().postAsynchronously(D,B,C);},postSynchronously:function(D,B,C){return this.createRequest().postSynchronously(D,B,C);}});A.RequestProxy=Object.subclass({initialize:function(D,C){this.identifier=+Math.random().toString().substr(2,7);this.request=D;this.logger=C;this.callbacks=[];var B=this;this.responseCallback=function(){if(D.readyState==4){B.logger.debug("["+B.identifier+"] : receive ["+B.statusCode()+"] "+B.statusText());var F=B.callbacks.length;for(var E=0;E<F;E++){try{B.callbacks[E](B);}catch(G){C.warn("connection closed prematurely",G);B.close();}}}};},statusCode:function(){try{return this.request.status;}catch(B){return 0;}},statusText:function(){try{return this.request.statusText;}catch(B){return"";}},on:function(C,B){this.callbacks.push(function(D){if(C(D)){B(D);}});},isServerError:function(){try{return this.request.status==500;}catch(B){return false;}},isEmpty:function(){try{return this.request.responseText=="";}catch(B){return true;}},isMatchingResponse:function(B){return B==this;},getAsynchronously:function(D,B,C){this.request.open("GET",D+"?"+B+"&rand="+Math.random(),true);if(C){C(this);}this.request.onreadystatechange=this.responseCallback;this.logger.debug("["+this.identifier+"] : send asynchronous GET");this.request.send("");return this;},postAsynchronously:function(D,B,C){this.request.open("POST",D,true);if(C){C(this);}this.request.onreadystatechange=this.responseCallback;this.logger.debug("["+this.identifier+"] : send asynchronous POST");this.request.send(B+"&rand="+Math.random()+"\n\n");return this;},getSynchronously:function(D,B,C){this.request.open("GET",D+"?"+B+"&rand="+Math.random(),false);if(C){C(this);}this.logger.debug("["+this.identifier+"] : send synchronous GET");this.request.send("");this.responseCallback();return this;},postSynchronously:function(D,B,C){this.request.open("POST",D,false);if(C){C(this);}this.logger.debug("["+this.identifier+"] : send synchronous POST");this.request.send(B+"&rand="+Math.random()+"\n\n");this.responseCallback();return this;},eachResponseHeader:function(C){var B=this.request.getAllResponseHeaders();var D=B.split("\n");D.each(function(H){var E=H.split(":");var F=E[0].trim();var G=E[1];C(F,G?G.trim():"");});},setRequestHeader:function(B,C){this.request.setRequestHeader(B,C);},getResponseHeader:function(B){try{return this.request.getResponseHeader(B);}catch(C){return null;}},containsResponseHeader:function(B){try{var D=this.request.getResponseHeader(B);return D&&D!="";}catch(C){return false;}},content:function(){try{return this.request.responseText;}catch(B){return"";}},contentAsDOM:function(){return this.request.responseXML;},abort:function(){if(this.request){try{this.request.onreadystatechange=Function.NOOP;this.request.abort();}catch(B){}finally{this.request=null;this.logger.debug("["+this.identifier+"] : connection aborted");}}},close:function(){if(this.request){try{this.request.onreadystatechange=Function.NOOP;}catch(B){}finally{this.request=null;this.logger.debug("["+this.identifier+"] : connection closed");}}}});});
[Ice.Parameter=new Object].as(function(A){A.Query=Object.subclass({initialize:function(){this.parameters=[];},add:function(B,C){this.parameters.push(new A.Association(B,C));return this;},addParameter:function(B){this.parameters.push(B);return this;},addQuery:function(B){B.serializeOn(this);return this;},asURIEncodedString:function(){var B=[];for(var C=0,D=this.parameters.length;C<D;C++){B.push(this.parameters[C].asURIEncodedString());}return B.join("&");},asString:function(){var C=25;var B=[];var F=this.parameters.length;var D=F>C;F=F<C?F:C;for(var E=0;E<F;E++){B.push("| "+this.parameters[E].asString()+" |");}return B.join("\n")+(D?"\n......\n......":"");},sendOn:function(C,B){C.send(this,B);},serializeOn:function(B){this.parameters.each(function(C){B.addParameter(C);});}});A.Query.create=function(C){var B=new A.Query;C.apply(this,[B]);return B;};A.Association=Object.subclass({initialize:function(B,C){this.name=B;this.value=C;},asURIEncodedString:function(){return encodeURIComponent(this.name)+"="+encodeURIComponent(this.value);},asString:function(){return this.name+"="+this.value;},serializeOn:function(B){B.add(this.name,this.value);}});});
[Ice.Geometry=new Object].as(function(A){A.Point=Object.subclass({initialize:function(B,C){this.x=B;this.y=C;},asString:function(){return"point ["+this.x+", "+this.y+"]";},toString:function(){return this.asString();},serializeOn:function(B){B.add("ice.event.x",this.x);B.add("ice.event.y",this.y);}});});
[Ice.ElementModel=new Object].as(function(This){This.TemporaryContainer=function(){var container=document.body.appendChild(document.createElement("div"));container.style.visibility="hidden";container.style.display="none";This.TemporaryContainer=function(){return container;};return container;};This.Update=Object.subclass({initialize:function(element){this.element=element;var tag=element.getAttribute("tag");this.startTag=function(html){html.push("<");html.push(tag);this.eachAttribute(function(name,value){html.push(" ");html.push(name);html.push('="');html.push(value);html.push('"');});html.push(">");};this.endTag=function(html){html.push("</");html.push(tag);html.push(">");};},eachAttribute:function(iterator){$enumerate(this.element.getElementsByTagName("attribute")).each(function(attribute){var value=attribute.firstChild?attribute.firstChild.data:"";iterator(attribute.getAttribute("name"),value);});},content:function(){var contentElement=this.element.getElementsByTagName("content")[0];return contentElement.firstChild?contentElement.firstChild.data.replace(/<\!\#cdata\#/g,"<![CDATA[").replace(/\#\#>/g,"]]>"):"";},asHTML:function(){var html=[];this.startTag(html);html.push(this.content());this.endTag(html);return html.join("");},asString:function(){var html=[];this.startTag(html);html.push("...");this.endTag(html);return html.join("");}});This.Element=Object.subclass({MouseListenerNames:["onClick","onDblClick","onMouseDown","onMouseMove","onMouseOut","onMouseOver","onMouseUp"],KeyListenerNames:["onKeyDown","onKeyPress","onKeyUp","onHelp"],initialize:function(element){this.element=element;},id:function(){return this.element.id;},isSubmit:function(){return false;},form:function(){var parent=this.element.parentNode;while(parent){if(parent.tagName&&parent.tagName.toLowerCase()=="form"){return This.Element.adaptToElement(parent);}parent=parent.parentNode;}throw"Cannot find enclosing form.";},updateDOM:function(update,optimizedJSListenerCleanup){this.replaceHtml(update.asHTML(),optimizedJSListenerCleanup);},replaceHtml:function(html,optimizedJSListenerCleanup){this.withTemporaryContainer(function(container){container.innerHTML=html;var newElement=container.firstChild;this.disconnectEventListeners(optimizedJSListenerCleanup);this.replaceHostElementWith(newElement);});},disconnectEventListeners:function(optimizedJSListenerCleanup){if(this.element.bridge){this.element.bridge.dispose();}var elements=this.element.getElementsByTagName("*");var length=elements.length;if(optimizedJSListenerCleanup){for(var i=0;i<length;i++){var element=elements[i];element.onkeypress=null;element.onmousedown=null;element.onmousemove=null;element.onmouseout=null;element.onmouseover=null;element.onclick=null;element.oncontextmenu=null;element.onchange=null;element.onfocus=null;element.onblur=null;}}else{for(var i=0;i<length;i++){var element=elements[i];$element(element).eachListenerName(function(listenerName){element[listenerName.toLowerCase()]=null;});}}},serializeOn:function(query){},sendOn:function(connection){Query.create(function(query){this.serializeOn(query);}.bind(this)).sendOn(connection);},send:function(){this.sendOn(connection);},withTemporaryContainer:function(execute){try{execute.apply(this,[This.TemporaryContainer()]);}finally{This.TemporaryContainer().innerHTML="";}},defaultReplaceHostElementWith:function(newElement){this.displayOff();this.element.parentNode.replaceChild(newElement,this.element);this.element=newElement;},replaceHostElementWith:function(newElement){this.defaultReplaceHostElementWith(newElement);},displayOff:/Safari/.test(navigator.userAgent)?Function.NOOP:function(){this.element.style.display="none";},eachListenerName:function(iterator){this.MouseListenerNames.each(iterator);this.KeyListenerNames.each(iterator);},findBridge:function(){return this.findContainerFor("bridge").bridge;},findConnection:function(){return this.findBridge().connection;},findContainerFor:function(property){var parent=this.element;while(parent){if(parent[property]){return parent;}else{parent=parent.parentNode;}}throw"couldn't find container for property: "+property;}});This.Element.adaptToElement=function(e){if(!e){return new This.Element(e);}switch(e.tagName.toLowerCase()){case"textarea":case"input":return new This.InputElement(e);case"thead":case"tfoot":case"tbody":case"th":case"td":case"tr":return new This.TableCellElement(e);case"button":return new This.ButtonElement(e);case"select":return new This.SelectElement(e);case"form":return new This.FormElement(e);case"body":return new This.BodyElement(e);case"script":return new This.ScriptElement(e);case"title":return new This.TitleElement(e);case"a":return new This.AnchorElement(e);case"iframe":return new This.IFrameElement(e);default:return new This.Element(e);}};This.ElementStyleProperties=["background","backgroundAttachment","backgroundColor","backgroundImage","backgroundPosition","backgroundRepeat","border","borderBottom","borderBottomColor","borderBottomStyle","borderBottomWidth","borderColor","borderLeft","borderLeftColor","borderLeftStyle","borderLeftWidth","borderRight","borderRightColor","borderRightStyle","borderRightWidth","borderStyle","borderTop","borderTopColor","borderTopStyle","borderTopWidth","borderWidth","clear","clip","color","cursor","display","filter","font","fontFamily","fontSize","fontVariant","fontWeight","height","left","letterSpacing","lineHeight","listStyle","listStyleImage","listStylePosition","listStyleType","margin","marginBottom","marginLeft","marginRight","marginTop","overflow","padding","paddingBottom","paddingLeft","paddingRight","paddingTop","pageBreakAfter","pageBreakBefore","position","styleFloat","textAlign","textDecoration","textDecorationBlink","textDecorationLineThrough","textDecorationNone","textDecorationOverline","textDecorationUnderline","textIndent","textTransform","top","verticalAlign","visibility","width","zIndex"];This.InputElementAttributes=["className","title","lang","name","value","checked","disabled","readOnly","size","maxLength","src","alt","useMap","isMap","tabIndex","accessKey","accept"];This.InputElement=This.Element.subclass({InputListenerNames:["onBlur","onFocus","onChange"],initialize:function(element){this.element=element;var type=element.type.toLowerCase();this.isSubmitElement=type=="submit"||type=="image"||type=="button";},isSubmit:function(){return this.isSubmitElement;},form:function(){return This.Element.adaptToElement(this.element.form);},focus:function(){var onFocusListener=this.element.onfocus;this.element.onfocus=Function.NOOP;this.element.focus();this.element.onfocus=onFocusListener;},replaceHostElementWith:function(newElement){This.InputElementAttributes.each(function(attributeName){var newValue=newElement[attributeName];var oldValue=this.element[attributeName];if(oldValue!=newValue){this.element[attributeName]=newValue;}}.bind(this));var newStyle=newElement.getAttribute("style");var oldStyle=this.element.getAttribute("style");var elementStyle=this.element.style;var newElementStyle=newElement.style;if(newStyle!=oldStyle){this.element.setAttribute("style",newStyle);This.ElementStyleProperties.each(function(p){if(Prototype.Browser.IE&&p==="font"&&!newElementStyle[p]){}else{elementStyle[p]=newElementStyle[p];}});}this.eachListenerName(function(listenerName){var name=listenerName.toLowerCase();this.element[name]=newElement[name]?newElement[name].bind(this.element):null;newElement[name]=null;}.bind(this));},serializeOn:function(query){switch(this.element.type.toLowerCase()){case"image":case"textarea":case"submit":case"hidden":case"password":case"text":query.add(this.element.name,this.element.value);break;case"checkbox":case"radio":if(this.element.checked){query.add(this.element.name,this.element.value||"on");}break;}},eachListenerName:function(iterator){this.MouseListenerNames.each(iterator);this.KeyListenerNames.each(iterator);this.InputListenerNames.each(iterator);}});This.SelectElement=This.InputElement.subclass({isSubmit:function(){return false;},replaceHostElementWith:function(newElement){this.defaultReplaceHostElementWith(newElement);},serializeOn:function(query){$enumerate(this.element.options).select(function(option){return option.selected;}).each(function(selectedOption){var value=selectedOption.value||(selectedOption.value==""?"":selectedOption.text);query.add(this.element.name,value);}.bind(this));}});This.ButtonElement=This.InputElement.subclass({initialize:function(element){this.element=element;this.isSubmitElement=element.type.toLowerCase()=="submit";},isSubmit:function(){return this.isSubmitElement;},replaceHostElementWith:function(newElement){this.defaultReplaceHostElementWith(newElement);},serializeOn:function(query){query.add(this.element.name,this.element.value);}});This.FormElement=This.Element.subclass({FormListenerNames:["onReset","onSubmit","submit"],FormAttributeNames:["acceptcharset","action","enctype","method","name","target"],detectDefaultSubmit:function(){var formElements=this.element.elements;var length=formElements.length;var defaultID=this.element.id+":default";for(var i=0;i<length;i++){var formElement=formElements[i];if(formElement.id==defaultID){return This.Element.adaptToElement(formElement);}}return null;},eachFormElement:/Safari/.test(navigator.userAgent)?function(iterator){var newestElements=[];$enumerate(this.element.elements).reverse().each(function(element){if(!newestElements.detect(function(newestElement){return element.id&&newestElement.id&&newestElement.id==element.id;})){newestElements.push(element);iterator(This.Element.adaptToElement(element));}});}:function(iterator){$enumerate(this.element.elements).each(function(e){iterator(This.Element.adaptToElement(e));});},captureOnSubmit:function(){var previousOnSubmit=this.element.onsubmit;this.element.onsubmit=function(event){if(previousOnSubmit){previousOnSubmit();}$event(event).cancelDefaultAction();iceSubmit(this,null,event);};},redirectSubmit:function(){this.element.submit=function(){iceSubmit(this,null,null);};},captureAndRedirectSubmit:function(){this.captureOnSubmit();this.redirectSubmit();},updateDOM:function(update,optimizedJSListenerCleanup){this.disconnectEventListeners(optimizedJSListenerCleanup);this.element.innerHTML=update.content();var remove=function(name){this.element[name]=null;}.bind(this);this.FormAttributeNames.each(function(name){this.element.removeAttribute(name);}.bind(this));this.eachListenerName(remove);update.eachAttribute(function(name,value){try{this.element.setAttribute(name,value);}catch(e){logger.error("failed to set attribute "+name+":"+value,e);}}.bind(this));},serializeOn:function(query){this.eachFormElement(function(formElement){if(!formElement.isSubmit()){formElement.serializeOn(query);}});},eachListenerName:function(iterator){this.MouseListenerNames.each(iterator);this.KeyListenerNames.each(iterator);this.FormListenerNames.each(iterator);},submit:function(){iceSubmit(this.element,null,null);}});This.BodyElement=This.Element.subclass({replaceHtml:function(html,optimizedJSListenerCleanup){this.disconnectEventListeners(optimizedJSListenerCleanup);var start=new RegExp("<noscript>","g").exec(html);if(start==null){this.element.innerHTML=html;}else{var end=new RegExp("</noscript>","g").exec(html);this.element.innerHTML=html.substring(0,start.index)+html.substring(end.index+11,html.length);}}});This.ScriptElement=This.Element.subclass({updateDOM:function(update,optimizedJSListenerCleanup){var scriptCode=update.content();if(scriptCode!=""&&scriptCode!=";"){var evalFunc=function(){eval(scriptCode);};evalFunc.apply(window);}}});This.TitleElement=This.Element.subclass({updateDOM:function(update,optimizedJSListenerCleanup){this.element.ownerDocument.title=update.content();}});This.AnchorElement=This.Element.subclass({isSubmit:function(){return true;},focus:function(){var onFocusListener=this.element.onfocus;this.element.onfocus=Function.NOOP;this.element.focus();this.element.onfocus=onFocusListener;},serializeOn:function(query){if(this.element.name){query.add(this.element.name,this.element.name);}}});This.TableCellElement=This.Element.subclass({replaceHtml:function(html,optimizedJSListenerCleanup){this.withTemporaryContainer(function(container){container.innerHTML="<TABLE>"+html+"</TABLE>";var newElement=container.firstChild;while((null!=newElement)&&(this.element.id!=newElement.id)){newElement=newElement.firstChild;}this.disconnectEventListeners(optimizedJSListenerCleanup);this.replaceHostElementWith(newElement);});}});This.IFrameElement=This.Element.subclass({replaceHostElementWith:function(newElement){this.eachAttributeName(function(attributeName){var value=newElement.getAttribute(attributeName);if(value==null){this.element.removeAttribute(attributeName);}else{this.element.setAttribute(attributeName,value);}}.bind(this));var oldLocation=this.element.contentWindow.location.href;var newLocation=newElement.src;if(oldLocation!=newLocation){this.element.contentWindow.location=newLocation;}this.eachListenerName(function(listenerName){var name=listenerName.toLowerCase();this.element[name]=newElement[name]?newElement[name].bind(this.element):null;newElement[name]=null;}.bind(this));},eachAttributeName:function(iterator){["title","lang","dir","class","style","align","frameborder","width","height","hspace","ismap","longdesc","marginwidth","marginheight","name","scrolling"].each(iterator);}});window.$element=This.Element.adaptToElement;});
[Ice.EventModel=new Object,Ice.ElementModel.Element,Ice.Parameter.Query,Ice.Geometry].as(function(E,B,A,G){E.IE=new Object;E.Netscape=new Object;E.Event=Object.subclass({initialize:function(I,H){this.event=I;this.currentElement=H;},cancel:function(){this.cancelBubbling();this.cancelDefaultAction();},isKeyEvent:function(){return false;},isMouseEvent:function(){return false;},type:function(){return this.event.type;},captured:function(){return this.currentElement?B.adaptToElement(this.currentElement):null;},serializeEventOn:function(H){H.add("ice.event.target",this.target()&&this.target().id());H.add("ice.event.captured",this.captured()&&this.captured().id());H.add("ice.event.type","on"+this.event.type);},serializeOn:function(H){this.serializeEventOn(H);},sendOn:function(H){A.create(function(I){I.add("ice.submit.partial",false);try{this.captured().serializeOn(I);this.serializeOn(I);}catch(J){this.serializeOn(I);}}.bind(this)).sendOn(H);},sendFullOn:function(H){A.create(function(I){I.add("ice.submit.partial",false);try{this.captured().serializeOn(I);this.form().serializeOn(I);this.serializeOn(I);}catch(J){this.serializeOn(I);}}.bind(this)).sendOn(H);},sendWithCondition:function(H){if(H(this)){this.send();}},send:function(){this.cancel();this.sendOn(this.captured().findConnection());},sendFull:function(){this.cancel();this.sendFullOn(this.captured().findConnection());}});E.IE.Event=E.Event.subclass({target:function(){return this.event.srcElement?B.adaptToElement(this.event.srcElement):null;},cancelBubbling:function(){this.event.cancelBubble=true;},cancelDefaultAction:function(){this.event.returnValue=false;}});E.Netscape.Event=E.Event.subclass({target:function(){if(window.blackberry){return this.event.currentTarget?B.adaptToElement(this.event.currentTarget):null;}return this.event.target?B.adaptToElement(this.event.target):null;},cancelBubbling:function(){this.event.stopPropagation();},cancelDefaultAction:function(){this.event.preventDefault();}});var F={isAltPressed:function(){return this.event.altKey;},isCtrlPressed:function(){return this.event.ctrlKey;},isShiftPressed:function(){return this.event.shiftKey;},isMetaPressed:function(){return this.event.metaKey;},serializeKeyAndMouseEventOn:function(H){H.add("ice.event.alt",this.isAltPressed());H.add("ice.event.ctrl",this.isCtrlPressed());H.add("ice.event.shift",this.isShiftPressed());H.add("ice.event.meta",this.isMetaPressed());}};var D={isMouseEvent:function(){return true;},serializeOn:function(H){this.serializeEventOn(H);this.serializeKeyAndMouseEventOn(H);this.pointer().serializeOn(H);H.add("ice.event.left",this.isLeftButton());H.add("ice.event.right",this.isRightButton());}};E.IE.MouseEvent=E.IE.Event.subclass({pointer:function(){return new G.Point(this.event.clientX+(document.documentElement.scrollLeft||document.body.scrollLeft),this.event.clientY+(document.documentElement.scrollTop||document.body.scrollTop));},isLeftButton:function(){return this.event.button==1;},isRightButton:function(){return this.event.button==2;}});E.IE.MouseEvent.methods(F);E.IE.MouseEvent.methods(D);E.Netscape.MouseEvent=E.Netscape.Event.subclass({pointer:function(){return new G.Point(this.event.pageX,this.event.pageY);},isLeftButton:function(){return this.event.which==1;},isRightButton:function(){return this.event.which==3;}});E.Netscape.MouseEvent.methods(F);E.Netscape.MouseEvent.methods(D);var C={keyCharacter:function(){return String.fromCharCode(this.keyCode());},isEnterKey:function(){return this.keyCode()==13;},isEscKey:function(){return this.keyCode()==27;},isBackspaceKey:function(){return this.keyCode()==8;},isDeleteKey:function(){return this.keyCode()==46||this.keyCode()==63272;},isSpaceKey:function(){return this.keyCode()==32;},isTabKey:function(){return this.keyCode()==9||(this.isShiftPressed()&&this.keyCode()==25);},isHomeKey:function(){return this.keyCode()==36||this.keyCode()==63273;},isEndKey:function(){return this.keyCode()==35||this.keyCode()==63275;},isPageUpKey:function(){return this.keyCode()==33||this.keyCode()==63276;},isPageDownKey:function(){return this.keyCode()==34||this.keyCode()==63277;},isArrowUpKey:function(){return this.keyCode()==38||this.keyCode()==63232;},isArrowDownKey:function(){return this.keyCode()==40||this.keyCode()==63233;},isArrowLeftKey:function(){return this.keyCode()==37||this.keyCode()==63234;},isArrowRightKey:function(){return this.keyCode()==39||this.keyCode()==63235;},isKeyEvent:function(){return true;},serializeOn:function(H){this.serializeEventOn(H);this.serializeKeyAndMouseEventOn(H);H.add("ice.event.keycode",this.keyCode());}};E.IE.KeyEvent=E.IE.Event.subclass({keyCode:function(){return this.event.keyCode;}});E.IE.KeyEvent.methods(F);E.IE.KeyEvent.methods(C);E.Netscape.KeyEvent=E.Netscape.Event.subclass({keyCode:function(){return this.event.which==0?this.event.keyCode:this.event.which;}});E.Netscape.KeyEvent.methods(F);E.Netscape.KeyEvent.methods(C);E.UnknownEvent=E.Event.subclass({initialize:function(H){this.currentElement=H;},target:function(){return this.currentElement==null?null:B.adaptToElement(this.currentElement);},type:function(){return"unknown";},serializeEventOn:function(H){H.add("ice.event.target",this.target()&&this.target().id());H.add("ice.event.captured",this.captured()&&this.captured().id());H.add("ice.event.type","unknown");},cancelBubbling:Function.NOOP,cancelDefaultAction:Function.NOOP});E.Event.adaptToPlainEvent=function(I,H){return window.event?new E.IE.Event(event,H):new E.Netscape.Event(I,H);};E.Event.adaptToMouseEvent=function(I,H){return window.event?new E.IE.MouseEvent(event,H):new E.Netscape.MouseEvent(I,H);};E.Event.adaptToKeyEvent=function(I,H){return window.event?new E.IE.KeyEvent(event,H):new E.Netscape.KeyEvent(I,H);};E.Event.adaptToEvent=function(K,H){var J=window.event||K;if(J){var I="on"+J.type;var L=function(M){return M.toLowerCase()==I;};if(B.prototype.KeyListenerNames.detect(L)){return E.Event.adaptToKeyEvent(K,H);}else{if(B.prototype.MouseListenerNames.detect(L)){return E.Event.adaptToMouseEvent(K,H);}else{return E.Event.adaptToPlainEvent(K,H);}}}else{return new E.UnknownEvent(H);}};window.$event=E.Event.adaptToEvent;});
[Ice].as(function(A){A.Cookie=A.Parameter.Association.subclass({initialize:function(B,C,D){this.name=B;this.value=C||"";this.path=D||"/";this.save();},saveValue:function(B){this.value=B;this.save();},loadValue:function(){this.load();return this.value;},save:function(){document.cookie=this.name+"="+this.value+"; path="+this.path;return this;},load:function(){var B=A.Cookie.parse().detect(function(C){return this.name==C[0];}.bind(this));this.value=B?B[1]:null;return this;},remove:function(){var B=new Date();B.setTime(B.getTime()-24*60*60*1000);document.cookie=this.name+"=; expires="+B.toGMTString()+"; path="+this.path;}});A.Cookie.all=function(){return A.Cookie.parse().collect(function(B){var C=B[0];var D=B[1];return new A.Cookie(C,D);});};A.Cookie.lookup=function(B,D){var C=A.Cookie.parse().detect(function(E){return B==E[0];});if(C){return new A.Cookie(B,C[1]);}else{if(D){return new A.Cookie(B,D);}else{throw"Cannot find cookie named: "+B;}}};A.Cookie.exists=function(B){return document.cookie.contains(B+"=");};A.Cookie.parse=function(){return document.cookie.split("; ").collect(function(B){return B.contains("=")?B.split("="):[B,""];});};});
function currentConnection(){var A=$enumerate(arguments).detect(function(B){return !!B;});return A.findConnection();}function formOf(A){var B=A.parentNode;while(B){if(B.tagName&&B.tagName.toLowerCase()=="form"){return B;}B=B.parentNode;}throw"Cannot find enclosing form.";}function iceSubmitPartial(E,C,A,F){E=(E?E:C.form);if(!F){F=new Ice.Parameter.Query();}if(Ice.InputFileIdPreUpload){F.add("ice.inputFile.preUpload",Ice.InputFileIdPreUpload);}if(Ice.InputFileIdPostUpload){F.add("ice.inputFile.postUpload",Ice.InputFileIdPostUpload);}if(Ice.Menu!=null&&Ice.Menu.menuContext!=null){F.add("ice.menuContext",Ice.Menu.menuContext);}if(Ice.FCKeditorUtility){Ice.FCKeditorUtility.saveAll();}F.add("ice.submit.partial",true);var D=$event(A,C);var B=D.type()=="blur";D.serializeOn(F);if(E&&E.id){$element(E).serializeOn(F);}if(C&&C.id){var G=$element(C);if(G.isSubmit()){G.serializeOn(F);}}F.sendOn(currentConnection($element(E),$element(C)),B);resetHiddenFieldsFor(E);return false;}function iceSubmit(A,H,D,F){A=(A?A:H.form);var B=$event(D,H);var C=$element(A);if(!F){F=new Ice.Parameter.Query();}if(Ice.InputFileIdPreUpload){F.add("ice.inputFile.preUpload",Ice.InputFileIdPreUpload);}if(Ice.InputFileIdPostUpload){F.add("ice.inputFile.postUpload",Ice.InputFileIdPostUpload);}if(Ice.Menu!=null&&Ice.Menu.menuContext!=null){F.add("ice.menuContext",Ice.Menu.menuContext);}if(Ice.FCKeditorUtility){Ice.FCKeditorUtility.saveAll();}F.add("ice.submit.partial",false);var I=B.type()=="blur";if(B.isKeyEvent()){if(B.isEnterKey()){var E=C?C.detectDefaultSubmit():null;B.cancelDefaultAction();B.serializeOn(F);if(E){E.serializeOn(F);}if(C){C.serializeOn(F);}F.sendOn(currentConnection($element(A),$element(H)),I);}}else{var G=H&&H.id?$element(H):null;B.serializeOn(F);if(G&&G.isSubmit()){G.serializeOn(F);}if(C){C.serializeOn(F);}F.sendOn(currentConnection($element(A),$element(H)),I);}resetHiddenFieldsFor(A);return false;}function resetHiddenFieldsFor(A){$enumerate(A.elements).each(function(B){if(B.type=="hidden"&&B.id==""&&B.name!="javax.faces.RenderKitId"){B.value="";}});}
[Ice.Document=new Object,Ice.ElementModel.Element,Ice.Connection,Ice.Ajax].as(function(D,A,C,B){D.replaceContainerHTML=function(E,I,H){var F=new RegExp("<body[^<]*>","g").exec(I);var G=new RegExp("</body>","g").exec(I);var J=I.substring(F.index,G.index+G[0].length);var L=J.substring(J.indexOf(">")+1,J.lastIndexOf("<"));var M=E.tagName;var K=$element(E);K.disconnectEventListeners(H);K.replaceHtml(["<",M,">",L,"</",M,">"].join(""),H);};D.Synchronizer=Object.subclass({initialize:function(F,H,K,E){this.logger=F.child("synchronizer");this.optimizedJSListenerCleanup=E;var J="history-frame:"+H+":"+K;try{window.frames[J].location.hash;this.historyFrame=window.frames[J];}catch(G){this.historyFrame=J.asElement().contentWindow;}var I=this.historyFrame.location.protocol;if(I.startsWith("about")||I.startsWith("javascript")){this.synchronize=Function.NOOP;this.reload=Function.NOOP;this.shutdown=Function.NOOP;this.logger.info("Browser history tracking is disabled.");}else{this.ajax=new B.Client(this.logger);try{if(this.historyFrame.location.hash.length>0){this.reload();}}catch(G){this.logger.error("History frame reload failed: "+G);}}},synchronize:function(){this.synchronize=Function.NOOP;try{if(!this.historyFrame.location.hash.contains("reload")){this.historyFrame.location.replace(this.historyFrame.location+"#reload");this.logger.debug("mark document as modified");}}catch(E){this.logger.warn("could not mark document as modified",E);}},reload:function(){try{this.logger.info("synchronize body");this.ajax.getAsynchronously(document.URL,"",function(F){F.setRequestHeader("Connection","close");F.on(C.OK,function(G){D.replaceContainerHTML(document.body,G.content(),this.optimizedJSListenerCleanup);}.bind(this));}.bind(this));}catch(E){this.logger.error("failed to reload body",E);}},shutdown:function(){this.synchronize=Function.NOOP;this.historyFrame=null;}});});
[Ice.Command=new Object].as(function(A){A.Dispatcher=Object.subclass({initialize:function(){this.commands=new Object;},register:function(B,C){this.commands[B]=C;},deserializeAndExecute:function(D){var B=D.tagName;for(var C in this.commands){if(C==B){this.commands[B](D);return ;}}throw"Unknown message received: "+B;}});A.SetCookie=function(B){document.cookie=B.firstChild.data;};A.ParsingError=function(C){logger.error("Parsing error");var D=C.firstChild;logger.error(D.data);var B=D.firstChild;logger.error(B.data);};});
[Ice.Script=new Object,Ice.Ajax.Client].as(function(This,Client){This.Loader=Object.subclass({initialize:function(logger){this.logger=logger.child("script-loader");this.referencedScripts=[];this.client=new Client(this.logger);$enumerate(document.documentElement.getElementsByTagName("script")).each(function(script){if(script.src){this.referencedScripts.push(script.src);}}.bind(this));},searchAndEvaluateScripts:function(element){$enumerate(element.getElementsByTagName("script")).each(function(s){this.evaluateScript(s);}.bind(this));},evaluateScript:function(script){var uri=script.src;if(uri){if(!this.referencedScripts.include(script.src)){this.logger.debug("loading : "+uri);this.client.getSynchronously(uri,"",function(request){request.on(Ice.Connection.OK,function(){this.referencedScripts.push(uri);this.logger.debug("evaluating script at : "+uri);try{eval(request.content());}catch(e){this.logger.warn("Failed to evaluate script located at: "+uri,e);}}.bind(this));}.bind(this));}}else{var code=script.innerHTML;this.logger.debug("evaluating script : "+code);try{eval(code);}catch(e){this.logger.warn("Failed to evaluate script: \n"+code,e);}}}});});
var currentFocus;function setFocus(A){currentFocus=A;}[Ice.Focus=new Object].as(function(F){function E(G){return/^\w[\w\-\:]*$/.test(G);}var B=/MSIE/.test(navigator.userAgent);var D=(function(H){if(H&&E(H)){try{var G=document.getElementById(H);if(G){setFocus(H);if(G.focus){G.focus();logger.debug("Focus Set on ["+H+"]");if(B){G.focus();logger.debug("Focus Set on ["+H+"] twice for IE");}}else{logger.info("Focus cannot be set on ["+H+"]");}}else{logger.info("Cannot set focus, no element for id ["+H+"]");}}catch(G){logger.info("Cannot set focus ",G);}}else{logger.debug("Focus interupted. Not Set on ["+H+"]");}}).delayFor(100);F.setFocus=D;window.onLoad(function(){if(window.windowFocusRestore&&B){var H=document.activeElement;var I=function(J){C(document,"onfocusout",function(){if(H==document.activeElement){J();}else{H=document.activeElement;}});};var G=function(J){C(window,"onfocus",J);};I(function(){F.setFocus=setFocus;});G(function(){F.setFocus=D;D(currentFocus);});}});function C(H,G,I){var J=H[G];if(J){H[G]=function(L){var K=[L];J.apply(H,K);I.apply(H,K);};}else{H[G]=I;}}function A(I){var G=I||window.event;var H=G.srcElement||G.target;setFocus(H.id);}F.captureFocusIn=function(G){$enumerate(["select","input","button","a"]).each(function(H){$enumerate(G.getElementsByTagName(H)).each(function(I){C(I,"onfocus",A);});});};window.onLoad(function(){F.captureFocusIn(document);});window.onBeforeUnload(function(){$enumerate(["select","input","button","a"]).each(function(G){$enumerate(document.body.getElementsByTagName(G)).each(function(H){H.onfocus=null;});});});});
[Ice.Status=new Object].as(function(A){A.NOOPIndicator={on:Function.NOOP,off:Function.NOOP};A.RedirectIndicator=Object.subclass({initialize:function(B){this.uri=B;},on:function(){window.location.href=this.uri;},off:Function.NOOP});A.ElementIndicator=Object.subclass({initialize:function(B,C){this.elementID=B;this.indicators=C;this.indicators.push(this);this.off();},on:function(){this.indicators.each(function(C){if(C!=this){C.off();}}.bind(this));var B=this.elementID.asElement();if(B){B.style.visibility="visible";}},off:function(){var B=this.elementID.asElement();if(B){B.style.visibility="hidden";}}});A.OverlappingStateProtector=Object.subclass({initialize:function(B){this.indicator=B;this.counter=0;},on:function(){if(this.counter==0){this.indicator.on();}++this.counter;},off:function(){if(this.counter<1){return ;}if(this.counter==1){this.indicator.off();}--this.counter;}});A.ToggleIndicator=Object.subclass({initialize:function(B,C){this.onElement=B;this.offElement=C;this.off();},on:function(){this.onElement.on();this.offElement.off();},off:function(){this.onElement.off();this.offElement.on();}});A.MuxIndicator=Object.subclass({initialize:function(){this.indicators=arguments;this.off();},on:function(){$enumerate(this.indicators).each(function(B){B.on();});},off:function(){$enumerate(this.indicators).each(function(B){B.off();});}});A.PointerIndicator=Object.subclass({initialize:function(B){this.toggle=function(){this.on=Function.NOOP;var C=["input","select","textarea","button","a"].inject([B],function(D,E){return D.concat($enumerate(B.getElementsByTagName(E)).toArray());}).collect(function(D){var E=D.style.cursor;D.style.cursor="wait";return function(){D.style.cursor=E;};});this.off=function(){C.broadcast();this.on=this.toggle;this.off=Function.NOOP;};};this.on=/Safari/.test(navigator.userAgent)?Function.NOOP:this.toggle;this.off=Function.NOOP;}});A.OverlayIndicator=Object.subclass({initialize:function(B){this.configuration=B;},on:function(){if(/MSIE/.test(navigator.userAgent)){this.overlay=document.createElement("iframe");this.overlay.setAttribute("src","javascript:document.write('<html><body style=\"cursor: wait;\"></body><html>');");this.overlay.setAttribute("frameborder","0");document.body.appendChild(this.overlay);}else{this.overlay=document.body.appendChild(document.createElement("div"));this.overlay.style.cursor="wait";}var B=this.overlay.style;B.position="absolute";B.backgroundColor="white";B.zIndex="38000";B.top="0";B.left="0";B.opacity="0";B.filter="alpha(opacity=0)";B.width=(Math.max(document.documentElement.scrollWidth,document.body.scrollWidth)-20)+"px";B.height=(Math.max(document.documentElement.scrollHeight,document.body.scrollHeight)-20)+"px";},off:function(){if(this.overlay){if(/MSIE/.test(navigator.userAgent)){var B=document.createElement("iframe");B.setAttribute("src",'javascript:document.write("<html></html>");');B.setAttribute("frameborder","0");document.body.replaceChild(B,this.overlay);document.body.removeChild(B);}else{document.body.removeChild(this.overlay);}}}});A.PopupIndicator=Object.subclass({initialize:function(F,E,D,C,B){this.message=F;this.description=E;this.buttonText=D;this.iconPath=C;this.panel=B;},on:function(){this.panel.on();var C=document.createElement("div");document.body.appendChild(C);var B=C.style;B.position="absolute";B.textAlign="center";B.zIndex="28001";B.color="black";B.backgroundColor="white";B.paddingLeft="0";B.paddingRight="0";B.paddingTop="15px";B.paddingBottom="15px";B.borderBottomColor="gray";B.borderRightColor="gray";B.borderTopColor="silver";B.borderLeftColor="silver";B.borderWidth="2px";B.borderStyle="solid";B.width="270px";var F=document.createElement("div");F.appendChild(document.createTextNode(this.message));var I=F.style;I.marginLeft="30px";I.textAlign="left";I.fontSize="14px";I.fontSize="14px";I.fontWeight="bold";C.appendChild(F);var E=document.createElement("div");E.appendChild(document.createTextNode(this.description));var H=E.style;H.fontSize="11px";H.marginTop="7px";H.marginBottom="7px";H.fontWeight="normal";F.appendChild(E);var G=document.createElement("input");G.type="button";G.value=this.buttonText;var J=G.style;J.fontSize="11px";J.fontWeight="normal";G.onclick=function(){window.location.reload();};C.appendChild(G);var D=function(){if(typeof window.width!="function"){window.width=function(){return window.innerWidth?window.innerWidth:(document.documentElement&&document.documentElement.clientWidth)?document.documentElement.clientWidth:document.body.clientWidth;};}if(typeof window.height!="function"){window.height=function(){return window.innerHeight?window.innerHeight:(document.documentElement&&document.documentElement.clientHeight)?document.documentElement.clientHeight:document.body.clientHeight;};}B.left=((window.width()-C.clientWidth)/2)+"px";B.top=((window.height()-C.clientHeight)/2)+"px";}.bind(this);D();window.onResize(D);},off:Function.NOOP});A.DefaultStatusManager=Object.subclass({initialize:function(G,D){this.configuration=G;this.container=D;this.connectionLostRedirect=G.connectionLostRedirectURI?new A.RedirectIndicator(G.connectionLostRedirectURI):null;this.sessionExpiredRedirect=G.sessionExpiredRedirectURI?new A.RedirectIndicator(G.sessionExpiredRedirectURI):null;var F=G.messages;var C=G.connection.context+"/xmlhttp/css/xp/css-images/connect_disconnected.gif";var E=G.connection.context+"/xmlhttp/css/xp/css-images/connect_caution.gif";var B=new A.PointerIndicator(D);this.busy=new A.OverlappingStateProtector(B);this.sessionExpired=this.sessionExpiredRedirect?this.sessionExpiredRedirect:new A.PopupIndicator(F.sessionExpired,F.description,F.buttonText,C,this);this.connectionLost=this.connectionLostRedirect?this.connectionLostRedirect:new A.PopupIndicator(F.connectionLost,F.description,F.buttonText,E,this);this.serverError=new A.PopupIndicator(F.serverError,F.description,F.buttonText,E,this);this.connectionTrouble={on:Function.NOOP,off:Function.NOOP};},on:function(){var D=this.container.ownerDocument.createElement("iframe");D.setAttribute("src",'javascript:document.write("<html></html>");');D.setAttribute("frameborder","0");var B=D.style;B.position="absolute";B.display="block";B.visibility="visible";B.backgroundColor="white";B.zIndex="28000";B.top="0";B.left="0";B.opacity=0.22;B.filter="alpha(opacity=22)";this.container.appendChild(D);var C=this.container.tagName.toLowerCase()=="body"?function(){B.width=Math.max(document.documentElement.scrollWidth,document.body.scrollWidth)+"px";B.height=Math.max(document.documentElement.scrollHeight,document.body.scrollHeight)+"px";}:function(){B.width=this.container.offsetWidth+"px";B.height=this.container.offsetHeight+"px";};C();window.onResize(C);},off:Function.NOOP});A.ComponentStatusManager=Object.subclass({initialize:function(F,M,J,E,H,B,L){var K=[];var C=new Ice.Status.ElementIndicator(F,K);var I=new Ice.Status.ElementIndicator(M,K);var D=new Ice.Status.ElementIndicator(E,K);var G=new Ice.Status.ToggleIndicator(C,I);this.busy=new Ice.Status.OverlappingStateProtector(L?new Ice.Status.MuxIndicator(H.busy,G):G);this.connectionTrouble=new Ice.Status.ElementIndicator(J,K);if(B){this.dsm=H;this.connectionLost=new Ice.Status.MuxIndicator(D,this.dsm.connectionLost);this.sessionExpired=new Ice.Status.MuxIndicator(D,this.dsm.sessionExpired);this.serverError=new Ice.Status.MuxIndicator(D,this.dsm.serverError);}else{this.connectionLost=H.connectionLostRedirect?H.connectionLostRedirect:D;this.sessionExpired=H.sessionExpiredRedirect?H.sessionExpiredRedirect:D;this.serverError=D;}},on:function(){this.dsm.on();},off:function(){[this.busy,this.sessionExpired,this.serverError,this.connectionLost,this.connectionTrouble].eachWithGuard(function(B){B.off();});}});});
[Ice.Connection=new Object,Ice.Connection,Ice.Ajax,Ice.Parameter.Query].as(function(D,C,B,A){D.FormPost=function(E){E.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=UTF-8");};D.Close=function(E){E.close();};D.BadResponse=function(E){return E.statusCode()==0;};D.ServerError=function(E){var F=E.statusCode();return F>=500&&F<600;};D.OK=function(E){return E.statusCode()==200;};D.Lock=Object.subclass({initialize:function(){var E=false;this.acquire=function(){E=true;}.bind(this);this.release=function(){E=false;}.bind(this);this.isReleased=function(){return !E;}.bind(this);}});D.NOOPLock=Object.subclass({initialize:function(){this.acquire=Function.NOOP;this.release=Function.NOOP;this.isReleased=function(){return true;};}});D.SyncConnection=Object.subclass({initialize:function(F,I,E,H){this.logger=F.child("sync-connection");this.channel=new B.Client(this.logger);this.defaultQuery=E;this.onSendListeners=[];this.onReceiveListeners=[];this.onServerErrorListeners=[];this.connectionDownListeners=[];this.timeoutBomb={cancel:Function.NOOP};this.logger.info("synchronous mode");this.sendURI=I.sendReceiveUpdatesURI;var G=I.timeout?I.timeout:60000;window.onBeforeUnload(function(){this.connectionDownListeners.clear();}.bind(this));this.onSend(function(){this.timeoutBomb.cancel();this.timeoutBomb=this.connectionDownListeners.broadcaster().delayExecutionFor(G);}.bind(this));this.onReceive(function(){this.timeoutBomb.cancel();}.bind(this));this.whenDown(function(){this.timeoutBomb.cancel();}.bind(this));this.receiveCallback=function(J){try{this.onReceiveListeners.broadcast(J);}catch(K){this.logger.error("receive broadcast failed",K);}}.bind(this);this.badResponseCallback=function(J){F.warn("bad response received\nstatus: ["+J.statusCode()+"] "+J.statusText()+"\ncontent:\n"+J.content());this.connectionDownListeners.broadcast(J);};this.serverErrorCallback=this.onServerErrorListeners.broadcaster();this.lock=I.blockUI?new C.Lock():new C.NOOPLock();},send:function(G,F){if(this.lock.isReleased()){if(!F){this.lock.acquire();}try{var I=[];var E=new A();E.addQuery(G);E.addQuery(this.defaultQuery);E.add("ice.focus",window.currentFocus);this.logger.debug("send > "+E.asString());this.channel.postAsynchronously(this.sendURI,E.asURIEncodedString(),function(J){D.FormPost(J);if(!F){J.on(C.OK,this.lock.release);}J.on(C.OK,I.broadcaster());J.on(C.OK,this.receiveCallback);J.on(C.BadResponse,this.badResponseCallback);J.on(C.ServerError,this.serverErrorCallback);J.on(C.OK,C.Close);this.onSendListeners.broadcast(function(K){if(K){I.push(K);}},F);}.bind(this));}catch(H){if(!F){this.lock.release();}}}},onSend:function(E){this.onSendListeners.push(E);},onReceive:function(E){this.onReceiveListeners.push(E);},onServerError:function(E){this.onServerErrorListeners.push(E);},whenDown:function(E){this.connectionDownListeners.push(E);},whenTrouble:Function.NOOP,shutdown:function(){this.shutdown=Function.NOOP;this.send=Function.NOOP;[this.onSendListeners,this.onReceiveListeners,this.onServerErrorListeners,this.connectionDownListeners].eachWithGuard(function(E){E.clear();});}});});
Ice.Community=new Object;
[Ice.Reliability=new Object].as(function(A){A.Heartbeat=Object.subclass({initialize:function(D,C,B){this.period=D;this.logger=B.child("heartbeat");this.pingListeners=[];this.lostPongListeners=[];this.beat=function(){var E=function(){this.logger.warn("pong lost");this.lostPongListeners.each(function(F){F.notify();});}.bind(this).delayExecutionFor(C);this.pingListeners.broadcast(new A.Ping(E,this,this.logger));}.bind(this);window.onKeyPress(function(E){if(E.keyCode()==46&&E.isCtrlPressed()&&E.isShiftPressed()){this.beatPID?this.stop():this.start();}}.bind(this));},start:function(){this.beatPID=this.beat.repeatExecutionEvery(this.period);this.logger.info("heartbeat started");return this;},stop:function(){try{this.beatPID.cancel();this.beatPID=null;this.pingListeners.clear();this.lostPongListeners.each(function(C){C.ignoreNotifications();});this.logger.info("heartbeat stopped");}catch(B){this.logger.warn("heartbeat not started",B);}return this;},reset:function(){this.lostPongListeners.each(function(B){B.reset();});},onPing:function(B){this.pingListeners.push(B);},onLostPongs:function(D,C){var B=C||1;this.lostPongListeners.push(new A.CoalescingListener(B,D));}});A.Ping=Object.subclass({initialize:function(B,D,C){this.pid=B;this.heartbeat=D;this.logger=C;this.logger.info("ping");},pong:function(){if(this.pid){this.heartbeat.reset();this.pid.cancel();this.pong=Function.NOOP;this.logger.info("pong");}}});A.CoalescingListener=Object.subclass({initialize:function(B,C){this.count=0;this.retries=B;this.callback=C;},notify:function(){this.count+=1;if(this.count==this.retries){this.callback();this.reset();}},ignoreNotifications:function(){this.notify=Function.NOOP;},reset:function(){this.count=0;}});});
[Ice.Community.Connection=new Object,Ice.Connection,Ice.Ajax,Ice.Reliability.Heartbeat,Ice.Cookie,Ice.Parameter.Query].as(function(F,E,C,D,A,B){F.CachingResponse=Object.subclass({initialize:function(G){this.responseHeaders=$H();G.eachResponseHeader(function(H,I){this.responseHeaders.set(H,I);}.bind(this));this.textContent=G.content();this.domContent=G.contentAsDOM();this.identifier=G.identifier;},eachResponseHeader:function(G){this.responseHeaders.each(function(H){G(H.key,H.value);});},getResponseHeader:function(G){return this.responseHeaders.get(G);},containsResponseHeader:function(G){return !!this.responseHeaders.contains(G);},content:function(){this.textContent;},contentAsDOM:function(){return this.domContent;}});F.AsyncConnection=Object.subclass({initialize:function(k,V,a,W,N,Z){this.logger=k.child("async-connection");this.sendChannel=new C.Client(this.logger.child("ui"));this.receiveChannel=new C.Client(this.logger.child("blocking"));this.defaultQuery=N;this.onSendListeners=[];this.onReceiveListeners=[];this.onServerErrorListeners=[];this.connectionDownListeners=[];this.connectionTroubleListeners=[];this.listener={close:Function.NOOP,abort:Function.NOOP};this.listening={remove:Function.NOOP};this.timeoutBomb={cancel:Function.NOOP};this.heartbeat={stop:Function.NOOP};this.pingURI=W.pingURI;this.getURI=W.receiveUpdatesURI;this.sendURI=W.sendReceiveUpdatesURI;this.receiveURI=W.receiveUpdatedViewsURI;window.onBeforeUnload(function(){this.connectionDownListeners.clear();}.bind(this));var R=W.timeout?W.timeout:60000;this.onSend(function(){this.timeoutBomb.cancel();this.timeoutBomb=this.connectionDownListeners.broadcaster().delayExecutionFor(R);}.bind(this));this.onReceive(function(){this.timeoutBomb.cancel();}.bind(this));this.serverErrorCallback=this.onServerErrorListeners.broadcaster();this.notifyReceiveListeners=function(m){this.logger.debug("processing response: "+m.identifier);try{this.onReceiveListeners.broadcast(m);}catch(n){this.logger.error("receive broadcast failed",n);}};var j=[];this.queueRequest=function(e){j.push({request:e,response:null,timestamp:new Date().getTime()});};this.receiveCallback=function(e){var n=j.detect(function(o){return o.request.isMatchingResponse(e);});if(n==null){this.notifyReceiveListeners(e);}else{if(n==j.first()){n.response=e;while(j.isNotEmpty()&&j.first().response){this.notifyReceiveListeners(j.shift().response);}}else{this.logger.debug("queuing response "+e.identifier);n.response=new F.CachingResponse(e);}}var m=new Date().getTime();j=j.reject(function(o){return m>o.timestamp+300000;});}.bind(this);this.badResponseCallback=function(e){k.warn("bad response received\nstatus: ["+e.statusCode()+"] "+e.statusText()+"\ncontent:\n"+e.content());this.connectionDownListeners.broadcast(e);}.bind(this);this.sendXWindowCookie=Function.NOOP;this.receiveXWindowCookie=function(e){var m=e.getResponseHeader("X-Set-Window-Cookie");if(m){this.sendXWindowCookie=function(n){n.setRequestHeader("X-Window-Cookie",m);};}}.bind(this);try{this.updatedViews=A.lookup("updates");}catch(d){this.updatedViews=new A("updates","");}Z.register("updated-views",function(m){var e=this.updatedViews.loadValue().split(" ");var n=m.firstChild;if(n&&!n.data.blank()){this.updatedViews.saveValue(e.concat(n.data.split(" ")).asSet().join(" "));}else{this.logger.warn("No updated views were returned.");}}.bind(this));try{this.listening=A.lookup("bconn");this.listening.remove();}catch(d){}var l=function(o,e,m){var n=0;var p=m.inject([e],function(r,q){r.unshift(o.delayFor(q));return r;});return function(){if(n<p.length){p[n].apply(this,arguments);n++;}};};function c(){return A.lookup("ice.sessions").loadValue().split(" ").collect(function(e){return e.split("#")[0];});}this.connect=function(){this.logger.debug("closing previous connection...");this.listener.close();this.logger.debug("connect...");var e=new B();c().each(function(m){e.add("ice.session",m);});this.listener=this.receiveChannel.postAsynchronously(this.receiveURI,e.asURIEncodedString(),function(m){this.sendXWindowCookie(m);E.FormPost(m);m.on(E.ServerError,L);m.on(E.OK,this.receiveXWindowCookie);m.on(E.OK,function(n){if(!n.isEmpty()){this.receiveCallback(n);}if(n.getResponseHeader("X-Connection")!="close"){this.connect();}else{this.heartbeat.stop();}}.bind(this));m.on(E.OK,E.Close);}.bind(this));}.bind(this);var L=l(this.connect,this.serverErrorCallback,W.serverErrorRetryTimeouts||[1000,2000,4000]);Z.register("pong",Function.NOOP);var I=W.heartbeat.interval?W.heartbeat.interval:50000;var M=W.heartbeat.timeout?W.heartbeat.timeout:30000;var g=W.heartbeat.retries?W.heartbeat.retries:3;var S=function(){this.heartbeat.stop();this.heartbeat=new D(I,M,this.logger);this.heartbeat.onPing(function(e){Z.register("pong",function(){e.pong();});this.sendChannel.postAsynchronously(this.pingURI,this.defaultQuery.asURIEncodedString(),function(m){E.FormPost(m);m.on(E.OK,this.receiveCallback);m.on(E.OK,E.Close);}.bind(this));}.bind(this));this.heartbeat.onLostPongs(this.connectionDownListeners.broadcaster(),g);this.heartbeat.onLostPongs(this.connectionTroubleListeners.broadcaster());this.heartbeat.onLostPongs(function(){this.logger.debug("retry to connect...");this.connect();}.bind(this));this.heartbeat.start();this.connect();}.bind(this);var Q=1000;var i=V+":"+a;var h=A.lookup("ice.lease",(new Date).getTime().toString());var X=this.listening=A.lookup("bconn","-");function K(){h.saveValue((new Date).getTime()+Q*2);}function G(){return h.loadValue().asNumber()<(new Date).getTime();}function J(){return !A.exists("bconn")||A.lookup("bconn").value=="-";}function O(){X.saveValue(i);}function T(){return X.loadValue().startsWith(i);}function P(){X.saveValue(i+":acquired");}function Y(){return X.loadValue().endsWith(":acquired");}var b=this;function f(){try{if(J()){O();b.logger.info("blocking connection not initialized...candidate for its creation");}else{if(T()){if(!Y()){P();S();}K();}if(Y()&&G()){O();b.logger.info("blocking connection lease expired...candidate for its creation");}}}catch(m){b.logger.info("could not determine the state of the blocking connection...retrying",m);}}this.blockingConnectionMonitor=setInterval(f,Q);function U(){b.sendChannel.postAsynchronously(b.getURI,b.defaultQuery.asURIEncodedString(),function(e){E.FormPost(e);b.queueRequest(e);e.on(E.OK,b.receiveCallback);e.on(E.BadResponse,this.badResponseCallback);e.on(E.OK,E.Close);});}setTimeout(U,Q);function H(){try{var m=b.updatedViews.loadValue().split(" ");if(m.include(i)){U();b.updatedViews.saveValue(m.complement([i]).join(" "));}}catch(n){b.logger.warn("failed to listen for updates",n);}}this.updatesMonitor=setInterval(H,300);this.lock=W.blockUI?new E.Lock():new E.NOOPLock();this.logger.info("asynchronous mode");},send:function(I,H){if(this.lock.isReleased()){if(!H){this.lock.acquire();}try{var K=[];var G=new B();G.addQuery(I);G.addQuery(this.defaultQuery);G.add("ice.focus",window.currentFocus);this.logger.debug("send > "+G.asString());this.sendChannel.postAsynchronously(this.sendURI,G.asURIEncodedString(),function(L){E.FormPost(L);this.queueRequest(L);if(!H){L.on(E.OK,this.lock.release);}L.on(E.OK,K.broadcaster());L.on(E.OK,this.receiveCallback);L.on(E.BadResponse,this.badResponseCallback);L.on(E.ServerError,this.serverErrorCallback);L.on(E.OK,E.Close);this.onSendListeners.broadcast(function(M){if(M){K.push(M);}},H);}.bind(this));}catch(J){if(!H){this.lock.release();}}}},onSend:function(G){this.onSendListeners.push(G);},onReceive:function(G){this.onReceiveListeners.push(G);},onServerError:function(G){this.onServerErrorListeners.push(G);},whenDown:function(G){this.connectionDownListeners.push(G);},whenTrouble:function(G){this.connectionTroubleListeners.push(G);},shutdown:function(){try{this.shutdown=Function.NOOP;this.send=Function.NOOP;this.connect=Function.NOOP;this.heartbeat.stop();}catch(G){}finally{[this.onSendListeners,this.onReceiveListeners,this.connectionDownListeners,this.onServerErrorListeners].eachWithGuard(function(H){H.clear();});this.listener.abort();[this.updatesMonitor,this.blockingConnectionMonitor].eachWithGuard(function(H){clearInterval(H);});this.listening.remove();}}});});
window.logger=new Ice.Log.Logger(["window"]);window.console&&window.console.firebug?new Ice.Log.FirebugLogHandler(window.logger):new Ice.Log.WindowLogHandler(window.logger,window);[Ice.Community].as(function(D){var E=function(Q){try{var N=Ice.Cookie.lookup("ice.sessions");var R=N.loadValue().split(" ");var M=function(S){return S.startsWith(Q);};var P=R.detect(M);if(P){R=R.reject(M);var L=P.split("#")[1].asNumber()+1;R.push(Q+"#"+L);}else{R.push(Q+"#"+1);}N.saveValue(R.join(" "));}catch(O){new Ice.Cookie("ice.sessions",Q+"#"+1);}};var F=function(M){if(Ice.Cookie.exists("ice.sessions")){var L=Ice.Cookie.lookup("ice.sessions");var N=L.loadValue().split(" ");L.saveValue(N.inject([],function(O,Q){if(Q){var R=Q.split("#");var S=R[0];var P=R[1].asNumber();if(S==M){--P;}if(P>0){O.push(R[0]+"#"+P);}}return O;}).join(" "));}};var K=window.views=window.views?window.views:[];var J=function(M,L){E(M);K.push(new Ice.Parameter.Association(M,L));};var C=function(){K.each(function(L){F(L.name);});K.clear();};var I=new Ice.Ajax.Client(logger.child("dispose"));var B=function(L){if(L.isEmpty()){return ;}try{var M=L.inject(new Ice.Parameter.Query(),function(O,P){return O.addParameter(P);});I.postSynchronously(window.disposeViewsURI,M.asURIEncodedString(),function(O){Ice.Connection.FormPost(O);O.on(Ice.Connection.OK,Ice.Connection.Close);});}catch(N){logger.warn("Failed to notify view disposal",N);}};var G=function(M,L){F(M);K=K.reject(function(N){return N.name==M&&N.value==L;});};var H=function(M,L){G(M,L);B([new Ice.Parameter.Association(M,L)]);};var A=function(){B(K);C();};window.onBeforeUnload(A);D.Application=Object.subclass({initialize:function(T,U){var L=T.optimizedJSListenerCleanup;var S=T.session;var W=T.view;J(S,W);var d=window.logger.child(S.substring(0,4)+"#"+W);var O=new Ice.Status.DefaultStatusManager(T,U);var N=new Ice.Script.Loader(d);var V=new Ice.Command.Dispatcher();var Z=new Ice.Document.Synchronizer(window.logger,S,W,L);var P=Ice.Parameter.Query.create(function(e){e.add("ice.session",S);e.add("ice.view",W);});var M=function(e){Ice.Document.replaceContainerHTML(U,e,L);N.searchAndEvaluateScripts(U);};var R=T.synchronous?new Ice.Connection.SyncConnection(d,T.connection,P):new D.Connection.AsyncConnection(d,S,W,T.connection,P,V);var b=function(){try{b=Function.NOOP;R.shutdown();}finally{U.bridge=null;}};var X=[];var a=function(e){X.push(e);};V.register("noop",Function.NOOP);V.register("set-cookie",Ice.Command.SetCookie);V.register("parsererror",Ice.Command.ParsingError);V.register("redirect",function(f){b();var e=f.getAttribute("url").replace(/&#38;/g,"&");d.info("Redirecting to "+e);window.location.href=e;});V.register("reload",function(h){d.info("Reloading");var g=window.location.href;B=Function.NOOP;b();if(g.contains("rvn=")){window.location.reload();}else{var e=h.getAttribute("view");if(e==""){window.location.reload();}else{var f=g.contains("?")?"&":"?";window.location.href=g+f+"rvn="+e;}}});V.register("macro",function(e){$enumerate(e.childNodes).each(function(f){V.deserializeAndExecute(f);});});V.register("updates",function(e){var f=0;$enumerate(e.getElementsByTagName("update")).each(function(i){try{var g=i.getAttribute("address");var l=new Ice.ElementModel.Update(i);var k=g.asExtendedElement();k.updateDOM(l,L);d.debug("applied update : "+l.asString());var h=g.asElement();Ice.Focus.captureFocusIn(h);N.searchAndEvaluateScripts(h);f++;}catch(j){d.error("failed to insert element: "+l.asString(),j);}});if(f>0){if(Ice.StateMon){Ice.StateMon.checkAll();Ice.StateMon.rebuild();}}});V.register("session-expired",function(){try{d.warn("Session has expired");O.busy.off();O.sessionExpired.on();G(S,W);}finally{b();X.broadcast();}});window.onUnload(function(){b();});var Y;if(T.connection.blockUI){var c=new Ice.Status.OverlayIndicator(T);var Q=function(){return false;};Y=function(){c.on();var e=["input","select","textarea","button","a"].inject([],function(f,g){return f.concat($enumerate(U.getElementsByTagName(g)).collect(function(l){if(l.hasCallbacksDisabled){return Function.NOOP;}else{l.hasCallbacksDisabled=true;var j=l.onkeypress;var i=l.onkeyup;var k=l.onkeydown;var h=l.onclick;l.onkeypress=Q;l.onkeyup=Q;l.onkeydown=Q;l.onclick=Q;return function(){l.onkeypress=j;l.onkeyup=i;l.onkeydown=k;l.onclick=h;l.hasCallbacksDisabled=null;};}}));});return function(){e.broadcast();c.off();};};}else{Y=function(){return Function.NOOP;};}R.onSend(function(g,e){var f=e?Function.NOOP:Y();O.busy.on();g(function(){O.busy.off();f();});});R.onReceive(function(e){var f=e.getResponseHeader("Content-Type");if(f.startsWith("text/html")){M(e.content());}else{if(f.startsWith("text/xml")){Z.synchronize();V.deserializeAndExecute(e.contentAsDOM().documentElement);}else{d.warn("unknown content in response");}}O.connectionTrouble.off();});R.onServerError(function(e){d.warn("server side error");O.busy.off();H(S,W);if(e.isEmpty()){O.serverError.on();}else{M(e.content());}b();});R.whenDown(function(){d.warn("connection to server was lost");O.busy.off();O.connectionLost.on();b();});R.whenTrouble(function(){d.warn("connection in trouble");O.connectionTrouble.on();});this.attachStatusManager=function(e){O.off();O=e(new Ice.Status.DefaultStatusManager(T,U));d.info("status indicators were updated");};this.connection=R;this.onSessionExpired=a;this.dispose=b;this.disposeAndNotify=function(){H(S,W);b();};d.info("bridge loaded!");}});});window.onKeyPress(function(A){if(A.isEscKey()){A.cancelDefaultAction();}});window.onUnload(function(){window.logger=null;window.views=null;window.disposeViewsURI=null;window.disposeOnViewRemoval=null;window.$element=null;window.$event=null;window.$enumerate=null;});
[Ice].as(function(A){function B(H){try{return H.asExtendedElement().findBridge();}catch(F){var E=H.asElement().getElementsByTagName("*");var D=E.length;for(var C=0;C<D;C++){var G=E[C];if(G.bridge){return G.bridge;}}throw"Cannot find bridge instance among the children or parents of ["+H+"]";}}window.disposeOnViewRemoval=function(C){B(C).disposeAndNotify();};A.onSendReceive=function(E,D,C){B(E).connection.onSend(function(F){D();F(C);});};A.onAsynchronousReceive=function(D,C){B(D).connection.onReceive(C);};A.onServerError=function(D,C){B(D).connection.onServerError(function(E){C(E.content());});};A.onSessionExpired=function(D,C){B(D).onSessionExpired(C);};A.onConnectionTrouble=function(D,C){B(D).connection.whenTrouble(C);};A.onConnectionLost=function(D,C){B(D).connection.whenDown(C);};});
}
if(typeof OpenAjax!="undefined"&&typeof OpenAjax.registerLibrary!="undefined"&&typeof OpenAjax.registerGlobals!="undefined"){OpenAjax.registerLibrary("icefaces-d2d","http://www.icefaces.org/","1.5.3");OpenAjax.registerGlobals("icefaces-d2d",["Class","Enumerable","iceSubmit","$A","resetHiddenFieldsFor","$H","setFocus","property","$R","$break","Hashtable","ObjectRange","$w","Template","current","$continue","PeriodicalExecuter","Try","currentFocus","Abstract","Ice","iceSubmitPartial"]);}

