var Prototype={Version:"1.5.0",BrowserFeatures:{XPath:!!document.evaluate},ScriptFragment:"(?:<script.*?>)((\n|\r|.)*?)(?:</script>)",emptyFunction:function(){
},K:function(x){
return x;
}};
var Class={create:function(){
return function(){
this.initialize.apply(this,arguments);
};
}};
var Abstract=new Object();
Object.extend=function(_2,_3){
for(var _4 in _3){
_2[_4]=_3[_4];
}
return _2;
};
Object.extend(Object,{inspect:function(_5){
try{
if(_5===undefined){
return "undefined";
}
if(_5===null){
return "null";
}
return _5.inspect?_5.inspect():_5.toString();
}
catch(e){
if(e instanceof RangeError){
return "...";
}
throw e;
}
},keys:function(_6){
var _7=[];
for(var _8 in _6){
_7.push(_8);
}
return _7;
},values:function(_9){
var _a=[];
for(var _b in _9){
_a.push(_9[_b]);
}
return _a;
},clone:function(_c){
return Object.extend({},_c);
}});
Function.prototype.bind=function(){
var _d=this,_e=$A(arguments),_f=_e.shift();
return function(){
return _d.apply(_f,_e.concat($A(arguments)));
};
};
Function.prototype.bindAsEventListener=function(_10){
var _11=this,_12=$A(arguments),_10=_12.shift();
return function(_13){
return _11.apply(_10,[(_13||window.event)].concat(_12).concat($A(arguments)));
};
};
Object.extend(Number.prototype,{toColorPart:function(){
var _14=this.toString(16);
if(this<16){
return "0"+_14;
}
return _14;
},succ:function(){
return this+1;
},times:function(_15){
$R(0,this,true).each(_15);
return this;
}});
var Try={these:function(){
var _16;
for(var i=0,_18=arguments.length;i<_18;i++){
var _19=arguments[i];
try{
_16=_19();
break;
}
catch(e){
}
}
return _16;
}};
var PeriodicalExecuter=Class.create();
PeriodicalExecuter.prototype={initialize:function(_1a,_1b){
this.callback=_1a;
this.frequency=_1b;
this.currentlyExecuting=false;
this.registerCallback();
},registerCallback:function(){
this.timer=setInterval(this.onTimerEvent.bind(this),this.frequency*1000);
},stop:function(){
if(!this.timer){
return;
}
clearInterval(this.timer);
this.timer=null;
},onTimerEvent:function(){
if(!this.currentlyExecuting){
try{
this.currentlyExecuting=true;
this.callback(this);
}
finally{
this.currentlyExecuting=false;
}
}
}};
String.interpret=function(_1c){
return _1c==null?"":String(_1c);
};
Object.extend(String.prototype,{gsub:function(_1d,_1e){
var _1f="",_20=this,_21;
_1e=arguments.callee.prepareReplacement(_1e);
while(_20.length>0){
if(_21=_20.match(_1d)){
_1f+=_20.slice(0,_21.index);
_1f+=String.interpret(_1e(_21));
_20=_20.slice(_21.index+_21[0].length);
}else{
_1f+=_20,_20="";
}
}
return _1f;
},sub:function(_22,_23,_24){
_23=this.gsub.prepareReplacement(_23);
_24=_24===undefined?1:_24;
return this.gsub(_22,function(_25){
if(--_24<0){
return _25[0];
}
return _23(_25);
});
},scan:function(_26,_27){
this.gsub(_26,_27);
return this;
},truncate:function(_28,_29){
_28=_28||30;
_29=_29===undefined?"...":_29;
return this.length>_28?this.slice(0,_28-_29.length)+_29:this;
},strip:function(){
return this.replace(/^\s+/,"").replace(/\s+$/,"");
},stripTags:function(){
return this.replace(/<\/?[^>]+>/gi,"");
},stripScripts:function(){
return this.replace(new RegExp(Prototype.ScriptFragment,"img"),"");
},extractScripts:function(){
var _2a=new RegExp(Prototype.ScriptFragment,"img");
var _2b=new RegExp(Prototype.ScriptFragment,"im");
return (this.match(_2a)||[]).map(function(_2c){
return (_2c.match(_2b)||["",""])[1];
});
},evalScripts:function(){
return this.extractScripts().map(function(_2d){
return eval(_2d);
});
},escapeHTML:function(){
var div=document.createElement("div");
var _2f=document.createTextNode(this);
div.appendChild(_2f);
return div.innerHTML;
},unescapeHTML:function(){
var div=document.createElement("div");
div.innerHTML=this.stripTags();
return div.childNodes[0]?(div.childNodes.length>1?$A(div.childNodes).inject("",function(_31,_32){
return _31+_32.nodeValue;
}):div.childNodes[0].nodeValue):"";
},toQueryParams:function(_33){
var _34=this.strip().match(/([^?#]*)(#.*)?$/);
if(!_34){
return {};
}
return _34[1].split(_33||"&").inject({},function(_35,_36){
if((_36=_36.split("="))[0]){
var _37=decodeURIComponent(_36[0]);
var _38=_36[1]?decodeURIComponent(_36[1]):undefined;
if(_35[_37]!==undefined){
if(_35[_37].constructor!=Array){
_35[_37]=[_35[_37]];
}
if(_38){
_35[_37].push(_38);
}
}else{
_35[_37]=_38;
}
}
return _35;
});
},toArray:function(){
return this.split("");
},succ:function(){
return this.slice(0,this.length-1)+String.fromCharCode(this.charCodeAt(this.length-1)+1);
},camelize:function(){
var _39=this.split("-"),len=_39.length;
if(len==1){
return _39[0];
}
var _3b=this.charAt(0)=="-"?_39[0].charAt(0).toUpperCase()+_39[0].substring(1):_39[0];
for(var i=1;i<len;i++){
_3b+=_39[i].charAt(0).toUpperCase()+_39[i].substring(1);
}
return _3b;
},capitalize:function(){
return this.charAt(0).toUpperCase()+this.substring(1).toLowerCase();
},underscore:function(){
return this.gsub(/::/,"/").gsub(/([A-Z]+)([A-Z][a-z])/,"#{1}_#{2}").gsub(/([a-z\d])([A-Z])/,"#{1}_#{2}").gsub(/-/,"_").toLowerCase();
},dasherize:function(){
return this.gsub(/_/,"-");
},inspect:function(_3d){
var _3e=this.replace(/\\/g,"\\\\");
if(_3d){
return "\""+_3e.replace(/"/g,"\\\"")+"\"";
}else{
return "'"+_3e.replace(/'/g,"\\'")+"'";
}
}});
String.prototype.gsub.prepareReplacement=function(_3f){
if(typeof _3f=="function"){
return _3f;
}
var _40=new Template(_3f);
return function(_41){
return _40.evaluate(_41);
};
};
String.prototype.parseQuery=String.prototype.toQueryParams;
var Template=Class.create();
Template.Pattern=/(^|.|\r|\n)(#\{(.*?)\})/;
Template.prototype={initialize:function(_42,_43){
this.template=_42.toString();
this.pattern=_43||Template.Pattern;
},evaluate:function(_44){
return this.template.gsub(this.pattern,function(_45){
var _46=_45[1];
if(_46=="\\"){
return _45[2];
}
return _46+String.interpret(_44[_45[3]]);
});
}};
var $break=new Object();
var $continue=new Object();
var Enumerable={each:function(_47){
var _48=0;
try{
this._each(function(_49){
try{
_47(_49,_48++);
}
catch(e){
if(e!=$continue){
throw e;
}
}
});
}
catch(e){
if(e!=$break){
throw e;
}
}
return this;
},eachSlice:function(_4a,_4b){
var _4c=-_4a,_4d=[],_4e=this.toArray();
while((_4c+=_4a)<_4e.length){
_4d.push(_4e.slice(_4c,_4c+_4a));
}
return _4d.map(_4b);
},all:function(_4f){
var _50=true;
this.each(function(_51,_52){
_50=_50&&!!(_4f||Prototype.K)(_51,_52);
if(!_50){
throw $break;
}
});
return _50;
},any:function(_53){
var _54=false;
this.each(function(_55,_56){
if(_54=!!(_53||Prototype.K)(_55,_56)){
throw $break;
}
});
return _54;
},collect:function(_57){
var _58=[];
this.each(function(_59,_5a){
_58.push((_57||Prototype.K)(_59,_5a));
});
return _58;
},detect:function(_5b){
var _5c;
this.each(function(_5d,_5e){
if(_5b(_5d,_5e)){
_5c=_5d;
throw $break;
}
});
return _5c;
},findAll:function(_5f){
var _60=[];
this.each(function(_61,_62){
if(_5f(_61,_62)){
_60.push(_61);
}
});
return _60;
},grep:function(_63,_64){
var _65=[];
this.each(function(_66,_67){
var _68=_66.toString();
if(_68.match(_63)){
_65.push((_64||Prototype.K)(_66,_67));
}
});
return _65;
},include:function(_69){
var _6a=false;
this.each(function(_6b){
if(_6b==_69){
_6a=true;
throw $break;
}
});
return _6a;
},inGroupsOf:function(_6c,_6d){
_6d=_6d===undefined?null:_6d;
return this.eachSlice(_6c,function(_6e){
while(_6e.length<_6c){
_6e.push(_6d);
}
return _6e;
});
},inject:function(_6f,_70){
this.each(function(_71,_72){
_6f=_70(_6f,_71,_72);
});
return _6f;
},invoke:function(_73){
var _74=$A(arguments).slice(1);
return this.map(function(_75){
return _75[_73].apply(_75,_74);
});
},max:function(_76){
var _77;
this.each(function(_78,_79){
_78=(_76||Prototype.K)(_78,_79);
if(_77==undefined||_78>=_77){
_77=_78;
}
});
return _77;
},min:function(_7a){
var _7b;
this.each(function(_7c,_7d){
_7c=(_7a||Prototype.K)(_7c,_7d);
if(_7b==undefined||_7c<_7b){
_7b=_7c;
}
});
return _7b;
},partition:function(_7e){
var _7f=[],_80=[];
this.each(function(_81,_82){
((_7e||Prototype.K)(_81,_82)?_7f:_80).push(_81);
});
return [_7f,_80];
},pluck:function(_83){
var _84=[];
this.each(function(_85,_86){
_84.push(_85[_83]);
});
return _84;
},reject:function(_87){
var _88=[];
this.each(function(_89,_8a){
if(!_87(_89,_8a)){
_88.push(_89);
}
});
return _88;
},sortBy:function(_8b){
return this.map(function(_8c,_8d){
return {value:_8c,criteria:_8b(_8c,_8d)};
}).sort(function(_8e,_8f){
var a=_8e.criteria,b=_8f.criteria;
return a<b?-1:a>b?1:0;
}).pluck("value");
},toArray:function(){
return this.map();
},zip:function(){
var _92=Prototype.K,_93=$A(arguments);
if(typeof _93.last()=="function"){
_92=_93.pop();
}
var _94=[this].concat(_93).map($A);
return this.map(function(_95,_96){
return _92(_94.pluck(_96));
});
},size:function(){
return this.toArray().length;
},inspect:function(){
return "#<Enumerable:"+this.toArray().inspect()+">";
}};
Object.extend(Enumerable,{map:Enumerable.collect,find:Enumerable.detect,select:Enumerable.findAll,member:Enumerable.include,entries:Enumerable.toArray});
var $A=Array.from=function(_97){
if(!_97){
return [];
}
if(_97.toArray){
return _97.toArray();
}else{
var _98=[];
for(var i=0,_9a=_97.length;i<_9a;i++){
_98.push(_97[i]);
}
return _98;
}
};
Object.extend(Array.prototype,Enumerable);
if(!Array.prototype._reverse){
Array.prototype._reverse=Array.prototype.reverse;
}
Object.extend(Array.prototype,{_each:function(_9b){
for(var i=0,_9d=this.length;i<_9d;i++){
_9b(this[i]);
}
},clear:function(){
this.length=0;
return this;
},first:function(){
return this[0];
},last:function(){
return this[this.length-1];
},compact:function(){
return this.select(function(_9e){
return _9e!=null;
});
},flatten:function(){
return this.inject([],function(_9f,_a0){
return _9f.concat(_a0&&_a0.constructor==Array?_a0.flatten():[_a0]);
});
},without:function(){
var _a1=$A(arguments);
return this.select(function(_a2){
return !_a1.include(_a2);
});
},indexOf:function(_a3){
for(var i=0,_a5=this.length;i<_a5;i++){
if(this[i]==_a3){
return i;
}
}
return -1;
},reverse:function(_a6){
return (_a6!==false?this:this.toArray())._reverse();
},reduce:function(){
return this.length>1?this:this[0];
},uniq:function(){
return this.inject([],function(_a7,_a8){
return _a7.include(_a8)?_a7:_a7.concat([_a8]);
});
},clone:function(){
return [].concat(this);
},size:function(){
return this.length;
},inspect:function(){
return "["+this.map(Object.inspect).join(", ")+"]";
}});
Array.prototype.toArray=Array.prototype.clone;
function $w(_a9){
_a9=_a9.strip();
return _a9?_a9.split(/\s+/):[];
}
if(window.opera){
Array.prototype.concat=function(){
var _aa=[];
for(var i=0,_ac=this.length;i<_ac;i++){
_aa.push(this[i]);
}
for(var i=0,_ac=arguments.length;i<_ac;i++){
if(arguments[i].constructor==Array){
for(var j=0,_ae=arguments[i].length;j<_ae;j++){
_aa.push(arguments[i][j]);
}
}else{
_aa.push(arguments[i]);
}
}
return _aa;
};
}
var Hash=function(obj){
Object.extend(this,obj||{});
};
Object.extend(Hash,{toQueryString:function(obj){
var _b1=[];
this.prototype._each.call(obj,function(_b2){
if(!_b2.key){
return;
}
if(_b2.value&&_b2.value.constructor==Array){
var _b3=_b2.value.compact();
if(_b3.length<2){
_b2.value=_b3.reduce();
}else{
key=encodeURIComponent(_b2.key);
_b3.each(function(_b4){
_b4=_b4!=undefined?encodeURIComponent(_b4):"";
_b1.push(key+"="+encodeURIComponent(_b4));
});
return;
}
}
if(_b2.value==undefined){
_b2[1]="";
}
_b1.push(_b2.map(encodeURIComponent).join("="));
});
return _b1.join("&");
}});
Object.extend(Hash.prototype,Enumerable);
Object.extend(Hash.prototype,{_each:function(_b5){
for(var key in this){
var _b7=this[key];
if(_b7&&_b7==Hash.prototype[key]){
continue;
}
var _b8=[key,_b7];
_b8.key=key;
_b8.value=_b7;
_b5(_b8);
}
},keys:function(){
return this.pluck("key");
},values:function(){
return this.pluck("value");
},merge:function(_b9){
return $H(_b9).inject(this,function(_ba,_bb){
_ba[_bb.key]=_bb.value;
return _ba;
});
},remove:function(){
var _bc;
for(var i=0,_be=arguments.length;i<_be;i++){
var _bf=this[arguments[i]];
if(_bf!==undefined){
if(_bc===undefined){
_bc=_bf;
}else{
if(_bc.constructor!=Array){
_bc=[_bc];
}
_bc.push(_bf);
}
}
delete this[arguments[i]];
}
return _bc;
},toQueryString:function(){
return Hash.toQueryString(this);
},inspect:function(){
return "#<Hash:{"+this.map(function(_c0){
return _c0.map(Object.inspect).join(": ");
}).join(", ")+"}>";
}});
function $H(_c1){
if(_c1&&_c1.constructor==Hash){
return _c1;
}
return new Hash(_c1);
}
ObjectRange=Class.create();
Object.extend(ObjectRange.prototype,Enumerable);
Object.extend(ObjectRange.prototype,{initialize:function(_c2,end,_c4){
this.start=_c2;
this.end=end;
this.exclusive=_c4;
},_each:function(_c5){
var _c6=this.start;
while(this.include(_c6)){
_c5(_c6);
_c6=_c6.succ();
}
},include:function(_c7){
if(_c7<this.start){
return false;
}
if(this.exclusive){
return _c7<this.end;
}
return _c7<=this.end;
}});
var $R=function(_c8,end,_ca){
return new ObjectRange(_c8,end,_ca);
};
var Ice=new Object;
Object.methods=function(_cb){
for(property in _cb){
this.prototype[property]=_cb[property];
}
};
Object.subclass=function(_cc){
var _cd=function(){
this.initialize.apply(this,arguments);
};
_cd.methods=this.methods;
_cd.subclass=this.subclass;
_cd.prototype.initialize=Function.NOOP;
_cd.methods(this.prototype);
_cd.prototype.initializeSuperclass=this.prototype.initialize?this.prototype.initialize:Function.NOOP;
_cd.methods(_cc||{});
return _cd;
};
Boolean.prototype.ifTrue=function(e){
if(this==true){
e();
}
return this;
};
Boolean.prototype.ifFalse=function(e){
if(this==false){
e();
}
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 _d0=this.asElement();
if(!_d0){
throw "cannot find element with id: '"+this+"'";
}
return Ice.ElementModel.Element.adaptToElement(_d0);
},asRegexp:function(){
return new RegExp(this);
},contains:function(_d1){
return this.indexOf(_d1)>=0;
},containsWords:function(){
return /(\w+)/.test(this);
}});
Object.extend(Array.prototype,{eachWithGuard:function(_d2){
this.each(function(_d3){
try{
_d2(_d3);
}
catch(e){
}
});
},intersect:function(_d4){
return this.select(function(_d5){
return _d4.include(_d5);
});
},complement:function(_d6){
return this.reject(function(_d7){
return _d6.include(_d7);
});
},isEmpty:function(){
return this.length==0;
},isNotEmpty:function(){
return this.length>0;
},as:function(_d8){
_d8.apply(_d8,this);
},copy:function(){
return this.collect(function(_d9){
return _d9;
});
},copyFrom:function(_da,_db){
var _dc=[];
var end=_da+_db;
for(var i=_da;i<end;i++){
_dc.push(this[i]);
}
return _dc;
},broadcast:function(_df){
this.each(function(_e0){
_e0(_df);
});
},broadcaster:function(){
return function(_e1){
this.broadcast(_e1);
}.bind(this);
},asSet:function(){
var set=[];
this.each(function(_e3){
if(!set.include(_e3)){
set.push(_e3);
}
});
return set;
}});
Function.prototype.delayFor=function(_e4){
var _e5=this;
return function(){
var _e6=this;
var _e7=arguments;
var _e8=function(){
try{
_e5.apply(_e6,_e7);
}
finally{
clearInterval(_e7.id);
_e7.id=null;
}
};
var id=_e7.id=setInterval(_e8,_e4);
arguments.callee.cancel=function(){
clearInterval(id);
_e7.id=null;
};
};
};
Function.prototype.delayExecutionFor=function(_ea){
var _eb=this.delayFor(_ea);
_eb.apply();
return _eb;
};
Function.prototype.repeatEvery=function(_ec){
var _ed=this;
return function(){
var _ee=this;
var _ef=arguments;
var _f0=function(){
_ed.apply(_ee,_ef);
};
var id=setInterval(_f0,_ec);
arguments.callee.cancel=function(){
clearInterval(id);
};
};
};
Function.prototype.repeatExecutionEvery=function(_f2){
var _f3=this.repeatEvery(_f2);
_f3.apply(this);
return _f3;
};
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(_f4){
if(!window[_f4]){
window[_f4]=function(_f5){
var _f6=_f4.toLowerCase();
var _f7=window[_f6];
var _f8=_f7?[_f7,_f5]:[_f5];
window[_f6]=_f8.broadcaster();
window[_f4]=function(_f9){
if(!_f8.detect(function(_fa){
return _fa.toString()==_f9.toString();
})){
_f8.push(_f9);
}
};
};
}
});
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(_fb){
var _fc=document.onkeypress;
document.onkeypress=_fc?function(e){
_fb(Ice.EventModel.Event.adaptToEvent(e));
_fc(e);
}:function(e){
_fb(Ice.EventModel.Event.adaptToKeyEvent(e));
};
};
[Ice].as(function(_ff){
_ff.Enumerator=Object.subclass({initialize:function(_100){
this.indexedObject=_100;
},_each:function(_101){
for(var i=0;i<this.indexedObject.length;i++){
_101(this.indexedObject[i],i);
}
},reverse:function(){
return new _ff.ReverseEnumerator(this.indexedObject);
}});
_ff.Enumerator.methods(Enumerable);
_ff.ReverseEnumerator=_ff.Enumerator.subclass({_each:function(_103){
for(var i=(this.indexedObject.length-1);i>=0;i--){
_103(this.indexedObject[i],i);
}
},reverse:function(){
return new _ff.Enumerator(this.indexedObject);
}});
window.$enumerate=function(_105){
return new _ff.Enumerator(_105);
};
});
[Ice.Log=new Object].as(function(This){
This.Priority=Object.subclass({debug:function(_107,_108,_109,_10a){
_107.debug(_108,_109,_10a);
},info:function(_10b,_10c,_10d,_10e){
_10b.info(_10c,_10d,_10e);
},warn:function(_10f,_110,_111,_112){
_10f.warn(_110,_111,_112);
},error:function(_113,_114,_115,_116){
_113.error(_114,_115,_116);
}});
This.Debug=This.Priority.subclass({asString:function(){
return "Debug";
}});
This.Info=This.Debug.subclass({debug:Function.NOOP,asString:function(){
return "Info";
}});
This.Warn=This.Info.subclass({info:Function.NOOP,asString:function(){
return "Warn";
}});
This.Error=This.Warn.subclass({warn:Function.NOOP,asString:function(){
return "Error";
}});
This.Priority.DEBUG=new This.Debug;
This.Priority.INFO=new This.Info;
This.Priority.WARN=new This.Warn;
This.Priority.ERROR=new This.Error;
This.Priority.Levels=[This.Priority.DEBUG,This.Priority.INFO,This.Priority.WARN,This.Priority.ERROR];
This.Logger=Object.subclass({initialize:function(_117,_118,_119){
this.handler=_118||{debug:Function.NOOP,info:Function.NOOP,warn:Function.NOOP,error:Function.NOOP};
this.category=_117;
this.children=[];
this.priority=_119||This.Priority.ERROR;
},debug:function(_11a,_11b){
this.priority.debug(this.handler,this.category,_11a,_11b);
},info:function(_11c,_11d){
this.priority.info(this.handler,this.category,_11c,_11d);
},warn:function(_11e,_11f){
this.priority.warn(this.handler,this.category,_11e,_11f);
},error:function(_120,_121){
this.priority.error(this.handler,this.category,_120,_121);
},child:function(_122){
var _123=this.category.copy();
_123.push(_122);
var _124=new This.Logger(_123,this.handler,this.priority);
this.children.push(_124);
return _124;
},threshold:function(_125){
this.priority=_125;
this.children.each(function(_126){
_126.threshold(_125);
});
},handleWith:function(_127){
this.handler=_127;
}});
This.WindowLogHandler=Object.subclass({initialize:function(_128,_129,_12a,_12b){
this.lineOptions=[25,50,100,200,400];
this.logger=_128;
this.logger.handleWith(this);
this.parentWindow=_129;
this.lines=_12a||this.lineOptions[3];
this.thresholdPriority=_12b||This.Priority.DEBUG;
this.categoryMatcher=/.*/;
this.closeOnExit=true;
this.toggle();
this.parentWindow.onKeyPress(function(e){
var key=e.keyCode();
if((key==20||key==84)&&e.isCtrlPressed()&&e.isShiftPressed()){
this.enable();
}
}.bind(this));
},enable:function(){
try{
this.window=this.parentWindow.open("","log"+window.identifier,"scrollbars=1,width=800,height=680");
var _12e=this.window.document;
this.log=this.window.document.getElementById("log-window");
this.toggle();
if(this.log){
return;
}
_12e.body.appendChild(_12e.createTextNode(" Close on exit "));
var _12f=_12e.createElement("input");
_12f.style.margin="2px";
_12f.setAttribute("type","checkbox");
_12f.defaultChecked=true;
_12f.checked=true;
_12f.onclick=function(){
this.closeOnExit=_12f.checked;
}.bind(this);
_12e.body.appendChild(_12f);
_12e.body.appendChild(_12e.createTextNode(" Lines "));
var _130=_12e.createElement("select");
_130.style.margin="2px";
this.lineOptions.each(function(_131,_132){
var _133=_130.appendChild(_12e.createElement("option"));
if(this.lines==_131){
_130.selectedIndex=_132;
}
_133.appendChild(_12e.createTextNode(_131.toString()));
}.bind(this));
_130.onchange=function(_134){
this.lines=this.lineOptions[_130.selectedIndex];
this.clearPreviousEvents();
}.bind(this);
_12e.body.appendChild(_130);
_12e.body.appendChild(_12e.createTextNode(" Category "));
var _135=_12e.createElement("input");
_135.style.margin="2px";
_135.setAttribute("type","text");
_135.setAttribute("value",this.categoryMatcher.source);
_135.onchange=function(){
this.categoryMatcher=_135.value.asRegexp();
}.bind(this);
_12e.body.appendChild(_135);
_12e.body.appendChild(_12e.createTextNode(" Level "));
var _136=_12e.createElement("select");
_136.style.margin="2px";
This.Priority.Levels.each(function(_137,_138){
var _139=_136.appendChild(_12e.createElement("option"));
if(this.thresholdPriority==_137){
_136.selectedIndex=_138;
}
_139.appendChild(_12e.createTextNode(_137.asString()));
}.bind(this));
this.logger.threshold(this.thresholdPriority);
_136.onchange=function(_13a){
this.thresholdPriority=This.Priority.Levels[_136.selectedIndex];
this.logger.threshold(this.thresholdPriority);
}.bind(this);
_12e.body.appendChild(_136);
var _13b=_12e.createElement("input");
_13b.style.margin="2px";
_13b.setAttribute("type","button");
_13b.setAttribute("value","Stop");
_13b.onclick=function(){
_13b.setAttribute("value",this.toggle()?"Stop":"Start");
}.bind(this);
_12e.body.appendChild(_13b);
var _13c=_12e.createElement("input");
_13c.style.margin="2px";
_13c.setAttribute("type","button");
_13c.setAttribute("value","Clear");
_13c.onclick=function(){
this.clearAllEvents();
}.bind(this);
_12e.body.appendChild(_13c);
this.log=_12e.body.appendChild(_12e.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(This.Priority.ERROR);
this.handle=Function.NOOP;
if(this.closeOnExit&&this.window){
this.window.close();
}
},toggle:function(){
if(this.handle==Function.NOOP){
delete this.handle;
return true;
}else{
this.handle=Function.NOOP;
return false;
}
},debug:function(_13d,_13e,_13f){
this.handle("#333","debug",_13d,_13e,_13f);
},info:function(_140,_141,_142){
this.handle("green","info",_140,_141,_142);
},warn:function(_143,_144,_145){
this.handle("orange","warn",_143,_144,_145);
},error:function(_146,_147,_148){
this.handle("red","error",_146,_147,_148);
},handle:function(_149,_14a,_14b,_14c,_14d){
if(this.categoryMatcher.test(_14b.join("."))){
var _14e=this.log.ownerDocument;
var _14f=(new Date()).toTimestamp();
var _150=_14b.join(".");
(_14f+" "+_14a+" \t["+_150+"] : "+_14c+(_14d?("\n"+_14d):"")).split("\n").each(function(line){
if(line.containsWords()){
var _152=_14e.createElement("div");
_152.style.padding="3px";
_152.style.color=_149;
this.log.appendChild(_152).appendChild(_14e.createTextNode(line));
}
}.bind(this));
this.log.scrollTop=this.log.scrollHeight;
}
this.clearPreviousEvents();
},clearPreviousEvents:function(){
var _153=$A(this.log.childNodes);
_153.copyFrom(0,_153.length-this.lines).each(function(node){
this.log.removeChild(node);
}.bind(this));
},clearAllEvents:function(){
$A(this.log.childNodes).each(function(node){
this.log.removeChild(node);
}.bind(this));
}});
This.NOOPConsole={debug:Function.NOOP,info:Function.NOOP,warn:Function.NOOP,error:Function.NOOP};
This.FirebugLogHandler=Object.subclass({initialize:function(_156){
_156.handleWith(this);
this.logger=_156;
this.console=This.NOOPConsole;
this.enable();
},enable:function(){
this.console=window.console;
this.logger.threshold(This.Priority.DEBUG);
},disable:function(){
this.console=This.NOOPConsole;
this.logger.threshold(This.Priority.ERROR);
},toggle:Function.NOOP,debug:function(_157,_158,_159){
_159?this.console.debug(this.format(_157,_158),_159):this.console.debug(this.format(_157,_158));
},info:function(_15a,_15b,_15c){
_15c?this.console.info(this.format(_15a,_15b),_15c):this.console.info(this.format(_15a,_15b));
},warn:function(_15d,_15e,_15f){
_15f?this.console.warn(this.format(_15d,_15e),_15f):this.console.warn(this.format(_15d,_15e));
},error:function(_160,_161,_162){
_162?this.console.error(this.format(_160,_161),_162):this.console.error(this.format(_160,_161));
},format:function(_163,_164){
return "["+_163.join(".")+"] "+_164;
}});
});
[Ice.Ajax=new Object].as(function(This){
This.Client=Object.subclass({initialize:function(_166){
this.logger=_166;
this.cookies=new Object;
document.cookie.split("; ").each(function(_167){
var _168=_167.split("=");
this.cookies[_168.first()]=_168.last();
}.bind(this));
try{
if(window.createRequest){
this.createRequest=function(){
var _169=new This.RequestProxy(window.createRequest(),this.logger);
_169.post=function(_16a,path,_16c,_16d){
this.get(_16a,path,_16c,_16d);
};
return _169;
}.bind(this);
}else{
if(window.XMLHttpRequest){
this.createRequest=function(){
return new This.RequestProxy(new XMLHttpRequest(),this.logger);
}.bind(this);
}else{
if(window.ActiveXObject){
this.createRequest=function(){
return new This.RequestProxy(new ActiveXObject("Microsoft.XMLHTTP"),this.logger);
}.bind(this);
}
}
}
}
catch(e){
this.logger.error("failed to create factory request",e);
}
},getAsynchronously:function(path,_16f,_170){
return this.createRequest().getAsynchronously(path,_16f,_170);
},getSynchronously:function(path,_172,_173){
return this.createRequest().getSynchronously(path,_172,_173);
},postAsynchronously:function(path,_175,_176){
return this.createRequest().postAsynchronously(path,_175,_176);
},postSynchronously:function(path,_178,_179){
return this.createRequest().postSynchronously(path,_178,_179);
}});
This.RequestProxy=Object.subclass({initialize:function(_17a,_17b){
this.identifier=+Math.random().toString().substr(2,7);
this.request=_17a;
this.logger=_17b;
this.callbacks=[];
this.responseCallback=function(){
if(this.isComplete()){
this.logger.debug("["+this.identifier+"] : receive ["+this.statusCode()+"] "+this.statusText());
}
this.callbacks.each(function(_17c){
try{
_17c(this);
}
catch(e){
this.logger.error("failed to respond",e);
}
}.bind(this));
}.bind(this);
},statusCode:function(){
try{
return this.request.status;
}
catch(e){
return 0;
}
},statusText:function(){
try{
return this.request.statusText;
}
catch(e){
return "";
}
},on:function(test,_17e){
this.callbacks.push(function(_17f){
if(test(_17f)){
_17e(_17f);
}
});
},isComplete:function(){
try{
return this.request.readyState==4;
}
catch(e){
return false;
}
},isResponseValid:function(){
try{
return this.request.status>=0;
}
catch(e){
return false;
}
},isOk:function(){
try{
return this.request.status==200;
}
catch(e){
return false;
}
},isServerError:function(){
try{
return this.request.status==500;
}
catch(e){
return false;
}
},isOkAndComplete:function(){
return this.isComplete()&&this.isOk();
},getAsynchronously:function(path,_181,_182){
this.request.open("GET",path+"?"+_181+"&rand="+Math.random(),true);
if(_182){
_182(this);
}
this.request.onreadystatechange=this.responseCallback;
this.logger.debug("["+this.identifier+"] : send asynchronous GET");
this.request.send("");
return this;
},postAsynchronously:function(path,_184,_185){
this.request.open("POST",path,true);
if(_185){
_185(this);
}
this.request.onreadystatechange=this.responseCallback;
this.logger.debug("["+this.identifier+"] : send asynchronous POST");
this.request.send(_184+"&rand="+Math.random()+"\n\n");
return this;
},getSynchronously:function(path,_187,_188){
this.request.open("GET",path+"?"+_187+"&rand="+Math.random(),false);
if(_188){
_188(this);
}
this.logger.debug("["+this.identifier+"] : send synchronous GET");
this.request.send("");
this.responseCallback();
return this;
},postSynchronously:function(path,_18a,_18b){
this.request.open("POST",path,false);
if(_18b){
_18b(this);
}
this.logger.debug("["+this.identifier+"] : send synchronous POST");
this.request.send(_18a+"&rand="+Math.random()+"\n\n");
this.responseCallback();
return this;
},setRequestHeader:function(name,_18d){
this.request.setRequestHeader(name,_18d);
},getResponseHeader:function(name){
try{
return this.request.getResponseHeader(name);
}
catch(e){
return null;
}
},containsResponseHeader:function(name){
try{
var _190=this.request.getResponseHeader(name);
return _190&&_190!="";
}
catch(e){
return false;
}
},content:function(){
try{
return this.request.responseText;
}
catch(e){
return "";
}
},contentAsDOM:function(){
return this.request.responseXML;
},close:function(){
try{
this.request.onreadystatechange=Function.NOOP;
this.request.abort();
}
catch(e){
}
finally{
this.request=null;
this.callbacks=null;
this.logger.debug("["+this.identifier+"] : connection closed");
}
}});
});
[Ice.Parameter=new Object].as(function(This){
This.Query=Object.subclass({initialize:function(){
this.parameters=[];
},add:function(name,_193){
if(!this.parameters.detect(function(_194){
return _194.name==name&&_194.value==_193;
})){
this.parameters.push(new This.Association(name,_193));
}
},addQuery:function(_195){
_195.serializeOn(this);
return this;
},asURIEncodedString:function(){
return this.parameters.inject("",function(_196,_197,_198){
return _196+=(_198==0)?_197.asURIEncodedString():"&"+_197.asURIEncodedString();
});
},asString:function(){
return this.parameters.inject("",function(_199,_19a,_19b){
return _199+"\n| "+_19a.asString()+" |";
});
},sendOn:function(_19c){
_19c.send(this);
},send:function(){
if(!connection){
throw "default connection not available";
}
this.sendOn(connection);
},serializeOn:function(_19d){
this.parameters.each(function(_19e){
_19e.serializeOn(_19d);
});
}});
This.Query.create=function(_19f){
var _1a0=new This.Query;
_19f.apply(this,[_1a0]);
return _1a0;
};
This.Association=Object.subclass({initialize:function(name,_1a2){
this.name=name;
this.value=_1a2;
},asURIEncodedString:function(){
return encodeURIComponent(this.name)+"="+encodeURIComponent(this.value);
},asString:function(){
return this.name+"="+this.value;
},serializeOn:function(_1a3){
_1a3.add(this.name,this.value);
}});
});
[Ice.Geometry=new Object].as(function(This){
This.Point=Object.subclass({initialize:function(x,y){
this.x=x;
this.y=y;
},asString:function(){
return "point ["+this.x+", "+this.y+"]";
},toString:function(){
return this.asString();
},serializeOn:function(_1a7){
_1a7.add("ice.event.x",this.x);
_1a7.add("ice.event.y",this.y);
}});
});
[Ice.ElementModel=new Object].as(function(This){
This.TemporaryContainer=function(){
var _1a9=document.body.appendChild(document.createElement("div"));
_1a9.style.visibility="hidden";
This.TemporaryContainer=function(){
return _1a9;
};
return _1a9;
};
This.DisconnectAllListenersAndPeers=function(e){
var _1ab=e.getElementsByTagName("*");
for(var i=0;i<_1ab.length;i++){
var _1ad=_1ab[i];
var peer=_1ad.peer;
if(peer){
peer.eachListenerName(function(_1af){
_1ad[_1af.toLowerCase()]=null;
});
_1ad.peer=null;
peer.element=null;
}
}
};
This.Element=Object.subclass({MouseListenerNames:["onClick","onDblClick","onMouseDown","onMouseMove","onMouseOut","onMouseOver","onMouseUp"],KeyListenerNames:["onKeyDown","onKeyPress","onKeyUp","onHelp"],initialize:function(_1b0){
this.element=_1b0;
},id:function(){
return this.element.id;
},replaceHtml:function(html){
this.withTemporaryContainer(function(_1b2){
_1b2.innerHTML=html;
var _1b3=_1b2.firstChild;
this.disconnectAllListenersAndPeers();
this.replaceHostElementWith(_1b3);
});
},withAllChildElements:function(_1b4){
var _1b5=this.element.getElementsByTagName("*");
for(var i=0;i<_1b5.length;i++){
var peer=_1b5[i].peer;
if(peer){
_1b4(peer);
}
}
},disconnectAllListenersAndPeers:/MSIE/.test(navigator.userAgent)?function(){
This.DisconnectAllListenersAndPeers.delayFor(100)(this.element);
}:function(){
This.DisconnectAllListenersAndPeers(this.element);
},serializeOn:function(_1b8){
this.serializeView(_1b8);
},sendOn:function(_1b9){
Query.create(function(_1ba){
this.serializeOn(_1ba);
}.bind(this)).sendOn(_1b9);
},send:function(){
this.sendOn(connection);
},withTemporaryContainer:function(_1bb){
try{
_1bb.apply(this,[This.TemporaryContainer()]);
}
finally{
This.TemporaryContainer().innerHTML="";
}
},defaultReplaceHostElementWith:function(_1bc){
this.displayOff();
this.element.parentNode.replaceChild(_1bc,this.element);
this.element=_1bc;
this.element.peer=this;
},replaceHostElementWith:function(_1bd){
this.defaultReplaceHostElementWith(_1bd);
},displayOff:/Safari/.test(navigator.userAgent)?Function.NOOP:function(){
this.element.style.display="none";
},eachListenerName:function(_1be){
this.MouseListenerNames.each(_1be);
this.KeyListenerNames.each(_1be);
},serializeView:function(_1bf){
var view;
var _1c1=this.element;
while(_1c1){
if(_1c1.viewIdentifier){
view=_1c1.viewIdentifier;
break;
}else{
_1c1=_1c1.parentNode;
}
}
if(view){
_1bf.add("ice.view.active",view);
}else{
throw "viewIdentifier is missing";
}
}});
This.Element.adaptToElement=function(e){
if(e.peer){
return e.peer;
}
switch(e.tagName.toLowerCase()){
case "textarea":
case "input":
e.peer=new This.InputElement(e);
break;
case "th":
case "td":
case "tr":
e.peer=new This.TableCellElement(e);
break;
case "button":
e.peer=new This.ButtonElement(e);
break;
case "select":
e.peer=new This.SelectElement(e);
break;
case "form":
e.peer=new This.FormElement(e);
break;
case "head":
e.peer=new This.HeadElement(e);
break;
case "body":
e.peer=new This.BodyElement(e);
break;
case "script":
e.peer=new This.ScriptElement(e);
break;
case "title":
e.peer=new This.TitleElement(e);
break;
case "a":
e.peer=new This.AnchorElement(e);
break;
case "fieldset":
e.peer=new This.FieldSetElement(e);
break;
case "object":
e.peer=new This.ObjectElement(e);
break;
case "iframe":
e.peer=new This.IFrameElement(e);
break;
case "html":
e.peer=new This.HtmlElement(e);
break;
default:
e.peer=new This.Element(e);
break;
}
return e.peer;
};
This.InputElement=This.Element.subclass({InputListenerNames:["onBlur","onFocus","onChange"],initialize:function(_1c3){
this.element=_1c3;
var type=_1c3.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 _1c5=this.element.onfocus;
this.element.onfocus=Function.NOOP;
this.element.focus();
this.element.onfocus=_1c5;
},replaceHostElementWith:function(_1c6){
this.eachAttributeName(function(_1c7){
var _1c8=_1c6[_1c7];
var _1c9=this.element[_1c7];
if(_1c9!=_1c8){
this.element[_1c7]=_1c8;
}
}.bind(this));
var _1ca=_1c6.getAttribute("style");
var _1cb=this.element.getAttribute("style");
if(_1ca!=_1cb){
this.element.setAttribute("style",_1ca);
}
this.eachListenerName(function(_1cc){
var name=_1cc.toLowerCase();
this.element[name]=_1c6[name]?_1c6[name].bind(this.element):null;
_1c6[name]=null;
}.bind(this));
},eachAttributeName:function(_1ce){
["className","title","lang"].each(_1ce);
["name","value","checked","disabled","readOnly","size","maxLength","src","alt","useMap","isMap","tabIndex","accessKey","accept"].each(_1ce);
},serializeOn:function(_1cf){
switch(this.element.type.toLowerCase()){
case "image":
case "textarea":
case "submit":
case "hidden":
case "password":
case "text":
_1cf.add(this.element.name,this.element.value);
break;
case "checkbox":
case "radio":
if(this.element.checked){
_1cf.add(this.element.name,this.element.value||"on");
}
break;
}
this.serializeView(_1cf);
},eachListenerName:function(_1d0){
this.MouseListenerNames.each(_1d0);
this.KeyListenerNames.each(_1d0);
this.InputListenerNames.each(_1d0);
}});
This.SelectElement=This.InputElement.subclass({isSubmit:function(){
return false;
},replaceHostElementWith:function(_1d1){
this.defaultReplaceHostElementWith(_1d1);
},serializeOn:function(_1d2){
$enumerate(this.element.options).select(function(_1d3){
return _1d3.selected;
}).each(function(_1d4){
var _1d5=_1d4.value||(_1d4.value==""?"":_1d4.text);
_1d2.add(this.element.name,_1d5);
}.bind(this));
this.serializeView(_1d2);
}});
This.ButtonElement=This.InputElement.subclass({initialize:function(_1d6){
this.element=_1d6;
this.isSubmitElement=_1d6.type.toLowerCase()=="submit";
},isSubmit:function(){
return this.isSubmitElement;
},replaceHostElementWith:function(_1d7){
this.defaultReplaceHostElementWith(_1d7);
},serializeOn:function(_1d8){
_1d8.add(this.element.name,this.element.value);
this.serializeView(_1d8);
}});
This.FormElement=This.Element.subclass({FormListenerNames:["onReset","onSubmit","submit"],formElements:/Safari/.test(navigator.userAgent)?function(){
var _1d9=[];
$enumerate(this.element.elements).reverse().each(function(_1da){
if(!_1d9.detect(function(_1db){
return _1da.id&&_1db.element.id&&_1db.element.id==_1da.id;
})){
_1d9.push(This.Element.adaptToElement(_1da));
}
});
return _1d9;
}:function(){
return $enumerate(this.element.elements).collect($element);
},captureOnSubmit:function(){
var _1dc=this.element.onsubmit;
this.element.onsubmit=function(_1dd){
if(_1dc){
_1dc();
}
$event(_1dd).cancelDefaultAction();
iceSubmit(this.element,null,_1dd);
};
},redirectSubmit:function(){
var _1de=this.element.submit;
this.element.submit=function(){
if(_1de){
_1de();
}
iceSubmit(this.element,null,null);
};
},captureAndRedirectSubmit:function(){
this.captureOnSubmit();
this.redirectSubmit();
},serializeOn:function(_1df){
this.formElements().each(function(_1e0){
if(!_1e0.isSubmit()){
_1e0.serializeOn(_1df);
}
});
this.serializeView(_1df);
},eachListenerName:function(_1e1){
this.MouseListenerNames.each(_1e1);
this.KeyListenerNames.each(_1e1);
this.FormListenerNames.each(_1e1);
}});
This.HtmlElement=This.Element.subclass({replaceHtml:function(html){
var _1e3=function(tag){
var _1e5=new RegExp("<"+tag+"[^<]*>","g").exec(html);
var end=new RegExp("</"+tag+">","g").exec(html);
return html.substring(_1e5.index,end.index+end[0].length);
};
var _1e7=document.body;
new This.BodyElement(_1e7).replaceHtml(_1e3("body"));
var _1e8=document.getElementsByTagName("title")[0];
new This.TitleElement(_1e8).replaceHtml(_1e3("title"));
var _1e9=document.getElementsByTagName("head")[0];
if(_1e9&&!/MSIE/.test(navigator.userAgent)){
new This.HeadElement(_1e9).replaceHtml(_1e3("head"));
}
}});
This.HeadElement=This.Element.subclass({replaceHtml:function(html){
$enumerate(this.element.childNodes).each(function(e){
this.element.removeChild(e);
}.bind(this));
this.withTemporaryContainer(function(_1ec){
_1ec.innerHTML=html.substring(html.indexOf(">")+1,html.lastIndexOf("<"));
$enumerate(_1ec.childNodes).each(function(e){
this.element.appendChild(e);
}.bind(this));
});
}});
This.BodyElement=This.Element.subclass({replaceHtml:function(html){
this.disconnectAllListenersAndPeers();
this.element.innerHTML=html.substring(html.indexOf(">")+1,html.lastIndexOf("<"));
}});
This.ScriptElement=This.Element.subclass({replaceHtml:function(html){
var _1f0=html.substring(html.indexOf(">")+1,html.lastIndexOf("<"));
if(_1f0!=""&&_1f0!=";"){
var _1f1=function(){
eval(_1f0);
};
_1f1.apply(window);
}
}});
This.TitleElement=This.Element.subclass({replaceHtml:function(html){
this.element.ownerDocument.title=html.substring(html.indexOf(">")+1,html.lastIndexOf("<"));
}});
This.FieldSetElement=This.Element.subclass({isSubmit:function(html){
return false;
}});
This.ObjectElement=This.Element.subclass({isSubmit:function(html){
return false;
}});
This.AnchorElement=This.Element.subclass({focus:function(){
var _1f5=this.element.onfocus;
this.element.onfocus=Function.NOOP;
this.element.focus();
this.element.onfocus=_1f5;
},serializeOn:function(_1f6){
if(this.element.name){
_1f6.add(this.element.name,this.element.name);
}
this.serializeView(_1f6);
},form:function(){
var _1f7=this.element.parentNode;
while(_1f7){
if(_1f7.tagName&&_1f7.tagName.toLowerCase()=="form"){
return This.Element.adaptToElement(_1f7);
}
_1f7=_1f7.parentNode;
}
throw "Cannot find enclosing form.";
}});
This.TableCellElement=This.Element.subclass({replaceHtml:function(html){
this.withTemporaryContainer(function(_1f9){
_1f9.innerHTML="<TABLE>"+html+"</TABLE>";
var _1fa=_1f9.firstChild;
while((null!=_1fa)&&(this.element.id!=_1fa.id)){
_1fa=_1fa.firstChild;
}
this.disconnectAllListenersAndPeers();
this.replaceHostElementWith(_1fa);
});
}});
This.IFrameElement=This.Element.subclass({replaceHostElementWith:function(_1fb){
this.eachAttributeName(function(_1fc){
var _1fd=_1fb.getAttribute(_1fc);
if(_1fd==null){
this.element.removeAttribute(_1fc);
}else{
this.element.setAttribute(_1fc,_1fd);
}
}.bind(this));
var _1fe=this.element.contentWindow.location.href;
var _1ff=_1fb.contentWindow.location.href;
if(_1fe!=_1ff){
this.element.contentWindow.location=_1ff;
}
this.eachListenerName(function(_200){
var name=_200.toLowerCase();
this.element[name]=_1fb[name]?_1fb[name].bind(this.element):null;
_1fb[name]=null;
}.bind(this));
},eachAttributeName:function(_202){
["title","lang","dir","class","style","align","frameborder","width","height","hspace","ismap","longdesc","marginwidth","marginheight","name","scrolling"].each(_202);
}});
window.$element=This.Element.adaptToElement;
});
[Ice.EventModel=new Object,Ice.ElementModel.Element,Ice.Parameter.Query,Ice.Geometry].as(function(This,_204,_205,_206){
This.IE=new Object;
This.Netscape=new Object;
This.Event=Object.subclass({initialize:function(_207,_208){
this.event=_207;
this.currentElement=_208;
},cancel:function(){
this.cancelBubbling();
this.cancelDefaultAction();
},isKeyEvent:function(){
return false;
},isMouseEvent:function(){
return false;
},captured:function(){
return this.currentElement?_204.adaptToElement(this.currentElement):null;
},serializeEventOn:function(_209){
_209.add("ice.event.target",this.target()&&this.target().id());
_209.add("ice.event.captured",this.captured()&&this.captured().id());
_209.add("ice.event.type","on"+this.event.type);
},serializeOn:function(_20a){
this.serializeEventOn(_20a);
},sendOn:function(_20b){
_205.create(function(_20c){
_20c.add("ice.submit.partial",false);
try{
this.captured().serializeOn(_20c);
this.serializeOn(_20c);
}
catch(e){
this.serializeOn(_20c);
}
}.bind(this)).sendOn(_20b);
},sendFullOn:function(_20d){
_205.create(function(_20e){
_20e.add("ice.submit.partial",false);
try{
this.captured().serializeOn(_20e);
this.captured().form().serializeOn(_20e);
this.serializeOn(_20e);
}
catch(e){
this.serializeOn(_20e);
}
}.bind(this)).sendOn(_20d);
},sendWithCondition:function(_20f){
if(_20f(this)){
this.send();
}
},send:function(){
this.cancel();
this.sendOn(connection);
},sendFull:function(){
this.cancel();
this.sendFullOn(connection);
}});
This.IE.Event=This.Event.subclass({target:function(){
return this.event.srcElement?_204.adaptToElement(this.event.srcElement):null;
},cancelBubbling:function(){
this.event.cancelBubble=true;
},cancelDefaultAction:function(){
this.event.returnValue=false;
}});
This.Netscape.Event=This.Event.subclass({target:function(){
return this.event.target?_204.adaptToElement(this.event.target):null;
},cancelBubbling:function(){
this.event.stopPropagation();
},cancelDefaultAction:function(){
this.event.preventDefault();
}});
var _210={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(_211){
_211.add("ice.event.alt",this.isAltPressed());
_211.add("ice.event.ctrl",this.isCtrlPressed());
_211.add("ice.event.shift",this.isShiftPressed());
_211.add("ice.event.meta",this.isMetaPressed());
}};
var _212={isMouseEvent:function(){
return true;
},serializeOn:function(_213){
this.serializeEventOn(_213);
this.serializeKeyAndMouseEventOn(_213);
this.pointer().serializeOn(_213);
_213.add("ice.event.left",this.isLeftButton());
_213.add("ice.event.right",this.isRightButton());
}};
This.IE.MouseEvent=This.IE.Event.subclass({pointer:function(){
return new _206.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;
}});
This.IE.MouseEvent.methods(_210);
This.IE.MouseEvent.methods(_212);
This.Netscape.MouseEvent=This.Netscape.Event.subclass({pointer:function(){
return new _206.Point(this.event.pageX,this.event.pageY);
},isLeftButton:function(){
return this.event.which==1;
},isRightButton:function(){
return this.event.which==3;
}});
This.Netscape.MouseEvent.methods(_210);
This.Netscape.MouseEvent.methods(_212);
var _214={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(_215){
this.serializeEventOn(_215);
this.serializeKeyAndMouseEventOn(_215);
_215.add("ice.event.keycode",this.keyCode());
}};
This.IE.KeyEvent=This.IE.Event.subclass({keyCode:function(){
return this.event.keyCode;
}});
This.IE.KeyEvent.methods(_210);
This.IE.KeyEvent.methods(_214);
This.Netscape.KeyEvent=This.Netscape.Event.subclass({keyCode:function(){
return this.event.which==0?this.event.keyCode:this.event.which;
}});
This.Netscape.KeyEvent.methods(_210);
This.Netscape.KeyEvent.methods(_214);
This.UnknownEvent=This.Event.subclass({initialize:function(_216){
this.currentElement=_216;
},target:function(){
return this.currentElement==null?null:_204.adaptToElement(this.currentElement);
},serializeEventOn:function(_217){
_217.add("ice.event.target",this.target()&&this.target().id());
_217.add("ice.event.captured",this.captured()&&this.captured().id());
_217.add("ice.event.type","unknown");
},cancelBubbling:Function.NOOP,cancelDefaultAction:Function.NOOP});
This.Event.adaptToPlainEvent=function(e,_219){
return window.event?new This.IE.Event(event,_219):new This.Netscape.Event(e,_219);
};
This.Event.adaptToMouseEvent=function(e,_21b){
return window.event?new This.IE.MouseEvent(event,_21b):new This.Netscape.MouseEvent(e,_21b);
};
This.Event.adaptToKeyEvent=function(e,_21d){
return window.event?new This.IE.KeyEvent(event,_21d):new This.Netscape.KeyEvent(e,_21d);
};
This.Event.adaptToEvent=function(e,_21f){
var _220=window.event||e;
if(_220){
var _221="on"+_220.type;
var _222=function(name){
return name.toLowerCase()==_221;
};
if(_204.prototype.KeyListenerNames.detect(_222)){
return This.Event.adaptToKeyEvent(e,_21f);
}else{
if(_204.prototype.MouseListenerNames.detect(_222)){
return This.Event.adaptToMouseEvent(e,_21f);
}else{
return This.Event.adaptToPlainEvent(e,_21f);
}
}
}else{
return new This.UnknownEvent(_21f);
}
};
window.$event=This.Event.adaptToEvent;
});
[Ice].as(function(This){
This.Cookie=This.Parameter.Association.subclass({initialize:function(name,_226){
this.name=name;
this.value=_226||"";
this.save();
},saveValue:function(_227){
this.value=_227;
this.save();
},loadValue:function(){
this.load();
return this.value;
},save:function(){
document.cookie=this.name+"="+this.value;
return this;
},load:function(){
var _228=This.Cookie.parse().detect(function(_229){
return this.name==_229[0];
}.bind(this));
this.value=_228[1];
return this;
},remove:function(){
document.cookie=this.name+"=0; expires="+(new Date).toGMTString();
}});
This.Cookie.all=function(){
return This.Cookie.parse().collect(function(_22a){
var name=_22a[0];
var _22c=_22a[1];
return new This.Cookie(name,_22c);
});
};
This.Cookie.lookup=function(name){
var _22e=This.Cookie.parse().detect(function(_22f){
return name==_22f[0];
});
if(_22e){
return new This.Cookie(_22e[0],_22e[1]);
}else{
throw "Cannot find cookie named: "+name;
}
};
This.Cookie.parse=function(){
return document.cookie.split("; ").collect(function(_230){
return _230.contains("=")?_230.split("="):[_230,""];
});
};
});
function iceSubmitPartial(form,_232,evt){
form=(form?form:_232.form);
Ice.Parameter.Query.create(function(_234){
_234.add("ice.submit.partial",true);
$event(evt,_232).serializeOn(_234);
if(form&&form.id){
$element(form).serializeOn(_234);
}
if(_232&&_232.id){
$element(_232).serializeOn(_234);
}
}).send();
resetHiddenFieldsFor(form);
}
function iceSubmit(_235,_236,_237){
_235=(_235?_235:_236.form);
var _238=$event(_237,_236);
var form=$element(_235);
if(_238.isKeyEvent()){
if(_238.isEnterKey()){
var _23a=form?form.formElements().detect(function(_23b){
return _23b.id()==_23b.form().id()+":default";
}):null;
_238.cancelDefaultAction();
Ice.Parameter.Query.create(function(_23c){
_23c.add("ice.submit.partial",false);
_238.serializeOn(_23c);
if(_23a){
_23a.serializeOn(_23c);
}
if(form){
form.serializeOn(_23c);
}
}).send();
}
}else{
var _23d=_236&&_236.id?$element(_236):null;
Ice.Parameter.Query.create(function(_23e){
_23e.add("ice.submit.partial",false);
_238.serializeOn(_23e);
if(_23d){
_23d.serializeOn(_23e);
}
if(form){
form.serializeOn(_23e);
}
}).send();
}
resetHiddenFieldsFor(_235);
}
function resetHiddenFieldsFor(_23f){
$enumerate(_23f.elements).each(function(_240){
if(_240.type=="hidden"&&_240.id==""){
_240.value="";
}
});
}
[Ice.Document=new Object,Ice.ElementModel.Element,Ice.Connection,Ice.Ajax].as(function(This,_242,_243,Ajax){
This.Synchronizer=Object.subclass({initialize:function(_245){
this.logger=_245.child("synchronizer");
this.ajax=new Ajax.Client(this.logger);
if(window.frames[0].location.hash.length>0){
this.reload();
}
},synchronize:function(){
try{
window.frames[0].location.hash="#reload";
this.logger.debug("mark document as modified");
this.synchronize=Function.NOOP;
}
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(_246){
_246.setRequestHeader("Connection","close");
_246.on(_243.Ok,function(){
var text=_246.content();
var _248="<BODY";
var end="</BODY>";
_242.adaptToElement(document.body).replaceHtml(text.substring(text.indexOf(_248),text.lastIndexOf(end)+end.length));
});
});
}
catch(e){
this.logger.error("failed to reload body",e);
}
}});
});
[Ice.Command=new Object].as(function(This){
This.Dispatcher=Object.subclass({initialize:function(){
this.commands=new Object;
},register:function(_24b,_24c){
this.commands[_24b]=_24c;
},deserializeAndExecute:function(_24d){
var _24e=_24d.tagName;
for(name in this.commands){
if(name==_24e){
this.commands[_24e](_24d);
return;
}
}
throw "Unknown message received: "+_24e;
}});
This.Redirect=function(_24f){
var url=_24f.getAttribute("url");
url=url.replace(/&#38;/g,"&");
logger.info("Redirecting to "+url);
if(url.contains("rvn=")){
window.connection.cancelDisposeViews();
}
window.location.href=url;
};
This.SetCookie=function(_251){
document.cookie=_251.firstChild.data;
};
This.ServerError=function(_252){
logger.error("Server side error");
logger.error(_252.firstChild.data);
statusManager.serverError.on();
application.dispose();
};
This.ParsingError=function(_253){
logger.error("Parsing error");
var _254=_253.firstChild;
logger.error(_254.data);
var _255=_254.firstChild;
logger.error(_255.data);
};
});
[Ice.Script=new Object,Ice.Ajax.Client].as(function(This,_257){
This.Loader=Object.subclass({initialize:function(_258){
this.logger=_258.child("script-loader");
this.referencedScripts=[];
this.client=new _257(this.logger);
$enumerate(document.documentElement.getElementsByTagName("script")).each(function(_259){
if(_259.src){
this.referencedScripts.push(_259.src);
}
}.bind(this));
},searchAndEvaluateScripts:function(_25a){
$enumerate(_25a.getElementsByTagName("script")).each(function(s){
this.evaluateScript(s);
}.bind(this));
},evaluateScript:function(_25c){
var uri=_25c.src;
if(uri){
if(!this.referencedScripts.include(_25c.src)){
this.logger.debug("loading : "+uri);
this.client.getAsynchronously(uri,"",function(_25e){
_25e.on(Ice.Connection.Ok,function(){
this.referencedScripts.push(uri);
this.logger.debug("evaluating script at : "+uri);
try{
eval(_25e.content());
}
catch(e){
this.logger.warn("Failed to evaluate script located at: "+uri,e);
}
}.bind(this));
}.bind(this));
}
}else{
var code=_25c.text;
this.logger.debug("evaluating script : "+code);
try{
eval(code);
}
catch(e){
this.logger.warn("Failed to evaluate script: \n"+code,e);
}
}
}});
});
function viewIdentifiers(){
return window.views.asSet();
}
function defaultParameters(){
return Ice.Parameter.Query.create(function(_260){
_260.add("ice.focus",currentFocus);
_260.add("ice.window",window.identifier);
_260.add("ice.session",window.session);
viewIdentifiers().each(function(view){
_260.add("ice.view.all",view);
});
});
}
var currentFocus;
Ice.Focus=new Object();
Ice.Focus.userInterupt=false;
Ice.Focus.userInterupt=function(e){
window.logger.debug("Interup pressed");
if(Ice.Focus.userInterupt==false){
window.logger.debug("User action. Set focus will be ignored.");
Ice.Focus.userInterupt=true;
}
};
Ice.Focus.setFocus=function(id){
window.setTimeout("Ice.Focus.setFocusNow('"+id+"');",100);
};
Ice.Focus.setFocusNow=function(id){
if((Ice.Focus.userInterupt==false)&&(id!="")&&(id!="undefined")){
try{
id.asExtendedElement().focus();
setFocus(id);
var ele=document.getElementById(id);
if(ele){
ele.focus();
}else{
window.logger.debug("Focus Failed. No element for id ["+id+"]");
}
window.logger.debug("Focus Set on ["+id+"]");
}
catch(e){
window.logger.error("Failed to set focus on ["+id+"]",e);
}
}else{
window.logger.debug("Focus interupted. Not Set on ["+id+"]");
}
};
document.onKeyDown=function(_266){
var _267=document.onkeydown;
document.onkeydown=_267!=null?function(e){
_266(Ice.EventModel.Event.adaptToKeyEvent(e));
_267(e);
}:function(e){
_266(Ice.EventModel.Event.adaptToKeyEvent(e));
};
};
document.onMouseDown=function(_26a){
var _26b=document.onmousedown;
document.onmousedown=_26b!=null?function(e){
_26a(e);
_26b(e);
}:function(e){
_26a(e);
};
};
document.onKeyDown(Ice.Focus.userInterupt);
document.onMouseDown(Ice.Focus.userInterupt);
function setFocus(id){
currentFocus=id;
}
window.onScroll(function(){
currentFocus=null;
window.focus();
});
[Ice.Status=new Object].as(function(This){
This.RedirectIndicator=Object.subclass({initialize:function(uri){
this.uri=uri;
},on:function(){
window.location.href=this.uri;
}});
This.ElementIndicator=Object.subclass({initialize:function(_271,_272){
this.elementID=_271;
this.indicators=_272;
this.indicators.push(this);
this.off();
},on:function(){
this.indicators.each(function(_273){
if(_273!=this){
_273.off();
}
}.bind(this));
this.elementID.asElement().style.visibility="visible";
},off:function(){
this.elementID.asElement().style.visibility="hidden";
}});
This.ToggleIndicator=Object.subclass({initialize:function(_274,_275){
this.onElement=_274;
this.offElement=_275;
this.off();
},on:function(){
this.onElement.on();
this.offElement.off();
},off:function(){
this.onElement.off();
this.offElement.on();
}});
This.PointerIndicator=Object.subclass({initialize:function(_276){
this.element=_276;
this.previousCursor=this.element.style.cursor;
},on:/Safari/.test(navigator.userAgent)?Function.NOOP:function(){
this.element.style.cursor="wait";
},off:/Safari/.test(navigator.userAgent)?Function.NOOP:function(){
this.element.style.cursor=this.previousCursor;
}});
This.OverlayIndicator=Object.subclass({initialize:function(_277,_278,_279,_27a){
this.message=_277;
this.description=_278;
this.iconPath=_279;
this.panel=_27a;
},on:function(){
this.panel.on();
messageContainer=document.createElement("div");
messageContainer.style.position="absolute";
messageContainer.style.textAlign="center";
messageContainer.style.zIndex="10001";
messageContainer.style.color="black";
messageContainer.style.backgroundColor="white";
messageContainer.style.paddingLeft="0";
messageContainer.style.paddingRight="0";
messageContainer.style.paddingTop="15px";
messageContainer.style.paddingBottom="15px";
messageContainer.style.borderBottomColor="gray";
messageContainer.style.borderRightColor="gray";
messageContainer.style.borderTopColor="silver";
messageContainer.style.borderLeftColor="silver";
messageContainer.style.borderWidth="2px";
messageContainer.style.borderStyle="solid";
messageContainer.style.width="270px";
document.body.appendChild(messageContainer);
var _27b=document.createElement("div");
_27b.appendChild(document.createTextNode(this.message));
_27b.style.marginLeft="30px";
_27b.style.textAlign="left";
_27b.style.fontSize="14px";
_27b.style.fontSize="14px";
_27b.style.fontWeight="bold";
messageContainer.appendChild(_27b);
var _27c=document.createElement("div");
_27c.appendChild(document.createTextNode(this.description));
_27c.style.fontSize="11px";
_27c.style.marginTop="7px";
_27c.style.marginBottom="7px";
_27c.style.fontWeight="normal";
_27b.appendChild(_27c);
var _27d=document.createElement("input");
_27d.type="button";
_27d.value="Reload";
_27d.style.fontSize="11px";
_27d.style.fontWeight="normal";
_27d.onclick=function(){
window.location.reload();
};
messageContainer.appendChild(_27d);
var _27e=function(){
messageContainer.style.left=((window.width()-messageContainer.clientWidth)/2)+"px";
messageContainer.style.top=((window.height()-messageContainer.clientHeight)/2)+"px";
}.bind(this);
_27e();
window.onResize(_27e);
}});
This.StatusManager=Object.subclass({initialize:function(_27f){
var _280=_27f.redirectURI?new This.RedirectIndicator(_27f.redirectURI):null;
if("connection-status".asElement()){
this.indicators=[];
var _281=new This.ElementIndicator("connection-working",this.indicators);
var _282=new This.ElementIndicator("connection-idle",this.indicators);
this.busy=new This.ToggleIndicator(_281,_282);
this.connectionLost=_280?_280:new This.ElementIndicator("connection-lost",this.indicators);
this.connectionTrouble=new This.ElementIndicator("connection-trouble",this.indicators);
this.sessionExpired=this.connectionLost;
this.serverError=this.connectionLost;
}else{
this.busy=new This.PointerIndicator(document.body);
var _283="To reconnect click the Reload button on the browser or click the button below";
var _284=_27f.connection.context+"/xmlhttp/css/xp/css-images/connect_disconnected.gif";
var _285=_27f.connection.context+"/xmlhttp/css/xp/css-images/connect_caution.gif";
this.sessionExpired=new This.OverlayIndicator("User Session Expired",_283,_284,this);
this.serverError=new This.OverlayIndicator("Server Internal Error",_283,_285,this);
this.connectionLost=_280?_280:new This.OverlayIndicator("Network Connection Interrupted",_283,_285,this);
this.connectionTrouble={on:Function.NOOP,off:Function.NOOP};
}
},on:function(){
document.body.style.zIndex="0";
window.frames[0].document.body.style.backgroundColor="white";
var _286=document.getElementById("history-frame");
_286.style.position="absolute";
_286.style.display="block";
_286.style.visibility="visible";
_286.style.backgroundColor="white";
_286.style.zIndex="10000";
_286.style.top="0";
_286.style.left="0";
var _287=function(){
var _288=document.documentElement.scrollWidth;
var _289=document.body.scrollWidth;
var _28a=document.documentElement.scrollHeight;
var _28b=document.body.scrollHeight;
_286.style.width=(_289>_288?_289:_288)+"px";
_286.style.height=(_28b>_28a?_28b:_28a)+"px";
};
_287();
window.onResize(_287);
}});
});
[Ice.Connection=new Object,Ice.Connection,Ice.Ajax].as(function(This,_28d,Ajax){
This.FormPost=function(_28f){
_28f.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=UTF-8");
};
This.Close=function(_290){
_290.close();
};
This.BadResponse=function(_291){
return _291.isComplete()&&!_291.isResponseValid();
};
This.ServerError=function(_292){
return _292.isComplete()&&_292.isServerError();
};
This.Receive=function(_293){
return _293.isOkAndComplete();
};
This.Ok=function(_294){
return _294.isOkAndComplete();
};
This.SyncConnection=Object.subclass({initialize:function(_295,_296,_297){
this.logger=_295.child("sync-connection");
this.channel=new Ajax.Client(this.logger);
this.defaultQuery=_297;
this.onSendListeners=[];
this.onReceiveListeners=[];
this.onServerErrorListeners=[];
this.connectionDownListeners=[];
this.timeoutBomb={cancel:Function.NOOP};
this.logger.info("synchronous mode");
this.sendURI=_296.context+"block/send-receive-updates";
this.disposeViewsURI=_296.context+"block/dispose-views";
var _298=_296.timeout?_296.timeout:5000;
this.onSend(function(){
this.timeoutBomb.cancel();
this.timeoutBomb=this.connectionDownListeners.broadcaster().delayExecutionFor(_298);
}.bind(this));
this.onReceive(function(){
this.timeoutBomb.cancel();
}.bind(this));
this.whenDown(function(){
this.timeoutBomb.cancel();
}.bind(this));
this.receiveCallback=function(_299){
try{
this.onReceiveListeners.broadcast(_299);
}
catch(e){
this.logger.error("receive broadcast failed",e);
}
}.bind(this);
this.badResponseCallback=this.connectionDownListeners.broadcaster();
this.serverErrorCallback=this.onServerErrorListeners.broadcaster();
},send:function(_29a){
this.logger.debug("send > "+_29a.asString());
var _29b=_29a.addQuery(this.defaultQuery());
this.channel.postAsynchronously(this.sendURI,_29b.asURIEncodedString(),function(_29c){
This.FormPost(_29c);
_29c.on(_28d.Receive,this.receiveCallback);
_29c.on(_28d.BadResponse,this.badResponseCallback);
_29c.on(_28d.ServerError,this.serverErrorCallback);
this.onSendListeners.broadcast(_29c);
}.bind(this));
},onSend:function(_29d){
this.onSendListeners.push(_29d);
},onReceive:function(_29e){
this.onReceiveListeners.push(_29e);
},onServerError:function(_29f){
this.onServerErrorListeners.push(_29f);
},whenDown:function(_2a0){
this.connectionDownListeners.push(_2a0);
},whenTrouble:function(_2a1){
},cancelDisposeViews:function(){
this.sendDisposeViews=Function.NOOP;
},sendDisposeViews:function(){
try{
this.channel.postAsynchronously(this.disposeViewsURI,this.defaultQuery().asURIEncodedString(),function(_2a2){
_28d.FormPost(_2a2);
_2a2.close();
});
}
catch(e){
this.logger.warn("Failed to notify view disposal",e);
}
},shutdown:function(){
this.shutdown=Function.NOOP;
this.send=Function.NOOP;
[this.onSendListeners,this.onReceiveListeners,this.onServerErrorListeners,this.connectionDownListeners].eachWithGuard(function(_2a3){
_2a3.clear();
});
}});
});
Ice.Community=new Object;
[Ice.Reliability=new Object].as(function(This){
This.Heartbeat=Object.subclass({initialize:function(_2a5,_2a6,_2a7){
this.period=_2a5;
this.logger=_2a7.child("heartbeat");
this.pingListeners=[];
this.lostPongListeners=[];
this.beat=function(){
var _2a8=function(){
this.logger.warn("pong lost");
this.lostPongListeners.each(function(_2a9){
_2a9.notify();
});
}.bind(this).delayExecutionFor(_2a6);
this.pingListeners.broadcast(new This.Ping(_2a8,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.lostPongListeners.each(function(_2ab){
_2ab.ignoreNotifications();
});
this.logger.info("heartbeat stopped");
}
catch(e){
this.logger.warn("heartbeat not started",e);
}
return this;
},reset:function(){
this.lostPongListeners.each(function(_2ac){
_2ac.reset();
});
},onPing:function(_2ad){
this.pingListeners.push(_2ad);
},onLostPongs:function(_2ae,_2af){
var _2b0=_2af||1;
this.lostPongListeners.push(new This.CoalescingListener(_2b0,_2ae));
}});
This.Ping=Object.subclass({initialize:function(pid,_2b2,_2b3){
this.pid=pid;
this.heartbeat=_2b2;
this.logger=_2b3;
this.logger.info("ping");
},pong:function(){
if(this.pid){
this.heartbeat.reset();
this.pid.cancel();
this.pong=Function.NOOP;
this.logger.info("pong");
}
}});
This.CoalescingListener=Object.subclass({initialize:function(_2b4,_2b5){
this.count=0;
this.retries=_2b4;
this.callback=_2b5;
},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.Command].as(function(This,_2b7,Ajax,_2b9,_2ba){
This.AsyncConnection=Object.subclass({initialize:function(_2bb,_2bc,_2bd,_2be){
this.logger=_2bb.child("async-connection");
this.sendChannel=new Ajax.Client(this.logger.child("ui"));
this.receiveChannel=new Ajax.Client(this.logger.child("blocking"));
this.defaultQuery=_2bd;
this.onSendListeners=[];
this.onReceiveListeners=[];
this.onServerErrorListeners=[];
this.connectionDownListeners=[];
this.connectionTroubleListeners=[];
this.listener={close:Function.NOOP};
this.timeoutBomb={cancel:Function.NOOP};
this.heartbeat={stop:Function.NOOP};
this.pingURI=_2bc.context+"block/ping";
this.getURI=_2bc.context+"block/receive-updates";
this.sendURI=_2bc.context+"block/send-receive-updates";
this.receiveURI=_2bc.context+"block/receive-updated-views";
this.disposeViewsURI=_2bc.context+"block/dispose-views";
var _2bf=_2bc.timeout?_2bc.timeout:5000;
this.onSend(function(){
this.timeoutBomb.cancel();
this.timeoutBomb=this.connectionDownListeners.broadcaster().delayExecutionFor(_2bf);
}.bind(this));
this.onReceive(function(){
this.timeoutBomb.cancel();
}.bind(this));
this.badResponseCallback=this.connectionDownListeners.broadcaster();
this.serverErrorCallback=this.onServerErrorListeners.broadcaster();
this.receiveCallback=function(_2c0){
try{
this.onReceiveListeners.broadcast(_2c0);
}
catch(e){
this.logger.error("receive broadcast failed",e);
}
}.bind(this);
this.sendXWindowCookie=Function.NOOP;
this.receiveXWindowCookie=function(_2c1){
var _2c2=_2c1.getResponseHeader("X-Set-Window-Cookie");
if(_2c2){
this.sendXWindowCookie=function(_2c3){
_2c3.setRequestHeader("X-Window-Cookie",_2c2);
};
}
}.bind(this);
try{
this.updatedViews=Ice.Cookie.lookup("updates");
}
catch(e){
this.updatedViews=new Ice.Cookie("updates","");
}
_2be.register("updated-views",function(_2c4){
this.updatedViews.saveValue(_2c4.firstChild.data);
}.bind(this));
this.listenerInitializerProcess=function(){
try{
this.listening=Ice.Cookie.lookup("bconn");
}
catch(e){
this.listening=new Ice.Cookie("bconn","started");
this.heartbeat.stop();
var _2c5=_2bc.heartbeat.interval?_2bc.heartbeat.interval:20000;
var _2c6=_2bc.heartbeat.timeout?_2bc.heartbeat.timeout:3000;
var _2c7=_2bc.heartbeat.retries?_2bc.heartbeat.retries:3;
this.heartbeat=new _2b9(_2c5,_2c6,this.logger);
this.heartbeat.onPing(function(ping){
_2be.register("pong",function(){
ping.pong();
});
this.sendChannel.postAsynchronously(this.pingURI,this.defaultQuery().asURIEncodedString(),_2b7.FormPost);
}.bind(this));
this.heartbeat.onLostPongs(this.connectionDownListeners.broadcaster(),_2c7);
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).repeatExecutionEvery(1000);
this.updatesListenerProcess=function(){
try{
var _2c9=this.updatedViews.loadValue().split(" ");
if(_2c9.intersect(viewIdentifiers()).isNotEmpty()){
this.sendChannel.postAsynchronously(this.getURI,this.defaultQuery().asURIEncodedString(),function(_2ca){
_2b7.FormPost(_2ca);
_2ca.on(_2b7.Receive,this.receiveCallback);
_2ca.on(_2b7.Receive,_2b7.Close);
}.bind(this));
this.updatedViews.saveValue(_2c9.complement(viewIdentifiers()).join(" "));
}
}
catch(e){
this.logger.warn("failed to listen for updates",e);
}
}.bind(this).repeatExecutionEvery(300);
this.logger.info("asynchronous mode");
},connect:function(){
this.logger.debug("closing previous connection...");
this.listener.close();
this.logger.debug("connect...");
this.listener=this.receiveChannel.postAsynchronously(this.receiveURI,this.defaultQuery().asURIEncodedString(),function(_2cb){
this.sendXWindowCookie(_2cb);
_2b7.FormPost(_2cb);
_2cb.on(_2b7.BadResponse,this.badResponseCallback);
_2cb.on(_2b7.ServerError,this.serverErrorCallback);
_2cb.on(_2b7.Receive,this.receiveCallback);
_2cb.on(_2b7.Receive,this.receiveXWindowCookie);
_2cb.on(_2b7.Receive,function(){
this.connect();
}.bind(this).delayFor(150));
}.bind(this));
},send:function(_2cc){
var _2cd=_2cc.addQuery(this.defaultQuery());
this.logger.debug("send > "+_2cd.asString());
this.sendChannel.postAsynchronously(this.sendURI,_2cd.asURIEncodedString(),function(_2ce){
_2b7.FormPost(_2ce);
_2ce.on(_2b7.Receive,this.receiveCallback);
_2ce.on(_2b7.ServerError,this.serverErrorCallback);
_2ce.on(_2b7.Receive,_2b7.Close);
this.onSendListeners.broadcast(_2ce);
}.bind(this));
},onSend:function(_2cf){
this.onSendListeners.push(_2cf);
},onReceive:function(_2d0){
this.onReceiveListeners.push(_2d0);
},onServerError:function(_2d1){
this.onServerErrorListeners.push(_2d1);
},whenDown:function(_2d2){
this.connectionDownListeners.push(_2d2);
},whenTrouble:function(_2d3){
this.connectionTroubleListeners.push(_2d3);
},cancelDisposeViews:function(){
this.sendDisposeViews=Function.NOOP;
},sendDisposeViews:function(){
try{
this.sendChannel.postAsynchronously(this.disposeViewsURI,this.defaultQuery().asURIEncodedString(),function(_2d4){
_2b7.FormPost(_2d4);
_2d4.close();
});
}
catch(e){
this.logger.warn("Failed to notify view disposal",e);
}
},shutdown:function(){
try{
this.shutdown=Function.NOOP;
this.send=Function.NOOP;
this.connect=Function.NOOP;
this.heartbeat.stop();
this.listening.remove();
this.listener.close();
}
catch(e){
}
finally{
[this.onSendListeners,this.onReceiveListeners,this.connectionDownListeners,this.onServerErrorListeners].eachWithGuard(function(_2d5){
_2d5.clear();
});
[this.updatesListenerProcess,this.listenerInitializerProcess].eachWithGuard(function(_2d6){
_2d6.cancel();
});
}
}});
});
[Ice.Community].as(function(This){
This.Application=Object.subclass({initialize:function(){
var _2d8=window.logger=this.logger=new Ice.Log.Logger(["window"]);
this.logHandler=window.console&&window.console.firebug?new Ice.Log.FirebugLogHandler(_2d8):new Ice.Log.WindowLogHandler(_2d8,window);
var _2d9=new Ice.Document.Synchronizer(_2d8);
var _2da=new Ice.Status.StatusManager(configuration);
var _2db=new Ice.Script.Loader(_2d8);
var _2dc=new Ice.Command.Dispatcher();
_2dc.register("noop",Function.NOOP);
_2dc.register("set-cookie",Ice.Command.SetCookie);
_2dc.register("redirect",Ice.Command.Redirect);
_2dc.register("parsererror",Ice.Command.ParsingError);
_2dc.register("macro",function(_2dd){
$enumerate(_2dd.childNodes).each(function(_2de){
_2dc.deserializeAndExecute(_2de);
});
});
_2dc.register("updates",function(_2df){
$enumerate(_2df.getElementsByTagName("update")).each(function(_2e0){
try{
var _2e1=_2e0.getAttribute("address");
var html=_2e0.firstChild.data.replace(/<\!\#cdata\#/g,"<![CDATA[").replace(/\#\#>/g,"]]>");
_2e1.asExtendedElement().replaceHtml(html);
_2d8.debug("applied update : "+html);
_2db.searchAndEvaluateScripts(_2e1.asElement());
}
catch(e){
_2d8.error("failed to insert element: "+html,e);
}
});
});
_2dc.register("server-error",function(_2e3){
_2d8.error("Server side error");
_2d8.error(_2e3.firstChild.data);
_2da.serverError.on();
this.dispose();
}.bind(this));
_2dc.register("session-expired",function(){
_2d8.warn("Session has expired");
_2da.sessionExpired.on();
this.dispose();
}.bind(this));
window.identifier=Math.round(Math.random()*10000).toString();
window.connection=this.connection=configuration.synchronous?new Ice.Connection.SyncConnection(_2d8,configuration.connection,defaultParameters):new This.Connection.AsyncConnection(_2d8,configuration.connection,defaultParameters,_2dc);
window.onKeyPress(function(e){
if(e.isEscKey()){
e.cancelDefaultAction();
}
});
window.onBeforeUnload(function(){
this.connection.sendDisposeViews();
this.connection.shutdown();
}.bind(this));
this.connection.onSend(function(){
Ice.Focus.userInterupt=false;
});
this.connection.onReceive(function(_2e5){
_2dc.deserializeAndExecute(_2e5.contentAsDOM().documentElement);
});
this.connection.onReceive(function(){
_2d9.synchronize();
});
this.connection.onServerError(function(_2e6){
this.dispose();
$element(document.documentElement).replaceHtml(_2e6.content());
_2db.searchAndEvaluateScripts(document.documentElement);
}.bind(this));
this.connection.whenDown(function(){
_2d8.warn("connection to server was lost");
_2da.connectionLost.on();
this.dispose();
}.bind(this));
this.connection.whenTrouble(function(){
_2d8.warn("connection in trouble");
_2da.connectionTrouble.on();
});
this.connection.onSend(function(_2e7){
_2da.busy.on();
});
this.connection.onReceive(function(_2e8){
_2da.busy.off();
});
this.logger.info("page loaded!");
},dispose:function(){
this.connection.shutdown();
this.logger.info("page unloaded!");
this.logHandler.disable();
this.dispose=Function.NOOP;
}});
window.onLoad(function(){
this.application=new This.Application;
});
window.onUnload(function(){
this.application.dispose();
});
});

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','defaultParameters','iceSubmit','$A','resetHiddenFieldsFor','$H','setFocus','property','$R','$break','Hash','ObjectRange','$w','Template','current','$continue','PeriodicalExecuter','viewIdentifiers','Try','currentFocus','Abstract','Ice','iceSubmitPartial']);}

