PageRenderTime 387ms CodeModel.GetById 81ms app.highlight 252ms RepoModel.GetById 20ms app.codeStats 1ms

/ajax/simile-ajax-bundle-debug.js

http://showslow.googlecode.com/
JavaScript | 1574 lines | 1547 code | 18 blank | 9 comment | 69 complexity | 2a118d93283b01bcb262e777295023e6 MD5 | raw file

Large files files are truncated, but you can click here to view the full file

   1
   2
   3/* platform.js */
   4SimileAjax.version="2.2.1";
   5SimileAjax.jQuery=jQuery.noConflict(true);
   6if(typeof window["$"]=="undefined"){window.$=SimileAjax.jQuery;
   7}SimileAjax.Platform.os={isMac:false,isWin:false,isWin32:false,isUnix:false};
   8SimileAjax.Platform.browser={isIE:false,isNetscape:false,isMozilla:false,isFirefox:false,isOpera:false,isSafari:false,majorVersion:0,minorVersion:0};
   9(function(){var an=navigator.appName.toLowerCase();
  10var ua=navigator.userAgent.toLowerCase();
  11SimileAjax.Platform.os.isMac=(ua.indexOf("mac")!=-1);
  12SimileAjax.Platform.os.isWin=(ua.indexOf("win")!=-1);
  13SimileAjax.Platform.os.isWin32=SimileAjax.Platform.isWin&&(ua.indexOf("95")!=-1||ua.indexOf("98")!=-1||ua.indexOf("nt")!=-1||ua.indexOf("win32")!=-1||ua.indexOf("32bit")!=-1);
  14SimileAjax.Platform.os.isUnix=(ua.indexOf("x11")!=-1);
  15SimileAjax.Platform.browser.isIE=(an.indexOf("microsoft")!=-1);
  16SimileAjax.Platform.browser.isNetscape=(an.indexOf("netscape")!=-1);
  17SimileAjax.Platform.browser.isMozilla=(ua.indexOf("mozilla")!=-1);
  18SimileAjax.Platform.browser.isFirefox=(ua.indexOf("firefox")!=-1);
  19SimileAjax.Platform.browser.isOpera=(an.indexOf("opera")!=-1);
  20SimileAjax.Platform.browser.isSafari=(an.indexOf("safari")!=-1);
  21var parseVersionString=function(s){var a=s.split(".");
  22SimileAjax.Platform.browser.majorVersion=parseInt(a[0]);
  23SimileAjax.Platform.browser.minorVersion=parseInt(a[1]);
  24};
  25var indexOf=function(s,sub,start){var i=s.indexOf(sub,start);
  26return i>=0?i:s.length;
  27};
  28if(SimileAjax.Platform.browser.isMozilla){var offset=ua.indexOf("mozilla/");
  29if(offset>=0){parseVersionString(ua.substring(offset+8,indexOf(ua," ",offset)));
  30}}if(SimileAjax.Platform.browser.isIE){var offset=ua.indexOf("msie ");
  31if(offset>=0){parseVersionString(ua.substring(offset+5,indexOf(ua,";",offset)));
  32}}if(SimileAjax.Platform.browser.isNetscape){var offset=ua.indexOf("rv:");
  33if(offset>=0){parseVersionString(ua.substring(offset+3,indexOf(ua,")",offset)));
  34}}if(SimileAjax.Platform.browser.isFirefox){var offset=ua.indexOf("firefox/");
  35if(offset>=0){parseVersionString(ua.substring(offset+8,indexOf(ua," ",offset)));
  36}}if(!("localeCompare" in String.prototype)){String.prototype.localeCompare=function(s){if(this<s){return -1;
  37}else{if(this>s){return 1;
  38}else{return 0;
  39}}};
  40}})();
  41SimileAjax.Platform.getDefaultLocale=function(){return SimileAjax.Platform.clientLocale;
  42};
  43
  44
  45/* ajax.js */
  46SimileAjax.ListenerQueue=function(wildcardHandlerName){this._listeners=[];
  47this._wildcardHandlerName=wildcardHandlerName;
  48};
  49SimileAjax.ListenerQueue.prototype.add=function(listener){this._listeners.push(listener);
  50};
  51SimileAjax.ListenerQueue.prototype.remove=function(listener){var listeners=this._listeners;
  52for(var i=0;
  53i<listeners.length;
  54i++){if(listeners[i]==listener){listeners.splice(i,1);
  55break;
  56}}};
  57SimileAjax.ListenerQueue.prototype.fire=function(handlerName,args){var listeners=[].concat(this._listeners);
  58for(var i=0;
  59i<listeners.length;
  60i++){var listener=listeners[i];
  61if(handlerName in listener){try{listener[handlerName].apply(listener,args);
  62}catch(e){SimileAjax.Debug.exception("Error firing event of name "+handlerName,e);
  63}}else{if(this._wildcardHandlerName!=null&&this._wildcardHandlerName in listener){try{listener[this._wildcardHandlerName].apply(listener,[handlerName]);
  64}catch(e){SimileAjax.Debug.exception("Error firing event of name "+handlerName+" to wildcard handler",e);
  65}}}}};
  66
  67
  68/* data-structure.js */
  69SimileAjax.Set=function(a){this._hash={};
  70this._count=0;
  71if(a instanceof Array){for(var i=0;
  72i<a.length;
  73i++){this.add(a[i]);
  74}}else{if(a instanceof SimileAjax.Set){this.addSet(a);
  75}}};
  76SimileAjax.Set.prototype.add=function(o){if(!(o in this._hash)){this._hash[o]=true;
  77this._count++;
  78return true;
  79}return false;
  80};
  81SimileAjax.Set.prototype.addSet=function(set){for(var o in set._hash){this.add(o);
  82}};
  83SimileAjax.Set.prototype.remove=function(o){if(o in this._hash){delete this._hash[o];
  84this._count--;
  85return true;
  86}return false;
  87};
  88SimileAjax.Set.prototype.removeSet=function(set){for(var o in set._hash){this.remove(o);
  89}};
  90SimileAjax.Set.prototype.retainSet=function(set){for(var o in this._hash){if(!set.contains(o)){delete this._hash[o];
  91this._count--;
  92}}};
  93SimileAjax.Set.prototype.contains=function(o){return(o in this._hash);
  94};
  95SimileAjax.Set.prototype.size=function(){return this._count;
  96};
  97SimileAjax.Set.prototype.toArray=function(){var a=[];
  98for(var o in this._hash){a.push(o);
  99}return a;
 100};
 101SimileAjax.Set.prototype.visit=function(f){for(var o in this._hash){if(f(o)==true){break;
 102}}};
 103SimileAjax.SortedArray=function(compare,initialArray){this._a=(initialArray instanceof Array)?initialArray:[];
 104this._compare=compare;
 105};
 106SimileAjax.SortedArray.prototype.add=function(elmt){var sa=this;
 107var index=this.find(function(elmt2){return sa._compare(elmt2,elmt);
 108});
 109if(index<this._a.length){this._a.splice(index,0,elmt);
 110}else{this._a.push(elmt);
 111}};
 112SimileAjax.SortedArray.prototype.remove=function(elmt){var sa=this;
 113var index=this.find(function(elmt2){return sa._compare(elmt2,elmt);
 114});
 115while(index<this._a.length&&this._compare(this._a[index],elmt)==0){if(this._a[index]==elmt){this._a.splice(index,1);
 116return true;
 117}else{index++;
 118}}return false;
 119};
 120SimileAjax.SortedArray.prototype.removeAll=function(){this._a=[];
 121};
 122SimileAjax.SortedArray.prototype.elementAt=function(index){return this._a[index];
 123};
 124SimileAjax.SortedArray.prototype.length=function(){return this._a.length;
 125};
 126SimileAjax.SortedArray.prototype.find=function(compare){var a=0;
 127var b=this._a.length;
 128while(a<b){var mid=Math.floor((a+b)/2);
 129var c=compare(this._a[mid]);
 130if(mid==a){return c<0?a+1:a;
 131}else{if(c<0){a=mid;
 132}else{b=mid;
 133}}}return a;
 134};
 135SimileAjax.SortedArray.prototype.getFirst=function(){return(this._a.length>0)?this._a[0]:null;
 136};
 137SimileAjax.SortedArray.prototype.getLast=function(){return(this._a.length>0)?this._a[this._a.length-1]:null;
 138};
 139SimileAjax.EventIndex=function(unit){var eventIndex=this;
 140this._unit=(unit!=null)?unit:SimileAjax.NativeDateUnit;
 141this._events=new SimileAjax.SortedArray(function(event1,event2){return eventIndex._unit.compare(event1.getStart(),event2.getStart());
 142});
 143this._idToEvent={};
 144this._indexed=true;
 145};
 146SimileAjax.EventIndex.prototype.getUnit=function(){return this._unit;
 147};
 148SimileAjax.EventIndex.prototype.getEvent=function(id){return this._idToEvent[id];
 149};
 150SimileAjax.EventIndex.prototype.add=function(evt){this._events.add(evt);
 151this._idToEvent[evt.getID()]=evt;
 152this._indexed=false;
 153};
 154SimileAjax.EventIndex.prototype.removeAll=function(){this._events.removeAll();
 155this._idToEvent={};
 156this._indexed=false;
 157};
 158SimileAjax.EventIndex.prototype.getCount=function(){return this._events.length();
 159};
 160SimileAjax.EventIndex.prototype.getIterator=function(startDate,endDate){if(!this._indexed){this._index();
 161}return new SimileAjax.EventIndex._Iterator(this._events,startDate,endDate,this._unit);
 162};
 163SimileAjax.EventIndex.prototype.getReverseIterator=function(startDate,endDate){if(!this._indexed){this._index();
 164}return new SimileAjax.EventIndex._ReverseIterator(this._events,startDate,endDate,this._unit);
 165};
 166SimileAjax.EventIndex.prototype.getAllIterator=function(){return new SimileAjax.EventIndex._AllIterator(this._events);
 167};
 168SimileAjax.EventIndex.prototype.getEarliestDate=function(){var evt=this._events.getFirst();
 169return(evt==null)?null:evt.getStart();
 170};
 171SimileAjax.EventIndex.prototype.getLatestDate=function(){var evt=this._events.getLast();
 172if(evt==null){return null;
 173}if(!this._indexed){this._index();
 174}var index=evt._earliestOverlapIndex;
 175var date=this._events.elementAt(index).getEnd();
 176for(var i=index+1;
 177i<this._events.length();
 178i++){date=this._unit.later(date,this._events.elementAt(i).getEnd());
 179}return date;
 180};
 181SimileAjax.EventIndex.prototype._index=function(){var l=this._events.length();
 182for(var i=0;
 183i<l;
 184i++){var evt=this._events.elementAt(i);
 185evt._earliestOverlapIndex=i;
 186}var toIndex=1;
 187for(var i=0;
 188i<l;
 189i++){var evt=this._events.elementAt(i);
 190var end=evt.getEnd();
 191toIndex=Math.max(toIndex,i+1);
 192while(toIndex<l){var evt2=this._events.elementAt(toIndex);
 193var start2=evt2.getStart();
 194if(this._unit.compare(start2,end)<0){evt2._earliestOverlapIndex=i;
 195toIndex++;
 196}else{break;
 197}}}this._indexed=true;
 198};
 199SimileAjax.EventIndex._Iterator=function(events,startDate,endDate,unit){this._events=events;
 200this._startDate=startDate;
 201this._endDate=endDate;
 202this._unit=unit;
 203this._currentIndex=events.find(function(evt){return unit.compare(evt.getStart(),startDate);
 204});
 205if(this._currentIndex-1>=0){this._currentIndex=this._events.elementAt(this._currentIndex-1)._earliestOverlapIndex;
 206}this._currentIndex--;
 207this._maxIndex=events.find(function(evt){return unit.compare(evt.getStart(),endDate);
 208});
 209this._hasNext=false;
 210this._next=null;
 211this._findNext();
 212};
 213SimileAjax.EventIndex._Iterator.prototype={hasNext:function(){return this._hasNext;
 214},next:function(){if(this._hasNext){var next=this._next;
 215this._findNext();
 216return next;
 217}else{return null;
 218}},_findNext:function(){var unit=this._unit;
 219while((++this._currentIndex)<this._maxIndex){var evt=this._events.elementAt(this._currentIndex);
 220if(unit.compare(evt.getStart(),this._endDate)<0&&unit.compare(evt.getEnd(),this._startDate)>0){this._next=evt;
 221this._hasNext=true;
 222return ;
 223}}this._next=null;
 224this._hasNext=false;
 225}};
 226SimileAjax.EventIndex._ReverseIterator=function(events,startDate,endDate,unit){this._events=events;
 227this._startDate=startDate;
 228this._endDate=endDate;
 229this._unit=unit;
 230this._minIndex=events.find(function(evt){return unit.compare(evt.getStart(),startDate);
 231});
 232if(this._minIndex-1>=0){this._minIndex=this._events.elementAt(this._minIndex-1)._earliestOverlapIndex;
 233}this._maxIndex=events.find(function(evt){return unit.compare(evt.getStart(),endDate);
 234});
 235this._currentIndex=this._maxIndex;
 236this._hasNext=false;
 237this._next=null;
 238this._findNext();
 239};
 240SimileAjax.EventIndex._ReverseIterator.prototype={hasNext:function(){return this._hasNext;
 241},next:function(){if(this._hasNext){var next=this._next;
 242this._findNext();
 243return next;
 244}else{return null;
 245}},_findNext:function(){var unit=this._unit;
 246while((--this._currentIndex)>=this._minIndex){var evt=this._events.elementAt(this._currentIndex);
 247if(unit.compare(evt.getStart(),this._endDate)<0&&unit.compare(evt.getEnd(),this._startDate)>0){this._next=evt;
 248this._hasNext=true;
 249return ;
 250}}this._next=null;
 251this._hasNext=false;
 252}};
 253SimileAjax.EventIndex._AllIterator=function(events){this._events=events;
 254this._index=0;
 255};
 256SimileAjax.EventIndex._AllIterator.prototype={hasNext:function(){return this._index<this._events.length();
 257},next:function(){return this._index<this._events.length()?this._events.elementAt(this._index++):null;
 258}};
 259
 260
 261/* date-time.js */
 262SimileAjax.DateTime=new Object();
 263SimileAjax.DateTime.MILLISECOND=0;
 264SimileAjax.DateTime.SECOND=1;
 265SimileAjax.DateTime.MINUTE=2;
 266SimileAjax.DateTime.HOUR=3;
 267SimileAjax.DateTime.DAY=4;
 268SimileAjax.DateTime.WEEK=5;
 269SimileAjax.DateTime.MONTH=6;
 270SimileAjax.DateTime.YEAR=7;
 271SimileAjax.DateTime.DECADE=8;
 272SimileAjax.DateTime.CENTURY=9;
 273SimileAjax.DateTime.MILLENNIUM=10;
 274SimileAjax.DateTime.EPOCH=-1;
 275SimileAjax.DateTime.ERA=-2;
 276SimileAjax.DateTime.gregorianUnitLengths=[];
 277(function(){var d=SimileAjax.DateTime;
 278var a=d.gregorianUnitLengths;
 279a[d.MILLISECOND]=1;
 280a[d.SECOND]=1000;
 281a[d.MINUTE]=a[d.SECOND]*60;
 282a[d.HOUR]=a[d.MINUTE]*60;
 283a[d.DAY]=a[d.HOUR]*24;
 284a[d.WEEK]=a[d.DAY]*7;
 285a[d.MONTH]=a[d.DAY]*31;
 286a[d.YEAR]=a[d.DAY]*365;
 287a[d.DECADE]=a[d.YEAR]*10;
 288a[d.CENTURY]=a[d.YEAR]*100;
 289a[d.MILLENNIUM]=a[d.YEAR]*1000;
 290})();
 291SimileAjax.DateTime._dateRegexp=new RegExp("^(-?)([0-9]{4})("+["(-?([0-9]{2})(-?([0-9]{2}))?)","(-?([0-9]{3}))","(-?W([0-9]{2})(-?([1-7]))?)"].join("|")+")?$");
 292SimileAjax.DateTime._timezoneRegexp=new RegExp("Z|(([-+])([0-9]{2})(:?([0-9]{2}))?)$");
 293SimileAjax.DateTime._timeRegexp=new RegExp("^([0-9]{2})(:?([0-9]{2})(:?([0-9]{2})(.([0-9]+))?)?)?$");
 294SimileAjax.DateTime.setIso8601Date=function(dateObject,string){var d=string.match(SimileAjax.DateTime._dateRegexp);
 295if(!d){throw new Error("Invalid date string: "+string);
 296}var sign=(d[1]=="-")?-1:1;
 297var year=sign*d[2];
 298var month=d[5];
 299var date=d[7];
 300var dayofyear=d[9];
 301var week=d[11];
 302var dayofweek=(d[13])?d[13]:1;
 303dateObject.setUTCFullYear(year);
 304if(dayofyear){dateObject.setUTCMonth(0);
 305dateObject.setUTCDate(Number(dayofyear));
 306}else{if(week){dateObject.setUTCMonth(0);
 307dateObject.setUTCDate(1);
 308var gd=dateObject.getUTCDay();
 309var day=(gd)?gd:7;
 310var offset=Number(dayofweek)+(7*Number(week));
 311if(day<=4){dateObject.setUTCDate(offset+1-day);
 312}else{dateObject.setUTCDate(offset+8-day);
 313}}else{if(month){dateObject.setUTCDate(1);
 314dateObject.setUTCMonth(month-1);
 315}if(date){dateObject.setUTCDate(date);
 316}}}return dateObject;
 317};
 318SimileAjax.DateTime.setIso8601Time=function(dateObject,string){var d=string.match(SimileAjax.DateTime._timeRegexp);
 319if(!d){SimileAjax.Debug.warn("Invalid time string: "+string);
 320return false;
 321}var hours=d[1];
 322var mins=Number((d[3])?d[3]:0);
 323var secs=(d[5])?d[5]:0;
 324var ms=d[7]?(Number("0."+d[7])*1000):0;
 325dateObject.setUTCHours(hours);
 326dateObject.setUTCMinutes(mins);
 327dateObject.setUTCSeconds(secs);
 328dateObject.setUTCMilliseconds(ms);
 329return dateObject;
 330};
 331SimileAjax.DateTime.timezoneOffset=new Date().getTimezoneOffset();
 332SimileAjax.DateTime.setIso8601=function(dateObject,string){var offset=null;
 333var comps=(string.indexOf("T")==-1)?string.split(" "):string.split("T");
 334SimileAjax.DateTime.setIso8601Date(dateObject,comps[0]);
 335if(comps.length==2){var d=comps[1].match(SimileAjax.DateTime._timezoneRegexp);
 336if(d){if(d[0]=="Z"){offset=0;
 337}else{offset=(Number(d[3])*60)+Number(d[5]);
 338offset*=((d[2]=="-")?1:-1);
 339}comps[1]=comps[1].substr(0,comps[1].length-d[0].length);
 340}SimileAjax.DateTime.setIso8601Time(dateObject,comps[1]);
 341}if(offset==null){offset=dateObject.getTimezoneOffset();
 342}dateObject.setTime(dateObject.getTime()+offset*60000);
 343return dateObject;
 344};
 345SimileAjax.DateTime.parseIso8601DateTime=function(string){try{return SimileAjax.DateTime.setIso8601(new Date(0),string);
 346}catch(e){return null;
 347}};
 348SimileAjax.DateTime.parseGregorianDateTime=function(o){if(o==null){return null;
 349}else{if(o instanceof Date){return o;
 350}}var s=o.toString();
 351if(s.length>0&&s.length<8){var space=s.indexOf(" ");
 352if(space>0){var year=parseInt(s.substr(0,space));
 353var suffix=s.substr(space+1);
 354if(suffix.toLowerCase()=="bc"){year=1-year;
 355}}else{var year=parseInt(s);
 356}var d=new Date(0);
 357d.setUTCFullYear(year);
 358return d;
 359}try{return new Date(Date.parse(s));
 360}catch(e){return null;
 361}};
 362SimileAjax.DateTime.roundDownToInterval=function(date,intervalUnit,timeZone,multiple,firstDayOfWeek){var timeShift=timeZone*SimileAjax.DateTime.gregorianUnitLengths[SimileAjax.DateTime.HOUR];
 363var date2=new Date(date.getTime()+timeShift);
 364var clearInDay=function(d){d.setUTCMilliseconds(0);
 365d.setUTCSeconds(0);
 366d.setUTCMinutes(0);
 367d.setUTCHours(0);
 368};
 369var clearInYear=function(d){clearInDay(d);
 370d.setUTCDate(1);
 371d.setUTCMonth(0);
 372};
 373switch(intervalUnit){case SimileAjax.DateTime.MILLISECOND:var x=date2.getUTCMilliseconds();
 374date2.setUTCMilliseconds(x-(x%multiple));
 375break;
 376case SimileAjax.DateTime.SECOND:date2.setUTCMilliseconds(0);
 377var x=date2.getUTCSeconds();
 378date2.setUTCSeconds(x-(x%multiple));
 379break;
 380case SimileAjax.DateTime.MINUTE:date2.setUTCMilliseconds(0);
 381date2.setUTCSeconds(0);
 382var x=date2.getUTCMinutes();
 383date2.setTime(date2.getTime()-(x%multiple)*SimileAjax.DateTime.gregorianUnitLengths[SimileAjax.DateTime.MINUTE]);
 384break;
 385case SimileAjax.DateTime.HOUR:date2.setUTCMilliseconds(0);
 386date2.setUTCSeconds(0);
 387date2.setUTCMinutes(0);
 388var x=date2.getUTCHours();
 389date2.setUTCHours(x-(x%multiple));
 390break;
 391case SimileAjax.DateTime.DAY:clearInDay(date2);
 392break;
 393case SimileAjax.DateTime.WEEK:clearInDay(date2);
 394var d=(date2.getUTCDay()+7-firstDayOfWeek)%7;
 395date2.setTime(date2.getTime()-d*SimileAjax.DateTime.gregorianUnitLengths[SimileAjax.DateTime.DAY]);
 396break;
 397case SimileAjax.DateTime.MONTH:clearInDay(date2);
 398date2.setUTCDate(1);
 399var x=date2.getUTCMonth();
 400date2.setUTCMonth(x-(x%multiple));
 401break;
 402case SimileAjax.DateTime.YEAR:clearInYear(date2);
 403var x=date2.getUTCFullYear();
 404date2.setUTCFullYear(x-(x%multiple));
 405break;
 406case SimileAjax.DateTime.DECADE:clearInYear(date2);
 407date2.setUTCFullYear(Math.floor(date2.getUTCFullYear()/10)*10);
 408break;
 409case SimileAjax.DateTime.CENTURY:clearInYear(date2);
 410date2.setUTCFullYear(Math.floor(date2.getUTCFullYear()/100)*100);
 411break;
 412case SimileAjax.DateTime.MILLENNIUM:clearInYear(date2);
 413date2.setUTCFullYear(Math.floor(date2.getUTCFullYear()/1000)*1000);
 414break;
 415}date.setTime(date2.getTime()-timeShift);
 416};
 417SimileAjax.DateTime.roundUpToInterval=function(date,intervalUnit,timeZone,multiple,firstDayOfWeek){var originalTime=date.getTime();
 418SimileAjax.DateTime.roundDownToInterval(date,intervalUnit,timeZone,multiple,firstDayOfWeek);
 419if(date.getTime()<originalTime){date.setTime(date.getTime()+SimileAjax.DateTime.gregorianUnitLengths[intervalUnit]*multiple);
 420}};
 421SimileAjax.DateTime.incrementByInterval=function(date,intervalUnit,timeZone){timeZone=(typeof timeZone=="undefined")?0:timeZone;
 422var timeShift=timeZone*SimileAjax.DateTime.gregorianUnitLengths[SimileAjax.DateTime.HOUR];
 423var date2=new Date(date.getTime()+timeShift);
 424switch(intervalUnit){case SimileAjax.DateTime.MILLISECOND:date2.setTime(date2.getTime()+1);
 425break;
 426case SimileAjax.DateTime.SECOND:date2.setTime(date2.getTime()+1000);
 427break;
 428case SimileAjax.DateTime.MINUTE:date2.setTime(date2.getTime()+SimileAjax.DateTime.gregorianUnitLengths[SimileAjax.DateTime.MINUTE]);
 429break;
 430case SimileAjax.DateTime.HOUR:date2.setTime(date2.getTime()+SimileAjax.DateTime.gregorianUnitLengths[SimileAjax.DateTime.HOUR]);
 431break;
 432case SimileAjax.DateTime.DAY:date2.setUTCDate(date2.getUTCDate()+1);
 433break;
 434case SimileAjax.DateTime.WEEK:date2.setUTCDate(date2.getUTCDate()+7);
 435break;
 436case SimileAjax.DateTime.MONTH:date2.setUTCMonth(date2.getUTCMonth()+1);
 437break;
 438case SimileAjax.DateTime.YEAR:date2.setUTCFullYear(date2.getUTCFullYear()+1);
 439break;
 440case SimileAjax.DateTime.DECADE:date2.setUTCFullYear(date2.getUTCFullYear()+10);
 441break;
 442case SimileAjax.DateTime.CENTURY:date2.setUTCFullYear(date2.getUTCFullYear()+100);
 443break;
 444case SimileAjax.DateTime.MILLENNIUM:date2.setUTCFullYear(date2.getUTCFullYear()+1000);
 445break;
 446}date.setTime(date2.getTime()-timeShift);
 447};
 448SimileAjax.DateTime.removeTimeZoneOffset=function(date,timeZone){return new Date(date.getTime()+timeZone*SimileAjax.DateTime.gregorianUnitLengths[SimileAjax.DateTime.HOUR]);
 449};
 450SimileAjax.DateTime.getTimezone=function(){var d=new Date().getTimezoneOffset();
 451return d/-60;
 452};
 453
 454
 455/* debug.js */
 456SimileAjax.Debug={silent:false};
 457SimileAjax.Debug.log=function(msg){var f;
 458if("console" in window&&"log" in window.console){f=function(msg2){console.log(msg2);
 459};
 460}else{f=function(msg2){if(!SimileAjax.Debug.silent){alert(msg2);
 461}};
 462}SimileAjax.Debug.log=f;
 463f(msg);
 464};
 465SimileAjax.Debug.warn=function(msg){var f;
 466if("console" in window&&"warn" in window.console){f=function(msg2){console.warn(msg2);
 467};
 468}else{f=function(msg2){if(!SimileAjax.Debug.silent){alert(msg2);
 469}};
 470}SimileAjax.Debug.warn=f;
 471f(msg);
 472};
 473SimileAjax.Debug.exception=function(e,msg){var f,params=SimileAjax.parseURLParameters();
 474if(params.errors=="throw"||SimileAjax.params.errors=="throw"){f=function(e2,msg2){throw (e2);
 475};
 476}else{if("console" in window&&"error" in window.console){f=function(e2,msg2){if(msg2!=null){console.error(msg2+" %o",e2);
 477}else{console.error(e2);
 478}throw (e2);
 479};
 480}else{f=function(e2,msg2){if(!SimileAjax.Debug.silent){alert("Caught exception: "+msg2+"\n\nDetails: "+("description" in e2?e2.description:e2));
 481}throw (e2);
 482};
 483}}SimileAjax.Debug.exception=f;
 484f(e,msg);
 485};
 486SimileAjax.Debug.objectToString=function(o){return SimileAjax.Debug._objectToString(o,"");
 487};
 488SimileAjax.Debug._objectToString=function(o,indent){var indent2=indent+" ";
 489if(typeof o=="object"){var s="{";
 490for(n in o){s+=indent2+n+": "+SimileAjax.Debug._objectToString(o[n],indent2)+"\n";
 491}s+=indent+"}";
 492return s;
 493}else{if(typeof o=="array"){var s="[";
 494for(var n=0;
 495n<o.length;
 496n++){s+=SimileAjax.Debug._objectToString(o[n],indent2)+"\n";
 497}s+=indent+"]";
 498return s;
 499}else{return o;
 500}}};
 501
 502
 503/* dom.js */
 504SimileAjax.DOM=new Object();
 505SimileAjax.DOM.registerEventWithObject=function(elmt,eventName,obj,handlerName){SimileAjax.DOM.registerEvent(elmt,eventName,function(elmt2,evt,target){return obj[handlerName].call(obj,elmt2,evt,target);
 506});
 507};
 508SimileAjax.DOM.registerEvent=function(elmt,eventName,handler){var handler2=function(evt){evt=(evt)?evt:((event)?event:null);
 509if(evt){var target=(evt.target)?evt.target:((evt.srcElement)?evt.srcElement:null);
 510if(target){target=(target.nodeType==1||target.nodeType==9)?target:target.parentNode;
 511}return handler(elmt,evt,target);
 512}return true;
 513};
 514if(SimileAjax.Platform.browser.isIE){elmt.attachEvent("on"+eventName,handler2);
 515}else{elmt.addEventListener(eventName,handler2,false);
 516}};
 517SimileAjax.DOM.getPageCoordinates=function(elmt){var left=0;
 518var top=0;
 519if(elmt.nodeType!=1){elmt=elmt.parentNode;
 520}var elmt2=elmt;
 521while(elmt2!=null){left+=elmt2.offsetLeft;
 522top+=elmt2.offsetTop;
 523elmt2=elmt2.offsetParent;
 524}var body=document.body;
 525while(elmt!=null&&elmt!=body){if("scrollLeft" in elmt){left-=elmt.scrollLeft;
 526top-=elmt.scrollTop;
 527}elmt=elmt.parentNode;
 528}return{left:left,top:top};
 529};
 530SimileAjax.DOM.getSize=function(elmt){var w=this.getStyle(elmt,"width");
 531var h=this.getStyle(elmt,"height");
 532if(w.indexOf("px")>-1){w=w.replace("px","");
 533}if(h.indexOf("px")>-1){h=h.replace("px","");
 534}return{w:w,h:h};
 535};
 536SimileAjax.DOM.getStyle=function(elmt,styleProp){if(elmt.currentStyle){var style=elmt.currentStyle[styleProp];
 537}else{if(window.getComputedStyle){var style=document.defaultView.getComputedStyle(elmt,null).getPropertyValue(styleProp);
 538}else{var style="";
 539}}return style;
 540};
 541SimileAjax.DOM.getEventRelativeCoordinates=function(evt,elmt){if(SimileAjax.Platform.browser.isIE){if(evt.type=="mousewheel"){var coords=SimileAjax.DOM.getPageCoordinates(elmt);
 542return{x:evt.clientX-coords.left,y:evt.clientY-coords.top};
 543}else{return{x:evt.offsetX,y:evt.offsetY};
 544}}else{var coords=SimileAjax.DOM.getPageCoordinates(elmt);
 545if((evt.type=="DOMMouseScroll")&&SimileAjax.Platform.browser.isFirefox&&(SimileAjax.Platform.browser.majorVersion==2)){return{x:evt.screenX-coords.left,y:evt.screenY-coords.top};
 546}else{return{x:evt.pageX-coords.left,y:evt.pageY-coords.top};
 547}}};
 548SimileAjax.DOM.getEventPageCoordinates=function(evt){if(SimileAjax.Platform.browser.isIE){var scrOfY=0;
 549var scrOfX=0;
 550if(document.body&&(document.body.scrollLeft||document.body.scrollTop)){scrOfY=document.body.scrollTop;
 551scrOfX=document.body.scrollLeft;
 552}else{if(document.documentElement&&(document.documentElement.scrollLeft||document.documentElement.scrollTop)){scrOfY=document.documentElement.scrollTop;
 553scrOfX=document.documentElement.scrollLeft;
 554}}return{x:evt.clientX+scrOfX,y:evt.clientY+scrOfY};
 555}else{return{x:evt.pageX,y:evt.pageY};
 556}};
 557SimileAjax.DOM.hittest=function(x,y,except){return SimileAjax.DOM._hittest(document.body,x,y,except);
 558};
 559SimileAjax.DOM._hittest=function(elmt,x,y,except){var childNodes=elmt.childNodes;
 560outer:for(var i=0;
 561i<childNodes.length;
 562i++){var childNode=childNodes[i];
 563for(var j=0;
 564j<except.length;
 565j++){if(childNode==except[j]){continue outer;
 566}}if(childNode.offsetWidth==0&&childNode.offsetHeight==0){var hitNode=SimileAjax.DOM._hittest(childNode,x,y,except);
 567if(hitNode!=childNode){return hitNode;
 568}}else{var top=0;
 569var left=0;
 570var node=childNode;
 571while(node){top+=node.offsetTop;
 572left+=node.offsetLeft;
 573node=node.offsetParent;
 574}if(left<=x&&top<=y&&(x-left)<childNode.offsetWidth&&(y-top)<childNode.offsetHeight){return SimileAjax.DOM._hittest(childNode,x,y,except);
 575}else{if(childNode.nodeType==1&&childNode.tagName=="TR"){var childNode2=SimileAjax.DOM._hittest(childNode,x,y,except);
 576if(childNode2!=childNode){return childNode2;
 577}}}}}return elmt;
 578};
 579SimileAjax.DOM.cancelEvent=function(evt){evt.returnValue=false;
 580evt.cancelBubble=true;
 581if("preventDefault" in evt){evt.preventDefault();
 582}};
 583SimileAjax.DOM.appendClassName=function(elmt,className){var classes=elmt.className.split(" ");
 584for(var i=0;
 585i<classes.length;
 586i++){if(classes[i]==className){return ;
 587}}classes.push(className);
 588elmt.className=classes.join(" ");
 589};
 590SimileAjax.DOM.createInputElement=function(type){var div=document.createElement("div");
 591div.innerHTML="<input type='"+type+"' />";
 592return div.firstChild;
 593};
 594SimileAjax.DOM.createDOMFromTemplate=function(template){var result={};
 595result.elmt=SimileAjax.DOM._createDOMFromTemplate(template,result,null);
 596return result;
 597};
 598SimileAjax.DOM._createDOMFromTemplate=function(templateNode,result,parentElmt){if(templateNode==null){return null;
 599}else{if(typeof templateNode!="object"){var node=document.createTextNode(templateNode);
 600if(parentElmt!=null){parentElmt.appendChild(node);
 601}return node;
 602}else{var elmt=null;
 603if("tag" in templateNode){var tag=templateNode.tag;
 604if(parentElmt!=null){if(tag=="tr"){elmt=parentElmt.insertRow(parentElmt.rows.length);
 605}else{if(tag=="td"){elmt=parentElmt.insertCell(parentElmt.cells.length);
 606}}}if(elmt==null){elmt=tag=="input"?SimileAjax.DOM.createInputElement(templateNode.type):document.createElement(tag);
 607if(parentElmt!=null){parentElmt.appendChild(elmt);
 608}}}else{elmt=templateNode.elmt;
 609if(parentElmt!=null){parentElmt.appendChild(elmt);
 610}}for(var attribute in templateNode){var value=templateNode[attribute];
 611if(attribute=="field"){result[value]=elmt;
 612}else{if(attribute=="className"){elmt.className=value;
 613}else{if(attribute=="id"){elmt.id=value;
 614}else{if(attribute=="title"){elmt.title=value;
 615}else{if(attribute=="type"&&elmt.tagName=="input"){}else{if(attribute=="style"){for(n in value){var v=value[n];
 616if(n=="float"){n=SimileAjax.Platform.browser.isIE?"styleFloat":"cssFloat";
 617}elmt.style[n]=v;
 618}}else{if(attribute=="children"){for(var i=0;
 619i<value.length;
 620i++){SimileAjax.DOM._createDOMFromTemplate(value[i],result,elmt);
 621}}else{if(attribute!="tag"&&attribute!="elmt"){elmt.setAttribute(attribute,value);
 622}}}}}}}}}return elmt;
 623}}};
 624SimileAjax.DOM._cachedParent=null;
 625SimileAjax.DOM.createElementFromString=function(s){if(SimileAjax.DOM._cachedParent==null){SimileAjax.DOM._cachedParent=document.createElement("div");
 626}SimileAjax.DOM._cachedParent.innerHTML=s;
 627return SimileAjax.DOM._cachedParent.firstChild;
 628};
 629SimileAjax.DOM.createDOMFromString=function(root,s,fieldElmts){var elmt=typeof root=="string"?document.createElement(root):root;
 630elmt.innerHTML=s;
 631var dom={elmt:elmt};
 632SimileAjax.DOM._processDOMChildrenConstructedFromString(dom,elmt,fieldElmts!=null?fieldElmts:{});
 633return dom;
 634};
 635SimileAjax.DOM._processDOMConstructedFromString=function(dom,elmt,fieldElmts){var id=elmt.id;
 636if(id!=null&&id.length>0){elmt.removeAttribute("id");
 637if(id in fieldElmts){var parentElmt=elmt.parentNode;
 638parentElmt.insertBefore(fieldElmts[id],elmt);
 639parentElmt.removeChild(elmt);
 640dom[id]=fieldElmts[id];
 641return ;
 642}else{dom[id]=elmt;
 643}}if(elmt.hasChildNodes()){SimileAjax.DOM._processDOMChildrenConstructedFromString(dom,elmt,fieldElmts);
 644}};
 645SimileAjax.DOM._processDOMChildrenConstructedFromString=function(dom,elmt,fieldElmts){var node=elmt.firstChild;
 646while(node!=null){var node2=node.nextSibling;
 647if(node.nodeType==1){SimileAjax.DOM._processDOMConstructedFromString(dom,node,fieldElmts);
 648}node=node2;
 649}};
 650
 651
 652/* graphics.js */
 653SimileAjax.Graphics=new Object();
 654SimileAjax.Graphics.pngIsTranslucent=(!SimileAjax.Platform.browser.isIE)||(SimileAjax.Platform.browser.majorVersion>6);
 655if(!SimileAjax.Graphics.pngIsTranslucent){SimileAjax.includeCssFile(document,SimileAjax.urlPrefix+"styles/graphics-ie6.css");
 656}SimileAjax.Graphics._createTranslucentImage1=function(url,verticalAlign){var elmt=document.createElement("img");
 657elmt.setAttribute("src",url);
 658if(verticalAlign!=null){elmt.style.verticalAlign=verticalAlign;
 659}return elmt;
 660};
 661SimileAjax.Graphics._createTranslucentImage2=function(url,verticalAlign){var elmt=document.createElement("img");
 662elmt.style.width="1px";
 663elmt.style.height="1px";
 664elmt.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+url+"', sizingMethod='image')";
 665elmt.style.verticalAlign=(verticalAlign!=null)?verticalAlign:"middle";
 666return elmt;
 667};
 668SimileAjax.Graphics.createTranslucentImage=SimileAjax.Graphics.pngIsTranslucent?SimileAjax.Graphics._createTranslucentImage1:SimileAjax.Graphics._createTranslucentImage2;
 669SimileAjax.Graphics._createTranslucentImageHTML1=function(url,verticalAlign){return'<img src="'+url+'"'+(verticalAlign!=null?' style="vertical-align: '+verticalAlign+';"':"")+" />";
 670};
 671SimileAjax.Graphics._createTranslucentImageHTML2=function(url,verticalAlign){var style="width: 1px; height: 1px; filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+url+"', sizingMethod='image');"+(verticalAlign!=null?" vertical-align: "+verticalAlign+";":"");
 672return"<img src='"+url+"' style=\""+style+'" />';
 673};
 674SimileAjax.Graphics.createTranslucentImageHTML=SimileAjax.Graphics.pngIsTranslucent?SimileAjax.Graphics._createTranslucentImageHTML1:SimileAjax.Graphics._createTranslucentImageHTML2;
 675SimileAjax.Graphics.setOpacity=function(elmt,opacity){if(SimileAjax.Platform.browser.isIE){elmt.style.filter="progid:DXImageTransform.Microsoft.Alpha(Style=0,Opacity="+opacity+")";
 676}else{var o=(opacity/100).toString();
 677elmt.style.opacity=o;
 678elmt.style.MozOpacity=o;
 679}};
 680SimileAjax.Graphics.bubbleConfig={containerCSSClass:"simileAjax-bubble-container",innerContainerCSSClass:"simileAjax-bubble-innerContainer",contentContainerCSSClass:"simileAjax-bubble-contentContainer",borderGraphicSize:50,borderGraphicCSSClassPrefix:"simileAjax-bubble-border-",arrowGraphicTargetOffset:33,arrowGraphicLength:100,arrowGraphicWidth:49,arrowGraphicCSSClassPrefix:"simileAjax-bubble-arrow-",closeGraphicCSSClass:"simileAjax-bubble-close",extraPadding:20};
 681SimileAjax.Graphics.createBubbleForContentAndPoint=function(div,pageX,pageY,contentWidth,orientation,maxHeight){if(typeof contentWidth!="number"){contentWidth=300;
 682}if(typeof maxHeight!="number"){maxHeight=0;
 683}div.style.position="absolute";
 684div.style.left="-5000px";
 685div.style.top="0px";
 686div.style.width=contentWidth+"px";
 687document.body.appendChild(div);
 688window.setTimeout(function(){var width=div.scrollWidth+10;
 689var height=div.scrollHeight+10;
 690var scrollDivW=0;
 691if(maxHeight>0&&height>maxHeight){height=maxHeight;
 692scrollDivW=width-25;
 693}var bubble=SimileAjax.Graphics.createBubbleForPoint(pageX,pageY,width,height,orientation);
 694document.body.removeChild(div);
 695div.style.position="static";
 696div.style.left="";
 697div.style.top="";
 698if(scrollDivW>0){var scrollDiv=document.createElement("div");
 699div.style.width="";
 700scrollDiv.style.width=scrollDivW+"px";
 701scrollDiv.appendChild(div);
 702bubble.content.appendChild(scrollDiv);
 703}else{div.style.width=width+"px";
 704bubble.content.appendChild(div);
 705}},200);
 706};
 707SimileAjax.Graphics.createBubbleForPoint=function(pageX,pageY,contentWidth,contentHeight,orientation){contentWidth=parseInt(contentWidth,10);
 708contentHeight=parseInt(contentHeight,10);
 709var bubbleConfig=SimileAjax.Graphics.bubbleConfig;
 710var pngTransparencyClassSuffix=SimileAjax.Graphics.pngIsTranslucent?"pngTranslucent":"pngNotTranslucent";
 711var bubbleWidth=contentWidth+2*bubbleConfig.borderGraphicSize;
 712var bubbleHeight=contentHeight+2*bubbleConfig.borderGraphicSize;
 713var generatePngSensitiveClass=function(className){return className+" "+className+"-"+pngTransparencyClassSuffix;
 714};
 715var div=document.createElement("div");
 716div.className=generatePngSensitiveClass(bubbleConfig.containerCSSClass);
 717div.style.width=contentWidth+"px";
 718div.style.height=contentHeight+"px";
 719var divInnerContainer=document.createElement("div");
 720divInnerContainer.className=generatePngSensitiveClass(bubbleConfig.innerContainerCSSClass);
 721div.appendChild(divInnerContainer);
 722var close=function(){if(!bubble._closed){document.body.removeChild(bubble._div);
 723bubble._doc=null;
 724bubble._div=null;
 725bubble._content=null;
 726bubble._closed=true;
 727}};
 728var bubble={_closed:false};
 729var layer=SimileAjax.WindowManager.pushLayer(close,true,div);
 730bubble._div=div;
 731bubble.close=function(){SimileAjax.WindowManager.popLayer(layer);
 732};
 733var createBorder=function(classNameSuffix){var divBorderGraphic=document.createElement("div");
 734divBorderGraphic.className=generatePngSensitiveClass(bubbleConfig.borderGraphicCSSClassPrefix+classNameSuffix);
 735divInnerContainer.appendChild(divBorderGraphic);
 736};
 737createBorder("top-left");
 738createBorder("top-right");
 739createBorder("bottom-left");
 740createBorder("bottom-right");
 741createBorder("left");
 742createBorder("right");
 743createBorder("top");
 744createBorder("bottom");
 745var divContentContainer=document.createElement("div");
 746divContentContainer.className=generatePngSensitiveClass(bubbleConfig.contentContainerCSSClass);
 747divInnerContainer.appendChild(divContentContainer);
 748bubble.content=divContentContainer;
 749var divClose=document.createElement("div");
 750divClose.className=generatePngSensitiveClass(bubbleConfig.closeGraphicCSSClass);
 751divInnerContainer.appendChild(divClose);
 752SimileAjax.WindowManager.registerEventWithObject(divClose,"click",bubble,"close");
 753(function(){var dims=SimileAjax.Graphics.getWindowDimensions();
 754var docWidth=dims.w;
 755var docHeight=dims.h;
 756var halfArrowGraphicWidth=Math.ceil(bubbleConfig.arrowGraphicWidth/2);
 757var createArrow=function(classNameSuffix){var divArrowGraphic=document.createElement("div");
 758divArrowGraphic.className=generatePngSensitiveClass(bubbleConfig.arrowGraphicCSSClassPrefix+"point-"+classNameSuffix);
 759divInnerContainer.appendChild(divArrowGraphic);
 760return divArrowGraphic;
 761};
 762if(pageX-halfArrowGraphicWidth-bubbleConfig.borderGraphicSize-bubbleConfig.extraPadding>0&&pageX+halfArrowGraphicWidth+bubbleConfig.borderGraphicSize+bubbleConfig.extraPadding<docWidth){var left=pageX-Math.round(contentWidth/2);
 763left=pageX<(docWidth/2)?Math.max(left,bubbleConfig.extraPadding+bubbleConfig.borderGraphicSize):Math.min(left,docWidth-bubbleConfig.extraPadding-bubbleConfig.borderGraphicSize-contentWidth);
 764if((orientation&&orientation=="top")||(!orientation&&(pageY-bubbleConfig.arrowGraphicTargetOffset-contentHeight-bubbleConfig.borderGraphicSize-bubbleConfig.extraPadding>0))){var divArrow=createArrow("down");
 765divArrow.style.left=(pageX-halfArrowGraphicWidth-left)+"px";
 766div.style.left=left+"px";
 767div.style.top=(pageY-bubbleConfig.arrowGraphicTargetOffset-contentHeight)+"px";
 768return ;
 769}else{if((orientation&&orientation=="bottom")||(!orientation&&(pageY+bubbleConfig.arrowGraphicTargetOffset+contentHeight+bubbleConfig.borderGraphicSize+bubbleConfig.extraPadding<docHeight))){var divArrow=createArrow("up");
 770divArrow.style.left=(pageX-halfArrowGraphicWidth-left)+"px";
 771div.style.left=left+"px";
 772div.style.top=(pageY+bubbleConfig.arrowGraphicTargetOffset)+"px";
 773return ;
 774}}}var top=pageY-Math.round(contentHeight/2);
 775top=pageY<(docHeight/2)?Math.max(top,bubbleConfig.extraPadding+bubbleConfig.borderGraphicSize):Math.min(top,docHeight-bubbleConfig.extraPadding-bubbleConfig.borderGraphicSize-contentHeight);
 776if((orientation&&orientation=="left")||(!orientation&&(pageX-bubbleConfig.arrowGraphicTargetOffset-contentWidth-bubbleConfig.borderGraphicSize-bubbleConfig.extraPadding>0))){var divArrow=createArrow("right");
 777divArrow.style.top=(pageY-halfArrowGraphicWidth-top)+"px";
 778div.style.top=top+"px";
 779div.style.left=(pageX-bubbleConfig.arrowGraphicTargetOffset-contentWidth)+"px";
 780}else{var divArrow=createArrow("left");
 781divArrow.style.top=(pageY-halfArrowGraphicWidth-top)+"px";
 782div.style.top=top+"px";
 783div.style.left=(pageX+bubbleConfig.arrowGraphicTargetOffset)+"px";
 784}})();
 785document.body.appendChild(div);
 786return bubble;
 787};
 788SimileAjax.Graphics.getWindowDimensions=function(){if(typeof window.innerHeight=="number"){return{w:window.innerWidth,h:window.innerHeight};
 789}else{if(document.documentElement&&document.documentElement.clientHeight){return{w:document.documentElement.clientWidth,h:document.documentElement.clientHeight};
 790}else{if(document.body&&document.body.clientHeight){return{w:document.body.clientWidth,h:document.body.clientHeight};
 791}}}};
 792SimileAjax.Graphics.createMessageBubble=function(doc){var containerDiv=doc.createElement("div");
 793if(SimileAjax.Graphics.pngIsTranslucent){var topDiv=doc.createElement("div");
 794topDiv.style.height="33px";
 795topDiv.style.background="url("+SimileAjax.urlPrefix+"images/message-top-left.png) top left no-repeat";
 796topDiv.style.paddingLeft="44px";
 797containerDiv.appendChild(topDiv);
 798var topRightDiv=doc.createElement("div");
 799topRightDiv.style.height="33px";
 800topRightDiv.style.background="url("+SimileAjax.urlPrefix+"images/message-top-right.png) top right no-repeat";
 801topDiv.appendChild(topRightDiv);
 802var middleDiv=doc.createElement("div");
 803middleDiv.style.background="url("+SimileAjax.urlPrefix+"images/message-left.png) top left repeat-y";
 804middleDiv.style.paddingLeft="44px";
 805containerDiv.appendChild(middleDiv);
 806var middleRightDiv=doc.createElement("div");
 807middleRightDiv.style.background="url("+SimileAjax.urlPrefix+"images/message-right.png) top right repeat-y";
 808middleRightDiv.style.paddingRight="44px";
 809middleDiv.appendChild(middleRightDiv);
 810var contentDiv=doc.createElement("div");
 811middleRightDiv.appendChild(contentDiv);
 812var bottomDiv=doc.createElement("div");
 813bottomDiv.style.height="55px";
 814bottomDiv.style.background="url("+SimileAjax.urlPrefix+"images/message-bottom-left.png) bottom left no-repeat";
 815bottomDiv.style.paddingLeft="44px";
 816containerDiv.appendChild(bottomDiv);
 817var bottomRightDiv=doc.createElement("div");
 818bottomRightDiv.style.height="55px";
 819bottomRightDiv.style.background="url("+SimileAjax.urlPrefix+"images/message-bottom-right.png) bottom right no-repeat";
 820bottomDiv.appendChild(bottomRightDiv);
 821}else{containerDiv.style.border="2px solid #7777AA";
 822containerDiv.style.padding="20px";
 823containerDiv.style.background="white";
 824SimileAjax.Graphics.setOpacity(containerDiv,90);
 825var contentDiv=doc.createElement("div");
 826containerDiv.appendChild(contentDiv);
 827}return{containerDiv:containerDiv,contentDiv:contentDiv};
 828};
 829SimileAjax.Graphics.createAnimation=function(f,from,to,duration,cont){return new SimileAjax.Graphics._Animation(f,from,to,duration,cont);
 830};
 831SimileAjax.Graphics._Animation=function(f,from,to,duration,cont){this.f=f;
 832this.cont=(typeof cont=="function")?cont:function(){};
 833this.from=from;
 834this.to=to;
 835this.current=from;
 836this.duration=duration;
 837this.start=new Date().getTime();
 838this.timePassed=0;
 839};
 840SimileAjax.Graphics._Animation.prototype.run=function(){var a=this;
 841window.setTimeout(function(){a.step();
 842},50);
 843};
 844SimileAjax.Graphics._Animation.prototype.step=function(){this.timePassed+=50;
 845var timePassedFraction=this.timePassed/this.duration;
 846var parameterFraction=-Math.cos(timePassedFraction*Math.PI)/2+0.5;
 847var current=parameterFraction*(this.to-this.from)+this.from;
 848try{this.f(current,current-this.current);
 849}catch(e){}this.current=current;
 850if(this.timePassed<this.duration){this.run();
 851}else{this.f(this.to,0);
 852this["cont"]();
 853}};
 854SimileAjax.Graphics.createStructuredDataCopyButton=function(image,width,height,createDataFunction){var div=document.createElement("div");
 855div.style.position="relative";
 856div.style.display="inline";
 857div.style.width=width+"px";
 858div.style.height=height+"px";
 859div.style.overflow="hidden";
 860div.style.margin="2px";
 861if(SimileAjax.Graphics.pngIsTranslucent){div.style.background="url("+image+") no-repeat";
 862}else{div.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+image+"', sizingMethod='image')";
 863}var style;
 864if(SimileAjax.Platform.browser.isIE){style="filter:alpha(opacity=0)";
 865}else{style="opacity: 0";
 866}div.innerHTML="<textarea rows='1' autocomplete='off' value='none' style='"+style+"' />";
 867var textarea=div.firstChild;
 868textarea.style.width=width+"px";
 869textarea.style.height=height+"px";
 870textarea.onmousedown=function(evt){evt=(evt)?evt:((event)?event:null);
 871if(evt.button==2){textarea.value=createDataFunction();
 872textarea.select();
 873}};
 874return div;
 875};
 876SimileAjax.Graphics.getWidthHeight=function(el){var w,h;
 877if(el.getBoundingClientRect==null){w=el.offsetWidth;
 878h=el.offsetHeight;
 879}else{var rect=el.getBoundingClientRect();
 880w=Math.ceil(rect.right-rect.left);
 881h=Math.ceil(rect.bottom-rect.top);
 882}return{width:w,height:h};
 883};
 884SimileAjax.Graphics.getFontRenderingContext=function(elmt,width){return new SimileAjax.Graphics._FontRenderingContext(elmt,width);
 885};
 886SimileAjax.Graphics._FontRenderingContext=function(elmt,width){this._elmt=elmt;
 887this._elmt.style.visibility="hidden";
 888if(typeof width=="string"){this._elmt.style.width=width;
 889}else{if(typeof width=="number"){this._elmt.style.width=width+"px";
 890}}};
 891SimileAjax.Graphics._FontRenderingContext.prototype.dispose=function(){this._elmt=null;
 892};
 893SimileAjax.Graphics._FontRenderingContext.prototype.update=function(){this._elmt.innerHTML="A";
 894this._lineHeight=this._elmt.offsetHeight;
 895};
 896SimileAjax.Graphics._FontRenderingContext.prototype.computeSize=function(text,className){var el=this._elmt;
 897el.innerHTML=text;
 898el.className=className===undefined?"":className;
 899var wh=SimileAjax.Graphics.getWidthHeight(el);
 900el.className="";
 901return wh;
 902};
 903SimileAjax.Graphics._FontRenderingContext.prototype.getLineHeight=function(){return this._lineHeight;
 904};
 905
 906
 907/* history.js */
 908SimileAjax.History={maxHistoryLength:10,historyFile:"__history__.html",enabled:true,_initialized:false,_listeners:new SimileAjax.ListenerQueue(),_actions:[],_baseIndex:0,_currentIndex:0,_plainDocumentTitle:document.title};
 909SimileAjax.History.formatHistoryEntryTitle=function(actionLabel){return SimileAjax.History._plainDocumentTitle+" {"+actionLabel+"}";
 910};
 911SimileAjax.History.initialize=function(){if(SimileAjax.History._initialized){return ;
 912}if(SimileAjax.History.enabled){var iframe=document.createElement("iframe");
 913iframe.id="simile-ajax-history";
 914iframe.style.position="absolute";
 915iframe.style.width="10px";
 916iframe.style.height="10px";
 917iframe.style.top="0px";
 918iframe.style.left="0px";
 919iframe.style.visibility="hidden";
 920iframe.src=SimileAjax.History.historyFile+"?0";
 921document.body.appendChild(iframe);
 922SimileAjax.DOM.registerEvent(iframe,"load",SimileAjax.History._handleIFrameOnLoad);
 923SimileAjax.History._iframe=iframe;
 924}SimileAjax.History._initialized=true;
 925};
 926SimileAjax.History.addListener=function(listener){SimileAjax.History.initialize();
 927SimileAjax.History._listeners.add(listener);
 928};
 929SimileAjax.History.removeListener=function(listener){SimileAjax.History.initialize();
 930SimileAjax.History._listeners.remove(listener);
 931};
 932SimileAjax.History.addAction=function(action){SimileAjax.History.initialize();
 933SimileAjax.History._listeners.fire("onBeforePerform",[action]);
 934window.setTimeout(function(){try{action.perform();
 935SimileAjax.History._listeners.fire("onAfterPerform",[action]);
 936if(SimileAjax.History.enabled){SimileAjax.History._actions=SimileAjax.History._actions.slice(0,SimileAjax.History._currentIndex-SimileAjax.History._baseIndex);
 937SimileAjax.History._actions.push(action);
 938SimileAjax.History._currentIndex++;
 939var diff=SimileAjax.History._actions.length-SimileAjax.History.maxHistoryLength;
 940if(diff>0){SimileAjax.History._actions=SimileAjax.History._actions.slice(diff);
 941SimileAjax.History._baseIndex+=diff;
 942}try{SimileAjax.History._iframe.contentWindow.location.search="?"+SimileAjax.History._currentIndex;
 943}catch(e){var title=SimileAjax.History.formatHistoryEntryTitle(action.label);
 944document.title=title;
 945}}}catch(e){SimileAjax.Debug.exception(e,"Error adding action {"+action.label+"} to history");
 946}},0);
 947};
 948SimileAjax.History.addLengthyAction=function(perform,undo,label){SimileAjax.History.addAction({perform:perform,undo:undo,label:label,uiLayer:SimileAjax.WindowManager.getBaseLayer(),lengthy:true});
 949};
 950SimileAjax.History._handleIFrameOnLoad=function(){try{var q=SimileAjax.History._iframe.contentWindow.location.search;
 951var c=(q.length==0)?0:Math.max(0,parseInt(q.substr(1)));
 952var finishUp=function(){var diff=c-SimileAjax.History._currentIndex;
 953SimileAjax.History._currentIndex+=diff;
 954SimileAjax.History._baseIndex+=diff;
 955SimileAjax.History._iframe.contentWindow.location.search="?"+c;
 956};
 957if(c<SimileAjax.History._currentIndex){SimileAjax.History._listeners.fire("onBeforeUndoSeveral",[]);
 958window.setTimeout(function(){while(SimileAjax.History._currentIndex>c&&SimileAjax.History._currentIndex>SimileAjax.History._baseIndex){SimileAjax.History._currentIndex--;
 959var action=SimileAjax.History._actions[SimileAjax.History._currentIndex-SimileAjax.History._baseIndex];
 960try{action.undo();
 961}catch(e){SimileAjax.Debug.exception(e,"History: Failed to undo action {"+action.label+"}");
 962}}SimileAjax.History._listeners.fire("onAfterUndoSeveral",[]);
 963finishUp();
 964},0);
 965}else{if(c>SimileAjax.History._currentIndex){SimileAjax.History._listeners.fire("onBeforeRedoSeveral",[]);
 966window.setTimeout(function(){while(SimileAjax.History._currentIndex<c&&SimileAjax.History._currentIndex-SimileAjax.History._baseIndex<SimileAjax.History._actions.length){var action=SimileAjax.History._actions[SimileAjax.History._currentIndex-SimileAjax.History._baseIndex];
 967try{action.perform();
 968}catch(e){SimileAjax.Debug.exception(e,"History: Failed to redo action {"+action.label+"}");
 969}SimileAjax.History._currentIndex++;
 970}SimileAjax.History._listeners.fire("onAfterRedoSeveral",[]);
 971finishUp();
 972},0);
 973}else{var index=SimileAjax.History._currentIndex-SimileAjax.History._baseIndex-1;
 974var title=(index>=0&&index<SimileAjax.History._actions.length)?SimileAjax.History.formatHistoryEntryTitle(SimileAjax.History._actions[index].label):SimileAjax.History._plainDocumentTitle;
 975SimileAjax.History._iframe.contentWindow.document.title=title;
 976document.title=title;
 977}}}catch(e){}};
 978SimileAjax.History.getNextUndoAction=function(){try{var index=SimileAjax.History._currentIndex-SimileAjax.History._baseIndex-1;
 979return SimileAjax.History._actions[index];
 980}catch(e){return null;
 981}};
 982SimileAjax.History.getNextRedoAction=function(){try{var index=SimileAjax.History._currentIndex-SimileAjax.History._baseIndex;
 983return SimileAjax.History._actions[index];
 984}catch(e){return null;
 985}};
 986
 987
 988/* html.js */
 989SimileAjax.HTML=new Object();
 990SimileAjax.HTML._e2uHash={};
 991(function(){var e2uHash=SimileAjax.HTML._e2uHash;
 992e2uHash["nbsp"]="\u00A0";
 993e2uHash["iexcl"]="\u00A1";
 994e2uHash["cent"]="\u00A2";
 995e2uHash["pound"]="\u00A3";
 996e2uHash["curren"]="\u00A4";
 997e2uHash["yen"]="\u00A5";
 998e2uHash["brvbar"]="\u00A6";
 999e2uHash["sect"]="\u00A7";
1000e2uHash["uml"]="\u00A8";
1001e2uHash["copy"]="\u00A9";
1002e2uHash["ordf"]="\u00AA";
1003e2uHash["laquo"]="\u00AB";
1004e2uHash["not"]="\u00AC";
1005e2uHash["shy"]="\u00AD";
1006e2uHash["reg"]="\u00AE";
1007e2uHash["macr"]="\u00AF";
1008e2uHash["deg"]="\u00B0";
1009e2uHash["plusmn"]="\u00B1";
1010e2uHash["sup2"]="\u00B2";
1011e2uHash["sup3"]="\u00B3";
1012e2uHash["acute"]="\u00B4";
1013e2uHash["micro"]="\u00B5";
1014e2uHash["para"]="\u00B6";
1015e2uHash["middot"]="\u00B7";
1016e2uHash["cedil"]="\u00B8";
1017e2uHash["sup1"]="\u00B9";
1018e2uHash["ordm"]="\u00BA";
1019e2uHash["raquo"]="\u00BB";
1020e2uHash["frac14"]="\u00BC";
1021e2uHash["frac12"]="\u00BD";
1022e2uHash["frac34"]="\u00BE";
1023e2uHash["iquest"]="\u00BF";
1024e2uHash["Agrave"]="\u00C0";
1025e2uHash["Aacute"]="\u00C1";
1026e2uHash["Acirc"]="\u00C2";
1027e2uHash["Atilde"]="\u00C3";
1028e2uHash["Auml"]="\u00C4";
1029e2uHash["Aring"]="\u00C5";
1030e2uHash["AElig"]="\u00C6";
1031e2uHash["Ccedil"]="\u00C7";
1032e2uHash["Egrave"]="\u00C8";
1033e2uHash["Eacute"]="\u00C9";
1034e2uHash["Ecirc"]="\u00CA";
1035e2uHash["Euml"]="\u00CB";
1036e2uHash["Igrave"]="\u00CC";
1037e2uHash["Iacute"]="\u00CD";
1038e2uHash["Icirc"]="\u00CE";
1039e2uHash["Iuml"]="\u00CF";
1040e2uHash["ETH"]="\u00D0";
1041e2uHash["Ntilde"]="\u00D1";
1042e2uHash["Ograve"]="\u00D2";
1043e2uHash["Oacute"]="\u00D3";
1044e2uHash["Ocirc"]="\u00D4";
1045e2uHash["Otilde"]="\u00D5";
1046e2uHash["Ouml"]="\u00D6";
1047e2uHash["times"]="\u00D7";
1048e2uHash["Oslash"]="\u00D8";
1049e2uHash["Ugrave"]="\u00D9";
1050e2uHash["Uacute"]="\u00DA";
1051e2uHash["Ucirc"]="\u00DB";
1052e2uHash["Uuml"]="\u00DC";
1053e2uHash["Yacute"]="\u00DD";
1054e2uHash["THORN"]="\u00DE";
1055e2uHash["szlig"]="\u00DF";
1056e2uHash["agrave"]="\u00E0";
1057e2uHash["aacute"]="\u00E1";
1058e2uHash["acirc"]="\u00E2";
1059e2uHash["atilde"]="\u00E3";
1060e2uHash["auml"]="\u00E4";
1061e2uHash["aring"]="\u00E5";
1062e2uHash["aelig"]="\u00E6";
1063e2uHash["ccedil"]="\u00E7";
1064e2uHash["egrave"]="\u00E8";
1065e2uHash["eacute"]="\u00E9";
1066e2uHash["ecirc"]="\u00EA";
1067e2uHash["euml"]="\u00EB";
1068e2uHash["igrave"]="\u00EC";
1069e2uHash["iacute"]="\u00ED";
1070e2uHash["icirc"]="\u00EE";
1071e2uHash["iuml"]="\u00EF";
1072e2uHash["eth"]="\u00F0";
1073e2uHash["ntilde"]="\u00F1";
1074e2uHash["ograve"]="\u00F2";
1075e2uHash["oacute"]="\u00F3";
1076e2uHash["ocirc"]="\u00F4";
1077e2uHash["otilde"]="\u00F5";
1078e2uHash["ouml"]="\u00F6";
1079e2uHash["divide"]="\u00F7";
1080e2uHash["oslash"]="\u00F8";
1081e2uHash["ugrave"]="\u00F9";
1082e2uHash["uacute"]="\u00FA";
1083e2uHash["ucirc"]="\u00FB";
1084e2uHash["uuml"]="\u00FC";
1085e2uHash["yacute"]="\u00FD";
1086e2uHash["thorn"]="\u00FE";
1087e2uHash["yuml"]="\u00FF";
1088e2uHash["quot"]="\u0022";
1089e2uHash["amp"]="\u0026";
1090e2uHash["lt"]="\u003C";
1091e2uHash["gt"]="\u003E";
1092e2uHash["OElig"]="";
1093e2uHash["oelig"]="\u0153";
1094e2uHash["Scaron"]="\u0160";
1095e2uHash["scaron"]="\u0161";
1096e2uHash["Yuml"]="\u0178";
1097e2uHash["circ"]="\u02C6";
1098e2uHash["tilde"]="\u02DC";
1099e2uHash["ensp"]="\u2002";
1100e2uHash["emsp"]="\u2003";
1101e2uHash["thinsp"]="\u2009";
1102e2uHash["zwnj"]="\u200C";
1103e2uHash["zwj"]="\u200D";
1104e2uHash["lrm"]="\u200E";
1105e2uHash["rlm"]="\u200F";
1106e2uHash["ndash"]="\u2013";
1107e2uHash["mdash"]="\u2014";
1108e2uHash["lsquo"]="\u2018";
1109e2uHash["rsquo"]="\u2019";
1110e2uHash["sbquo"]="\u201A";
1111e2uHash["ldquo"]="\u201C";
1112e2uHash["rdquo"]="\u201D";
1113e2uHash["bdquo"]="\u201E";
1114e2uHash["dagger"]="\u2020";
1115e2uHash["Dagger"]="\u2021";
1116e2uHash["permil"]="\u2030";
1117e2uHash["lsaquo"]="\u2039";
1118e2uHash["rsaquo"]="\u203A";
1119e2uHash["euro"]="\u20AC";
1120e2uHash["fnof"]="\u0192";
1121e2uHash["Alpha"]="\u0391";
1122e2uHash["Beta"]="\u0392";
1123e2uHash["Gamma"]="\u0393";
1124e2uHash["Delta"]="\u0394";
1125e2uHash["Epsilon"]="\u0395";
1126e2uHash["Zeta"]="\u0396";
1127e2uHash["Eta"]="\u0397";
1128e2uHash["Theta"]="\u0398";
1129e2uHash["Iota"]="\u0399";
1130e2uHash["Kappa"]="\u039A";
1131e2uHash["Lambda"]="\u039B";
1132e2uHash["Mu"]="\u039C";
1133e2uHash["Nu"]="\u039D";
1134e2uHash["Xi"]="\u039E";
1135e2uHash["Omicron"]="\u039F";
1136e2uHash["Pi"]="\u03A0";
1137e2uHash["Rho"]="\u03A1";
1138e2uHash["Sigma"]="\u03A3";
1139e2uHash["Tau"]="\u03A4";
1140e2uHash["Upsilon"]="\u03A5";
1141e2uHash["Phi"]="\u03A6";
1142e2uHash["Chi"]="\u03A7";
1143e2uHash["Psi"]="\u03A8";
1144e2uHash["Omega"]="\u03A9";
1145e2uHash["alpha"]="\u03B1";
1146e2uHash["beta"]="\u03B2";
1147e2uHash["gamma"]="\u03B3";
1148e2uHash["delta"]="\u03B4";
1149e2uHash["

Large files files are truncated, but you can click here to view the full file