/ajax/simile-ajax-bundle.js
JavaScript | 1574 lines | 1547 code | 18 blank | 9 comment | 69 complexity | f291fe0a0894de37c4e426cffc387b8b 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 C=navigator.appName.toLowerCase(); 10var A=navigator.userAgent.toLowerCase(); 11SimileAjax.Platform.os.isMac=(A.indexOf("mac")!=-1); 12SimileAjax.Platform.os.isWin=(A.indexOf("win")!=-1); 13SimileAjax.Platform.os.isWin32=SimileAjax.Platform.isWin&&(A.indexOf("95")!=-1||A.indexOf("98")!=-1||A.indexOf("nt")!=-1||A.indexOf("win32")!=-1||A.indexOf("32bit")!=-1); 14SimileAjax.Platform.os.isUnix=(A.indexOf("x11")!=-1); 15SimileAjax.Platform.browser.isIE=(C.indexOf("microsoft")!=-1); 16SimileAjax.Platform.browser.isNetscape=(C.indexOf("netscape")!=-1); 17SimileAjax.Platform.browser.isMozilla=(A.indexOf("mozilla")!=-1); 18SimileAjax.Platform.browser.isFirefox=(A.indexOf("firefox")!=-1); 19SimileAjax.Platform.browser.isOpera=(C.indexOf("opera")!=-1); 20SimileAjax.Platform.browser.isSafari=(C.indexOf("safari")!=-1); 21var E=function(G){var F=G.split("."); 22SimileAjax.Platform.browser.majorVersion=parseInt(F[0]); 23SimileAjax.Platform.browser.minorVersion=parseInt(F[1]); 24}; 25var B=function(H,G,I){var F=H.indexOf(G,I); 26return F>=0?F:H.length; 27}; 28if(SimileAjax.Platform.browser.isMozilla){var D=A.indexOf("mozilla/"); 29if(D>=0){E(A.substring(D+8,B(A," ",D))); 30}}if(SimileAjax.Platform.browser.isIE){var D=A.indexOf("msie "); 31if(D>=0){E(A.substring(D+5,B(A,";",D))); 32}}if(SimileAjax.Platform.browser.isNetscape){var D=A.indexOf("rv:"); 33if(D>=0){E(A.substring(D+3,B(A,")",D))); 34}}if(SimileAjax.Platform.browser.isFirefox){var D=A.indexOf("firefox/"); 35if(D>=0){E(A.substring(D+8,B(A," ",D))); 36}}if(!("localeCompare" in String.prototype)){String.prototype.localeCompare=function(F){if(this<F){return -1; 37}else{if(this>F){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(A){this._listeners=[]; 47this._wildcardHandlerName=A; 48}; 49SimileAjax.ListenerQueue.prototype.add=function(A){this._listeners.push(A); 50}; 51SimileAjax.ListenerQueue.prototype.remove=function(C){var B=this._listeners; 52for(var A=0; 53A<B.length; 54A++){if(B[A]==C){B.splice(A,1); 55break; 56}}}; 57SimileAjax.ListenerQueue.prototype.fire=function(B,A){var D=[].concat(this._listeners); 58for(var C=0; 59C<D.length; 60C++){var E=D[C]; 61if(B in E){try{E[B].apply(E,A); 62}catch(F){SimileAjax.Debug.exception("Error firing event of name "+B,F); 63}}else{if(this._wildcardHandlerName!=null&&this._wildcardHandlerName in E){try{E[this._wildcardHandlerName].apply(E,[B]); 64}catch(F){SimileAjax.Debug.exception("Error firing event of name "+B+" to wildcard handler",F); 65}}}}}; 66 67 68/* data-structure.js */ 69SimileAjax.Set=function(A){this._hash={}; 70this._count=0; 71if(A instanceof Array){for(var B=0; 72B<A.length; 73B++){this.add(A[B]); 74}}else{if(A instanceof SimileAjax.Set){this.addSet(A); 75}}}; 76SimileAjax.Set.prototype.add=function(A){if(!(A in this._hash)){this._hash[A]=true; 77this._count++; 78return true; 79}return false; 80}; 81SimileAjax.Set.prototype.addSet=function(B){for(var A in B._hash){this.add(A); 82}}; 83SimileAjax.Set.prototype.remove=function(A){if(A in this._hash){delete this._hash[A]; 84this._count--; 85return true; 86}return false; 87}; 88SimileAjax.Set.prototype.removeSet=function(B){for(var A in B._hash){this.remove(A); 89}}; 90SimileAjax.Set.prototype.retainSet=function(B){for(var A in this._hash){if(!B.contains(A)){delete this._hash[A]; 91this._count--; 92}}}; 93SimileAjax.Set.prototype.contains=function(A){return(A in this._hash); 94}; 95SimileAjax.Set.prototype.size=function(){return this._count; 96}; 97SimileAjax.Set.prototype.toArray=function(){var A=[]; 98for(var B in this._hash){A.push(B); 99}return A; 100}; 101SimileAjax.Set.prototype.visit=function(A){for(var B in this._hash){if(A(B)==true){break; 102}}}; 103SimileAjax.SortedArray=function(B,A){this._a=(A instanceof Array)?A:[]; 104this._compare=B; 105}; 106SimileAjax.SortedArray.prototype.add=function(C){var A=this; 107var B=this.find(function(D){return A._compare(D,C); 108}); 109if(B<this._a.length){this._a.splice(B,0,C); 110}else{this._a.push(C); 111}}; 112SimileAjax.SortedArray.prototype.remove=function(C){var A=this; 113var B=this.find(function(D){return A._compare(D,C); 114}); 115while(B<this._a.length&&this._compare(this._a[B],C)==0){if(this._a[B]==C){this._a.splice(B,1); 116return true; 117}else{B++; 118}}return false; 119}; 120SimileAjax.SortedArray.prototype.removeAll=function(){this._a=[]; 121}; 122SimileAjax.SortedArray.prototype.elementAt=function(A){return this._a[A]; 123}; 124SimileAjax.SortedArray.prototype.length=function(){return this._a.length; 125}; 126SimileAjax.SortedArray.prototype.find=function(D){var B=0; 127var A=this._a.length; 128while(B<A){var C=Math.floor((B+A)/2); 129var E=D(this._a[C]); 130if(C==B){return E<0?B+1:B; 131}else{if(E<0){B=C; 132}else{A=C; 133}}}return B; 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(B){var A=this; 140this._unit=(B!=null)?B:SimileAjax.NativeDateUnit; 141this._events=new SimileAjax.SortedArray(function(D,C){return A._unit.compare(D.getStart(),C.getStart()); 142}); 143this._idToEvent={}; 144this._indexed=true; 145}; 146SimileAjax.EventIndex.prototype.getUnit=function(){return this._unit; 147}; 148SimileAjax.EventIndex.prototype.getEvent=function(A){return this._idToEvent[A]; 149}; 150SimileAjax.EventIndex.prototype.add=function(A){this._events.add(A); 151this._idToEvent[A.getID()]=A; 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(A,B){if(!this._indexed){this._index(); 161}return new SimileAjax.EventIndex._Iterator(this._events,A,B,this._unit); 162}; 163SimileAjax.EventIndex.prototype.getReverseIterator=function(A,B){if(!this._indexed){this._index(); 164}return new SimileAjax.EventIndex._ReverseIterator(this._events,A,B,this._unit); 165}; 166SimileAjax.EventIndex.prototype.getAllIterator=function(){return new SimileAjax.EventIndex._AllIterator(this._events); 167}; 168SimileAjax.EventIndex.prototype.getEarliestDate=function(){var A=this._events.getFirst(); 169return(A==null)?null:A.getStart(); 170}; 171SimileAjax.EventIndex.prototype.getLatestDate=function(){var A=this._events.getLast(); 172if(A==null){return null; 173}if(!this._indexed){this._index(); 174}var C=A._earliestOverlapIndex; 175var B=this._events.elementAt(C).getEnd(); 176for(var D=C+1; 177D<this._events.length(); 178D++){B=this._unit.later(B,this._events.elementAt(D).getEnd()); 179}return B; 180}; 181SimileAjax.EventIndex.prototype._index=function(){var D=this._events.length(); 182for(var E=0; 183E<D; 184E++){var C=this._events.elementAt(E); 185C._earliestOverlapIndex=E; 186}var G=1; 187for(var E=0; 188E<D; 189E++){var C=this._events.elementAt(E); 190var B=C.getEnd(); 191G=Math.max(G,E+1); 192while(G<D){var A=this._events.elementAt(G); 193var F=A.getStart(); 194if(this._unit.compare(F,B)<0){A._earliestOverlapIndex=E; 195G++; 196}else{break; 197}}}this._indexed=true; 198}; 199SimileAjax.EventIndex._Iterator=function(B,A,D,C){this._events=B; 200this._startDate=A; 201this._endDate=D; 202this._unit=C; 203this._currentIndex=B.find(function(E){return C.compare(E.getStart(),A); 204}); 205if(this._currentIndex-1>=0){this._currentIndex=this._events.elementAt(this._currentIndex-1)._earliestOverlapIndex; 206}this._currentIndex--; 207this._maxIndex=B.find(function(E){return C.compare(E.getStart(),D); 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 A=this._next; 215this._findNext(); 216return A; 217}else{return null; 218}},_findNext:function(){var B=this._unit; 219while((++this._currentIndex)<this._maxIndex){var A=this._events.elementAt(this._currentIndex); 220if(B.compare(A.getStart(),this._endDate)<0&&B.compare(A.getEnd(),this._startDate)>0){this._next=A; 221this._hasNext=true; 222return ; 223}}this._next=null; 224this._hasNext=false; 225}}; 226SimileAjax.EventIndex._ReverseIterator=function(B,A,D,C){this._events=B; 227this._startDate=A; 228this._endDate=D; 229this._unit=C; 230this._minIndex=B.find(function(E){return C.compare(E.getStart(),A); 231}); 232if(this._minIndex-1>=0){this._minIndex=this._events.elementAt(this._minIndex-1)._earliestOverlapIndex; 233}this._maxIndex=B.find(function(E){return C.compare(E.getStart(),D); 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 A=this._next; 242this._findNext(); 243return A; 244}else{return null; 245}},_findNext:function(){var B=this._unit; 246while((--this._currentIndex)>=this._minIndex){var A=this._events.elementAt(this._currentIndex); 247if(B.compare(A.getStart(),this._endDate)<0&&B.compare(A.getEnd(),this._startDate)>0){this._next=A; 248this._hasNext=true; 249return ; 250}}this._next=null; 251this._hasNext=false; 252}}; 253SimileAjax.EventIndex._AllIterator=function(A){this._events=A; 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 B=SimileAjax.DateTime; 278var A=B.gregorianUnitLengths; 279A[B.MILLISECOND]=1; 280A[B.SECOND]=1000; 281A[B.MINUTE]=A[B.SECOND]*60; 282A[B.HOUR]=A[B.MINUTE]*60; 283A[B.DAY]=A[B.HOUR]*24; 284A[B.WEEK]=A[B.DAY]*7; 285A[B.MONTH]=A[B.DAY]*31; 286A[B.YEAR]=A[B.DAY]*365; 287A[B.DECADE]=A[B.YEAR]*10; 288A[B.CENTURY]=A[B.YEAR]*100; 289A[B.MILLENNIUM]=A[B.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(H,F){var I=F.match(SimileAjax.DateTime._dateRegexp); 295if(!I){throw new Error("Invalid date string: "+F); 296}var B=(I[1]=="-")?-1:1; 297var J=B*I[2]; 298var G=I[5]; 299var C=I[7]; 300var E=I[9]; 301var A=I[11]; 302var M=(I[13])?I[13]:1; 303H.setUTCFullYear(J); 304if(E){H.setUTCMonth(0); 305H.setUTCDate(Number(E)); 306}else{if(A){H.setUTCMonth(0); 307H.setUTCDate(1); 308var L=H.getUTCDay(); 309var K=(L)?L:7; 310var D=Number(M)+(7*Number(A)); 311if(K<=4){H.setUTCDate(D+1-K); 312}else{H.setUTCDate(D+8-K); 313}}else{if(G){H.setUTCDate(1); 314H.setUTCMonth(G-1); 315}if(C){H.setUTCDate(C); 316}}}return H; 317}; 318SimileAjax.DateTime.setIso8601Time=function(F,C){var G=C.match(SimileAjax.DateTime._timeRegexp); 319if(!G){SimileAjax.Debug.warn("Invalid time string: "+C); 320return false; 321}var A=G[1]; 322var E=Number((G[3])?G[3]:0); 323var D=(G[5])?G[5]:0; 324var B=G[7]?(Number("0."+G[7])*1000):0; 325F.setUTCHours(A); 326F.setUTCMinutes(E); 327F.setUTCSeconds(D); 328F.setUTCMilliseconds(B); 329return F; 330}; 331SimileAjax.DateTime.timezoneOffset=new Date().getTimezoneOffset(); 332SimileAjax.DateTime.setIso8601=function(B,A){var D=null; 333var E=(A.indexOf("T")==-1)?A.split(" "):A.split("T"); 334SimileAjax.DateTime.setIso8601Date(B,E[0]); 335if(E.length==2){var C=E[1].match(SimileAjax.DateTime._timezoneRegexp); 336if(C){if(C[0]=="Z"){D=0; 337}else{D=(Number(C[3])*60)+Number(C[5]); 338D*=((C[2]=="-")?1:-1); 339}E[1]=E[1].substr(0,E[1].length-C[0].length); 340}SimileAjax.DateTime.setIso8601Time(B,E[1]); 341}if(D==null){D=B.getTimezoneOffset(); 342}B.setTime(B.getTime()+D*60000); 343return B; 344}; 345SimileAjax.DateTime.parseIso8601DateTime=function(A){try{return SimileAjax.DateTime.setIso8601(new Date(0),A); 346}catch(B){return null; 347}}; 348SimileAjax.DateTime.parseGregorianDateTime=function(G){if(G==null){return null; 349}else{if(G instanceof Date){return G; 350}}var B=G.toString(); 351if(B.length>0&&B.length<8){var C=B.indexOf(" "); 352if(C>0){var A=parseInt(B.substr(0,C)); 353var E=B.substr(C+1); 354if(E.toLowerCase()=="bc"){A=1-A; 355}}else{var A=parseInt(B); 356}var F=new Date(0); 357F.setUTCFullYear(A); 358return F; 359}try{return new Date(Date.parse(B)); 360}catch(D){return null; 361}}; 362SimileAjax.DateTime.roundDownToInterval=function(B,G,J,K,A){var D=J*SimileAjax.DateTime.gregorianUnitLengths[SimileAjax.DateTime.HOUR]; 363var I=new Date(B.getTime()+D); 364var E=function(L){L.setUTCMilliseconds(0); 365L.setUTCSeconds(0); 366L.setUTCMinutes(0); 367L.setUTCHours(0); 368}; 369var C=function(L){E(L); 370L.setUTCDate(1); 371L.setUTCMonth(0); 372}; 373switch(G){case SimileAjax.DateTime.MILLISECOND:var H=I.getUTCMilliseconds(); 374I.setUTCMilliseconds(H-(H%K)); 375break; 376case SimileAjax.DateTime.SECOND:I.setUTCMilliseconds(0); 377var H=I.getUTCSeconds(); 378I.setUTCSeconds(H-(H%K)); 379break; 380case SimileAjax.DateTime.MINUTE:I.setUTCMilliseconds(0); 381I.setUTCSeconds(0); 382var H=I.getUTCMinutes(); 383I.setTime(I.getTime()-(H%K)*SimileAjax.DateTime.gregorianUnitLengths[SimileAjax.DateTime.MINUTE]); 384break; 385case SimileAjax.DateTime.HOUR:I.setUTCMilliseconds(0); 386I.setUTCSeconds(0); 387I.setUTCMinutes(0); 388var H=I.getUTCHours(); 389I.setUTCHours(H-(H%K)); 390break; 391case SimileAjax.DateTime.DAY:E(I); 392break; 393case SimileAjax.DateTime.WEEK:E(I); 394var F=(I.getUTCDay()+7-A)%7; 395I.setTime(I.getTime()-F*SimileAjax.DateTime.gregorianUnitLengths[SimileAjax.DateTime.DAY]); 396break; 397case SimileAjax.DateTime.MONTH:E(I); 398I.setUTCDate(1); 399var H=I.getUTCMonth(); 400I.setUTCMonth(H-(H%K)); 401break; 402case SimileAjax.DateTime.YEAR:C(I); 403var H=I.getUTCFullYear(); 404I.setUTCFullYear(H-(H%K)); 405break; 406case SimileAjax.DateTime.DECADE:C(I); 407I.setUTCFullYear(Math.floor(I.getUTCFullYear()/10)*10); 408break; 409case SimileAjax.DateTime.CENTURY:C(I); 410I.setUTCFullYear(Math.floor(I.getUTCFullYear()/100)*100); 411break; 412case SimileAjax.DateTime.MILLENNIUM:C(I); 413I.setUTCFullYear(Math.floor(I.getUTCFullYear()/1000)*1000); 414break; 415}B.setTime(I.getTime()-D); 416}; 417SimileAjax.DateTime.roundUpToInterval=function(D,F,C,A,B){var E=D.getTime(); 418SimileAjax.DateTime.roundDownToInterval(D,F,C,A,B); 419if(D.getTime()<E){D.setTime(D.getTime()+SimileAjax.DateTime.gregorianUnitLengths[F]*A); 420}}; 421SimileAjax.DateTime.incrementByInterval=function(B,E,A){A=(typeof A=="undefined")?0:A; 422var D=A*SimileAjax.DateTime.gregorianUnitLengths[SimileAjax.DateTime.HOUR]; 423var C=new Date(B.getTime()+D); 424switch(E){case SimileAjax.DateTime.MILLISECOND:C.setTime(C.getTime()+1); 425break; 426case SimileAjax.DateTime.SECOND:C.setTime(C.getTime()+1000); 427break; 428case SimileAjax.DateTime.MINUTE:C.setTime(C.getTime()+SimileAjax.DateTime.gregorianUnitLengths[SimileAjax.DateTime.MINUTE]); 429break; 430case SimileAjax.DateTime.HOUR:C.setTime(C.getTime()+SimileAjax.DateTime.gregorianUnitLengths[SimileAjax.DateTime.HOUR]); 431break; 432case SimileAjax.DateTime.DAY:C.setUTCDate(C.getUTCDate()+1); 433break; 434case SimileAjax.DateTime.WEEK:C.setUTCDate(C.getUTCDate()+7); 435break; 436case SimileAjax.DateTime.MONTH:C.setUTCMonth(C.getUTCMonth()+1); 437break; 438case SimileAjax.DateTime.YEAR:C.setUTCFullYear(C.getUTCFullYear()+1); 439break; 440case SimileAjax.DateTime.DECADE:C.setUTCFullYear(C.getUTCFullYear()+10); 441break; 442case SimileAjax.DateTime.CENTURY:C.setUTCFullYear(C.getUTCFullYear()+100); 443break; 444case SimileAjax.DateTime.MILLENNIUM:C.setUTCFullYear(C.getUTCFullYear()+1000); 445break; 446}B.setTime(C.getTime()-D); 447}; 448SimileAjax.DateTime.removeTimeZoneOffset=function(B,A){return new Date(B.getTime()+A*SimileAjax.DateTime.gregorianUnitLengths[SimileAjax.DateTime.HOUR]); 449}; 450SimileAjax.DateTime.getTimezone=function(){var A=new Date().getTimezoneOffset(); 451return A/-60; 452}; 453 454 455/* debug.js */ 456SimileAjax.Debug={silent:false}; 457SimileAjax.Debug.log=function(B){var A; 458if("console" in window&&"log" in window.console){A=function(C){console.log(C); 459}; 460}else{A=function(C){if(!SimileAjax.Debug.silent){alert(C); 461}}; 462}SimileAjax.Debug.log=A; 463A(B); 464}; 465SimileAjax.Debug.warn=function(B){var A; 466if("console" in window&&"warn" in window.console){A=function(C){console.warn(C); 467}; 468}else{A=function(C){if(!SimileAjax.Debug.silent){alert(C); 469}}; 470}SimileAjax.Debug.warn=A; 471A(B); 472}; 473SimileAjax.Debug.exception=function(B,D){var A,C=SimileAjax.parseURLParameters(); 474if(C.errors=="throw"||SimileAjax.params.errors=="throw"){A=function(F,E){throw (F); 475}; 476}else{if("console" in window&&"error" in window.console){A=function(F,E){if(E!=null){console.error(E+" %o",F); 477}else{console.error(F); 478}throw (F); 479}; 480}else{A=function(F,E){if(!SimileAjax.Debug.silent){alert("Caught exception: "+E+"\n\nDetails: "+("description" in F?F.description:F)); 481}throw (F); 482}; 483}}SimileAjax.Debug.exception=A; 484A(B,D); 485}; 486SimileAjax.Debug.objectToString=function(A){return SimileAjax.Debug._objectToString(A,""); 487}; 488SimileAjax.Debug._objectToString=function(D,A){var C=A+" "; 489if(typeof D=="object"){var B="{"; 490for(E in D){B+=C+E+": "+SimileAjax.Debug._objectToString(D[E],C)+"\n"; 491}B+=A+"}"; 492return B; 493}else{if(typeof D=="array"){var B="["; 494for(var E=0; 495E<D.length; 496E++){B+=SimileAjax.Debug._objectToString(D[E],C)+"\n"; 497}B+=A+"]"; 498return B; 499}else{return D; 500}}}; 501 502 503/* dom.js */ 504SimileAjax.DOM=new Object(); 505SimileAjax.DOM.registerEventWithObject=function(C,A,D,B){SimileAjax.DOM.registerEvent(C,A,function(F,E,G){return D[B].call(D,F,E,G); 506}); 507}; 508SimileAjax.DOM.registerEvent=function(C,B,D){var A=function(E){E=(E)?E:((event)?event:null); 509if(E){var F=(E.target)?E.target:((E.srcElement)?E.srcElement:null); 510if(F){F=(F.nodeType==1||F.nodeType==9)?F:F.parentNode; 511}return D(C,E,F); 512}return true; 513}; 514if(SimileAjax.Platform.browser.isIE){C.attachEvent("on"+B,A); 515}else{C.addEventListener(B,A,false); 516}}; 517SimileAjax.DOM.getPageCoordinates=function(B){var E=0; 518var D=0; 519if(B.nodeType!=1){B=B.parentNode; 520}var C=B; 521while(C!=null){E+=C.offsetLeft; 522D+=C.offsetTop; 523C=C.offsetParent; 524}var A=document.body; 525while(B!=null&&B!=A){if("scrollLeft" in B){E-=B.scrollLeft; 526D-=B.scrollTop; 527}B=B.parentNode; 528}return{left:E,top:D}; 529}; 530SimileAjax.DOM.getSize=function(B){var A=this.getStyle(B,"width"); 531var C=this.getStyle(B,"height"); 532if(A.indexOf("px")>-1){A=A.replace("px",""); 533}if(C.indexOf("px")>-1){C=C.replace("px",""); 534}return{w:A,h:C}; 535}; 536SimileAjax.DOM.getStyle=function(B,A){if(B.currentStyle){var C=B.currentStyle[A]; 537}else{if(window.getComputedStyle){var C=document.defaultView.getComputedStyle(B,null).getPropertyValue(A); 538}else{var C=""; 539}}return C; 540}; 541SimileAjax.DOM.getEventRelativeCoordinates=function(A,B){if(SimileAjax.Platform.browser.isIE){if(A.type=="mousewheel"){var C=SimileAjax.DOM.getPageCoordinates(B); 542return{x:A.clientX-C.left,y:A.clientY-C.top}; 543}else{return{x:A.offsetX,y:A.offsetY}; 544}}else{var C=SimileAjax.DOM.getPageCoordinates(B); 545if((A.type=="DOMMouseScroll")&&SimileAjax.Platform.browser.isFirefox&&(SimileAjax.Platform.browser.majorVersion==2)){return{x:A.screenX-C.left,y:A.screenY-C.top}; 546}else{return{x:A.pageX-C.left,y:A.pageY-C.top}; 547}}}; 548SimileAjax.DOM.getEventPageCoordinates=function(A){if(SimileAjax.Platform.browser.isIE){var B=0; 549var C=0; 550if(document.body&&(document.body.scrollLeft||document.body.scrollTop)){B=document.body.scrollTop; 551C=document.body.scrollLeft; 552}else{if(document.documentElement&&(document.documentElement.scrollLeft||document.documentElement.scrollTop)){B=document.documentElement.scrollTop; 553C=document.documentElement.scrollLeft; 554}}return{x:A.clientX+C,y:A.clientY+B}; 555}else{return{x:A.pageX,y:A.pageY}; 556}}; 557SimileAjax.DOM.hittest=function(A,C,B){return SimileAjax.DOM._hittest(document.body,A,C,B); 558}; 559SimileAjax.DOM._hittest=function(C,L,K,H){var M=C.childNodes; 560outer:for(var G=0; 561G<M.length; 562G++){var A=M[G]; 563for(var F=0; 564F<H.length; 565F++){if(A==H[F]){continue outer; 566}}if(A.offsetWidth==0&&A.offsetHeight==0){var B=SimileAjax.DOM._hittest(A,L,K,H); 567if(B!=A){return B; 568}}else{var J=0; 569var E=0; 570var D=A; 571while(D){J+=D.offsetTop; 572E+=D.offsetLeft; 573D=D.offsetParent; 574}if(E<=L&&J<=K&&(L-E)<A.offsetWidth&&(K-J)<A.offsetHeight){return SimileAjax.DOM._hittest(A,L,K,H); 575}else{if(A.nodeType==1&&A.tagName=="TR"){var I=SimileAjax.DOM._hittest(A,L,K,H); 576if(I!=A){return I; 577}}}}}return C; 578}; 579SimileAjax.DOM.cancelEvent=function(A){A.returnValue=false; 580A.cancelBubble=true; 581if("preventDefault" in A){A.preventDefault(); 582}}; 583SimileAjax.DOM.appendClassName=function(C,D){var B=C.className.split(" "); 584for(var A=0; 585A<B.length; 586A++){if(B[A]==D){return ; 587}}B.push(D); 588C.className=B.join(" "); 589}; 590SimileAjax.DOM.createInputElement=function(A){var B=document.createElement("div"); 591B.innerHTML="<input type='"+A+"' />"; 592return B.firstChild; 593}; 594SimileAjax.DOM.createDOMFromTemplate=function(B){var A={}; 595A.elmt=SimileAjax.DOM._createDOMFromTemplate(B,A,null); 596return A; 597}; 598SimileAjax.DOM._createDOMFromTemplate=function(A,I,E){if(A==null){return null; 599}else{if(typeof A!="object"){var D=document.createTextNode(A); 600if(E!=null){E.appendChild(D); 601}return D; 602}else{var C=null; 603if("tag" in A){var J=A.tag; 604if(E!=null){if(J=="tr"){C=E.insertRow(E.rows.length); 605}else{if(J=="td"){C=E.insertCell(E.cells.length); 606}}}if(C==null){C=J=="input"?SimileAjax.DOM.createInputElement(A.type):document.createElement(J); 607if(E!=null){E.appendChild(C); 608}}}else{C=A.elmt; 609if(E!=null){E.appendChild(C); 610}}for(var B in A){var G=A[B]; 611if(B=="field"){I[G]=C; 612}else{if(B=="className"){C.className=G; 613}else{if(B=="id"){C.id=G; 614}else{if(B=="title"){C.title=G; 615}else{if(B=="type"&&C.tagName=="input"){}else{if(B=="style"){for(n in G){var H=G[n]; 616if(n=="float"){n=SimileAjax.Platform.browser.isIE?"styleFloat":"cssFloat"; 617}C.style[n]=H; 618}}else{if(B=="children"){for(var F=0; 619F<G.length; 620F++){SimileAjax.DOM._createDOMFromTemplate(G[F],I,C); 621}}else{if(B!="tag"&&B!="elmt"){C.setAttribute(B,G); 622}}}}}}}}}return C; 623}}}; 624SimileAjax.DOM._cachedParent=null; 625SimileAjax.DOM.createElementFromString=function(A){if(SimileAjax.DOM._cachedParent==null){SimileAjax.DOM._cachedParent=document.createElement("div"); 626}SimileAjax.DOM._cachedParent.innerHTML=A; 627return SimileAjax.DOM._cachedParent.firstChild; 628}; 629SimileAjax.DOM.createDOMFromString=function(A,C,D){var B=typeof A=="string"?document.createElement(A):A; 630B.innerHTML=C; 631var E={elmt:B}; 632SimileAjax.DOM._processDOMChildrenConstructedFromString(E,B,D!=null?D:{}); 633return E; 634}; 635SimileAjax.DOM._processDOMConstructedFromString=function(D,A,B){var E=A.id; 636if(E!=null&&E.length>0){A.removeAttribute("id"); 637if(E in B){var C=A.parentNode; 638C.insertBefore(B[E],A); 639C.removeChild(A); 640D[E]=B[E]; 641return ; 642}else{D[E]=A; 643}}if(A.hasChildNodes()){SimileAjax.DOM._processDOMChildrenConstructedFromString(D,A,B); 644}}; 645SimileAjax.DOM._processDOMChildrenConstructedFromString=function(E,B,D){var C=B.firstChild; 646while(C!=null){var A=C.nextSibling; 647if(C.nodeType==1){SimileAjax.DOM._processDOMConstructedFromString(E,C,D); 648}C=A; 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(A,C){var B=document.createElement("img"); 657B.setAttribute("src",A); 658if(C!=null){B.style.verticalAlign=C; 659}return B; 660}; 661SimileAjax.Graphics._createTranslucentImage2=function(A,C){var B=document.createElement("img"); 662B.style.width="1px"; 663B.style.height="1px"; 664B.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+A+"', sizingMethod='image')"; 665B.style.verticalAlign=(C!=null)?C:"middle"; 666return B; 667}; 668SimileAjax.Graphics.createTranslucentImage=SimileAjax.Graphics.pngIsTranslucent?SimileAjax.Graphics._createTranslucentImage1:SimileAjax.Graphics._createTranslucentImage2; 669SimileAjax.Graphics._createTranslucentImageHTML1=function(A,B){return'<img src="'+A+'"'+(B!=null?' style="vertical-align: '+B+';"':"")+" />"; 670}; 671SimileAjax.Graphics._createTranslucentImageHTML2=function(A,C){var B="width: 1px; height: 1px; filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+A+"', sizingMethod='image');"+(C!=null?" vertical-align: "+C+";":""); 672return"<img src='"+A+"' style=\""+B+'" />'; 673}; 674SimileAjax.Graphics.createTranslucentImageHTML=SimileAjax.Graphics.pngIsTranslucent?SimileAjax.Graphics._createTranslucentImageHTML1:SimileAjax.Graphics._createTranslucentImageHTML2; 675SimileAjax.Graphics.setOpacity=function(B,A){if(SimileAjax.Platform.browser.isIE){B.style.filter="progid:DXImageTransform.Microsoft.Alpha(Style=0,Opacity="+A+")"; 676}else{var C=(A/100).toString(); 677B.style.opacity=C; 678B.style.MozOpacity=C; 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(F,D,C,A,B,E){if(typeof A!="number"){A=300; 682}if(typeof E!="number"){E=0; 683}F.style.position="absolute"; 684F.style.left="-5000px"; 685F.style.top="0px"; 686F.style.width=A+"px"; 687document.body.appendChild(F); 688window.setTimeout(function(){var J=F.scrollWidth+10; 689var G=F.scrollHeight+10; 690var I=0; 691if(E>0&&G>E){G=E; 692I=J-25; 693}var H=SimileAjax.Graphics.createBubbleForPoint(D,C,J,G,B); 694document.body.removeChild(F); 695F.style.position="static"; 696F.style.left=""; 697F.style.top=""; 698if(I>0){var K=document.createElement("div"); 699F.style.width=""; 700K.style.width=I+"px"; 701K.appendChild(F); 702H.content.appendChild(K); 703}else{F.style.width=J+"px"; 704H.content.appendChild(F); 705}},200); 706}; 707SimileAjax.Graphics.createBubbleForPoint=function(B,A,K,M,D){K=parseInt(K,10); 708M=parseInt(M,10); 709var E=SimileAjax.Graphics.bubbleConfig; 710var N=SimileAjax.Graphics.pngIsTranslucent?"pngTranslucent":"pngNotTranslucent"; 711var L=K+2*E.borderGraphicSize; 712var P=M+2*E.borderGraphicSize; 713var O=function(S){return S+" "+S+"-"+N; 714}; 715var H=document.createElement("div"); 716H.className=O(E.containerCSSClass); 717H.style.width=K+"px"; 718H.style.height=M+"px"; 719var F=document.createElement("div"); 720F.className=O(E.innerContainerCSSClass); 721H.appendChild(F); 722var I=function(){if(!J._closed){document.body.removeChild(J._div); 723J._doc=null; 724J._div=null; 725J._content=null; 726J._closed=true; 727}}; 728var J={_closed:false}; 729var R=SimileAjax.WindowManager.pushLayer(I,true,H); 730J._div=H; 731J.close=function(){SimileAjax.WindowManager.popLayer(R); 732}; 733var G=function(T){var S=document.createElement("div"); 734S.className=O(E.borderGraphicCSSClassPrefix+T); 735F.appendChild(S); 736}; 737G("top-left"); 738G("top-right"); 739G("bottom-left"); 740G("bottom-right"); 741G("left"); 742G("right"); 743G("top"); 744G("bottom"); 745var C=document.createElement("div"); 746C.className=O(E.contentContainerCSSClass); 747F.appendChild(C); 748J.content=C; 749var Q=document.createElement("div"); 750Q.className=O(E.closeGraphicCSSClass); 751F.appendChild(Q); 752SimileAjax.WindowManager.registerEventWithObject(Q,"click",J,"close"); 753(function(){var Z=SimileAjax.Graphics.getWindowDimensions(); 754var U=Z.w; 755var S=Z.h; 756var V=Math.ceil(E.arrowGraphicWidth/2); 757var Y=function(a){var b=document.createElement("div"); 758b.className=O(E.arrowGraphicCSSClassPrefix+"point-"+a); 759F.appendChild(b); 760return b; 761}; 762if(B-V-E.borderGraphicSize-E.extraPadding>0&&B+V+E.borderGraphicSize+E.extraPadding<U){var X=B-Math.round(K/2); 763X=B<(U/2)?Math.max(X,E.extraPadding+E.borderGraphicSize):Math.min(X,U-E.extraPadding-E.borderGraphicSize-K); 764if((D&&D=="top")||(!D&&(A-E.arrowGraphicTargetOffset-M-E.borderGraphicSize-E.extraPadding>0))){var T=Y("down"); 765T.style.left=(B-V-X)+"px"; 766H.style.left=X+"px"; 767H.style.top=(A-E.arrowGraphicTargetOffset-M)+"px"; 768return ; 769}else{if((D&&D=="bottom")||(!D&&(A+E.arrowGraphicTargetOffset+M+E.borderGraphicSize+E.extraPadding<S))){var T=Y("up"); 770T.style.left=(B-V-X)+"px"; 771H.style.left=X+"px"; 772H.style.top=(A+E.arrowGraphicTargetOffset)+"px"; 773return ; 774}}}var W=A-Math.round(M/2); 775W=A<(S/2)?Math.max(W,E.extraPadding+E.borderGraphicSize):Math.min(W,S-E.extraPadding-E.borderGraphicSize-M); 776if((D&&D=="left")||(!D&&(B-E.arrowGraphicTargetOffset-K-E.borderGraphicSize-E.extraPadding>0))){var T=Y("right"); 777T.style.top=(A-V-W)+"px"; 778H.style.top=W+"px"; 779H.style.left=(B-E.arrowGraphicTargetOffset-K)+"px"; 780}else{var T=Y("left"); 781T.style.top=(A-V-W)+"px"; 782H.style.top=W+"px"; 783H.style.left=(B+E.arrowGraphicTargetOffset)+"px"; 784}})(); 785document.body.appendChild(H); 786return J; 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(H){var G=H.createElement("div"); 793if(SimileAjax.Graphics.pngIsTranslucent){var I=H.createElement("div"); 794I.style.height="33px"; 795I.style.background="url("+SimileAjax.urlPrefix+"images/message-top-left.png) top left no-repeat"; 796I.style.paddingLeft="44px"; 797G.appendChild(I); 798var C=H.createElement("div"); 799C.style.height="33px"; 800C.style.background="url("+SimileAjax.urlPrefix+"images/message-top-right.png) top right no-repeat"; 801I.appendChild(C); 802var F=H.createElement("div"); 803F.style.background="url("+SimileAjax.urlPrefix+"images/message-left.png) top left repeat-y"; 804F.style.paddingLeft="44px"; 805G.appendChild(F); 806var A=H.createElement("div"); 807A.style.background="url("+SimileAjax.urlPrefix+"images/message-right.png) top right repeat-y"; 808A.style.paddingRight="44px"; 809F.appendChild(A); 810var D=H.createElement("div"); 811A.appendChild(D); 812var B=H.createElement("div"); 813B.style.height="55px"; 814B.style.background="url("+SimileAjax.urlPrefix+"images/message-bottom-left.png) bottom left no-repeat"; 815B.style.paddingLeft="44px"; 816G.appendChild(B); 817var E=H.createElement("div"); 818E.style.height="55px"; 819E.style.background="url("+SimileAjax.urlPrefix+"images/message-bottom-right.png) bottom right no-repeat"; 820B.appendChild(E); 821}else{G.style.border="2px solid #7777AA"; 822G.style.padding="20px"; 823G.style.background="white"; 824SimileAjax.Graphics.setOpacity(G,90); 825var D=H.createElement("div"); 826G.appendChild(D); 827}return{containerDiv:G,contentDiv:D}; 828}; 829SimileAjax.Graphics.createAnimation=function(B,E,D,C,A){return new SimileAjax.Graphics._Animation(B,E,D,C,A); 830}; 831SimileAjax.Graphics._Animation=function(B,E,D,C,A){this.f=B; 832this.cont=(typeof A=="function")?A:function(){}; 833this.from=E; 834this.to=D; 835this.current=E; 836this.duration=C; 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 B=this.timePassed/this.duration; 846var A=-Math.cos(B*Math.PI)/2+0.5; 847var D=A*(this.to-this.from)+this.from; 848try{this.f(D,D-this.current); 849}catch(C){}this.current=D; 850if(this.timePassed<this.duration){this.run(); 851}else{this.f(this.to,0); 852this["cont"](); 853}}; 854SimileAjax.Graphics.createStructuredDataCopyButton=function(F,D,A,E){var G=document.createElement("div"); 855G.style.position="relative"; 856G.style.display="inline"; 857G.style.width=D+"px"; 858G.style.height=A+"px"; 859G.style.overflow="hidden"; 860G.style.margin="2px"; 861if(SimileAjax.Graphics.pngIsTranslucent){G.style.background="url("+F+") no-repeat"; 862}else{G.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+F+"', sizingMethod='image')"; 863}var C; 864if(SimileAjax.Platform.browser.isIE){C="filter:alpha(opacity=0)"; 865}else{C="opacity: 0"; 866}G.innerHTML="<textarea rows='1' autocomplete='off' value='none' style='"+C+"' />"; 867var B=G.firstChild; 868B.style.width=D+"px"; 869B.style.height=A+"px"; 870B.onmousedown=function(H){H=(H)?H:((event)?event:null); 871if(H.button==2){B.value=E(); 872B.select(); 873}}; 874return G; 875}; 876SimileAjax.Graphics.getWidthHeight=function(C){var A,B; 877if(C.getBoundingClientRect==null){A=C.offsetWidth; 878B=C.offsetHeight; 879}else{var D=C.getBoundingClientRect(); 880A=Math.ceil(D.right-D.left); 881B=Math.ceil(D.bottom-D.top); 882}return{width:A,height:B}; 883}; 884SimileAjax.Graphics.getFontRenderingContext=function(A,B){return new SimileAjax.Graphics._FontRenderingContext(A,B); 885}; 886SimileAjax.Graphics._FontRenderingContext=function(A,B){this._elmt=A; 887this._elmt.style.visibility="hidden"; 888if(typeof B=="string"){this._elmt.style.width=B; 889}else{if(typeof B=="number"){this._elmt.style.width=B+"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(D,C){var B=this._elmt; 897B.innerHTML=D; 898B.className=C===undefined?"":C; 899var A=SimileAjax.Graphics.getWidthHeight(B); 900B.className=""; 901return A; 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(A){return SimileAjax.History._plainDocumentTitle+" {"+A+"}"; 910}; 911SimileAjax.History.initialize=function(){if(SimileAjax.History._initialized){return ; 912}if(SimileAjax.History.enabled){var A=document.createElement("iframe"); 913A.id="simile-ajax-history"; 914A.style.position="absolute"; 915A.style.width="10px"; 916A.style.height="10px"; 917A.style.top="0px"; 918A.style.left="0px"; 919A.style.visibility="hidden"; 920A.src=SimileAjax.History.historyFile+"?0"; 921document.body.appendChild(A); 922SimileAjax.DOM.registerEvent(A,"load",SimileAjax.History._handleIFrameOnLoad); 923SimileAjax.History._iframe=A; 924}SimileAjax.History._initialized=true; 925}; 926SimileAjax.History.addListener=function(A){SimileAjax.History.initialize(); 927SimileAjax.History._listeners.add(A); 928}; 929SimileAjax.History.removeListener=function(A){SimileAjax.History.initialize(); 930SimileAjax.History._listeners.remove(A); 931}; 932SimileAjax.History.addAction=function(A){SimileAjax.History.initialize(); 933SimileAjax.History._listeners.fire("onBeforePerform",[A]); 934window.setTimeout(function(){try{A.perform(); 935SimileAjax.History._listeners.fire("onAfterPerform",[A]); 936if(SimileAjax.History.enabled){SimileAjax.History._actions=SimileAjax.History._actions.slice(0,SimileAjax.History._currentIndex-SimileAjax.History._baseIndex); 937SimileAjax.History._actions.push(A); 938SimileAjax.History._currentIndex++; 939var C=SimileAjax.History._actions.length-SimileAjax.History.maxHistoryLength; 940if(C>0){SimileAjax.History._actions=SimileAjax.History._actions.slice(C); 941SimileAjax.History._baseIndex+=C; 942}try{SimileAjax.History._iframe.contentWindow.location.search="?"+SimileAjax.History._currentIndex; 943}catch(B){var D=SimileAjax.History.formatHistoryEntryTitle(A.label); 944document.title=D; 945}}}catch(B){SimileAjax.Debug.exception(B,"Error adding action {"+A.label+"} to history"); 946}},0); 947}; 948SimileAjax.History.addLengthyAction=function(C,A,B){SimileAjax.History.addAction({perform:C,undo:A,label:B,uiLayer:SimileAjax.WindowManager.getBaseLayer(),lengthy:true}); 949}; 950SimileAjax.History._handleIFrameOnLoad=function(){try{var B=SimileAjax.History._iframe.contentWindow.location.search; 951var F=(B.length==0)?0:Math.max(0,parseInt(B.substr(1))); 952var E=function(){var G=F-SimileAjax.History._currentIndex; 953SimileAjax.History._currentIndex+=G; 954SimileAjax.History._baseIndex+=G; 955SimileAjax.History._iframe.contentWindow.location.search="?"+F; 956}; 957if(F<SimileAjax.History._currentIndex){SimileAjax.History._listeners.fire("onBeforeUndoSeveral",[]); 958window.setTimeout(function(){while(SimileAjax.History._currentIndex>F&&SimileAjax.History._currentIndex>SimileAjax.History._baseIndex){SimileAjax.History._currentIndex--; 959var G=SimileAjax.History._actions[SimileAjax.History._currentIndex-SimileAjax.History._baseIndex]; 960try{G.undo(); 961}catch(H){SimileAjax.Debug.exception(H,"History: Failed to undo action {"+G.label+"}"); 962}}SimileAjax.History._listeners.fire("onAfterUndoSeveral",[]); 963E(); 964},0); 965}else{if(F>SimileAjax.History._currentIndex){SimileAjax.History._listeners.fire("onBeforeRedoSeveral",[]); 966window.setTimeout(function(){while(SimileAjax.History._currentIndex<F&&SimileAjax.History._currentIndex-SimileAjax.History._baseIndex<SimileAjax.History._actions.length){var G=SimileAjax.History._actions[SimileAjax.History._currentIndex-SimileAjax.History._baseIndex]; 967try{G.perform(); 968}catch(H){SimileAjax.Debug.exception(H,"History: Failed to redo action {"+G.label+"}"); 969}SimileAjax.History._currentIndex++; 970}SimileAjax.History._listeners.fire("onAfterRedoSeveral",[]); 971E(); 972},0); 973}else{var A=SimileAjax.History._currentIndex-SimileAjax.History._baseIndex-1; 974var D=(A>=0&&A<SimileAjax.History._actions.length)?SimileAjax.History.formatHistoryEntryTitle(SimileAjax.History._actions[A].label):SimileAjax.History._plainDocumentTitle; 975SimileAjax.History._iframe.contentWindow.document.title=D; 976document.title=D; 977}}}catch(C){}}; 978SimileAjax.History.getNextUndoAction=function(){try{var A=SimileAjax.History._currentIndex-SimileAjax.History._baseIndex-1; 979return SimileAjax.History._actions[A]; 980}catch(B){return null; 981}}; 982SimileAjax.History.getNextRedoAction=function(){try{var A=SimileAjax.History._currentIndex-SimileAjax.History._baseIndex; 983return SimileAjax.History._actions[A]; 984}catch(B){return null; 985}}; 986 987 988/* html.js */ 989SimileAjax.HTML=new Object(); 990SimileAjax.HTML._e2uHash={}; 991(function(){var A=SimileAjax.HTML._e2uHash; 992A["nbsp"]="\u00A0"; 993A["iexcl"]="\u00A1"; 994A["cent"]="\u00A2"; 995A["pound"]="\u00A3"; 996A["curren"]="\u00A4"; 997A["yen"]="\u00A5"; 998A["brvbar"]="\u00A6"; 999A["sect"]="\u00A7"; 1000A["uml"]="\u00A8"; 1001A["copy"]="\u00A9"; 1002A["ordf"]="\u00AA"; 1003A["laquo"]="\u00AB"; 1004A["not"]="\u00AC"; 1005A["shy"]="\u00AD"; 1006A["reg"]="\u00AE"; 1007A["macr"]="\u00AF"; 1008A["deg"]="\u00B0"; 1009A["plusmn"]="\u00B1"; 1010A["sup2"]="\u00B2"; 1011A["sup3"]="\u00B3"; 1012A["acute"]="\u00B4"; 1013A["micro"]="\u00B5"; 1014A["para"]="\u00B6"; 1015A["middot"]="\u00B7"; 1016A["cedil"]="\u00B8"; 1017A["sup1"]="\u00B9"; 1018A["ordm"]="\u00BA"; 1019A["raquo"]="\u00BB"; 1020A["frac14"]="\u00BC"; 1021A["frac12"]="\u00BD"; 1022A["frac34"]="\u00BE"; 1023A["iquest"]="\u00BF"; 1024A["Agrave"]="\u00C0"; 1025A["Aacute"]="\u00C1"; 1026A["Acirc"]="\u00C2"; 1027A["Atilde"]="\u00C3"; 1028A["Auml"]="\u00C4"; 1029A["Aring"]="\u00C5"; 1030A["AElig"]="\u00C6"; 1031A["Ccedil"]="\u00C7"; 1032A["Egrave"]="\u00C8"; 1033A["Eacute"]="\u00C9"; 1034A["Ecirc"]="\u00CA"; 1035A["Euml"]="\u00CB"; 1036A["Igrave"]="\u00CC"; 1037A["Iacute"]="\u00CD"; 1038A["Icirc"]="\u00CE"; 1039A["Iuml"]="\u00CF"; 1040A["ETH"]="\u00D0"; 1041A["Ntilde"]="\u00D1"; 1042A["Ograve"]="\u00D2"; 1043A["Oacute"]="\u00D3"; 1044A["Ocirc"]="\u00D4"; 1045A["Otilde"]="\u00D5"; 1046A["Ouml"]="\u00D6"; 1047A["times"]="\u00D7"; 1048A["Oslash"]="\u00D8"; 1049A["Ugrave"]="\u00D9"; 1050A["Uacute"]="\u00DA"; 1051A["Ucirc"]="\u00DB"; 1052A["Uuml"]="\u00DC"; 1053A["Yacute"]="\u00DD"; 1054A["THORN"]="\u00DE"; 1055A["szlig"]="\u00DF"; 1056A["agrave"]="\u00E0"; 1057A["aacute"]="\u00E1"; 1058A["acirc"]="\u00E2"; 1059A["atilde"]="\u00E3"; 1060A["auml"]="\u00E4"; 1061A["aring"]="\u00E5"; 1062A["aelig"]="\u00E6"; 1063A["ccedil"]="\u00E7"; 1064A["egrave"]="\u00E8"; 1065A["eacute"]="\u00E9"; 1066A["ecirc"]="\u00EA"; 1067A["euml"]="\u00EB"; 1068A["igrave"]="\u00EC"; 1069A["iacute"]="\u00ED"; 1070A["icirc"]="\u00EE"; 1071A["iuml"]="\u00EF"; 1072A["eth"]="\u00F0"; 1073A["ntilde"]="\u00F1"; 1074A["ograve"]="\u00F2"; 1075A["oacute"]="\u00F3"; 1076A["ocirc"]="\u00F4"; 1077A["otilde"]="\u00F5"; 1078A["ouml"]="\u00F6"; 1079A["divide"]="\u00F7"; 1080A["oslash"]="\u00F8"; 1081A["ugrave"]="\u00F9"; 1082A["uacute"]="\u00FA"; 1083A["ucirc"]="\u00FB"; 1084A["uuml"]="\u00FC"; 1085A["yacute"]="\u00FD"; 1086A["thorn"]="\u00FE"; 1087A["yuml"]="\u00FF"; 1088A["quot"]="\u0022"; 1089A["amp"]="\u0026"; 1090A["lt"]="\u003C"; 1091A["gt"]="\u003E"; 1092A["OElig"]=""; 1093A["oelig"]="\u0153"; 1094A["Scaron"]="\u0160"; 1095A["scaron"]="\u0161"; 1096A["Yuml"]="\u0178"; 1097A["circ"]="\u02C6"; 1098A["tilde"]="\u02DC"; 1099A["ensp"]="\u2002"; 1100A["emsp"]="\u2003"; 1101A["thinsp"]="\u2009"; 1102A["zwnj"]="\u200C"; 1103A["zwj"]="\u200D"; 1104A["lrm"]="\u200E"; 1105A["rlm"]="\u200F"; 1106A["ndash"]="\u2013"; 1107A["mdash"]="\u2014"; 1108A["lsquo"]="\u2018"; 1109A["rsquo"]="\u2019"; 1110A["sbquo"]="\u201A"; 1111A["ldquo"]="\u201C"; 1112A["rdquo"]="\u201D"; 1113A["bdquo"]="\u201E"; 1114A["dagger"]="\u2020"; 1115A["Dagger"]="\u2021"; 1116A["permil"]="\u2030"; 1117A["lsaquo"]="\u2039"; 1118A["rsaquo"]="\u203A"; 1119A["euro"]="\u20AC"; 1120A["fnof"]="\u0192"; 1121A["Alpha"]="\u0391"; 1122A["Beta"]="\u0392"; 1123A["Gamma"]="\u0393"; 1124A["Delta"]="\u0394"; 1125A["Epsilon"]="\u0395"; 1126A["Zeta"]="\u0396"; 1127A["Eta"]="\u0397"; 1128A["Theta"]="\u0398"; 1129A["Iota"]="\u0399"; 1130A["Kappa"]="\u039A"; 1131A["Lambda"]="\u039B"; 1132A["Mu"]="\u039C"; 1133A["Nu"]="\u039D"; 1134A["Xi"]="\u039E"; 1135A["Omicron"]="\u039F"; 1136A["Pi"]="\u03A0"; 1137A["Rho"]="\u03A1"; 1138A["Sigma"]="\u03A3"; 1139A["Tau"]="\u03A4"; 1140A["Upsilon"]="\u03A5"; 1141A["Phi"]="\u03A6"; 1142A["Chi"]="\u03A7"; 1143A["Psi"]="\u03A8"; 1144A["Omega"]="\u03A9"; 1145A["alpha"]="\u03B1"; 1146A["beta"]="\u03B2"; 1147A["gamma"]="\u03B3"; 1148A["delta"]="\u03B4"; 1149A["epsilon"]="\u03B5"; 1150A["zeta"]="\u03B6"; 1151A["eta"]="\u03B7"; 1152A["theta"]="\u03B8"; 1153A["iota"]="\u03B9"; 1154A["kappa"]="\u03BA"; 1155A["lambda"]="\u03BB"; 1156A["mu"]="\u03BC"; 1157A["nu"]="\u03BD"; 1158A["xi"]="\u03BE"; 1159A["omicron"]="\u03BF"; 1160A["pi"]="\u03C0"; 1161A["rho"]="\u03C1"; 1162A["sigmaf"]="\u03C2"; 1163A["sigma"]="\u03C3"; 1164A["tau"]="\u03C4"; 1165A["upsilon"]="\u03C5"; 1166A["phi"]="\u03C6"; 1167A["chi"]="\u03C7"; 1168A["psi"]="\u03C8"; 1169A["omega"]="\u03C9"; 1170A["thetasym"]="\u03D1"; 1171A["upsih"]="\u03D2"; 1172A["piv"]="\u03D6"; 1173A["bull"]="\u2022"; 1174A["hellip"]="\u2026"; 1175A["prime"]="\u2032"; 1176A["Prime"]="\u2033"; 1177A["oline"]="\u203E"; 1178A["frasl"]="\u2044"; 1179A["weierp"]="\u2118"; 1180A["image"]="\u2111"; 1181A["real"]="\u211C"; 1182A["trade"]="\u2122"; 1183A["alefsym"]="\u2135"; 1184A["larr"]="\u2190"; 1185A["uarr"]="\u2191"; 1186A["rarr"]="\u2192"; 1187A["darr"]="\u2193"; 1188A["harr"]="\u2194"; 1189A["crarr"]="\u21B5"; 1190A["lArr"]="\u21D0"; 1191A["uArr"]="\u21D1"; 1192A["rArr"]="\u21D2"; 1193A["dArr"]="\u21D3"; 1194A["hArr"]="\u21D4"; 1195A["forall"]="\u2200"; 1196A["part"]="\u2202"; 1197A["exist"]="\u2203"; 1198A["empty"]="\u2205"; 1199A["nabla"]="\u2207"; 1200A["isin"]="\u2208"; 1201A["notin"]="\u2209"; 1202A["ni"]="\u220B"; 1203A["prod"]="\u220F"; 1204A["sum"]="\u2211"; 1205A["minus"]="\u2212"; 1206A["lowast"]="\u2217"; 1207A["radic"]="\u221A"; 1208A["prop"]="\u221D"; 1209A["infin"]="\u221E"; 1210A["ang"]="\u2220"; 1211A["and"]="\u2227"; 1212A["or"]="\u2228"; 1213A["cap"]="\u2229"; 1214A["cup"]="\u222A"; 1215A["int"]="\u222B"; 1216A["there4"]="\u2234"; 1217A["sim"]="\u223C"; 1218A["cong"]="\u2245"; 1219A["asymp"]="\u2248"; 1220A["ne"]="\u2260"; 1221A["equiv"]="\u2261"; 1222A["le"]="\u2264"; 1223A["ge"]="\u2265"; 1224A["sub"]="\u2282"; 1225A["sup"]="\u2283"; 1226A["nsub"]="\u2284"; 1227A["sube"]="\u2286"; 1228A["supe"]="\u2287"; 1229A["oplus"]="\u2295"; 1230A["otimes"]="\u2297"; 1231A["perp"]="\u22A5"; 1232A["sdot"]="\u22C5"; 1233A["lceil"]="\u2308"; 1234A["rceil"]="\u2309"; 1235A["lfloor"]="\u230A"; 1236A["rfloor"]="\u230B"; 1237A["lang"]="\u2329"; 1238A["rang"]="\u232A"; 1239A["loz"]="\u25CA"; 1240A["spades"]="\u2660"; 1241A["clubs"]="\u2663"; 1242A["hearts"]="\u2665"; 1243A["diams"]="\u2666"; 1244})(); 1245SimileAjax.HTML.deEntify=function(C){var D=SimileAjax.HTML._e2uHash; 1246var B=/&(\w+?);/; 1247while(B.test(C)){var A=C.match(B); 1248C=C.replace(B,D[A[1]]); 1249}return C; 1250}; 1251 1252 1253/* json.js */ 1254SimileAjax.JSON=new Object(); 1255(function(){var m={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"}; 1256var s={array:function(x){var a=["["],b,f,i,l=x.length,v; 1257for(i=0; 1258i<l; 1259i+=1){v=x[i]; 1260f=s[typeof v]; 1261if(f){v=f(v); 1262if(typeof v=="string"){if(b){a[a.length]=","; 1263}a[a.length]=v; 1264b=true; 1265}}}a[a.length]="]"; 1266return a.join(""); 1267},"boolean":function(x){return String(x); 1268},"null":function(x){return"null"; 1269},number:function(x){return isFinite(x)?String(x):"null"; 1270},object:function(x){if(x){if(x instanceof Array){return s.array(x); 1271}var a=["{"],b,f,i,v; 1272for(i in x){v=x[i]; 1273f=s[typeof v]; 1274if(f){v=f(v); 1275if(typeof v=="string"){if(b){a[a.length]=","; 1276}a.push(s.string(i),":",v); 1277b=true; 1278}}}a[a.length]="}"; 1279return a.join(""); 1280}return"null"; 1281},string:function(x){if(/["\\\x00-\x1f]/.test(x)){x=x.replace(/([\x00-\x1f\\"])/g,function(a,b){var c=m[b]; 1282if(c){return c; 1283}c=b.charCodeAt(); 1284return"\\u00"+Math.floor(c/16).toString(16)+(c%16).toString(16); 1285}); 1286}return'"'+x+'"'; 1287}}; 1288SimileAjax.JSON.toJSONString=function(o){if(o instanceof Object){return s.object(o); 1289}else{if(o instanceof Array){return s.array(o); 1290}else{return o.toString(); 1291}}}; 1292SimileAjax.JSON.parseJSON=function(){try{return !(/[^,:{}\[\]0-9.\-+Eaeflnr-u \n\r\t]/.test(this.replace(/"(\\.|[^"\\])*"/g,"")))&&eval("("+this+")"); 1293}catch(e){return false; 1294}}; 1295})(); 1296 1297 1298/* remoteLog.js */ 1299SimileAjax.RemoteLog={defaultURL:"http://groups.csail.mit.edu/haystack/facetlog/logger.php",url:null,logActive:false}; 1300SimileAjax.RemoteLog.possiblyLog=function(A){if((SimileAjax.RemoteLog.logActive)&&(SimileAjax.RemoteLog.url!=null)){A["url"]=window.location.href; 1301try{SimileAjax.jQuery.ajax({type:"POST",url:SimileAjax.RemoteLog.url,data:A}); 1302}catch(B){}}}; 1303 1304 1305/* string.js */ 1306String.prototype.trim=function(){return this.replace(/^\s+|\s+$/g,""); 1307}; 1308String.prototype.startsWith=function(A){return this.length>=A.length&&this.substr(0,A.length)==A; 1309}; 1310String.prototype.endsWith=function(A){return this.length>=A.length&&this.substr(this.length-A.length)==A; 1311}; 1312String.substitute=function(B,D){var A=""; 1313var F=0; 1314while(F<B.length-1){var C=B.indexOf("%",F); 1315if(C<0||C==B.length-1){break; 1316}else{if(C>F&&B.charAt(C-1)=="\\"){A+=B.substring(F,C-1)+"%"; 1317F=C+1; 1318}else{var E=parseInt(B.charAt(C+1)); 1319if(isNaN(E)||E>=D.length){A+=B.substring(F,C+2); 1320}else{A+=B.substring(F,C)+D[E].toString(); 1321}F=C+2; 1322}}}if(F<B.length){A+=B.substring(F); 1323}return A; 1324}; 1325 1326 1327/* units.js */ 1328SimileAjax.NativeDateUnit=new Object(); 1329SimileAjax.NativeDateUnit.makeDefaultValue=function(){return new Date(); 1330}; 1331SimileAjax.NativeDateUnit.cloneValue=function(A){return new Date(A.getTime()); 1332}; 1333SimileAjax.NativeDateUnit.getParser=function(A){if(typeof A=="string"){A=A.toLowerCase(); 1334}var B=(A=="iso8601"||A=="iso 8601")?SimileAjax.DateTime.parseIso8601DateTime:SimileAjax.DateTime.parseGregorianDateTime; 1335return function(C){if(typeof C!="undefined"&&typeof C.toUTCString=="function"){return C; 1336}else{return B(C); 1337}}; 1338}; 1339SimileAjax.NativeDateUnit.parseFromObject=function(A){return SimileAjax.DateTime.parseGregorianDateTime(A); 1340}; 1341SimileAjax.NativeDateUnit.toNumber=function(A){return A.getTime(); 1342}; 1343SimileAjax.NativeDateUnit.fromNumber=function(A){return new Date(A); 1344}; 1345SimileAjax.NativeDateUnit.compare=function(D,C){var B,A; 1346if(typeof D=="object"){B=D.getTime(); 1347}else{B=Number(D); 1348}if(typeof C=="object"){A=C.getTime(); 1349}else{A=Number(C); 1350}return B-A; 1351}; 1352SimileAjax.NativeDateUnit.earlier=function(B,A){return SimileAjax.NativeDateUnit.compare(B,A)<0?B:A; 1353}; 1354SimileAjax.NativeDateUnit.later=function(B,A){return SimileAjax.NativeDateUnit.compare(B,A)>0?B:A; 1355}; 1356SimileAjax.NativeDateUnit.change=function(A,B){return new Date(A.getTime()+B); 1357}; 1358 1359 1360/* window-manager.js */ 1361SimileAjax.WindowManager={_initialized:false,_listeners:[],_draggedElement:null,_draggedElementCallback:null,_dropTargetHighlightElement:null,_lastCoords:null,_ghostCoords:null,_draggingMode:"",_dragging:false,_layers:[]}; 1362SimileAjax.WindowManager.initialize=function(){if(SimileAjax.WindowManager._initialized){return ; 1363}SimileAjax.DOM.registerEvent(document.body,"mousedown",SimileAjax.WindowManager._onBodyMouseDown); 1364SimileAjax.DOM.registerEvent(document.body,"mousemove",SimileAjax.WindowManager._onBodyMouseMove); 1365SimileAjax.DOM.registerEvent(document.body,"mouseup",SimileAjax.WindowManager._onBodyMouseUp); 1366SimileAjax.DOM.registerEvent(document,"keydown",SimileAjax.WindowManager._onBodyKeyDown); 1367SimileAjax.DOM.registerEvent(document,"keyup",SimileAjax.WindowManager._onBodyKeyUp); 1368SimileAjax.WindowManager._layers.push({index:0}); 1369SimileAjax.WindowManager._historyListener={onBeforeUndoSeveral:function(){},onAfterUndoSeveral:function(){},onBeforeUndo:function(){},onAfterUndo:function(){},onBeforeRedoSeveral:function(){},onAfterRedoSeveral:function(){},onBeforeRedo:function(){},onAfterRedo:function(){}}; 1370SimileAjax.History.addListener(SimileAjax.WindowManager._historyListener); 1371SimileAjax.WindowManager._initialized=true; 1372}; 1373SimileAjax.WindowManager.getBaseLayer=function(){SimileAjax.WindowManager.initialize(); 1374return SimileAjax.WindowManager._layers[0]; 1375}; 1376SimileAjax.WindowManager.getHighestLayer=function(){SimileAjax.WindowManager.initialize(); 1377return SimileAjax.WindowManager._layers[SimileAjax.WindowManager._layers.length-1]; 1378}; 1379SimileAjax.WindowManager.registerEventWithObject=function(D,A,E,B,C){SimileAjax.WindowManager.registerEvent(D,A,function(G,F,H){return E[B].call(E,G,F,H); 1380},C); 1381}; 1382SimileAjax.WindowManager.registerEvent=function(D,B,E,C){if(C==null){C=SimileAjax.WindowManager.getHighestLayer(); 1383}var A=function(G,F,I){if(SimileAjax.WindowManager._canProcessEventAtLayer(C)){SimileAjax.WindowManager._popToLayer(C.index); 1384try{E(G,F,I); 1385}catch(H){SimileAjax.Debug.exception(H); 1386}}SimileAjax.DOM.cancelEvent(F); 1387return false; 1388}; 1389SimileAjax.DOM.registerEvent(D,B,A); 1390}; 1391SimileAjax.WindowManager.pushLayer=function(C,D,B){var A={onPop:C,index:SimileAjax.WindowManager._layers.length,ephemeral:(D),elmt:B}; 1392SimileAjax.WindowManager._layers.push(A); 1393return A; 1394}; 1395SimileAjax.WindowManager.popLayer=function(B){for(var A=1; 1396A<SimileAjax.WindowManager._layers.length; 1397A++){if(SimileAjax.WindowManager._layers[A]==B){SimileAjax.WindowManager._popToLayer(A-1); 1398break; 1399}}}; 1400SimileAjax.WindowManager.popAllLayers=function(){SimileAjax.WindowManager._popToLayer(0); 1401}; 1402SimileAjax.WindowManager.registerForDragging=function(B,C,A){SimileAjax.WindowManager.registerEvent(B,"mousedown",function(E,D,F){SimileAjax.WindowManager._handle…
Large files files are truncated, but you can click here to view the full file