1var Prototype={Version:"1.6.0",Browser:{IE:!!(window.attachEvent&&!window.opera),Opera:!!window.opera,WebKit:navigator.userAgent.indexOf("AppleWebKit/")>-1,Gecko:navigator.userAgent.indexOf("Gecko")>-1&&navigator.userAgent.indexOf("KHTML")==-1,MobileSafari:!!navigator.userAgent.match(/Apple.*Mobile.*Safari/)},BrowserFeatures:{XPath:!!document.evaluate,ElementExtensions:!!window.HTMLElement,SpecificElementExtensions:document.createElement("div").__proto__&&document.createElement("div").__proto__!==document.createElement("form").__proto__},ScriptFragment:"<script[^>]*>([\\S\\s]*?)<\/script>",JSONFilter:/^\/\*-secure-([\s\S]*)\*\/\s*$/,emptyFunction:function(){},K:function(A){return A 2}}; 3if(Prototype.Browser.MobileSafari){Prototype.BrowserFeatures.SpecificElementExtensions=false 4}if(Prototype.Browser.WebKit){Prototype.BrowserFeatures.XPath=false 5}var Class={create:function(){var E=null,D=$A(arguments); 6if(Object.isFunction(D[0])){E=D.shift() 7}function A(){this.initialize.apply(this,arguments) 8}Object.extend(A,Class.Methods); 9A.superclass=E; 10A.subclasses=[]; 11if(E){var B=function(){}; 12B.prototype=E.prototype; 13A.prototype=new B; 14E.subclasses.push(A) 15}for(var C=0; 16C<D.length; 17C++){A.addMethods(D[C]) 18}if(!A.prototype.initialize){A.prototype.initialize=Prototype.emptyFunction 19}A.prototype.constructor=A; 20return A 21}}; 22Class.Methods={addMethods:function(G){var C=this.superclass&&this.superclass.prototype; 23var B=Object.keys(G); 24if(!Object.keys({toString:true}).length){B.push("toString","valueOf") 25}for(var A=0,D=B.length; 26A<D; 27A++){var F=B[A],E=G[F]; 28if(C&&Object.isFunction(E)&&E.argumentNames().first()=="$super"){var H=E,E=Object.extend((function(I){return function(){return C[I].apply(this,arguments) 29} 30})(F).wrap(H),{valueOf:function(){return H 31},toString:function(){return H.toString() 32}}) 33}this.prototype[F]=E 34}return this 35}}; 36var Abstract={}; 37Object.extend=function(A,C){for(var B in C){A[B]=C[B] 38}return A 39}; 40Object.extend(Object,{inspect:function(A){try{if(A===undefined){return"undefined" 41}if(A===null){return"null" 42}return A.inspect?A.inspect():A.toString() 43}catch(B){if(B instanceof RangeError){return"..." 44}throw B 45}},toJSON:function(A){var C=typeof A; 46switch(C){case"undefined":case"function":case"unknown":return ; 47case"boolean":return A.toString() 48}if(A===null){return"null" 49}if(A.toJSON){return A.toJSON() 50}if(Object.isElement(A)){return 51}var B=[]; 52for(var E in A){var D=Object.toJSON(A[E]); 53if(D!==undefined){B.push(E.toJSON()+": "+D) 54}}return"{"+B.join(", ")+"}" 55},toQueryString:function(A){return $H(A).toQueryString() 56},toHTML:function(A){return A&&A.toHTML?A.toHTML():String.interpret(A) 57},keys:function(A){var B=[]; 58for(var C in A){B.push(C) 59}return B 60},values:function(B){var A=[]; 61for(var C in B){A.push(B[C]) 62}return A 63},clone:function(A){return Object.extend({},A) 64},isElement:function(A){return A&&A.nodeType==1 65},isArray:function(A){return A&&A.constructor===Array 66},isHash:function(A){return A instanceof Hash 67},isFunction:function(A){return typeof A=="function" 68},isString:function(A){return typeof A=="string" 69},isNumber:function(A){return typeof A=="number" 70},isUndefined:function(A){return typeof A=="undefined" 71}}); 72Object.extend(Function.prototype,{argumentNames:function(){var A=this.toString().match(/^[\s\(]*function[^(]*\((.*?)\)/)[1].split(",").invoke("strip"); 73return A.length==1&&!A[0]?[]:A 74},bind:function(){if(arguments.length<2&&arguments[0]===undefined){return this 75}var A=this,C=$A(arguments),B=C.shift(); 76return function(){return A.apply(B,C.concat($A(arguments))) 77} 78},bindAsEventListener:function(){var A=this,C=$A(arguments),B=C.shift(); 79return function(D){return A.apply(B,[D||window.event].concat(C)) 80} 81},curry:function(){if(!arguments.length){return this 82}var A=this,B=$A(arguments); 83return function(){return A.apply(this,B.concat($A(arguments))) 84} 85},delay:function(){var A=this,B=$A(arguments),C=B.shift()*1000; 86return window.setTimeout(function(){return A.apply(A,B) 87},C) 88},wrap:function(B){var A=this; 89return function(){return B.apply(this,[A.bind(this)].concat($A(arguments))) 90} 91},methodize:function(){if(this._methodized){return this._methodized 92}var A=this; 93return this._methodized=function(){return A.apply(null,[this].concat($A(arguments))) 94} 95}}); 96Function.prototype.defer=Function.prototype.delay.curry(0.01); 97Date.prototype.toJSON=function(){return'"'+this.getUTCFullYear()+"-"+(this.getUTCMonth()+1).toPaddedString(2)+"-"+this.getUTCDate().toPaddedString(2)+"T"+this.getUTCHours().toPaddedString(2)+":"+this.getUTCMinutes().toPaddedString(2)+":"+this.getUTCSeconds().toPaddedString(2)+'Z"' 98}; 99var Try={these:function(){var C; 100for(var B=0,D=arguments.length; 101B<D; 102B++){var A=arguments[B]; 103try{C=A(); 104break 105}catch(E){}}return C 106}}; 107RegExp.prototype.match=RegExp.prototype.test;
108RegExp.escape=function(A){return String(A).replace(/([.*+?^=!:${}()|[\]\/\\])/g,"\\$1") 109}; 110var PeriodicalExecuter=Class.create({initialize:function(B,A){this.callback=B; 111this.frequency=A; 112this.currentlyExecuting=false; 113this.registerCallback() 114},registerCallback:function(){this.timer=setInterval(this.onTimerEvent.bind(this),this.frequency*1000) 115},execute:function(){this.callback(this) 116},stop:function(){if(!this.timer){return 117}clearInterval(this.timer); 118this.timer=null 119},onTimerEvent:function(){if(!this.currentlyExecuting){try{this.currentlyExecuting=true; 120this.execute() 121}finally{this.currentlyExecuting=false 122}}}}); 123Object.extend(String,{interpret:function(A){return A==null?"":String(A) 124},specialChar:{"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r","\\":"\\\\"}}); 125Object.extend(String.prototype,{gsub:function(E,C){var A="",D=this,B; 126C=arguments.callee.prepareReplacement(C); 127while(D.length>0){if(B=D.match(E)){A+=D.slice(0,B.index); 128A+=String.interpret(C(B)); 129D=D.slice(B.index+B[0].length) 130}else{A+=D,D="" 131}}return A 132},sub:function(C,A,B){A=this.gsub.prepareReplacement(A); 133B=B===undefined?1:B; 134return this.gsub(C,function(D){if(--B<0){return D[0] 135}return A(D) 136}) 137},scan:function(B,A){this.gsub(B,A); 138return String(this) 139},truncate:function(B,A){B=B||30; 140A=A===undefined?"...":A; 141return this.length>B?this.slice(0,B-A.length)+A:String(this) 142},strip:function(){return this.replace(/^\s+/,"").replace(/\s+$/,"") 143},stripTags:function(){return this.replace(/<\/?[^>]+>/gi,"") 144},stripScripts:function(){return this.replace(new RegExp(Prototype.ScriptFragment,"img"),"") 145},extractScripts:function(){var B=new RegExp(Prototype.ScriptFragment,"img"); 146var A=new RegExp(Prototype.ScriptFragment,"im"); 147return(this.match(B)||[]).map(function(D){var C=(D.match(A)||["",""])[1]; 148C=C.replace(/</,"<").replace(/\s*<!--[^\r\n]*/,""); 149return C 150}) 151},evalScripts:function(){return this.extractScripts().map(function(script){return eval(script) 152}) 153},escapeHTML:function(){var A=arguments.callee; 154A.text.data=this; 155return A.div.innerHTML 156},unescapeHTML:function(){var A=new Element("div"); 157A.innerHTML=this.stripTags(); 158return A.childNodes[0]?(A.childNodes.length>1?$A(A.childNodes).inject("",function(B,C){return B+C.nodeValue 159}):A.childNodes[0].nodeValue):"" 160},toQueryParams:function(B){var A=this.strip().match(/([^?#]*)(#.*)?$/); 161if(!A){return{} 162}return A[1].split(B||"&").inject({}
162,function(E,F){if((F=F.split("="))[0]){var C=decodeURIComponent(F.shift()); 163var D=F.length>1?F.join("="):F[0]; 164if(D!=undefined){D=decodeURIComponent(D) 165}if(C in E){if(!Object.isArray(E[C])){E[C]=[E[C]] 166}E[C].push(D) 167}else{E[C]=D 168}}return E 169}) 170},toArray:function(){return this.split("") 171},succ:function(){return this.slice(0,this.length-1)+String.fromCharCode(this.charCodeAt(this.length-1)+1) 172},times:function(A){return A<1?"":new Array(A+1).join(this) 173},camelize:function(){var D=this.split("-"),A=D.length; 174if(A==1){return D[0] 175}var C=this.charAt(0)=="-"?D[0].charAt(0).toUpperCase()+D[0].substring(1):D[0]; 176for(var B=1; 177B<A; 178B++){C+=D[B].charAt(0).toUpperCase()+D[B].substring(1) 179}return C 180},capitalize:function(){return this.charAt(0).toUpperCase()+this.substring(1).toLowerCase() 181},underscore:function(){return this.gsub(/::/,"/").gsub(/([A-Z]+)([A-Z][a-z])/,"#{1}_#{2}").gsub(/([a-z\d])([A-Z])/,"#{1}_#{2}").gsub(/-/,"_").toLowerCase() 182},dasherize:function(){return this.gsub(/_/,"-") 183},inspect:function(B){var A=this.gsub(/[\x00-\x1f\\]/,function(C){var D=String.specialChar[C[0]]; 184return D?D:"\\u00"+C[0].charCodeAt().toPaddedString(2,16) 185}); 186if(B){return'"'+A.replace(/"/g,'\\"')+'"' 187}return"'"+A.replace(/'/g,"\\'")+"'" 188},toJSON:function(){return this.inspect(true) 189},unfilterJSON:function(A){return this.sub(A||Prototype.JSONFilter,"#{1}") 190},isJSON:function(){var A=this.replace(/\\./g,"@").replace(/"[^"\\\n\r]*"/g,""); 191return(/^[,:{}\[\]0-9.\-+Eaeflnr-u \n\r\t]*$/).test(A) 192},evalJSON:function(sanitize){var json=this.unfilterJSON(); 193try{if(!sanitize||json.isJSON()){return eval("("+json+")") 194}}catch(e){}throw new SyntaxError("Badly formed JSON string: "+this.inspect()) 195},include:function(A){return this.indexOf(A)>-1 196},startsWith:function(A){return this.indexOf(A)===0 197},endsWith:function(A){var B=this.length-A.length; 198return B>=0&&this.lastIndexOf(A)===B 199},empty:function(){return this=="" 200},blank:function(){return/^\s*$/.test(this) 201},interpolate:function(A,B){return new Template(this,B).evaluate(A) 202}}); 203if(Prototype.Browser.WebKit||Prototype.Browser.IE){Object.extend(String.prototype,{escapeHTML:function(){return this.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">") 204},unescapeHTML:function(){return this.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">") 205}}) 206}String.prototype.gsub.prepareReplacement=function(B){if(Object.isFunction(B)){return B 207}var A=new Template(B); 208return function(C){return A.evaluate(C) 209} 210}; 211String.prototype.parseQuery=String.prototype.toQueryParams; 212Object.extend(String.prototype.escapeHTML,{div:document.createElement("div"),text:document.createTextNode("")}); 213with(String.prototype.escapeHTML){div.appendChild(text) 214}var Template=Class.create({initialize:function(A,B){this.template=A.toString(); 215this.pattern=B||Template.Pattern 216},evaluate:function(A){if(Object.isFunction(A.toTemplateReplacements)){A=A.toTemplateReplacements() 217}return this.template.gsub(this.pattern,function(D){if(A==null){return"" 218}var F=D[1]||""; 219if(F=="\\"){return D[2] 220}var B=A,G=D[3]; 221var E=/^([^.[]+|\[((?:.*?[^\\])?)\])(\.|\[|$)/,D=E.exec(G); 222if(D==null){return F 223}while(D!=null){var C=D[1].startsWith("[")?D[2].gsub("\\\\]","]"):D[1]; 224B=B[C]; 225if(null==B||""==D[3]){break 226}G=G.substring("["==D[3]?D[1].length:D[0].length); 227D=E.exec(G) 228}return F+String.interpret(B) 229}.bind(this)) 230}}); 231Template.Pattern=/(^|.|\r|\n)(#\{(.*?)\})/; 232var $break={}; 233var Enumerable={each:function(C,B){var A=0; 234C=C.bind(B); 235try{this._each(function(E){C(E,A++) 236}) 237}catch(D){if(D!=$break){throw D 238}}return this 239},eachSlice:function(D,C,B){C=C?C.bind(B):Prototype.K; 240var A=-D,E=[],F=this.toArray(); 241while((A+=D)<F.length){E.push(F.slice(A,A+D)) 242}return E.collect(C,B) 243},all:function(C,B){C=C?C.bind(B):Prototype.K; 244var A=true; 245this.each(function(E,D){A=A&&!!C(E,D); 246if(!A){throw $break 247}}); 248return A 249},any:function(C,B){C=C?C.bind(B):Prototype.K; 250var A=false; 251this.each(function(E,D){if(A=!!C(E,D)){throw $break 252}}); 253return A 254},collect:function(C,B){C=C?C.bind(B):Prototype.K; 255var A=[]; 256this.each(function(E,D){A.push(C(E,D)) 257}); 258return A 259},detect:function(C,B){C=C.bind(B); 260var A; 261this.each(function(E,D){if(C(E,D)){A=E; 262throw $break 263}}); 264return A 265},findAll:function(C,B){C=C.bind(B); 266var A=[]; 267this.each(function(E,D){if(C(E,D)){A.push(E) 268}}); 269return A 270},grep:function(D,C,B){C=C?C.bind(B):Prototype.K; 271var A=[]; 272if(Object.isString(D)){D=new RegExp(D) 273}
273this.each(function(F,E){if(D.match(F)){A.push(C(F,E)) 274}}); 275return A 276},include:function(A){if(Object.isFunction(this.indexOf)){if(this.indexOf(A)!=-1){return true 277}}var B=false; 278this.each(function(C){if(C==A){B=true; 279throw $break 280}}); 281return B 282},inGroupsOf:function(B,A){A=A===undefined?null:A; 283return this.eachSlice(B,function(C){while(C.length<B){C.push(A) 284}return C 285}) 286},inject:function(A,C,B){C=C.bind(B); 287this.each(function(E,D){A=C(A,E,D) 288}); 289return A 290},invoke:function(B){var A=$A(arguments).slice(1); 291return this.map(function(C){return C[B].apply(C,A) 292}) 293},max:function(C,B){C=C?C.bind(B):Prototype.K; 294var A; 295this.each(function(E,D){E=C(E,D); 296if(A==undefined||E>=A){A=E 297}}); 298return A 299},min:function(C,B){C=C?C.bind(B):Prototype.K; 300var A; 301this.each(function(E,D){E=C(E,D); 302if(A==undefined||E<A){A=E 303}}); 304return A 305},partition:function(D,B){D=D?D.bind(B):Prototype.K; 306var C=[],A=[]; 307this.each(function(F,E){(D(F,E)?C:A).push(F) 308}); 309return[C,A] 310},pluck:function(B){var A=[]; 311this.each(function(C){A.push(C[B]) 312}); 313return A 314},reject:function(C,B){C=C.bind(B); 315var A=[]; 316this.each(function(E,D){if(!C(E,D)){A.push(E) 317}}); 318return A 319},sortBy:function(B,A){B=B.bind(A); 320return this.map(function(D,C){return{value:D,criteria:B(D,C)} 321}).sort(function(F,E){var D=F.criteria,C=E.criteria; 322return D<C?-1:D>C?1:0 323}).pluck("value") 324},toArray:function(){return this.map() 325},zip:function(){var B=Prototype.K,A=$A(arguments); 326if(Object.isFunction(A.last())){B=A.pop() 327}var C=[this].concat(A).map($A); 328return this.map(function(E,D){return B(C.pluck(D)) 329}) 330},size:function(){return this.toArray().length 331},inspect:function(){return"#<Enumerable:"+this.toArray().inspect()+">" 332}}; 333Object.extend(Enumerable,{map:Enumerable.collect,find:Enumerable.detect,select:Enumerable.findAll,filter:Enumerable.findAll,member:Enumerable.include,entries:Enumerable.toArray,every:Enumerable.all,some:Enumerable.any}); 334function $A(C){if(!C){return[] 335}if(C.toArray){return C.toArray() 336}var B=C.length,A=new Array(B); 337while(B--){A[B]=C[B] 338}return A 339}if(Prototype.Browser.WebKit){function $A(C){if(!C){return[] 340}if(!(Object.isFunction(C)&&C=="[object NodeList]")&&C.toArray){return C.toArray() 341}var B=C.length,A=new Array(B); 342while(B--){A[B]=C[B] 343}return A 344}}Array.from=$A; 345Object.extend(Array.prototype,Enumerable); 346if(!Array.prototype._reverse){Array.prototype._reverse=Array.prototype.reverse 347}Object.extend(Array.prototype,{_each:function(B){for(var A=0,C=this.length; 348A<C; 349A++){B(this[A]) 350}},clear:function(){this.length=0; 351return this 352},first:function(){return this[0] 353},last:function(){return this[this.length-1] 354},compact:function(){return this.select(function(A){return A!=null 355}) 356},flatten:function(){return this.inject([],function(B,A){return B.concat(Object.isArray(A)?A.flatten():[A]) 357}) 358},without:function(){var A=$A(arguments); 359return this.select(function(B){return !A.include(B) 360}) 361},reverse:function(A){return(A!==false?this:this.toArray())._reverse() 362},reduce:function(){return this.length>1?this:this[0] 363},uniq:function(A){return this.inject([],function(D,C,B){if(0==B||(A?D.last()!=C:!D.include(C))){D.push(C) 364}return D 365}) 366},intersect:function(A){return this.uniq().findAll(function(B){return A.detect(function(C){return B===C 367}) 368}) 369},clone:function(){return[].concat(this) 370},size:function(){return this.length 371},inspect:function(){return"["+this.map(Object.inspect).join(", ")+"]" 372},toJSON:function(){var A=[]; 373this.each(function(B){var C=Object.toJSON(B); 374if(C!==undefined){A.push(C) 375}}); 376return"["+A.join(", ")+"]" 377}}); 378if(Object.isFunction(Array.prototype.forEach)){Array.prototype._each=Array.prototype.forEach 379}if(!Array.prototype.indexOf){Array.prototype.indexOf=function(C,A){A||(A=0); 380var B=this.length; 381if(A<0){A=B+A 382}for(; 383A<B; 384A++){if(this[A]===C){return A 385}}return -1 386} 387}if(!Array.prototype.lastIndexOf){Array.prototype.lastIndexOf=function(B,A){A=isNaN(A)?this.length:(A<0?this.length+A:A)+1; 388var C=this.slice(0,A).reverse().indexOf(B); 389return(C<0)?C:A-C-1 390} 391}Array.prototype.toArray=Array.prototype.clone; 392function $w(A){if(!Object.isString(A)){return[] 393}A=A.strip(); 394return A?A.split(/\s+/):[] 395}if(Prototype.Browser.Opera){Array.prototype.concat=function(){var E=[]; 396for(var B=0,C=this.length; 397B<C; 398B++){E.push(this[B]) 399}for(var B=0,C=arguments.length; 400B<C;
401B++){if(Object.isArray(arguments[B])){for(var A=0,D=arguments[B].length; 402A<D; 403A++){E.push(arguments[B][A]) 404}}else{E.push(arguments[B]) 405}}return E 406} 407}Object.extend(Number.prototype,{toColorPart:function(){return this.toPaddedString(2,16) 408},succ:function(){return this+1 409},times:function(A){$R(0,this,true).each(A); 410return this 411},toPaddedString:function(C,B){var A=this.toString(B||10); 412return"0".times(C-A.length)+A 413},toJSON:function(){return isFinite(this)?this.toString():"null" 414}}); 415$w("abs round ceil floor").each(function(A){Number.prototype[A]=Math[A].methodize() 416}); 417function $H(A){return new Hash(A) 418}var Hash=Class.create(Enumerable,(function(){if(function(){var C=0,E=function(F){this.key=F 419}; 420E.prototype.key="foo"; 421for(var D in new E("bar")){C++ 422}return C>1 423}()){function B(E){var C=[]; 424for(var D in this._object){var F=this._object[D]; 425if(C.include(D)){continue 426}C.push(D); 427var G=[D,F]; 428G.key=D; 429G.value=F; 430E(G) 431}}}else{function B(D){for(var C in this._object){var E=this._object[C],F=[C,E]; 432F.key=C; 433F.value=E; 434D(F) 435}}}function A(C,D){if(Object.isUndefined(D)){return C 436}return C+"="+encodeURIComponent(String.interpret(D)) 437}return{initialize:function(C){this._object=Object.isHash(C)?C.toObject():Object.clone(C) 438},_each:B,set:function(C,D){return this._object[C]=D 439},get:function(C){return this._object[C] 440},unset:function(C){var D=this._object[C]; 441delete this._object[C]; 442return D 443},toObject:function(){return Object.clone(this._object) 444},keys:function(){return this.pluck("key") 445},values:function(){return this.pluck("value") 446},index:function(D){var C=this.detect(function(E){return E.value===D 447}); 448return C&&C.key 449},merge:function(C){return this.clone().update(C) 450},update:function(C){return new Hash(C).inject(this,function(D,E){D.set(E.key,E.value); 451return D 452}) 453},toQueryString:function(){return this.map(function(E){var D=encodeURIComponent(E.key),C=E.value; 454if(C&&typeof C=="object"){if(Object.isArray(C)){return C.map(A.curry(D)).join("&") 455}}return A(D,C) 456}).join("&") 457},inspect:function(){return"#<Hash:{"+this.map(function(C){return C.map(Object.inspect).join(": ") 458}).join(", ")+"}>" 459},toJSON:function(){return Object.toJSON(this.toObject()) 460},clone:function(){return new Hash(this) 461}} 462})()); 463Hash.prototype.toTemplateReplacements=Hash.prototype.toObject; 464Hash.from=$H; 465var ObjectRange=Class.create(Enumerable,{initialize:function(C,A,B){this.start=C; 466this.end=A; 467this.exclusive=B 468},_each:function(A){var B=this.start; 469while(this.include(B)){A(B); 470B=B.succ() 471}},include:function(A){if(A<this.start){return false 472}if(this.exclusive){return A<this.end 473}return A<=this.end 474}}); 475var $R=function(C,A,B){return new ObjectRange(C,A,B) 476}; 477var Ajax={getTransport:function(){return Try.these(function(){return new XMLHttpRequest() 478},function(){return new ActiveXObject("Msxml2.XMLHTTP") 479},function(){return new ActiveXObject("Microsoft.XMLHTTP") 480})||false 481},activeRequestCount:0}; 482Ajax.Responders={responders:[],_each:function(A){this.responders._each(A) 483},register:function(A){if(!this.include(A)){this.responders.push(A) 484}},unregister:function(A){this.responders=this.responders.without(A) 485},dispatch:function(D,B,C,A){this.each(function(E){if(Object.isFunction(E[D])){try{E[D].apply(E,[B,C,A]) 486}catch(F){}}}) 487}}; 488Object.extend(Ajax.Responders,Enumerable); 489Ajax.Responders.register({onCreate:function(){Ajax.activeRequestCount++ 490},onComplete:function(){Ajax.activeRequestCount-- 491}}); 492Ajax.Base=Class.create({initialize:function(A){this.options={method:"post",asynchronous:true,contentType:"application/x-www-form-urlencoded",encoding:"UTF-8",parameters:"",evalJSON:true,evalJS:true}; 493Object.extend(this.options,A||{}); 494this.options.method=this.options.method.toLowerCase(); 495if(Object.isString(this.options.parameters)){this.options.parameters=this.options.parameters.toQueryParams() 496}}}); 497Ajax.Request=Class.create(Ajax.Base,{_complete:false,initialize:function($super,B,A){$super(A); 498this.transport=Ajax.getTransport(); 499this.request(B) 500},request:function(B){this.url=B; 501this.method=this.options.method; 502var D=Object.clone(this.options.parameters); 503if(!["get","post"].include(this.method)){D["_method"]=this.method; 504this.method="post" 505}this.parameters=D; 506if(D=Object.toQueryString(D)){if(this.method=="get"){this.url+=(this.url.include("?")?"&":"?")+D 507}else{if(/Konqueror|Safari|KHTML/.test(navigator.userAgent)){D+="&_=" 508}}}try{var A=new Ajax.Response(this); 509if(this.options.onCreate){this.options.onCreate(A) 510}Ajax.Responders.dispatch("onCreate",this,A); 511this.transport.open(this.method.toUpperCase(),this.url,this.options.asynchronous); 512if(this.options.asynchronous){this.respondToReadyState.bind(this).defer(1) 513}this.transport.onreadystatechange=this.onStateChange.bind(this); 514this.setRequestHeaders(); 515this.body=this.method=="post"?(this.options.postBody||D):null; 516this.transport.send(this.body); 517if(!this.options.asynchronous&&this.transport.overrideMimeType){this.onStateChange() 518}}catch(C){this.dispatchException(C) 519}},onStateChange:function(){var A=this.transport.readyState; 520if(A>1&&!((A==4)&&this._complete)){this.respondToReadyState(this.transport.readyState) 521}},setRequestHeaders:function(){var E={"X-Requested-With":"XMLHttpRequest","X-Prototype-Version":Prototype.Version,"Accept":"text/javascript, text/html, application/xml, text/xml, */*"}; 522if(this.method=="post"){E["Content-type"]=this.options.contentType+(this.options.encoding?"; charset="+this.options.encoding:""); 523if(this.transport.overrideMimeType&&(navigator.userAgent.match(/Gecko\/(\d{4})/)||[0,2005])[1]<2005){E["Connection"]="close" 524}}if(typeof this.options.requestHeaders=="object"){var C=this.options.requestHeaders; 525if(Object.isFunction(C.push)){for(var B=0,D=C.length; 526B<D; 527B+=2){E[C[B]]=C[B+1] 528}}else{$H(C).each(function(F){E[F.key]=F.value 529}) 530}}for(var A in E){this.transport.setRequestHeader(A,E[A]) 531}},success:function(){var A=this.getStatus(); 532return !A||(A>=200&&A<300) 533},getStatus:function(){try{return this.transport.status||0 534}catch(A){return 0 535}}
535,respondToReadyState:function(A){var C=Ajax.Request.Events[A],B=new Ajax.Response(this); 536if(C=="Complete"){try{this._complete=true; 537(this.options["on"+B.status]||this.options["on"+(this.success()?"Success":"Failure")]||Prototype.emptyFunction)(B,B.headerJSON) 538}catch(D){this.dispatchException(D) 539}var E=B.getHeader("Content-type"); 540if(this.options.evalJS=="force"||(this.options.evalJS&&E&&E.match(/^\s*(text|application)\/(x-)?(java|ecma)script(;.*)?\s*$/i))){this.evalResponse() 541}}try{(this.options["on"+C]||Prototype.emptyFunction)(B,B.headerJSON); 542Ajax.Responders.dispatch("on"+C,this,B,B.headerJSON) 543}catch(D){this.dispatchException(D) 544}if(C=="Complete"){this.transport.onreadystatechange=Prototype.emptyFunction 545}},getHeader:function(A){try{return this.transport.getResponseHeader(A) 546}catch(B){return null 547}},evalResponse:function(){try{return eval((this.transport.responseText||"").unfilterJSON()) 548}catch(e){this.dispatchException(e) 549}},dispatchException:function(A){(this.options.onException||Prototype.emptyFunction)(this,A); 550Ajax.Responders.dispatch("onException",this,A) 551}}); 552Ajax.Request.Events=["Uninitialized","Loading","Loaded","Interactive","Complete"]; 553Ajax.Response=Class.create({initialize:function(C){this.request=C; 554var D=this.transport=C.transport,A=this.readyState=D.readyState; 555if((A>2&&!Prototype.Browser.IE)||A==4){this.status=this.getStatus(); 556this.statusText=this.getStatusText(); 557this.responseText=String.interpret(D.responseText); 558this.headerJSON=this._getHeaderJSON() 559}if(A==4){var B=D.responseXML; 560this.responseXML=B===undefined?null:B; 561this.responseJSON=this._getResponseJSON() 562}},status:0,statusText:"",getStatus:Ajax.Request.prototype.getStatus,getStatusText:function(){try{return this.transport.statusText||"" 563}catch(A){return"" 564}},getHeader:Ajax.Request.prototype.getHeader,getAllHeaders:function(){try{return this.getAllResponseHeaders() 565}catch(A){return null 566}},getResponseHeader:function(A){return this.transport.getResponseHeader(A) 567},getAllResponseHeaders:function(){return this.transport.getAllResponseHeaders() 568},_getHeaderJSON:function(){var A=this.getHeader("X-JSON"); 569if(!A){return null 570}A=decodeURIComponent(escape(A)); 571try{return A.evalJSON(this.request.options.sanitizeJSON) 572}catch(B){this.request.dispatchException(B) 573}},_getResponseJSON:function(){var A=this.request.options; 574if(!A.evalJSON||(A.evalJSON!="force"&&!(this.getHeader("Content-type")||"").include("application/json"))){return null 575}try{return this.transport.responseText.evalJSON(A.sanitizeJSON) 576}catch(B){this.request.dispatchException(B) 577}}}); 578Ajax.Updater=Class.create(Ajax.Request,{initialize:function($super,A,C,B){this.container={success:(A.success||A),failure:(A.failure||(A.success?null:A))}; 579B=B||{}; 580var D=B.onComplete; 581B.onComplete=(function(E,F){this.updateContent(E.responseText); 582if(Object.isFunction(D)){D(E,F) 583}}).bind(this); 584$super(C,B) 585},updateContent:function(D){var C=this.container[this.success()?"success":"failure"],A=this.options; 586if(!A.evalScripts){D=D.stripScripts() 587}if(C=$(C)){if(A.insertion){if(Object.isString(A.insertion)){var B={}; 588B[A.insertion]=D; 589C.insert(B) 590}else{A.insertion(C,D) 591}}else{C.update(D) 592}}if(this.success()){if(this.onComplete){this.onComplete.bind(this).defer() 593}}}}); 594Ajax.PeriodicalUpdater=Class.create(Ajax.Base,{initialize:function($super,A,C,B){$super(B); 595this.onComplete=this.options.onComplete; 596this.frequency=(this.options.frequency||2); 597this.decay=(this.options.decay||1); 598this.updater={}; 599this.container=A; 600this.url=C; 601this.start() 602},start:function(){this.options.onComplete=this.updateComplete.bind(this); 603this.onTimerEvent() 604},stop:function(){this.updater.options.onComplete=undefined; 605clearTimeout(this.timer); 606(this.onComplete||Prototype.emptyFunction).apply(this,arguments) 607},updateComplete:function(A){if(this.options.decay){this.decay=(A.responseText==this.lastText?this.decay*this.options.decay:1); 608this.lastText=A.responseText 609}this.timer=this.onTimerEvent.bind(this).delay(this.decay*this.frequency) 610},onTimerEvent:function(){this.updater=new Ajax.Updater(this.container,this.url,this.options) 611}}); 612function $(B){if(arguments.length>1){for(var A=0,D=[],C=arguments.length; 613A<C; 614A++){D.push($(arguments[A])) 615}return D 616}if(Object.isString(B)){B=document.getElementById(B) 617}return Element.extend(B) 618}if(Prototype.BrowserFeatures.XPath){document._getElementsByXPath=function(F,A){var C=[]; 619var E=document.evaluate(F,$(A)||document,null,XPathResult.ORDERED_NODE_SNAPSHOT_TYPE,null); 620for(var B=0,D=E.snapshotLength; 621B<D; 622B++){C.push(Element.extend(E.snapshotItem(B))) 623}return C 624} 625}if(!window.Node){var Node={} 626}if(!Node.ELEMENT_NODE){Object.extend(Node,{ELEMENT_NODE:1,ATTRIBUTE_NODE:2,TEXT_NODE:3,CDATA_SECTION_NODE:4,ENTITY_REFERENCE_NODE:5,ENTITY_NODE:6,PROCESSING_INSTRUCTION_NODE:7,COMMENT_NODE:8,DOCUMENT_NODE:9,DOCUMENT_TYPE_NODE:10,DOCUMENT_FRAGMENT_NODE:11,NOTATION_NODE:12}) 627}(function(){var A=this.Element; 628this.Element=function(D,C){C=C||{}; 629D=D.toLowerCase(); 630var B=Element.cache;
631if(Prototype.Browser.IE&&C.name){D="<"+D+' name="'+C.name+'">'; 632delete C.name; 633return Element.writeAttribute(document.createElement(D),C) 634}if(!B[D]){B[D]=Element.extend(document.createElement(D)) 635}return Element.writeAttribute(B[D].cloneNode(false),C) 636}; 637Object.extend(this.Element,A||{}) 638}).call(window); 639Element.cache={}; 640Element.Methods={visible:function(A){return $(A).style.display!="none" 641},toggle:function(A){A=$(A); 642Element[Element.visible(A)?"hide":"show"](A); 643return A 644},hide:function(A){$(A).style.display="none"; 645return A 646},show:function(A){$(A).style.display=""; 647return A 648},remove:function(A){A=$(A); 649A.parentNode.removeChild(A); 650return A 651},update:function(A,B){A=$(A); 652if(B&&B.toElement){B=B.toElement() 653}if(Object.isElement(B)){return A.update().insert(B) 654}B=Object.toHTML(B); 655A.innerHTML=B.stripScripts(); 656B.evalScripts.bind(B).defer(); 657return A 658},replace:function(B,C){B=$(B); 659if(C&&C.toElement){C=C.toElement() 660}else{if(!Object.isElement(C)){C=Object.toHTML(C); 661var A=B.ownerDocument.createRange(); 662A.selectNode(B); 663C.evalScripts.bind(C).defer(); 664C=A.createContextualFragment(C.stripScripts()) 665}}B.parentNode.replaceChild(C,B); 666return B 667},insert:function(C,E){C=$(C); 668if(Object.isString(E)||Object.isNumber(E)||Object.isElement(E)||(E&&(E.toElement||E.toHTML))){E={bottom:E} 669}var D,B,A; 670for(position in E){D=E[position]; 671position=position.toLowerCase(); 672B=Element._insertionTranslations[position]; 673if(D&&D.toElement){D=D.toElement() 674}if(Object.isElement(D)){B.insert(C,D); 675continue 676}D=Object.toHTML(D); 677A=C.ownerDocument.createRange(); 678B.initializeRange(C,A); 679B.insert(C,A.createContextualFragment(D.stripScripts())); 680D.evalScripts.bind(D).defer() 681}return C 682},wrap:function(B,C,A){B=$(B); 683if(Object.isElement(C)){$(C).writeAttribute(A||{}) 684}else{if(Object.isString(C)){C=new Element(C,A) 685}else{C=new Element("div",C) 686}}if(B.parentNode){B.parentNode.replaceChild(C,B) 687}C.appendChild(B); 688return C 689},inspect:function(B){B=$(B); 690var A="<"+B.tagName.toLowerCase(); 691$H({"id":"id","className":"class"}).each(function(F){var E=F.first(),C=F.last(); 692var D=(B[E]||"").toString(); 693if(D){A+=" "+C+"="+D.inspect(true) 694}}); 695return A+">" 696},recursivelyCollect:function(A,C){A=$(A); 697var B=[]; 698while(A=A[C]){if(A.nodeType==1){B.push(Element.extend(A)) 699}}return B 700},ancestors:function(A){return $(A).recursivelyCollect("parentNode") 701},descendants:function(A){return $A($(A).getElementsByTagName("*")).each(Element.extend) 702},firstDescendant:function(A){A=$(A).firstChild; 703while(A&&A.nodeType!=1){A=A.nextSibling 704}return $(A) 705},immediateDescendants:function(A){if(!(A=$(A).firstChild)){return[] 706}while(A&&A.nodeType!=1){A=A.nextSibling 707}if(A){return[A].concat($(A).nextSiblings()) 708}return[] 709},previousSiblings:function(A){return $(A).recursivelyCollect("previousSibling") 710},nextSiblings:function(A){return $(A).recursivelyCollect("nextSibling") 711},siblings:function(A){A=$(A); 712return A.previousSiblings().reverse().concat(A.nextSiblings()) 713},match:function(B,A){if(Object.isString(A)){A=new Selector(A) 714}return A.match($(B)) 715},up:function(B,D,A){B=$(B); 716if(arguments.length==1){return $(B.parentNode) 717}var C=B.ancestors(); 718return D?Selector.findElement(C,D,A):C[A||0] 719},down:function(B,C,A){B=$(B); 720if(arguments.length==1){return B.firstDescendant() 721}var D=B.descendants(); 722return C?Selector.findElement(D,C,A):D[A||0] 723},previous:function(B,D,A){B=$(B); 724if(arguments.length==1){return $(Selector.handlers.previousElementSibling(B)) 725}var C=B.previousSiblings(); 726return D?Selector.findElement(C,D,A):C[A||0] 727},next:function(C,D,B){C=$(C); 728if(arguments.length==1){return $(Selector.handlers.nextElementSibling(C)) 729}var A=C.nextSiblings(); 730return D?Selector.findElement(A,D,B):A[B||0] 731},select:function(){var A=$A(arguments),B=$(A.shift()); 732return Selector.findChildElements(B,A) 733},adjacent:function(){var A=$A(arguments),B=$(A.shift()); 734return Selector.findChildElements(B.parentNode,A).without(B) 735},identify:function(B){B=$(B); 736var C=B.readAttribute("id"),A=arguments.callee; 737if(C){return C 738}do{C="anonymous_element_"+A.counter++ 739}while($(C)); 740B.writeAttribute("id",C); 741return C 742},readAttribute:function(C,A){C=$(C); 743if(Prototype.Browser.IE){var B=Element._attributeTranslations.read; 744if(B.values[A]){return B.values[A](C,A) 745}if(B.names[A]){A=B.names[A] 746}if(A.include(":")){return(!C.attributes||!C.attributes[A])?null:C.attributes[A].value 747}}return C.getAttribute(A) 748},writeAttribute:function(E,C,F){E=$(E); 749var B={},D=Element._attributeTranslations.write; 750if(typeof C=="object"){B=C 751}
751else{B[C]=F===undefined?true:F 752}for(var A in B){var C=D.names[A]||A,F=B[A]; 753if(D.values[A]){C=D.values[A](E,F) 754}if(F===false||F===null){E.removeAttribute(C) 755}else{if(F===true){E.setAttribute(C,C) 756}else{E.setAttribute(C,F) 757}}}return E 758},getHeight:function(A){return $(A).getDimensions().height 759},getWidth:function(A){return $(A).getDimensions().width 760},classNames:function(A){return new Element.ClassNames(A) 761},hasClassName:function(A,B){if(!(A=$(A))){return 762}var C=A.className; 763return(C.length>0&&(C==B||new RegExp("(^|\\s)"+B+"(\\s|$)").test(C))) 764},addClassName:function(A,B){if(!(A=$(A))){return 765}if(!A.hasClassName(B)){A.className+=(A.className?" ":"")+B 766}return A 767},removeClassName:function(A,B){if(!(A=$(A))){return 768}A.className=A.className.replace(new RegExp("(^|\\s+)"+B+"(\\s+|$)")," ").strip(); 769return A 770},toggleClassName:function(A,B){if(!(A=$(A))){return 771}return A[A.hasClassName(B)?"removeClassName":"addClassName"](B) 772},cleanWhitespace:function(B){B=$(B); 773var C=B.firstChild; 774while(C){var A=C.nextSibling; 775if(C.nodeType==3&&!/\S/.test(C.nodeValue)){B.removeChild(C) 776}C=A 777}return B 778},empty:function(A){return $(A).innerHTML.blank() 779},descendantOf:function(D,C){D=$(D),C=$(C); 780if(D.compareDocumentPosition){return(D.compareDocumentPosition(C)&8)===8 781}if(D.sourceIndex&&!Prototype.Browser.Opera){var E=D.sourceIndex,B=C.sourceIndex,A=C.nextSibling; 782if(!A){do{C=C.parentNode 783}while(!(A=C.nextSibling)&&C.parentNode) 784}if(A){return(E>B&&E<A.sourceIndex) 785}}while(D=D.parentNode){if(D==C){return true 786}}return false 787},scrollTo:function(A){A=$(A); 788var B=A.cumulativeOffset(); 789window.scrollTo(B[0],B[1]); 790return A 791},getStyle:function(B,C){B=$(B); 792C=C=="float"?"cssFloat":C.camelize(); 793var D=B.style[C]; 794if(!D){var A=document.defaultView.getComputedStyle(B,null); 795D=A?A[C]:null 796}if(C=="opacity"){return D?parseFloat(D):1 797}return D=="auto"?null:D 798},getOpacity:function(A){return $(A).getStyle("opacity") 799},setStyle:function(B,C){B=$(B); 800var E=B.style,A; 801if(Object.isString(C)){B.style.cssText+=";"+C; 802return C.include("opacity")?B.setOpacity(C.match(/opacity:\s*(\d?\.?\d*)/)[1]):B 803}for(var D in C){if(D=="opacity"){B.setOpacity(C[D]) 804}else{E[(D=="float"||D=="cssFloat")?(E.styleFloat===undefined?"cssFloat":"styleFloat"):D]=C[D] 805}}return B 806},setOpacity:function(A,B){A=$(A); 807A.style.opacity=(B==1||B==="")?"":(B<0.00001)?0:B; 808return A 809},getDimensions:function(C){C=$(C); 810var G=$(C).getStyle("display"); 811if(G!="none"&&G!=null){return{width:C.offsetWidth,height:C.offsetHeight} 812}var B=C.style; 813var F=B.visibility; 814var D=B.position; 815var A=B.display; 816B.visibility="hidden"; 817B.position="absolute"; 818B.display="block"; 819var H=C.clientWidth; 820var E=C.clientHeight; 821B.display=A; 822B.position=D; 823B.visibility=F; 824return{width:H,height:E} 825},makePositioned:function(A){A=$(A); 826var B=Element.getStyle(A,"position"); 827if(B=="static"||!B){A._madePositioned=true; 828A.style.position="relative"; 829if(window.opera){A.style.top=0; 830A.style.left=0 831}}return A 832},undoPositioned:function(A){A=$(A); 833if(A._madePositioned){A._madePositioned=undefined; 834A.style.position=A.style.top=A.style.left=A.style.bottom=A.style.right="" 835}return A 836},makeClipping:function(A){A=$(A); 837if(A._overflow){return A 838}A._overflow=Element.getStyle(A,"overflow")||"auto"; 839if(A._overflow!=="hidden"){A.style.overflow="hidden" 840}return A 841},undoClipping:function(A){A=$(A); 842if(!A._overflow){return A 843}A.style.overflow=A._overflow=="auto"?"":A._overflow; 844A._overflow=null; 845return A 846},cumulativeOffset:function(B){var A=0,C=0; 847do{A+=B.offsetTop||0; 848C+=B.offsetLeft||0; 849B=B.offsetParent 850}while(B); 851return Element._returnOffset(C,A) 852},positionedOffset:function(B){var A=0,D=0; 853do{A+=B.offsetTop||0; 854D+=B.offsetLeft||0; 855B=B.offsetParent; 856if(B){if(B.tagName=="BODY"){break 857}var C=Element.getStyle(B,"position"); 858if(C=="relative"||C=="absolute"){break 859}}}while(B); 860return Element._returnOffset(D,A) 861},absolutize:function(B){B=$(B); 862if(B.getStyle("position")=="absolute"){return 863}var D=B.positionedOffset(); 864var F=D[1]; 865var E=D[0]; 866var C=B.clientWidth; 867var A=B.clientHeight; 868B._originalLeft=E-parseFloat(B.style.left||0); 869B._originalTop=F-parseFloat(B.style.top||0); 870B._originalWidth=B.style.width; 871B._originalHeight=B.style.height; 872B.style.position="absolute"; 873B.style.top=F+"px"; 874B.style.left=E+"px"; 875B.style.width=C+"px"; 876B.style.height=A+"px"; 877return B 878},relativize:function(A){A=$(A); 879if(A.getStyle("position")=="relative"){return 880}A.style.position="relative"; 881var C=parseFloat(A.style.top||0)-(A._originalTop||0); 882var B=parseFloat(A.style.left||0)-(A._originalLeft||0); 883A.style.top=C+"px"; 884A.style.left=B+"px"; 885A.style.height=A._originalHeight; 886A.style.width=A._originalWidth; 887return A 888},cumulativeScrollOffset:function(B){var A=0,C=0; 889do{A+=B.scrollTop||0; 890C+=B.scrollLeft||0; 891B=B.parentNode 892}while(B); 893return Element._returnOffset(C,A) 894},getOffsetParent:function(A){if(A.offsetParent){return $(A.offsetParent) 895}if(A==document.body){return $(A) 896}while((A=A.parentNode)&&A!=document.body){if(Element.getStyle(A,"position")!="static"){return $(A) 897}}return $(document.body) 898},viewportOffset:function(D){var A=0,C=0; 899var B=D; 900do{A+=B.offsetTop||0; 901C+=B.offsetLeft||0; 902if(B.offsetParent==document.body&&Element.getStyle(B,"position")=="absolute"){break 903}}while(B=B.offsetParent); 904B=D; 905do{if(!Prototype.Browser.Opera||B.tagName=="BODY"){A-=B.scrollTop||0; 906C-=B.scrollLeft||0 907}}while(B=B.parentNode); 908return Element._returnOffset(C,A) 909},clonePosition:function(B,D){var A=Object.extend({setLeft:true,setTop:true,setWidth:true,setHeight:true,offsetTop:0,offsetLeft:0},arguments[2]||{}); 910D=$(D); 911var E=D.viewportOffset(); 912B=$(B); 913var F=[0,0]; 914var C=null; 915if(Element.getStyle(B,"position")=="absolute"){C=B.getOffsetParent(); 916F=C.viewportOffset() 917}if(C==document.body){F[0]-=document.body.offsetLeft; 918F[1]-=document.body.offsetTop 919}if(A.setLeft){B.style.left=(E[0]-F[0]+A.offsetLeft)+"px" 920}if(A.setTop){B.style.top=(E[1]-F[1]+A.offsetTop)+"px" 921}if(A.setWidth){B.style.width=D.offsetWidth+"px" 922}if(A.setHeight){B.style.height=D.offsetHeight+"px"
923}return B 924}}; 925Element.Methods.identify.counter=1; 926Object.extend(Element.Methods,{getElementsBySelector:Element.Methods.select,childElements:Element.Methods.immediateDescendants}); 927Element._attributeTranslations={write:{names:{className:"class",htmlFor:"for"},values:{}}}; 928if(!document.createRange||Prototype.Browser.Opera){Element.Methods.insert=function(E,G){E=$(E); 929if(Object.isString(G)||Object.isNumber(G)||Object.isElement(G)||(G&&(G.toElement||G.toHTML))){G={bottom:G} 930}var D=Element._insertionTranslations,F,B,H,C; 931for(B in G){F=G[B]; 932B=B.toLowerCase(); 933H=D[B]; 934if(F&&F.toElement){F=F.toElement() 935}if(Object.isElement(F)){H.insert(E,F); 936continue 937}F=Object.toHTML(F); 938C=((B=="before"||B=="after")?E.parentNode:E).tagName.toUpperCase(); 939if(D.tags[C]){var A=Element._getContentFromAnonymousElement(C,F.stripScripts()); 940if(B=="top"||B=="after"){A.reverse() 941}A.each(H.insert.curry(E)) 942}else{E.insertAdjacentHTML(H.adjacency,F.stripScripts()) 943}F.evalScripts.bind(F).defer() 944}return E 945} 946}if(Prototype.Browser.Opera){Element.Methods._getStyle=Element.Methods.getStyle; 947Element.Methods.getStyle=function(A,B){switch(B){case"left":case"top":case"right":case"bottom":if(Element._getStyle(A,"position")=="static"){return null 948}default:return Element._getStyle(A,B) 949}}; 950Element.Methods._readAttribute=Element.Methods.readAttribute; 951Element.Methods.readAttribute=function(A,B){if(B=="title"){return A.title 952}return Element._readAttribute(A,B) 953} 954}else{if(Prototype.Browser.IE){$w("positionedOffset getOffsetParent viewportOffset").each(function(A){Element.Methods[A]=Element.Methods[A].wrap(function(D,C){C=$(C); 955var B=C.getStyle("position"); 956if(B!="static"){return D(C) 957}C.setStyle({position:"relative"}); 958var E=D(C); 959C.setStyle({position:B}); 960return E 961}) 962}); 963Element.Methods.getStyle=function(A,B){A=$(A); 964B=(B=="float"||B=="cssFloat")?"styleFloat":B.camelize(); 965var C=A.style[B]; 966if(!C&&A.currentStyle){C=A.currentStyle[B] 967}if(B=="opacity"){if(C=(A.getStyle("filter")||"").match(/alpha\(opacity=(.*)\)/)){if(C[1]){return parseFloat(C[1])/100 968}}return 1 969}if(C=="auto"){if((B=="width"||B=="height")&&(A.getStyle("display")!="none")){return A["offset"+B.capitalize()]+"px" 970}return null 971}return C 972}; 973Element.Methods.setOpacity=function(B,E){function F(G){return G.replace(/alpha\([^\)]*\)/gi,"") 974}B=$(B); 975var A=B.currentStyle; 976if((A&&!A.hasLayout)||(!A&&B.style.zoom=="normal")){B.style.zoom=1 977}var D=B.getStyle("filter"),C=B.style; 978if(E==1||E===""){(D=F(D))?C.filter=D:C.removeAttribute("filter"); 979return B 980}else{if(E<0.00001){E=0 981}}C.filter=F(D)+"alpha(opacity="+(E*100)+")"; 982return B 983}; 984Element._attributeTranslations={read:{names:{"class":"className","for":"htmlFor"},values:{_getAttr:function(A,B){return A.getAttribute(B,2) 985},_getAttrNode:function(A,C){var B=A.getAttributeNode(C); 986return B?B.value:"" 987},_getEv:function(A,B){var B=A.getAttribute(B); 988return B?B.toString().slice(23,-2):null 989},_flag:function(A,B){return $(A).hasAttribute(B)?B:null 990},style:function(A){return A.style.cssText.toLowerCase() 991},title:function(A){return A.title 992}}}}; 993Element._attributeTranslations.write={names:Object.clone(Element._attributeTranslations.read.names),values:{checked:function(A,B){A.checked=!!B 994},style:function(A,B){A.style.cssText=B?B:"" 995}}}; 996Element._attributeTranslations.has={}; 997$w("colSpan rowSpan vAlign dateTime accessKey tabIndex encType maxLength readOnly longDesc").each(function(A){Element._attributeTranslations.write.names[A.toLowerCase()]=A; 998Element._attributeTranslations.has[A.toLowerCase()]=A 999}); 1000(function(A){Object.extend(A,{href:A._getAttr,src:A._getAttr,type:A._getAttr,action:A._getAttrNode,disabled:A._flag,checked:A._flag,readonly:A._flag,multiple:A._flag,onload:A._getEv,onunload:A._getEv,onclick:A._getEv,ondblclick:A._getEv,onmousedown:A._getEv,onmouseup:A._getEv,onmouseover:A._getEv,onmousemove:A._getEv,onmouseout:A._getEv,onfocus:A._getEv,onblur:A._getEv,onkeypress:A._getEv,onkeydown:A._getEv,onkeyup:A._getEv,onsubmit:A._getEv,onreset:A._getEv,onselect:A._getEv,onchange:A._getEv}) 1001})(Element._attributeTranslations.read.values) 1002}else{if(Prototype.Browser.Gecko&&/rv:1\.8\.0/.test(navigator.userAgent)){
1002Element.Methods.setOpacity=function(A,B){A=$(A); 1003A.style.opacity=(B==1)?0.999999:(B==="")?"":(B<0.00001)?0:B; 1004return A 1005} 1006}else{if(Prototype.Browser.WebKit){Element.Methods.setOpacity=function(A,B){A=$(A); 1007A.style.opacity=(B==1||B==="")?"":(B<0.00001)?0:B; 1008if(B==1){if(A.tagName=="IMG"&&A.width){A.width++; 1009A.width-- 1010}else{try{var D=document.createTextNode(" "); 1011A.appendChild(D); 1012A.removeChild(D) 1013}catch(C){}}}return A 1014}; 1015Element.Methods.cumulativeOffset=function(B){var A=0,C=0; 1016do{A+=B.offsetTop||0; 1017C+=B.offsetLeft||0; 1018if(B.offsetParent==document.body){if(Element.getStyle(B,"position")=="absolute"){break 1019}}B=B.offsetParent 1020}while(B); 1021return Element._returnOffset(C,A) 1022} 1023}}}}if(Prototype.Browser.IE||Prototype.Browser.Opera){Element.Methods.update=function(B,C){B=$(B); 1024if(C&&C.toElement){C=C.toElement() 1025}if(Object.isElement(C)){return B.update().insert(C) 1026}C=Object.toHTML(C); 1027var A=B.tagName.toUpperCase(); 1028if(A in Element._insertionTranslations.tags){$A(B.childNodes).each(function(D){B.removeChild(D) 1029}); 1030Element._getContentFromAnonymousElement(A,C.stripScripts()).each(function(D){B.appendChild(D) 1031}) 1032}else{B.innerHTML=C.stripScripts() 1033}C.evalScripts.bind(C).defer(); 1034return B 1035} 1036}if(document.createElement("div").outerHTML){Element.Methods.replace=function(C,E){C=$(C); 1037if(E&&E.toElement){E=E.toElement() 1038}if(Object.isElement(E)){C.parentNode.replaceChild(E,C); 1039return C 1040}E=Object.toHTML(E); 1041var D=C.parentNode,B=D.tagName.toUpperCase(); 1042if(Element._insertionTranslations.tags[B]){var F=C.next(); 1043var A=Element._getContentFromAnonymousElement(B,E.stripScripts()); 1044D.removeChild(C); 1045if(F){A.each(function(G){D.insertBefore(G,F) 1046}) 1047}else{A.each(function(G){D.appendChild(G) 1048}) 1049}}else{C.outerHTML=E.stripScripts() 1050}E.evalScripts.bind(E).defer(); 1051return C 1052} 1053}Element._returnOffset=function(B,C){var A=[B,C]; 1054A.left=B; 1055A.top=C; 1056return A 1057}; 1058Element._getContentFromAnonymousElement=function(C,B){var D=new Element("div"),A=Element._insertionTranslations.tags[C]; 1059D.innerHTML=A[0]+B+A[1]; 1060A[2].times(function(){D=D.firstChild 1061}); 1062return $A(D.childNodes) 1063}; 1064Element._insertionTranslations={before:{adjacency:"beforeBegin",insert:function(A,B){A.parentNode.insertBefore(B,A) 1065},initializeRange:function(B,A){A.setStartBefore(B) 1066}},top:{adjacency:"afterBegin",insert:function(A,B){A.insertBefore(B,A.firstChild) 1067},initializeRange:function(B,A){A.selectNodeContents(B); 1068A.collapse(true) 1069}},bottom:{adjacency:"beforeEnd",insert:function(A,B){A.appendChild(B) 1070}},after:{adjacency:"afterEnd",insert:function(A,B){A.parentNode.insertBefore(B,A.nextSibling) 1071},initializeRange:function(B,A){A.setStartAfter(B) 1072}},tags:{TABLE:["<table>","</table>",1],TBODY:["<table><tbody>","</tbody></table>",2],TR:["<table><tbody><tr>","</tr></tbody></table>",3],TD:["<table><tbody><tr><td>","</td></tr></tbody></table>",4],SELECT:["<select>","</select>",1]}}; 1073(function(){this.bottom.initializeRange=this.top.initializeRange; 1074Object.extend(this.tags,{THEAD:this.tags.TBODY,TFOOT:this.tags.TBODY,TH:this.tags.TD}) 1075}).call(Element._insertionTranslations); 1076Element.Methods.Simulated={hasAttribute:function(A,C){C=Element._attributeTranslations.has[C]||C; 1077var B=$(A).getAttributeNode(C); 1078return B&&B.specified 1079}}; 1080Element.Methods.ByTag={}; 1081Object.extend(Element,Element.Methods); 1082if(!Prototype.BrowserFeatures.ElementExtensions&&document.createElement("div").__proto__){window.HTMLElement={}; 1083window.HTMLElement.prototype=document.createElement("div").__proto__; 1084Prototype.BrowserFeatures.ElementExtensions=true 1085}Element.extend=(function(){if(Prototype.BrowserFeatures.SpecificElementExtensions){return Prototype.K 1086}var A={},B=Element.Methods.ByTag; 1087var C=Object.extend(function(F){if(!F||F._extendedByPrototype||F.nodeType!=1||F==window){return F 1088}var D=Object.clone(A),E=F.tagName,H,G; 1089if(B[E]){Object.extend(D,B[E]) 1090}for(H in D){G=D[H]; 1091if(Object.isFunction(G)&&!(H in F)){F[H]=G.methodize() 1092}}F._extendedByPrototype=Prototype.emptyFunction; 1093return F 1094},{refresh:function(){if(!Prototype.BrowserFeatures.ElementExtensions){Object.extend(A,Element.Methods); 1095Object.extend(A,Element.Methods.Simulated) 1096}}}); 1097C.refresh(); 1098return C 1099})(); 1100Element.hasAttribute=function(A,B){if(A.hasAttribute){return A.hasAttribute(B) 1101}return Element.Methods.Simulated.hasAttribute(A,B) 1102}; 1103Element.addMethods=function(C){var I=Prototype.BrowserFeatures,D=Element.Methods.ByTag; 1104if(!C){Object.extend(Form,Form.Methods); 1105Object.extend(Form.Element,Form.Element.Methods); 1106Object.extend(Element.Methods.ByTag,{"FORM":Object.clone(Form.Methods),"INPUT":Object.clone(Form.Element.Methods),"SELECT":Object.clone(Form.Element.Methods),"TEXTAREA":Object.clone(Form.Element.Methods)}) 1107}if(arguments.length==2){var B=C; 1108C=arguments[1] 1109}if(!B){Object.extend(Element.Methods,C||{}) 1110}else{if(Object.isArray(B)){B.each(H) 1111}else{H(B) 1112}}function H(F){F=F.toUpperCase(); 1113if(!Element.Methods.ByTag[F]){Element.Methods.ByTag[F]={} 1114}Object.extend(Element.Methods.ByTag[F],C) 1115}function A(L,K,F){F=F||false; 1116for(var N in L){var M=L[N]; 1117if(!Object.isFunction(M)){continue 1118}
1118if(!F||!(N in K)){K[N]=M.methodize() 1119}}}function E(L){var F; 1120var K={"OPTGROUP":"OptGroup","TEXTAREA":"TextArea","P":"Paragraph","FIELDSET":"FieldSet","UL":"UList","OL":"OList","DL":"DList","DIR":"Directory","H1":"Heading","H2":"Heading","H3":"Heading","H4":"Heading","H5":"Heading","H6":"Heading","Q":"Quote","INS":"Mod","DEL":"Mod","A":"Anchor","IMG":"Image","CAPTION":"TableCaption","COL":"TableCol","COLGROUP":"TableCol","THEAD":"TableSection","TFOOT":"TableSection","TBODY":"TableSection","TR":"TableRow","TH":"TableCell","TD":"TableCell","FRAMESET":"FrameSet","IFRAME":"IFrame"}; 1121if(K[L]){F="HTML"+K[L]+"Element" 1122}if(window[F]){return window[F] 1123}F="HTML"+L+"Element"; 1124if(window[F]){return window[F] 1125}F="HTML"+L.capitalize()+"Element"; 1126if(window[F]){return window[F] 1127}window[F]={}; 1128window[F].prototype=document.createElement(L).__proto__; 1129return window[F] 1130}if(I.ElementExtensions){A(Element.Methods,HTMLElement.prototype); 1131A(Element.Methods.Simulated,HTMLElement.prototype,true) 1132}if(I.SpecificElementExtensions){for(var J in Element.Methods.ByTag){var G=E(J); 1133if(Object.isUndefined(G)){continue 1134}A(D[J],G.prototype) 1135}}Object.extend(Element,Element.Methods); 1136delete Element.ByTag; 1137if(Element.extend.refresh){Element.extend.refresh() 1138}Element.cache={} 1139}; 1140document.viewport={getDimensions:function(){var A={}; 1141$w("width height").each(function(C){var B=C.capitalize(); 1142A[C]=self["inner"+B]||(document.documentElement["client"+B]||document.body["client"+B]) 1143}); 1144return A 1145},getWidth:function(){return this.getDimensions().width 1146},getHeight:function(){return this.getDimensions().height 1147},getScrollOffsets:function(){return Element._returnOffset(window.pageXOffset||document.documentElement.scrollLeft||document.body.scrollLeft,window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop) 1148}}; 1149var Selector=Class.create({initialize:function(A){this.expression=A.strip(); 1150this.compileMatcher() 1151},compileMatcher:function(){if(Prototype.BrowserFeatures.XPath&&!(/(\[[\w-]*?:|:checked)/).test(this.expression)){return this.compileXPathMatcher() 1152}var e=this.expression,ps=Selector.patterns,h=Selector.handlers,c=Selector.criteria,le,p,m; 1153if(Selector._cache[e]){this.matcher=Selector._cache[e]; 1154return 1155}this.matcher=["this.matcher = function(root) {","var r = root, h = Selector.handlers, c = false, n;"]; 1156while(e&&le!=e&&(/\S/).test(e)){le=e; 1157for(var i in ps){p=ps[i]; 1158if(m=e.match(p)){this.matcher.push(Object.isFunction(c[i])?c[i](m):new Template(c[i]).evaluate(m)); 1159e=e.replace(m[0],""); 1160break 1161}}}this.matcher.push("return h.unique(n);\n}"); 1162eval(this.matcher.join("\n")); 1163Selector._cache[this.expression]=this.matcher 1164},compileXPathMatcher:function(){var E=this.expression,F=Selector.patterns,B=Selector.xpath,D,A; 1165if(Selector._cache[E]){this.xpath=Selector._cache[E]; 1166return 1167}this.matcher=[".//*"]; 1168while(E&&D!=E&&(/\S/).test(E)){D=E; 1169for(var C in F){if(A=E.match(F[C])){this.matcher.push(Object.isFunction(B[C])?B[C](A):new Template(B[C]).evaluate(A)); 1170E=E.replace(A[0],""); 1171break 1172}}}this.xpath=this.matcher.join(""); 1173Selector._cache[this.expression]=this.xpath 1174},findElements:function(A){A=A||document; 1175if(this.xpath){return document._getElementsByXPath(this.xpath,A) 1176}return this.matcher(A) 1177},match:function(H){this.tokens=[]; 1178var L=this.expression,A=Selector.patterns,E=Selector.assertions; 1179var B,D,F; 1180while(L&&B!==L&&(/\S/).test(L)){B=L; 1181for(var I in A){D=A[I]; 1182if(F=L.match(D)){if(E[I]){this.tokens.push([I,Object.clone(F)]); 1183L=L.replace(F[0],"") 1184}else{return this.findElements(document).include(H) 1185}}}}var K=true,C,J; 1186for(var I=0,G; 1187G=this.tokens[I]; 1188I++){C=G[0],J=G[1]; 1189if(!Selector.assertions[C](H,J)){K=false; 1190break 1191}}return K 1192},toString:function(){return this.expression 1193},inspect:function(){return"#<Selector:"+this.expression.inspect()+">" 1194}}); 1195Object.extend(Selector,{_cache:{},xpath:{descendant:"//*",child:"/*",adjacent:"/following-sibling::*[1]",laterSibling:"/following-sibling::*",tagName:function(A){if(A[1]=="*"){return"" 1196}return"[local-name()='"+A[1].toLowerCase()+"' or local-name()='"+A[1].toUpperCase()+"']" 1197},className:"[contains(concat(' ', @class, ' '), ' #{1} ')]",id:"[@id='#{1}']",attrPresence:"[@#{1}]",attr:function(A){A[3]=A[5]||A[6]; 1198return new Template(Selector.xpath.operators[A[2]]).evaluate(A) 1199},pseudo:function(A){var B=Selector.xpath.pseudos[A[1]]; 1200if(!B){return"" 1201}if(Object.isFunction(B)){return B(A) 1202}return new Template(Selector.xpath.pseudos[A[1]]).evaluate(A) 1203},operators:{"=":"[@#{1}='#{3}']","!=":"[@#{1}!='#{3}']","^=":"[starts-with(@#{1}, '#{3}')]","$=":"[substring(@#{1}, (string-length(@#{1}) - string-length('#{3}') + 1))='#{3}']","*=":"[contains(@#{1}, '#{3}')]","~=":"[contains(concat(' ', @#{1}, ' '), ' #{3} ')]","|=":"[contains(concat('-', @#{1}, '-'), '-#{3}-')]"},pseudos:{"first-child":"[not(preceding-sibling::*)]","last-child":"[not(following-sibling::*)]","only-child":"[not(preceding-sibling::* or following-sibling::*)]","empty":"[count(*) = 0 and (count(text()) = 0 or translate(text(), ' \t\r\n', '') = '')]","checked":"[@checked]","disabled":"[@disabled]","enabled":"[not(@disabled)]","not":function(B){var H=B[6],G=Selector.patterns,A=Selector.xpath,E,B,C; 1204var F=[]; 1205while(H&&E!=H&&(/\S/).test(H)){E=H; 1206for(var D in G){if(B=H.match(G[D])){C=Object.isFunction(A[D])?A[D](B):new Template(A[D]).evaluate(B); 1207F.push("("+C.substring(1,C.length-1)+")"); 1208H=H.replace(B[0],""); 1209break 1210}}}
1210return"[not("+F.join(" and ")+")]" 1211},"nth-child":function(A){return Selector.xpath.pseudos.nth("(count(./preceding-sibling::*) + 1) ",A) 1212},"nth-last-child":function(A){return Selector.xpath.pseudos.nth("(count(./following-sibling::*) + 1) ",A) 1213},"nth-of-type":function(A){return Selector.xpath.pseudos.nth("position() ",A) 1214},"nth-last-of-type":function(A){return Selector.xpath.pseudos.nth("(last() + 1 - position()) ",A) 1215},"first-of-type":function(A){A[6]="1"; 1216return Selector.xpath.pseudos["nth-of-type"](A) 1217},"last-of-type":function(A){A[6]="1"; 1218return Selector.xpath.pseudos["nth-last-of-type"](A) 1219},"only-of-type":function(A){var B=Selector.xpath.pseudos; 1220return B["first-of-type"](A)+B["last-of-type"](A) 1221},nth:function(E,C){var F,G=C[6],B; 1222if(G=="even"){G="2n+0" 1223}if(G=="odd"){G="2n+1" 1224}if(F=G.match(/^(\d+)$/)){return"["+E+"= "+F[1]+"]" 1225}if(F=G.match(/^(-?\d*)?n(([+-])(\d+))?/)){if(F[1]=="-"){F[1]=-1 1226}var D=F[1]?Number(F[1]):1; 1227var A=F[2]?Number(F[2]):0; 1228B="[((#{fragment} - #{b}) mod #{a} = 0) and ((#{fragment} - #{b}) div #{a} >= 0)]"; 1229return new Template(B).evaluate({fragment:E,a:D,b:A}) 1230}}}},criteria:{tagName:'n = h.tagName(n, r, "#{1}", c); c = false;',className:'n = h.className(n, r, "#{1}", c); c = false;',id:'n = h.id(n, r, "#{1}", c); c = false;',attrPresence:'n = h.attrPresence(n, r, "#{1}"); c = false;',attr:function(A){A[3]=(A[5]||A[6]); 1231return new Template('n = h.attr(n, r, "#{1}", "#{3}", "#{2}"); c = false;').evaluate(A) 1232},pseudo:function(A){if(A[6]){A[6]=A[6].replace(/"/g,'\\"') 1233}return new Template('n = h.pseudo(n, "#{1}", "#{6}", r, c); c = false;').evaluate(A) 1234},descendant:'c = "descendant";',child:'c = "child";',adjacent:'c = "adjacent";',laterSibling:'c = "laterSibling";'},patterns:{laterSibling:/^\s*~\s*/,child:/^\s*>\s*/,adjacent:/^\s*\+\s*/,descendant:/^\s/,tagName:/^\s*(\*|[\w\-]+)(\b|$)?/,id:/^#([\w\-\*]+)(\b|$)/,className:/^\.([\w\-\*]+)(\b|$)/,pseudo:/^:((first|last|nth|nth-last|only)(-child|-of-type)|empty|checked|(en|dis)abled|not)(\((.*?)\))?(\b|$|(?=\s)|(?=:))/,attrPresence:/^\[([\w]+)\]/,attr:/\[((?:[\w-]*:)?[\w-]+)\s*(?:([!^$*~|]?=)\s*((['"])([^\4]*?)\4|([^'"][^\]]*?)))?\]/},assertions:{tagName:function(A,B){return B[1].toUpperCase()==A.tagName.toUpperCase() 1235},className:function(A,B){return Element.hasClassName(A,B[1]) 1236},id:function(A,B){return A.id===B[1] 1237},attrPresence:function(A,B){return Element.hasAttribute(A,B[1]) 1238},attr:function(B,C){var A=Element.readAttribute(B,C[1]); 1239return Selector.operators[C[2]](A,C[3]) 1240}},handlers:{concat:function(B,A){for(var C=0,D; 1241D=A[C]; 1242C++){B.push(D) 1243}return B 1244},mark:function(A){for(var B=0,C; 1245C=A[B]; 1246B++){C._counted=true 1247}return A 1248},unmark:function(A){for(var B=0,C; 1249C=A[B]; 1250B++){C._counted=undefined 1251}return A 1252},index:function(A,D,G){A._counted=true; 1253if(D){for(var B=A.childNodes,E=B.length-1,C=1; 1254E>=0; 1255E--){var F=B[E]; 1256if(F.nodeType==1&&(!G||F._counted)){F.nodeIndex=C++ 1257}}}else{for(var E=0,C=1,B=A.childNodes; 1258F=B[E]; 1259E++){if(F.nodeType==1&&(!G||F._counted)){F.nodeIndex=C++ 1260}}}},unique:function(B){if(B.length==0){return B 1261}var D=[],E; 1262for(var C=0,A=B.length; 1263C<A; 1264C++){if(!(E=B[C])._counted){E._counted=true; 1265D.push(Element.extend(E)) 1266}}return Selector.handlers.unmark(D) 1267},descendant:function(A){var D=Selector.handlers; 1268for(var C=0,B=[],E; 1269E=A[C]; 1270C++){D.concat(B,E.getElementsByTagName("*")) 1271}return B 1272},child:function(A){var F=Selector.handlers; 1273for(var E=0,D=[],G; 1274G=A[E]; 1275E++){for(var B=0,C=[],H; 1276H=G.childNodes[B]; 1277B++){if(H.nodeType==1&&H.tagName!="!"){D.push(H) 1278}}}return D 1279},adjacent:function(A){for(var C=0,B=[],E; 1280E=A[C]; 1281C++){var D=this.nextElementSibling(E); 1282if(D){B.push(D) 1283}}return B 1284},laterSibling:function(A){var D=Selector.handlers; 1285for(var C=0,B=[],E; 1286E=A[C]; 1287C++){D.concat(B,Element.nextSiblings(E)) 1288}return B 1289},nextElementSibling:function(A){while(A=A.nextSibling){if(A.nodeType==1){return A 1290}}return null 1291},previousElementSibling:function(A){while(A=A.previousSibling){if(A.nodeType==1){return A 1292}}return null 1293},tagName:function(B,A,E,H){E=E.toUpperCase(); 1294var D=[],F=Selector.handlers; 1295if(B){if(H){if(H=="descendant"){for(var C=0,G; 1296G=B[C]; 1297C++){F.concat(D,G.getElementsByTagName(E)) 1298}return D 1299}else{B=this[H](B) 1300}if(E=="*"){return B 1301}}for(var C=0,G; 1302G=B[C]; 1303C++){if(G.tagName.toUpperCase()==E){D.push(G) 1304}}return D 1305}else{return A.getElementsByTagName(E) 1306}},id:function(B,A,H,F){var G=$(H),D=Selector.handlers; 1307if(!G){return[] 1308}if(!B&&A==document){return[G] 1309}if(B){if(F){if(F=="child"){for(var C=0,E; 1310E=B[C]; 1311C++){if(G.parentNode==E){return[G] 1312}}}else{if(F=="descendant"){for(var C=0,E; 1313E=B[C]; 1314C++){if(Element.descendantOf(G,E)){return[G] 1315}}}else{if(F=="adjacent"){for(var C=0,E; 1316E=B[C]; 1317C++){if(Selector.handlers.previousElementSibling(G)==E){return[G] 1318}}}else{B=D[F](B) 1319}}}}for(var C=0,E; 1320E=B[C]; 1321C++){if(E==G){return[G] 1322}}return[] 1323}return(G&&Element.descendantOf(G,A))?[G]:[] 1324},className:function(B,A,C,D){if(B&&D){B=this[D](B) 1325}return Selector.handlers.byClassName(B,A,C) 1326},byClassName:function(C,B,F){if(!C){C=Selector.handlers.descendant([B]) 1327}var H=" "+F+" "; 1328for(var E=0,D=[],G,A; 1329G=C[E]; 1330E++){A=G.className; 1331if(A.length==0){continue 1332}if(A==F||(" "+A+" ").include(H)){D.push(G) 1333}}return D 1334},attrPresence:function(C,B,A){if(!C){C=B.getElementsByTagName("*") 1335}var E=[]; 1336for(var D=0,F; 1337F=C[D];
1338D++){if(Element.hasAttribute(F,A)){E.push(F) 1339}}return E 1340},attr:function(A,H,G,I,B){if(!A){A=H.getElementsByTagName("*") 1341}var J=Selector.operators[B],D=[]; 1342for(var E=0,C; 1343C=A[E]; 1344E++){var F=Element.readAttribute(C,G); 1345if(F===null){continue 1346}if(J(F,I)){D.push(C) 1347}}return D 1348},pseudo:function(B,C,E,A,D){if(B&&D){B=this[D](B) 1349}if(!B){B=A.getElementsByTagName("*") 1350}return Selector.pseudos[C](B,E,A) 1351}},pseudos:{"first-child":function(B,F,A){for(var D=0,C=[],E; 1352E=B[D]; 1353D++){if(Selector.handlers.previousElementSibling(E)){continue 1354}C.push(E) 1355}return C 1356},"last-child":function(B,F,A){for(var D=0,C=[],E; 1357E=B[D]; 1358D++){if(Selector.handlers.nextElementSibling(E)){continue 1359}C.push(E) 1360}return C 1361},"only-child":function(B,G,A){var E=Selector.handlers; 1362for(var D=0,C=[],F; 1363F=B[D]; 1364D++){if(!E.previousElementSibling(F)&&!E.nextElementSibling(F)){C.push(F) 1365}}return C 1366},"nth-child":function(B,C,A){return Selector.pseudos.nth(B,C,A) 1367},"nth-last-child":function(B,C,A){return Selector.pseudos.nth(B,C,A,true) 1368},"nth-of-type":function(B,C,A){return Selector.pseudos.nth(B,C,A,false,true) 1369},"nth-last-of-type":function(B,C,A){return Selector.pseudos.nth(B,C,A,true,true) 1370},"first-of-type":function(B,C,A){return Selector.pseudos.nth(B,"1",A,false,true) 1371},"last-of-type":function(B,C,A){return Selector.pseudos.nth(B,"1",A,true,true) 1372},"only-of-type":function(B,D,A){var C=Selector.pseudos; 1373return C["last-of-type"](C["first-of-type"](B,D,A),D,A) 1374},getIndices:function(B,A,C){if(B==0){return A>0?[A]:[] 1375}return $R(1,C).inject([],function(D,E){if(0==(E-A)%B&&(E-A)/B>=0){D.push(E) 1376}return D 1377}) 1378},nth:function(A,L,N,K,C){if(A.length==0){return[] 1379}if(L=="even"){L="2n+0" 1380}if(L=="odd"){L="2n+1" 1381}var J=Selector.handlers,I=[],B=[],E; 1382J.mark(A); 1383for(var H=0,D; 1384D=A[H]; 1385H++){if(!D.parentNode._counted){J.index(D.parentNode,K,C); 1386B.push(D.parentNode) 1387}}if(L.match(/^\d+$/)){L=Number(L); 1388for(var H=0,D; 1389D=A[H]; 1390H++){if(D.nodeIndex==L){I.push(D) 1391}}}else{if(E=L.match(/^(-?\d*)?n(([+-])(\d+))?/)){if(E[1]=="-"){E[1]=-1 1392}var O=E[1]?Number(E[1]):1; 1393var M=E[2]?Number(E[2]):0; 1394var P=Selector.pseudos.getIndices(O,M,A.length); 1395for(var H=0,D,F=P.length; 1396D=A[H]; 1397H++){for(var G=0; 1398G<F; 1399G++){if(D.nodeIndex==P[G]){I.push(D) 1400}}}}}J.unmark(A); 1401J.unmark(B); 1402return I 1403},"empty":function(B,F,A){for(var D=0,C=[],E; 1404E=B[D]; 1405D++){if(E.tagName=="!"||(E.firstChild&&!E.innerHTML.match(/^\s*$/))){continue 1406}C.push(E) 1407}return C 1408},"not":function(A,D,I){var G=Selector.handlers,J,C; 1409var H=new Selector(D).findElements(I); 1410G.mark(H); 1411for(var F=0,E=[],B; 1412B=A[F]; 1413F++){if(!B._counted){E.push(B) 1414}}G.unmark(H); 1415return E 1416},"enabled":function(B,F,A){for(var D=0,C=[],E; 1417E=B[D]; 1418D++){if(!E.disabled){C.push(E) 1419}}return C 1420},"disabled":function(B,F,A){for(var D=0,C=[],E; 1421E=B[D]; 1422D++){if(E.disabled){C.push(E) 1423}}return C 1424},"checked":function(B,F,A){for(var D=0,C=[],E; 1425E=B[D]; 1426D++){if(E.checked){C.push(E) 1427}}return C 1428}},operators:{"=":function(B,A){return B==A 1429},"!=":function(B,A){return B!=A 1430},"^=":function(B,A){return B.startsWith(A) 1431},"$=":function(B,A){return B.endsWith(A) 1432},"*=":function(B,A){return B.include(A) 1433},"~=":function(B,A){return(" "+B+" ").include(" "+A+" ") 1434},"|=":function(B,A){return("-"+B.toUpperCase()+"-").include("-"+A.toUpperCase()+"-") 1435}},matchElements:function(F,G){var E=new Selector(G).findElements(),D=Selector.handlers; 1436D.mark(E); 1437for(var C=0,B=[],A; 1438A=F[C];
1439C++){if(A._counted){B.push(A) 1440}}D.unmark(E); 1441return B 1442},findElement:function(B,C,A){if(Object.isNumber(C)){A=C; 1443C=false 1444}return Selector.matchElements(B,C||"*")[A||0] 1445},findChildElements:function(E,G){var H=G.join(","),G=[]; 1446H.scan(/(([\w#:.~>+()\s-]+|\*|\[.*?\])+)\s*(,|$)/,function(I){G.push(I[1].strip()) 1447}); 1448var D=[],F=Selector.handlers; 1449for(var C=0,B=G.length,A; 1450C<B; 1451C++){A=new Selector(G[C].strip()); 1452F.concat(D,A.findElements(E)) 1453}return(B>1)?F.unique(D):D 1454}}); 1455function $$(){return Selector.findChildElements(document,$A(arguments)) 1456}var Form={reset:function(A){$(A).reset(); 1457return A 1458},serializeElements:function(G,B){if(typeof B!="object"){B={hash:!!B} 1459}else{if(B.hash===undefined){B.hash=true 1460}}var C,F,A=false,E=B.submit; 1461var D=G.inject({},function(H,I){if(!I.disabled&&I.name){C=I.name; 1462F=$(I).getValue(); 1463if(F!=null&&(I.type!="submit"||(!A&&E!==false&&(!E||C==E)&&(A=true)))){if(C in H){if(!Object.isArray(H[C])){H[C]=[H[C]] 1464}H[C].push(F) 1465}else{H[C]=F 1466}}}return H 1467}); 1468return B.hash?D:Object.toQueryString(D) 1469}}; 1470Form.Methods={serialize:function(B,A){return Form.serializeElements(Form.getElements(B),A) 1471},getElements:function(A){return $A($(A).getElementsByTagName("*")).inject([],function(B,C){if(Form.Element.Serializers[C.tagName.toLowerCase()]){B.push(Element.extend(C)) 1472}return B 1473}) 1474},getInputs:function(G,C,D){G=$(G); 1475var A=G.getElementsByTagName("input"); 1476if(!C&&!D){return $A(A).map(Element.extend) 1477}for(var E=0,H=[],F=A.length; 1478E<F; 1479E++){var B=A[E]; 1480if((C&&B.type!=C)||(D&&B.name!=D)){continue 1481}H.push(Element.extend(B)) 1482}return H 1483},disable:function(A){A=$(A); 1484Form.getElements(A).invoke("disable"); 1485return A 1486},enable:function(A){A=$(A); 1487Form.getElements(A).invoke("enable"); 1488return A 1489},findFirstElement:function(B){var C=$(B).getElements().findAll(function(D){return"hidden"!=D.type&&!D.disabled 1490}); 1491var A=C.findAll(function(D){return D.hasAttribute("tabIndex")&&D.tabIndex>=0 1492}).sortBy(function(D){return D.tabIndex 1493}).first(); 1494return A?A:C.find(function(D){return["input","select","textarea"].include(D.tagName.toLowerCase()) 1495}) 1496},focusFirstElement:function(A){A=$(A); 1497A.findFirstElement().activate(); 1498return A 1499},request:function(B,A){B=$(B),A=Object.clone(A||{}); 1500var D=A.parameters,C=B.readAttribute("action")||""; 1501if(C.blank()){C=window.location.href 1502}A.parameters=B.serialize(true); 1503if(D){if(Object.isString(D)){D=D.toQueryParams() 1504}Object.extend(A.parameters,D) 1505}if(B.hasAttribute("method")&&!A.method){A.method=B.method 1506}return new Ajax.Request(C,A) 1507}}; 1508Form.Element={focus:function(A){$(A).focus(); 1509return A 1510},select:function(A){$(A).select(); 1511return A 1512}}; 1513Form.Element.Methods={serialize:function(A){A=$(A); 1514if(!A.disabled&&A.name){var B=A.getValue(); 1515if(B!=undefined){var C={}; 1516C[A.name]=B; 1517return Object.toQueryString(C) 1518}}return"" 1519},getValue:function(A){A=$(A); 1520var B=A.tagName.toLowerCase(); 1521return Form.Element.Serializers[B](A) 1522},setValue:function(A,B){A=$(A); 1523var C=A.tagName.toLowerCase(); 1524Form.Element.Serializers[C](A,B); 1525return A 1526},clear:function(A){$(A).value=""; 1527return A 1528},present:function(A){return $(A).value!="" 1529},activate:function(A){A=$(A); 1530try{A.focus(); 1531if(A.select&&(A.tagName.toLowerCase()!="input"||!["button","reset","submit"].include(A.type))){A.select() 1532}}catch(B){}return A 1533},disable:function(A){A=$(A); 1534A.blur(); 1535A.disabled=true; 1536return A 1537},enable:function(A){A=$(A); 1538A.disabled=false; 1539return A 1540}}; 1541var Field=Form.Element; 1542var $F=Form.Element.Methods.getValue; 1543Form.Element.Serializers={input:function(A,B){switch(A.type.toLowerCase()){case"checkbox":case"radio":return Form.Element.Serializers.inputSelector(A,B); 1544default:return Form.Element.Serializers.textarea(A,B) 1545}},inputSelector:function(A,B){if(B===undefined){return A.checked?A.value:null 1546}else{A.checked=!!B 1547}},textarea:function(A,B){if(B===undefined){return A.value 1548}else{A.value=B 1549}},select:function(D,A){if(A===undefined){return this[D.type=="select-one"?"selectOne":"selectMany"](D) 1550}else{var C,F,G=!Object.isArray(A); 1551for(var B=0,E=D.length; 1552B<E; 1553B++){C=D.options[B]; 1554F=this.optionValue(C); 1555if(G){if(F==A){C.selected=true; 1556return 1557}}else{C.selected=A.include(F) 1558}}}},selectOne:function(B){var A=B.selectedIndex; 1559return A>=0?this.optionValue(B.options[A]):null 1560},selectMany:function(D){var A,E=D.length; 1561if(!E){return null 1562}for(var C=0,A=[]; 1563C<E; 1564C++){var B=D.options[C]; 1565if(B.selected){A.push(this.optionValue(B)) 1566}}return A 1567},optionValue:function(A){return Element.extend(A).hasAttribute("value")?A.value:A.text 1568}}; 1569Abstract.TimedObserver=Class.create(PeriodicalExecuter,{initialize:function($super,A,B,C){$super(C,B); 1570this.element=$(A); 1571this.lastValue=this.getValue() 1572},execute:function(){var A=this.getValue(); 1573if(Object.isString(this.lastValue)&&Object.isString(A)?this.lastValue!=A:String(this.lastValue)!=String(A)){this.callback(this.element,A); 1574this.lastValue=A 1575}}}); 1576Form.Element.Observer=Class.create(Abstract.TimedObserver,{getValue:function(){return Form.Element.getValue(this.element) 1577}}); 1578Form.Observer=Class.create(Abstract.TimedObserver,{getValue:function(){return Form.serialize(this.element) 1579}}); 1580Abstract.EventObserver=Class.create({initialize:function(A,B){this.element=$(A); 1581this.callback=B; 1582this.lastValue=this.getValue(); 1583if(this.element.tagName.toLowerCase()=="form"){this.registerFormCallbacks() 1584}else{this.registerCallback(this.element) 1585}},onElementEvent:function(){var A=this.getValue(); 1586if(this.lastValue!=A){this.callback(this.element,A); 1587this.lastValue=A 1588}},registerFormCallbacks:function(){Form.getElements(this.element).each(this.registerCallback,this) 1589},registerCallback:function(A){if(A.type){switch(A.type.toLowerCase()){case"checkbox":case"radio":Event.observe(A,"click",this.onElementEvent.bind(this)); 1590break; 1591default:Event.observe(A,"change",this.onElementEvent.bind(this)); 1592break 1593}}}}); 1594Form.Element.EventObserver=Class.create(Abstract.EventObserver,{getValue:function(){return Form.Element.getValue(this.element) 1595}}); 1596Form.EventObserver=Class.create(Abstract.EventObserver,{getValue:function(){return Form.serialize(this.element) 1597}}); 1598if(!window.Event){var Event={} 1599}Object.extend(Event,{KEY_BACKSPACE:8,KEY_TAB:9,KEY_RETURN:13,KEY_ESC:27,KEY_LEFT:37,KEY_UP:38,KEY_RIGHT:39,KEY_DOWN:40,KEY_DELETE:46,KEY_HOME:36,KEY_END:35,KEY_PAGEUP:33,KEY_PAGEDOWN:34,KEY_INSERT:45,cache:{},relatedTarget:function(B){var A; 1600switch(B.type){case"mouseover":A=B.fromElement; 1601break; 1602case"mouseout":A=B.toElement; 1603break; 1604default:return null 1605}return Element.extend(A) 1606}}); 1607Event.Methods=(function(){var A; 1608if(Prototype.Browser.IE){var B={0:1,1:4,2:2}; 1609A=function(D,C){return D.button==B[C] 1610} 1611}else{if(Prototype.Browser.WebKit){A=function(D,C){switch(C){case 0:return D.which==1&&!D.metaKey; 1612case 1:return D.which==1&&D.metaKey; 1613default:return false 1614}} 1615}else{A=function(D,C){return D.which?(D.which===C+1):(D.button===C) 1616} 1617}}return{isLeftClick:function(C){return A(C,0) 1618},isMiddleClick:function(C){return A(C,1) 1619},isRightClick:function(C){return A(C,2) 1620},element:function(D){var C=Event.extend(D).target; 1621return Element.extend(C.nodeType==Node.TEXT_NODE?C.parentNode:C) 1622},findElement:function(D,E){var C=Event.element(D); 1623return C.match(E)?C:C.up(E) 1624},pointer:function(C){return{x:C.pageX||(C.clientX+(document.documentElement.scrollLeft||document.body.scrollLeft)),y:C.pageY||(C.clientY+(document.documentElement.scrollTop||document.body.scrollTop))} 1625},pointerX:function(C){return Event.pointer(C).x 1626},pointerY:function(C){return Event.pointer(C).y 1627},stop:function(C){Event.extend(C); 1628C.preventDefault(); 1629C.stopPropagation(); 1630C.stopped=true 1631}} 1632})(); 1633Event.extend=(function(){var A=Object.keys(Event.Methods).inject({},function(B,C){B[C]=Event.Methods[C].methodize(); 1634return B 1635}); 1636if(Prototype.Browser.IE){Object.extend(A,{stopPropagation:function(){this.cancelBubble=true 1637},preventDefault:function(){this.returnValue=false 1638},inspect:function(){return"[object Event]" 1639}}); 1640return function(B){if(!B){return false 1641}if(B._extendedByPrototype){return B 1642}B._extendedByPrototype=Prototype.emptyFunction; 1643var C=Event.pointer(B); 1644Object.extend(B,{target:B.srcElement,relatedTarget:Event.relatedTarget(B),pageX:C.x,pageY:C.y}); 1645return Object.extend(B,A) 1646}
1646 1647}else{Event.prototype=Event.prototype||document.createEvent("HTMLEvents").__proto__; 1648Object.extend(Event.prototype,A); 1649return Prototype.K 1650}})(); 1651Event.getDOMEventName=function(A){if(A&&A.include(":")){return"dataavailable" 1652}return A 1653}; 1654Object.extend(Event,(function(){var C=Event.cache; 1655function D(H){if(H._eventID){return H._eventID 1656}arguments.callee.id=arguments.callee.id||1; 1657return H._eventID=++arguments.callee.id 1658}function E(H){return C[H]=C[H]||{} 1659}function F(J,H){var I=E(J); 1660return I[H]=I[H]||[] 1661}function A(I,H,J){var M=D(I); 1662var L=F(M,H); 1663if(L.pluck("handler").include(J)){return false 1664}var K=function(N){if(!Event||!Event.extend||(N.eventName&&N.eventName!=H)){return false 1665}Event.extend(N); 1666J.call(I,N) 1667}; 1668K.handler=J; 1669L.push(K); 1670return K 1671}function B(K,H,I){var J=F(K,H); 1672return J.find(function(L){return L.handler==I 1673}) 1674}function G(K,H,I){var J=E(K); 1675if(!J[H]){return false 1676}J[H]=J[H].without(B(K,H,I)) 1677}return{observe:function(J,H,K){J=$(J); 1678var I=Event.getDOMEventName(H); 1679var L=A(J,H,K); 1680if(!L){return J 1681}if(J.addEventListener){J.addEventListener(I,L,false) 1682}else{J.attachEvent("on"+I,L) 1683}return J 1684},stopObserving:function(J,H,K){J=$(J); 1685var M=D(J),I=Event.getDOMEventName(H); 1686if(!K&&H){F(M,H).each(function(N){J.stopObserving(H,N.handler) 1687}); 1688return J 1689}else{if(!H){Object.keys(E(M)).each(function(N){J.stopObserving(N) 1690}); 1691return J 1692}}var L=B(M,H,K); 1693if(!L){return J 1694}if(J.removeEventListener){J.removeEventListener(I,L,false) 1695}else{J.detachEvent("on"+I,L) 1696}G(M,H,K); 1697return J 1698},fire:function(J,I,H){J=$(J); 1699if(J==document&&document.createEvent&&!J.dispatchEvent){J=document.documentElement 1700}if(document.createEvent){var K=document.createEvent("HTMLEvents"); 1701K.initEvent("dataavailable",true,true) 1702}else{var K=document.createEventObject(); 1703K.eventType="ondataavailable" 1704}K.eventName=I; 1705K.memo=H||{}; 1706if(document.createEvent){J.dispatchEvent(K) 1707}else{J.fireEvent(K.eventType,K) 1708}return K 1709}} 1710})()); 1711Object.extend(Event,Event.Methods); 1712Element.addMethods({fire:Event.fire,observe:Event.observe,stopObserving:Event.stopObserving}); 1713Object.extend(document,{fire:Element.Methods.fire.methodize(),observe:Element.Methods.observe.methodize(),stopObserving:Element.Methods.stopObserving.methodize()}); 1714(function(){var C,B=false; 1715function A(){if(B){return 1716}if(C){window.clearInterval(C) 1717}document.fire("dom:loaded"); 1718B=true 1719}if(document.addEventListener){if(Prototype.Browser.WebKit){C=window.setInterval(function(){if(/loaded|complete/.test(document.readyState)){A() 1720}},0); 1721Event.observe(window,"load",A) 1722}else{document.addEventListener("DOMContentLoaded",A,false) 1723}}else{if(document.readyState!="complete"){document.write("<script id=__onDOMContentLoaded defer src=//:><\/script>"); 1724$("__onDOMContentLoaded").onreadystatechange=function(){if(this.readyState=="complete"){this.onreadystatechange=null; 1725A() 1726}} 1727}}})(); 1728Hash.toQueryString=Object.toQueryString; 1729var Toggle={display:Element.toggle}; 1730Element.Methods.childOf=Element.Methods.descendantOf; 1731var Insertion={Before:function(A,B){return Element.insert(A,{before:B}) 1732},Top:function(A,B){return Element.insert(A,{top:B}) 1733},Bottom:function(A,B){return Element.insert(A,{bottom:B}) 1734},After:function(A,B){return Element.insert(A,{after:B}) 1735}}; 1736var $continue=new Error('"throw $continue" is deprecated, use "return" instead'); 1737var Position={includeScrollOffsets:false,prepare:function(){this.deltaX=window.pageXOffset||document.documentElement.scrollLeft||document.body.scrollLeft||0; 1738this.deltaY=window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0 1739},within:function(B,A,C){if(this.includeScrollOffsets){return this.withinIncludingScrolloffsets(B,A,C) 1740}this.xcomp=A; 1741this.ycomp=C; 1742this.offset=Element.cumulativeOffset(B); 1743return(C>=this.offset[1]&&C<this.offset[1]+B.offsetHeight&&A>=this.offset[0]&&A<this.offset[0]+B.offsetWidth) 1744},withinIncludingScrolloffsets:function(B,A,D){var C=Element.cumulativeScrollOffset(B); 1745this.xcomp=A+C[0]-this.deltaX; 1746this.ycomp=D+C[1]-this.deltaY; 1747this.offset=Element.cumulativeOffset(B); 1748return(this.ycomp>=this.offset[1]&&this.ycomp<this.offset[1]+B.offsetHeight&&this.xcomp>=this.offset[0]&&this.xcomp<this.offset[0]+B.offsetWidth) 1749},overlap:function(B,A){if(!B){return 0 1750}if(B=="vertical"){return((this.offset[1]+A.offsetHeight)-this.ycomp)/A.offsetHeight 1751}if(B=="horizontal"){return((this.offset[0]+A.offsetWidth)-this.xcomp)/A.offsetWidth 1752}},cumulativeOffset:Element.Methods.cumulativeOffset,positionedOffset:Element.Methods.positionedOffset,absolutize:function(A){Position.prepare(); 1753return Element.absolutize(A) 1754},relativize:function(A){Position.prepare(); 1755return Element.relativize(A) 1756},realOffset:Element.Methods.cumulativeScrollOffset,offsetParent:Element.Methods.getOffsetParent,page:Element.Methods.viewportOffset,clone:function(B,C,A){A=A||{}; 1757return Element.clonePosition(C,B,A) 1758}}; 1759if(!document.getElementsByClassName){document.getElementsByClassName=function(B){function A(C){return C.blank()?null:"[contains(concat(' ', @class, ' '), ' "+C+" ')]" 1760}B.getElementsByClassName=Prototype.BrowserFeatures.XPath?function(C,E){E=E.toString().str
1760ip(); 1761var D=/\s/.test(E)?$w(E).map(A).join(""):A(E); 1762return D?document._getElementsByXPath(".//*"+D,C):[] 1763}:function(E,F){F=F.toString().strip(); 1764var G=[],H=(/\s/.test(F)?$w(F):null); 1765if(!H&&!F){return G 1766}var C=$(E).getElementsByTagName("*"); 1767F=" "+F+" "; 1768for(var D=0,J,I; 1769J=C[D]; 1770D++){if(J.className&&(I=" "+J.className+" ")&&(I.include(F)||(H&&H.all(function(K){return !K.toString().blank()&&I.include(" "+K+" ") 1771})))){G.push(Element.extend(J)) 1772}}return G 1773}; 1774return function(D,C){return $(C||document.body).getElementsByClassName(D) 1775} 1776}(Element.Methods) 1777}Element.ClassNames=Class.create(); 1778Element.ClassNames.prototype={initialize:function(A){this.element=$(A) 1779},_each:function(A){this.element.className.split(/\s+/).select(function(B){return B.length>0 1780})._each(A) 1781},set:function(A){this.element.className=A 1782},add:function(A){if(this.include(A)){return 1783}this.set($A(this).concat(A).join(" ")) 1784},remove:function(A){if(!this.include(A)){return 1785}this.set($A(this).without(A).join(" ")) 1786},toString:function(){return $A(this).join(" ") 1787}}; 1788Object.extend(Element.ClassNames.prototype,Enumerable); 1789Element.addMethods(); 1790if(!window.RichFaces){window.RichFaces={} 1791}if(!window.RichFaces.Memory){window.RichFaces.Memory={cleaners:{},addCleaner:function(A,B){this.cleaners[A]=B 1792},applyCleaners:function(B){for(var A in this.cleaners){this.cleaners[A](B) 1793}},clean:function(E){if(E){this.applyCleaners(E); 1794var B=E.all; 1795if(B){var A=0; 1796var D=B.length; 1797for(var A=0; 1798A<D; 1799A++){this.applyCleaners(B[A]) 1800}}else{var C=E.firstChild; 1801while(C){this.clean(C); 1802C=C.nextSibling 1803}}}}}; 1804window.RichFaces.Memory.addCleaner("richfaces",function(D){var B=D.component; 1805if(B){var C=B["rich:destructor"]; 1806if(C){var A=B[C]; 1807if(A){A.call(B) 1808}}}}); 1809if(window.attachEvent){window.attachEvent("onunload",function(){var A=window.RichFaces.Memory; 1810A.clean(document); 1811A.clean(window) 1812}) 1813}}Function.prototype.indexOf=function(){return -1 1814}; 1815Element.clearChildren=function(A){A=$(A); 1816while(A.firstChild){A.removeChild(A.firstChild) 1817}return A 1818}; 1819Element.isChildOf=function(B,A){while(B&&A!=B){B=B.parentNode 1820}return A==B 1821}; 1822if(typeof Node=="undefined"){Node={ELEMENT_NODE:1,ATTRIBUTE_NODE:2,TEXT_NODE:3,CDATA_SECTION_NODE:4,ENTITY_REFERENCE_NODE:5,ENTITY_NODE:6,PROCESSING_INSTRUCTION_NODE:7,COMMENT_NODE:8,DOCUMENT_NODE:9,DOCUMENT_TYPE_NODE:10,DOCUMENT_FRAGMENT_NODE:11,NOTATION_NODE:12} 1823}Element.isUninitialized=function(A){if(A){if(A.nodeType==Node.ELEMENT_NODE){if(!A.parentNode||A.document&&A.document.readyState=="uninitialized"){return true 1824}else{return !Element.descendantOf(A,document.documentElement) 1825}return false 1826}}}; 1827if(window.RichFaces&&window.RichFaces.Memory){window.RichFaces.Memory.addCleaner("prototype",function(E){var D=E._eventID; 1828if(D){var B=Event.cache[D]; 1829for(var A in B){var F=B[A]; 1830var C=Event.getDOMEventName(A); 1831F.each(function(G){if(E.removeEventListener){E.removeEventListener(C,G,false) 1832}else{E.detachEvent("on"+C,G) 1833}}); 1834B[A]=null 1835}delete Event.cache[D] 1836}}) 1837} 1838if(!window.A4J){window.A4J={} 1839}function Sarissa(){}Sarissa.VERSION="0.9.9.3"; 1840Sarissa.PARSED_OK="Document contains no parsing errors"; 1841Sarissa.PARSED_EMPTY="Document is empty"; 1842Sarissa.PARSED_UNKNOWN_ERROR="Not well-formed or other error"; 1843Sarissa.IS_ENABLED_TRANSFORM_NODE=false; 1844Sarissa.REMOTE_CALL_FLAG="gr.abiss.sarissa.REMOTE_CALL_FLAG"; 1845Sarissa._sarissa_iNsCounter=0; 1846Sarissa._SARISSA_IEPREFIX4XSLPARAM=""; 1847Sarissa._SARISSA_HAS_DOM_IMPLEMENTATION=document.implementation&&true; 1848Sarissa._SARISSA_HAS_DOM_CREATE_DOCUMENT=Sarissa._SARISSA_HAS_DOM_IMPLEMENTATION&&document.implementation.createDocument; 1849Sarissa._SARISSA_HAS_DOM_FEATURE=Sarissa._SARISSA_HAS_DOM_IMPLEMENTATION&&document.implementation.hasFeature; 1850Sarissa._SARISSA_IS_MOZ=Sarissa._SARISSA_HAS_DOM_CREATE_DOCUMENT&&Sarissa._SARISSA_HAS_DOM_FEATURE; 1851Sarissa._SARISSA_IS_SAFARI=navigator.userAgent.toLowerCase().indexOf("safari")!=-1||navigator.userAgent.toLowerCase().indexOf("konqueror")!=-1; 1852Sarissa._SARISSA_IS_SAFARI_OLD=Sarissa._SARISSA_IS_SAFARI&&(parseInt((navigator.userAgent.match(/AppleWebKit\/(\d+)/)||{})[1],10)<420); 1853Sarissa._SARISSA_IS_IE=document.all&&window.ActiveXObject&&navigator.userAgent.toLowerCase().indexOf("msie")>-1&&navigator.userAgent.toLowerCase().indexOf("opera")==-1; 1854Sarissa._SARISSA_IS_OPERA=navigator.userAgent.toLowerCase().indexOf("opera")!=-1; 1855if(!window.Node||!Node.ELEMENT_NODE){Node={ELEMENT_NODE:1,ATTRIBUTE_NODE:2,TEXT_NODE:3,CDATA_SECTION_NODE:4,ENTITY_REFERENCE_NODE:5,ENTITY_NODE:6,PROCESSING_INSTRUCTION_NODE:7,COMMENT_NODE:8,DOCUMENT_NODE:9,DOCUMENT_TYPE_NODE:10,DOCUMENT_FRAGMENT_NODE:11,NOTATION_NODE:12} 1856}if(Sarissa._SARISSA_IS_SAFARI_OLD){HTMLHtmlElement=document.createElement("html").constructor; 1857Node=HTMLElement={}; 1858HTMLElement.prototype=HTMLHtmlElement.__proto__.__proto__; 1859HTMLDocument=Document=document.constructor; 1860var x=new DOMParser(); 1861XMLDocument=x.constructor; 1862Element=x.parseFromString("<Single />","text/xml").documentElement.constructor; 1863x=null 1864}if(typeof XMLDocument=="undefined"&&typeof Document!="undefined"){XMLDocument=Document 1865}if(Sarissa._SARISSA_IS_IE){Sarissa._SARISSA_IEPREFIX4XSLPARAM="xsl:"; 1866var _SARISSA_DOM_PROGID=""; 1867var _SARISSA_XMLHTTP_PROGID=""; 1868var _SARISSA_DOM_XMLWRITER=""; 1869Sarissa.pickRecentProgID=function(E){var D=false,G; 1870var F; 1871for(var B=0; 1872B<E.length&&!D; 1873B++){try{var A=new ActiveXObject(E[B]); 1874F=E[B];
1875D=true 1876}catch(C){G=C 1877}}if(!D){throw"Could not retrieve a valid progID of Class: "+E[E.length-1]+". (original exception: "+G+")" 1878}E=null; 1879return F 1880}; 1881_SARISSA_DOM_PROGID=null; 1882_SARISSA_THREADEDDOM_PROGID=null; 1883_SARISSA_XSLTEMPLATE_PROGID=null; 1884_SARISSA_XMLHTTP_PROGID=null; 1885XMLHttpRequest=function(){if(!_SARISSA_XMLHTTP_PROGID){_SARISSA_XMLHTTP_PROGID=Sarissa.pickRecentProgID(["Msxml2.XMLHTTP.6.0","MSXML2.XMLHTTP.3.0","MSXML2.XMLHTTP","Microsoft.XMLHTTP"]) 1886}return new ActiveXObject(_SARISSA_XMLHTTP_PROGID) 1887}; 1888Sarissa.getDomDocument=function(D,C){if(!_SARISSA_DOM_PROGID){_SARISSA_DOM_PROGID=Sarissa.pickRecentProgID(["Msxml2.DOMDocument.6.0","Msxml2.DOMDocument.3.0","MSXML2.DOMDocument","MSXML.DOMDocument","Microsoft.XMLDOM"]) 1889}var A=new ActiveXObject(_SARISSA_DOM_PROGID); 1890if(C){var B=""; 1891if(D){if(C.indexOf(":")>1){B=C.substring(0,C.indexOf(":")); 1892C=C.substring(C.indexOf(":")+1) 1893}else{B="a"+(Sarissa._sarissa_iNsCounter++) 1894}}if(D){A.loadXML("<"+B+":"+C+" xmlns:"+B+'="'+D+'" />') 1895}else{A.loadXML("<"+C+" />") 1896}}return A 1897}; 1898Sarissa.getParseErrorText=function(A){var C=Sarissa.PARSED_OK; 1899if(A&&A.parseError&&A.parseError.errorCode&&A.parseError.errorCode!=0){C="XML Parsing Error: "+A.parseError.reason+"\nLocation: "+A.parseError.url+"\nLine Number "+A.parseError.line+", Column "+A.parseError.linepos+":\n"+A.parseError.srcText+"\n"; 1900for(var B=0; 1901B<A.parseError.linepos; 1902B++){C+="-" 1903}C+="^\n" 1904}else{if(A.documentElement===null){C=Sarissa.PARSED_EMPTY 1905}}return C 1906}; 1907Sarissa.setXpathNamespaces=function(A,B){A.setProperty("SelectionLanguage","XPath"); 1908A.setProperty("SelectionNamespaces",B) 1909}; 1910XSLTProcessor=function(){if(!_SARISSA_XSLTEMPLATE_PROGID){_SARISSA_XSLTEMPLATE_PROGID=Sarissa.pickRecentProgID(["Msxml2.XSLTemplate.6.0","MSXML2.XSLTemplate.3.0"]) 1911}this.template=new ActiveXObject(_SARISSA_XSLTEMPLATE_PROGID); 1912this.processor=null 1913}; 1914XSLTProcessor.prototype.importStylesheet=function(D){if(!_SARISSA_THREADEDDOM_PROGID){_SARISSA_THREADEDDOM_PROGID=Sarissa.pickRecentProgID(["MSXML2.FreeThreadedDOMDocument.6.0","MSXML2.FreeThreadedDOMDocument.3.0"]) 1915}D.setProperty("SelectionLanguage","XPath"); 1916D.setProperty("SelectionNamespaces","xmlns:xsl='http://www.w3.org/1999/XSL/Transform'"); 1917var C=new ActiveXObject(_SARISSA_THREADEDDOM_PROGID); 1918try{C.resolveExternals=true; 1919C.setProperty("AllowDocumentFunction",true) 1920}catch(B){}if(D.url&&D.selectSingleNode("//xsl:*[local-name() = 'import' or local-name() = 'include']")!=null){C.async=false; 1921C.load(D.url) 1922}else{C.loadXML(D.xml) 1923}C.setProperty("SelectionNamespaces","xmlns:xsl='http://www.w3.org/1999/XSL/Transform'"); 1924var A=C.selectSingleNode("//xsl:output"); 1925if(A){this.outputMethod=A.getAttribute("method") 1926}else{delete this.outputMethod 1927}this.template.stylesheet=C; 1928this.processor=this.template.createProcessor(); 1929this.paramsSet=[] 1930}; 1931XSLTProcessor.prototype.transformToDocument=function(C){var B; 1932if(_SARISSA_THREADEDDOM_PROGID){this.processor.input=C; 1933B=new ActiveXObject(_SARISSA_DOM_PROGID); 1934this.processor.output=B; 1935this.processor.transform(); 1936return B 1937}else{if(!_SARISSA_DOM_XMLWRITER){_SARISSA_DOM_XMLWRITER=Sarissa.pickRecentProgID(["Msxml2.MXXMLWriter.6.0","Msxml2.MXXMLWriter.3.0","MSXML2.MXXMLWriter","MSXML.MXXMLWriter","Microsoft.XMLDOM"]) 1938}this.processor.input=C; 1939B=new ActiveXObject(_SARISSA_DOM_XMLWRITER); 1940this.processor.output=B; 1941this.processor.transform(); 1942var A=new ActiveXObject(_SARISSA_DOM_PROGID); 1943A.loadXML(B.output+""); 1944return A 1945}}; 1946XSLTProcessor.prototype.transformToFragment=function(G,D){this.processor.input=G; 1947this.processor.transform(); 1948var E=this.processor.output; 1949var F=D.createDocumentFragment(); 1950var B; 1951if(this.outputMethod=="text"){F.appendChild(D.createTextNode(E)) 1952}else{if(D.body&&D.body.innerHTML){B=D.createElement("div"); 1953B.innerHTML=E; 1954while(B.hasChildNodes()){F.appendChild(B.firstChild) 1955}}else{var A=new ActiveXObject(_SARISSA_DOM_PROGID); 1956if(E.substring(0,5)=="<?xml"){E=E.substring(E.indexOf("?>")+2) 1957}var C="".concat("<my>",E,"</my>"); 1958A.loadXML(C); 1959B=A.documentElement; 1960while(B.hasChildNodes()){F.appendChild(B.firstChild) 1961}}}return F 1962}; 1963XSLTProcessor.prototype.setParameter=function(C,A,B){B=B?B:""; 1964if(C){this.processor.addParameter(A,B,C) 1965}else{this.processor.addParameter(A,B) 1966}C=""+(C||""); 1967if(!this.paramsSet[C]){this.paramsSet[C]=[] 1968}this.paramsSet[C][A]=B 1969}; 1970XSLTProcessor.prototype.getParameter=function(B,A){B=""+(B||""); 1971if(this.paramsSet[B]&&this.paramsSet[B][A]){return this.paramsSet[B][A] 1972}else{return null 1973}}; 1974XSLTProcessor.prototype.clearParameters=function(){for(var B in this.paramsSet){for(var A in this.paramsSet[B]){if(B!=""){this.processor.addParameter(A,"",B) 1975}else{this.processor.addParameter(A,"") 1976}}}this.paramsSet=[] 1977} 1978}else{if(Sarissa._SARISSA_HAS_DOM_CREATE_DOCUMENT){Sarissa.__handleLoad__=function(A){Sarissa.__setReadyState__(A,4) 1979}; 1980_sarissa_XMLDocument_onload=function(){Sarissa.__handleLoad__(this) 1981}; 1982Sarissa.__setReadyState__=function(A,B){A.readyState=B; 1983A.readystate=B; 1984if(A.onreadystatechange!=null&&typeof A.onreadystatechange=="function"){A.onreadystatechange() 1985}}; 1986Sarissa.getDomDocument=function(C,B){var A=document.implementation.createDocument(C?C:null,B?B:null,null); 1987if(!A.onreadystatechange){A.onreadystatechange=null 1988}if(!A.readyState){A.readyState=0 1989}A.addEventListener("load",_sarissa_XMLDocument_onload,false); 1990return A 1991}; 1992if(window.XMLDocument){}else{if(Sarissa._SARISSA_HAS_DOM_FEATURE&&window.Document&&!Document.prototype.load&&document.implementation.hasFeature("LS","3.0")){Sarissa.getDomDocument=function(C,B){var A=document.implementation.createDocument(C?C:null,B?B:null,null); 1993return A 1994} 1995}else{Sarissa.getDomDocument=function(C,B){var A=document.implementation.createDocument(C?C:null,B?B:null,null); 1996if(A&&(C||B)&&!A.documentElement){A.appendChild(A.createElementNS(C,B)) 1997}return A 1998} 1999}}}}if(!window.DOMParser){if(Sarissa._SARISSA_IS_SAFARI){DOMParser=function(){}; 2000DOMParser.prototype.parseFromString=function(B,C){var A=new XMLHttpRequest(); 2001A.open("GET","data:text/xml;charset=utf-8,"+encodeURIComponent(B),false); 2002A.send(null); 2003return A.responseXML 2004} 2005}else{if(Sarissa.getDomDocument&&Sarissa.getDomDocument()&&Sarissa.getDomDocument(null,"bar").xml){DOMParser=function(){}; 2006DOMParser.prototype.parseFromString=function(A,C){var B=Sarissa.getDomDocument(); 2007B.loadXML(A); 2008return B 2009} 2010}}}if((typeof (document.importNode)=="undefined")&&Sarissa._SARISSA_IS_IE){try{document.importNode=function(D,C){var B; 2011if(D.nodeName=="#text"){return document.createTextNode(D.data) 2012}else{var A=false; 2013if(D.nodeName=="tbody"&&D.parentNode){D=D.parentNode; 2014A=true 2015}else{if(D.nodeName=="tbody"||D.nodeName=="tr"){B=document.createElement("tr") 2016}else{if(D.nodeName=="td"){B=document.createElement("tr") 2017}else{if(D.nodeName=="option"){B=document.createElement("select") 2018}}}}if(!B){B=document.createElement("div") 2019}if(C){B.innerHTML=D.xml?D.xml:D.outerHTML 2020}else{B.innerHTML=D.xml?D.cloneNode(false).xml:D.cloneNode(false).outerHTML 2021}if(A){return B.firstChild.tBodies[0] 2022}else{return B.getElementsByTagName("*")[0] 2023}}} 2024}catch(e){}}if(!Sarissa.getParseErrorText){Sarissa.getParseErrorText=function(A){var
2024C=Sarissa.PARSED_OK; 2025if(!A.documentElement){C=Sarissa.PARSED_EMPTY 2026}else{if(A.documentElement.tagName=="parsererror"){C=A.documentElement.firstChild.data; 2027C+="\n"+A.documentElement.firstChild.nextSibling.firstChild.data 2028}else{if(A.getElementsByTagName("parsererror").length>0){var B=A.getElementsByTagName("parsererror")[0]; 2029C=Sarissa.getText(B,true)+"\n" 2030}else{if(A.parseError&&A.parseError.errorCode!=0){C=Sarissa.PARSED_UNKNOWN_ERROR 2031}}}}return C 2032} 2033}Sarissa.getText=function(G,B){var E=""; 2034var C=G.childNodes; 2035for(var D=0; 2036D<C.length; 2037D++){var F=C[D]; 2038var A=F.nodeType; 2039if(A==Node.TEXT_NODE||A==Node.CDATA_SECTION_NODE){E+=F.data 2040}else{if(B===true&&(A==Node.ELEMENT_NODE||A==Node.DOCUMENT_NODE||A==Node.DOCUMENT_FRAGMENT_NODE)){E+=Sarissa.getText(F,true) 2041}}}return E 2042}; 2043if(!window.XMLSerializer&&Sarissa.getDomDocument&&Sarissa.getDomDocument("","foo",null).xml){XMLSerializer=function(){}; 2044XMLSerializer.prototype.serializeToString=function(A){return A.xml 2045} 2046}Sarissa.stripTags=function(A){return A?A.replace(/<[^>]+>/g,""):A 2047}; 2048Sarissa.clearChildNodes=function(A){while(A.firstChild){A.removeChild(A.firstChild) 2049}}; 2050Sarissa.copyChildNodes=function(D,E,F){if(Sarissa._SARISSA_IS_SAFARI&&E.nodeType==Node.DOCUMENT_NODE){E=E.documentElement 2051}if((!D)||(!E)){throw"Both source and destination nodes must be provided" 2052}if(!F){Sarissa.clearChildNodes(E) 2053}var B=E.nodeType==Node.DOCUMENT_NODE?E:E.ownerDocument; 2054var A=D.childNodes; 2055var C; 2056if(typeof (B.importNode)!="undefined"){for(C=0; 2057C<A.length; 2058C++){E.appendChild(B.importNode(A[C],true)) 2059}}else{for(C=0; 2060C<A.length; 2061C++){E.appendChild(A[C].cloneNode(true)) 2062}}}; 2063Sarissa.moveChildNodes=function(D,E,F){if((!D)||(!E)){throw"Both source and destination nodes must be provided" 2064}if(!F){Sarissa.clearChildNodes(E) 2065}var A=D.childNodes; 2066if(D.ownerDocument==E.ownerDocument){while(D.firstChild){E.appendChild(D.firstChild) 2067}}else{var B=E.nodeType==Node.DOCUMENT_NODE?E:E.ownerDocument; 2068var C; 2069if(typeof (B.importNode)!="undefined"){for(C=0; 2070C<A.length; 2071C++){E.appendChild(B.importNode(A[C],true)) 2072}}else{for(C=0; 2073C<A.length; 2074C++){E.appendChild(A[C].cloneNode(true)) 2075}}Sarissa.clearChildNodes(D) 2076}}; 2077Sarissa.xmlize=function(E,G,D){D=D?D:""; 2078var F=D+"<"+G+">"; 2079var B=false; 2080if(!(E instanceof Object)||E instanceof Number||E instanceof String||E instanceof Boolean||E instanceof Date){F+=Sarissa.escape(""+E); 2081B=true 2082}else{F+="\n"; 2083var A=E instanceof Array; 2084for(var C in E){F+=Sarissa.xmlize(E[C],(A?'array-item key="'+C+'"':C),D+" ") 2085}F+=D 2086}return(F+=(G.indexOf(" ")!=-1?"</array-item>\n":"</"+G+">\n")) 2087}; 2088Sarissa.escape=function(A){return A.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'") 2089}; 2090Sarissa.unescape=function(A){return A.replace(/'/g,"'").replace(/"/g,'"').replace(/>/g,">").replace(/</g,"<").replace(/&/g,"&") 2091}; 2092Sarissa.updateCursor=function(B,A){if(B&&B.style&&B.style.cursor!=undefined){B.style.cursor=A 2093}}; 2094Sarissa.updateContentFromURI=function(C,H,A,G,E){try{Sarissa.updateCursor(H,"wait"); 2095var B=new XMLHttpRequest(); 2096B.open("GET",C,true); 2097B.onreadystatechange=function(){if(B.readyState==4){try{var I=B.responseXML; 2098if(I&&Sarissa.getParseErrorText(I)==Sarissa.PARSED_OK){Sarissa.updateContentFromNode(B.responseXML,H,A); 2099G(C,H) 2100}else{throw Sarissa.getParseErrorText(I) 2101}}catch(J){if(G){G(C,H,J) 2102}else{throw J 2103}}}}; 2104if(E){var F="Sat, 1 Jan 2000 00:00:00 GMT"; 2105B.setRequestHeader("If-Modified-Since",F) 2106}B.send("") 2107}catch(D){Sarissa.updateCursor(H,"auto"); 2108if(G){G(C,H,D) 2109}else{throw D 2110}}}; 2111Sarissa.updateContentFromNode=function(E,F,A){try{Sarissa.updateCursor(F,"wait"); 2112Sarissa.clearChildNodes(F); 2113var B=E.nodeType==Node.DOCUMENT_NODE?E:E.ownerDocument; 2114if(B.parseError&&B.parseError.errorCode!=0){var D=document.createElement("pre"); 2115D.appendChild(document.createTextNode(Sarissa.getParseErrorText(B))); 2116F.appendChild(D) 2117}else{if(A){E=A.transformToDocument(E) 2118}if(F.tagName.toLowerCase()=="textarea"||F.tagName.toLowerCase()=="input"){F.value=new XMLSerializer().serializeToString(E) 2119}else{if(E.nodeType==Node.DOCUMENT_NODE||E.ownerDocument.documentElement==E){F.innerHTML=new XMLSerializer().serializeToString(E) 2120}else{F.appendChild(F.ownerDocument.importNode(E,true)) 2121}}}}catch(C){throw C 2122}finally{Sarissa.updateCursor(F,"auto") 2123}}; 2124Sarissa.formToQueryString=function(G){var A=""; 2125for(var F=0; 2126F<G.elements.length; 2127F++){var E=G.elements[F]; 2128var D=E.getAttribute("name")?E.getAttribute("name"):E.getAttribute("id"); 2129if(D&&((!E.disabled)||E.type=="hidden")){switch(E.type){case"hidden":case"text":case"textarea":case"password":A+=D+"="+encodeURIComponent(E.value)+"&"; 2130break; 2131case"select-one":A+=D+"="+encodeURIComponent(E.options[E.selectedIndex].value)+"&"; 2132break; 2133case"select-multiple":for(var C=0; 2134C<E.length; 2135C++){var B=E.options[C]; 2136if(B.selected===true){A+=D+"[]="+encodeURIComponent(B.value)+"&" 2137}}break; 2138case"checkbox":case"radio":if(E.checked){A+=D+"="+encodeURIComponent(E.value)+"&" 2139}break 2140}}}
2140return A.substr(0,A.length-1) 2141}; 2142Sarissa.updateContentFromForm=function(F,H,A,G){try{Sarissa.updateCursor(H,"wait"); 2143var E=Sarissa.formToQueryString(F)+"&"+Sarissa.REMOTE_CALL_FLAG+"=true"; 2144var B=new XMLHttpRequest(); 2145var C=F.getAttribute("method")&&F.getAttribute("method").toLowerCase()=="get"; 2146if(C){B.open("GET",F.getAttribute("action")+"?"+E,true) 2147}else{B.open("POST",F.getAttribute("action"),true); 2148B.setRequestHeader("Content-type","application/x-www-form-urlencoded"); 2149B.setRequestHeader("Content-length",E.length); 2150B.setRequestHeader("Connection","close") 2151}B.onreadystatechange=function(){try{if(B.readyState==4){var I=B.responseXML; 2152if(I&&Sarissa.getParseErrorText(I)==Sarissa.PARSED_OK){Sarissa.updateContentFromNode(B.responseXML,H,A); 2153G(F,H) 2154}else{throw Sarissa.getParseErrorText(I) 2155}}}catch(J){if(G){G(F,H,J) 2156}else{throw J 2157}}}; 2158B.send(C?"":E) 2159}catch(D){Sarissa.updateCursor(H,"auto"); 2160if(G){G(F,H,D) 2161}else{throw D 2162}}return false 2163}; 2164A4J.AJAX={}; 2165A4J.AJAX.XMLHttpRequest=function(A){this._query=A; 2166this._documentElement=window.document.documentElement 2167}; 2168A4J.AJAX.XMLHttpRequest.prototype={_query:null,_timeout:0,_timeoutID:null,onready:null,_parsingStatus:Sarissa.PARSED_EMPTY,_errorMessage:"XML Response object not set",_contentType:null,_onerror:function(C,A,B){if(A!=599&&C.getResponseText()){A4J.AJAX.replacePage(C) 2169}},onfinish:null,options:{},domEvt:null,form:null,_request:null,_aborted:false,_documentElement:null,setRequestTimeout:function(A){this._timeout=A 2170},send:function(){this._request=new XMLHttpRequest(); 2171var C=this; 2172this._request.onreadystatechange=function(){if(window.document.documentElement!=C._documentElement){LOG.warn("Page for current request have been unloaded - abort processing"); 2173C.abort(); 2174return 2175}if(C._aborted){return 2176}LOG.debug("Reqest state : "+C._request.readyState); 2177if(C._request.readyState==4){LOG.debug("Reqest end with state 4"); 2178if(C._timeoutID){window.clearTimeout(C._timeoutID) 2179}var F; 2180var D; 2181try{F=C._request.status; 2182D=C._request.statusText 2183}catch(E){LOG.error("request don't have status code - network problem, "+E.message); 2184F=599; 2185D="Network error" 2186}if(F==200){try{LOG.debug("Response with content-type: "+C.getResponseHeader("Content-Type")); 2187LOG.debug("Full response content: ",C.getResponseText()) 2188}catch(E){}if(C._request.responseXML){C._parsingStatus=Sarissa.getParseErrorText(C._request.responseXML); 2189if(C._parsingStatus==Sarissa.PARSED_OK&&Sarissa.setXpathNamespaces){Sarissa.setXpathNamespaces(C._request.responseXML,"xmlns='http://www.w3.org/1999/xhtml'") 2190}}if(C.onready){C.onready(C) 2191}}else{C._errorMessage="Reqest error, status : "+F+" "+D; 2192LOG.error(C._errorMessage); 2193if(typeof (C._onerror)=="function"){C._onerror(C,F,C._errorMessage) 2194}if(C.onfinish){C.onfinish(C) 2195}}C=undefined 2196}}; 2197try{LOG.debug("Start XmlHttpRequest"); 2198this._request.open("POST",this._query.getActionUrl(""),true); 2199var B="application/x-www-form-urlencoded; charset=UTF-8"; 2200this._request.setRequestHeader("Content-Type",B) 2201}catch(A){LOG.debug("XmlHttpRequest not support setRequestHeader - use GET instead of POST"); 2202this._request.open("GET",this._query.getActionUrl("")+"?"+this._query.getQueryString(),true) 2203}this._request.send(this._query.getQueryString()); 2204if(this._timeout>0){this._timeoutID=window.setTimeout(function(){LOG.warn("request stopped due to timeout"); 2205if(!C._aborted){A4J.AJAX.status(C.containerId,C.options.status,false); 2206if(typeof (A4J.AJAX.onAbort)=="function"){A4J.AJAX.onAbort(C) 2207}}C._aborted=true; 2208C._request.abort(); 2209if(C._onerror){C._errorMessage="Request timeout"; 2210C._onerror(C,500,C._errorMessage) 2211}if(C.onfinish){C.onfinish(C) 2212}C._request=undefined; 2213C=undefined 2214},this._timeout) 2215}},abort:function(){if(!this._aborted){A4J.AJAX.status(this.containerId,this.options.status,false); 2216if(typeof (A4J.AJAX.onAbort)=="function"){A4J.AJAX.onAbort(this) 2217}}this._aborted=true; 2218if(this._request){try{if(this._timeoutID){window.clearTimeout(this._timeoutID) 2219}}catch(A){LOG.warn("Exception for abort current request "+A.Message) 2220}}},getResponseText:function(){try{return this._request.responseText 2221}catch(A){return null 2222}},getError:function(){return this._errorMessage 2223},getParserStatus:function(){return this._parsingStatus 2224},getContentType:function(){if(!this._contentType){var B=this.getResponseHeader("Content-Type"); 2225if(B){var A=B.indexOf(";"); 2226if(A>=0){this._contentType=B.substring(0,A) 2227}else{this._contentType=B 2228}}else{this._contentType="text/html" 2229}}return this._contentType 2230},getResponseHeader:function(B){var A; 2231try{A=this._request.getResponseHeader(B); 2232if(A===""){A=undefined 2233}}catch(E){}if(!A){LOG.debug("Header "+B+" not found, search in <meta>"); 2234if(this._parsingStatus==Sarissa.PARSED_OK){var F=this.getElementsByTagName("meta"); 2235for(var C=0; 2236C<F.length; 2237C++){var D=F[C]; 2238LOG.debug("Find <meta name='"+D.getAttribute("name")+"' content='"+D.getAttribute("content")+"'>"); 2239if(D.getAttribute("name")==B){A=D.getAttribute("content"); 2240break 2241}}}}return A 2242},getElementsByTagName:function(A,C){if(!C){C=this._request.responseXML 2243}LOG.debug("search for elements by name '"+A+"' in element "+C.nodeName); 2244var E; 2245try{E=C.selectNodes('.//*[local-name()="'+A+'"]') 2246}catch(B){try{E=C.getElementsByTagName(A) 2247}catch(D){LOG.debug("getElementsByTagName found no elements, "+D.Message) 2248}}return E 2249},getElementById:function(B){var A=this._request.responseXML; 2250if(A){if(typeof (A.getElementById)!="undefined"){LOG.debug("call getElementById for id= "+B); 2251return A.getElementById(B) 2252}else{if(typeof (A.selectSingleNode)!="undefined"){LOG.debug("call selectSingleNode for id= "+B);
2253return A.selectSingleNode("//*[@id='"+B+"']") 2254}else{if(typeof (A.nodeFromID)!="undefined"){LOG.debug("call nodeFromID for id= "+B); 2255return A.nodeFromID(B) 2256}}}LOG.error("No functions for getElementById found ") 2257}else{LOG.debug("No parsed XML document in response") 2258}return null 2259},getJSON:function(id){var data; 2260var dataElement=this.getElementById(id); 2261if(dataElement){try{data=Sarissa.getText(dataElement,true); 2262data=window.eval("("+data+")") 2263}catch(e){LOG.error("Error on parsing JSON data "+e.message,data) 2264}}return data 2265},evalScripts:function(node,isLast){var newscripts=this.getElementsByTagName("script",node); 2266LOG.debug("Scripts in updated part count : "+newscripts.length); 2267if(newscripts.length>0){var _this=this; 2268window.setTimeout(function(){for(var i=0; 2269i<newscripts.length; 2270i++){var includeComments=!A4J.AJAX.isXhtmlScriptMode(); 2271var newscript=A4J.AJAX.getText(newscripts[i],includeComments); 2272try{LOG.debug("Evaluate script replaced area in document: ",newscript); 2273if(window.execScript){window.execScript(newscript) 2274}else{window.eval(newscript) 2275}}catch(e){LOG.error("ERROR Evaluate script: Error name: "+e.name+e.message?". Error message: "+e.message:"") 2276}}newscripts=null; 2277if(isLast){_this.doFinish(); 2278_this=undefined 2279}},0) 2280}else{if(isLast){this.doFinish() 2281}}},updatePagePart:function(G,D){var C=this.getElementById(G); 2282if(!C){LOG.error("New node for ID "+G+" is not present in response"); 2283if(D){this.doFinish() 2284}return 2285}var A=window.document.getElementById(G); 2286if(A){if(window.RichFaces&&window.RichFaces.Memory){window.RichFaces.Memory.clean(A) 2287}var B=A.parentNode; 2288if(!window.opera&&A.outerHTML&&!A.tagName.match(/(tbody|thead|tfoot|tr|th|td)/i)){LOG.debug("Replace content of node by outerHTML()"); 2289try{A.innerHTML="" 2290}catch(F){LOG.error("Error to clear node content by innerHTML "+F.message); 2291Sarissa.clearChildNodes(A) 2292}A.outerHTML=new XMLSerializer().serializeToString(C) 2293}else{var E; 2294Sarissa.clearChildNodes(A); 2295E=window.document.importNode(C,true); 2296LOG.debug("Replace content of node by replaceChild()"); 2297B.replaceChild(E,A) 2298}if(!A4J.AJAX._scriptEvaluated){this.evalScripts(C,D) 2299}LOG.debug("Update part of page for Id: "+G+" successful") 2300}else{LOG.warn("Node for replace by response with id "+G+" not found in document"); 2301if(!A4J.AJAX._scriptEvaluated&&D){this.doFinish() 2302}}if(A4J.AJAX._scriptEvaluated&&D){this.doFinish() 2303}},doFinish:function(){if(this.onfinish){this.onfinish(this) 2304}},appendNewHeadElements:function(F){var C=this._appendNewElements("script","src",null,null,["type","language","charset"]); 2305var E=this; 2306C.concat(this._appendNewElements("link","href","class",["component","user"],["type","rev","media"],{"class":"className"},function(H,G){E._copyAttribute(H,G,"rel") 2307})); 2308if(C.length==0){F(); 2309return 2310}A4J.AJAX.headElementsCounter=C.length; 2311var A=function(){if(this.readyState=="loaded"||this.readyState=="complete"){this.onreadystatechange=null; 2312this.onload=null; 2313F() 2314}}; 2315var D=function(){this.onreadystatechange=null; 2316this.onload=null; 2317F() 2318}; 2319for(var B=0; 2320B<C.length; 2321B++){C[B].onreadystatechange=A; 2322C[B].onload=D 2323}},_appendNewElements:function(W,Q,X,N,J,B,D){var E=document.getElementsByTagName("head")[0]||document.documentElement; 2324var C=this.getElementsByTagName(W); 2325var L=document.getElementsByTagName(W); 2326var F=(B&&B[X])||X; 2327var M=[]; 2328var R={}; 2329if(N){var P=0; 2330for(var O=0; 2331O<L.length; 2332O++){var G=L[O]; 2333var S=G[F]; 2334for(; 2335P<N.length&&N[P]!=S; 2336P++){R[N[P]]=G 2337}if(P==N.length){break 2338}}}for(var P=0; 2339P<C.length; 2340P++){var A=C[P]; 2341var H=A.getAttribute(Q); 2342var K; 2343if(N){K=A.getAttribute(X) 2344}if(H){var U=false; 2345LOG.debug("<"+W+"> in response with src="+H); 2346for(var O=0; 2347O<L.length; 2348O++){if(this._noSessionHref(H)==this._noSessionHref(L[O].getAttribute(Q))){LOG.debug("Such element exist in document"); 2349if(X){var V=L[O][F]; 2350if((!K^!V)||(K&&V&&K!=V)){LOG.warn("Roles are different") 2351}}U=true; 2352break 2353}}if(!U){var T=document.createElement(W); 2354T.setAttribute(Q,H); 2355for(var O=0; 2356O<J.length; 2357O++){this._copyAttribute(A,T,J[O]) 2358}if(K){T[F]=K 2359}LOG.debug("append element to document"); 2360for(var O=0; 2361O<A4J.AJAX._headTransformers.length; 2362O++){A4J.AJAX._headTransformers[O](T) 2363}var I=R[K]; 2364if(I&&I.parentNode){I.parentNode.insertBefore(T,I) 2365}else{E.appendChild(T) 2366}if(D){D(A,T) 2367}if(W!="link"||T.type.toLowerCase()=="text/javascript"){M.push(T) 2368}}}}return M 2369},_noSessionHref:function(A){var B=A; 2370if(A){var C=A.lastIndexOf(";jsessionid="); 2371if(C>0){B=A.substring(0,C); 2372var D=A.lastIndexOf("?"); 2373if(D>C){B=B+A.substring(D) 2374}}}return B 2375},_copyAttribute:function(C,D,A){var B=C.getAttribute(A); 2376if(B){D.setAttribute(A,B) 2377}}}; 2378A4J.AJAX._eventsQueues={}; 2379A4J.AJAX.Listener=function(A){this.onafterajax=A 2380}; 2381A4J.AJAX._listeners=[]; 2382A4J.AJAX.AddListener=function(A){A4J.AJAX._listeners.push(A) 2383}; 2384A4J.AJAX.removeListeners=function(A){A4J.AJAX._listeners=[] 2385}; 2386A4J.AJAX.HeadElementTransformer=function(A){this.elt=A 2387}; 2388A4J.AJAX._headTransformers=[]; 2389A4J.AJAX.AddHeadElementTransformer=function(A){A4J.AJAX._headTransformers.push(A) 2390}; 2391A4J.AJAX._pollers={}; 2392A4J.AJAX.Poll=function(A,C,B){A4J.AJAX.StopPoll(B.pollId); 2393if(!B.onerror){B.onerror=function(F,D,E){if(typeof (A4J.AJAX.onError)=="function"){A4J.AJAX.onError(F,D,E) 2394}A4J.AJAX.Poll(A,C,B) 2395} 2396}A4J.AJAX._pollers[B.pollId]=window.setTimeout(function(){A4J.AJAX._pollers[B.pollId]=undefined; 2397if((typeof (B.onsubmit)=="function")&&(B.onsubmit()==false)){A4J.AJAX.Poll(A,C,B) 2398}else{A4J.AJAX.SubmitRequest(A,C,null,B) 2399}},B.pollinterval) 2400}; 2401A4J.AJAX.StopPoll=function(A){if(A4J.AJAX._pollers[A]){window.clearTimeout(A4J.AJAX._pollers[A]); 2402A4J.AJAX._pollers[A]=undefined 2403}}; 2404A4J.AJAX.Push=function(A,C,B){A4J.AJAX.StopPush(B.pushId); 2405B.onerror=function(){A4J.AJAX.Push(A,C,B) 2406}; 2407A4J.AJAX._pollers[B.pushId]=window.setTimeout(function(){var D=new XMLHttpRequest(); 2408D.onreadystatechange=function(){if(D.readyState==4){try{if(D.status==200){
2408if(D.getResponseHeader("Ajax-Push-Status")=="READY"){A4J.AJAX.SubmitRequest(A,C||B.dummyForm,null,B) 2409}}}catch(E){}D=null; 2410A4J.AJAX._pollers[B.pushId]=null; 2411A4J.AJAX.Push(A,C,B) 2412}}; 2413A4J.AJAX.SendPush(D,B) 2414},B.pushinterval) 2415}; 2416A4J.AJAX.SendPush=function(C,B){var A=B.pushUrl||B.actionUrl; 2417C.open("HEAD",A,true); 2418C.setRequestHeader("Ajax-Push-Key",B.pushId); 2419if(B.timeout){C.setRequestHeader("Timeout",B.timeout) 2420}C.send(null) 2421}; 2422A4J.AJAX.StopPush=function(A){if(A4J.AJAX._pollers[A]){window.clearTimeout(A4J.AJAX._pollers[A]); 2423A4J.AJAX._pollers[A]=null 2424}}; 2425A4J.AJAX.CloneObject=function(C,B){var A={}; 2426for(var D in C){if(B&&typeof (evt[prop])=="function"){continue 2427}A[D]=C[D] 2428}return A 2429}; 2430A4J.AJAX.SubmitForm=function(A,D,B){var C=A4J.AJAX.CloneObject(B); 2431if(A4J._formInput){LOG.debug("Form submitted by button "+A4J._formInput.id); 2432C.control=A4J._formInput; 2433A4J._formInput=null; 2434C.submitByForm=true 2435}A4J.AJAX.Submit(A,D,null,C) 2436}; 2437A4J.AJAX.Submit=function(E,A,H,I){var C; 2438H=H||window.event||null; 2439if(H){try{C=A4J.AJAX.CloneObject(H,false) 2440}catch(G){LOG.warn("Exception on clone event "+G.name+":"+G.message) 2441}LOG.debug("Have Event "+C+" with properties: target: "+C.target+", srcElement: "+C.srcElement+", type: "+C.type) 2442}if(I.eventsQueue){var D=A4J.AJAX._eventsQueues[I.eventsQueue]; 2443if(D){var F=D.options.eventsCount||1; 2444D.wait=true; 2445D.containerId=E; 2446D.form=A; 2447D.domEvt=C; 2448D.options=I; 2449D.options.eventsCount=F+1; 2450if(I.ignoreDupResponses&&D.request){LOG.debug("Abort uncompleted request in queue "+I.eventsQueue); 2451D.request.abort(); 2452D.request=false; 2453D.wait=false; 2454if(I.requestDelay){window.setTimeout(function(){LOG.debug("End delay waiting, make request in queue "+I.eventsQueue); 2455A4J.AJAX.SubmiteventsQueue(A4J.AJAX._eventsQueues[I.eventsQueue]) 2456},I.requestDelay); 2457LOG.debug("Create new waiting for request in queue "+I.eventsQueue); 2458return 2459}}else{LOG.debug("Put new event to queue "+I.eventsQueue); 2460return 2461}}else{var B={wait:false,containerId:E,form:A,domEvt:C,options:I}; 2462A4J.AJAX._eventsQueues[I.eventsQueue]=B; 2463if(I.requestDelay){window.setTimeout(function(){LOG.debug("End delay waiting, make request in queue "+I.eventsQueue); 2464A4J.AJAX.SubmiteventsQueue(A4J.AJAX._eventsQueues[I.eventsQueue]) 2465},I.requestDelay); 2466LOG.debug("Event occurs, create waiting for request in queue "+I.eventsQueue); 2467return 2468}}}A4J.AJAX.SubmitRequest(E,A,C,I) 2469}; 2470A4J.AJAX.SubmiteventsQueue=function(A){A.wait=false; 2471A4J.AJAX.SubmitRequest(A.containerId,A.form,A.domEvt,A.options) 2472}; 2473A4J.AJAX.SubmitRequest=function(E,H,D,I){LOG.debug("NEW AJAX REQUEST !!! with form :"+H); 2474var A=window.document.getElementById(H); 2475if((!A||A.nodeName.toUpperCase()!="FORM")&&D){var F=D.target||D.srcElement||null; 2476if(F){A=A4J.AJAX.locateForm(F) 2477}}if(!I.submitByForm&&A&&A.onsubmit){LOG.debug("Form have onsubmit function, call it"); 2478if(A.onsubmit()==false){return false 2479}}var B=new A4J.Query(E,A); 2480B.appendFormControls(I.single,I.control); 2481if(I.parameters){B.appendParameters(I.parameters) 2482}if(I.eventsCount){B.appendParameter("AJAX:EVENTS_COUNT",I.eventsCount) 2483}if(I.actionUrl){B.setActionUrl(I.actionUrl) 2484}var G=new A4J.AJAX.XMLHttpRequest(B); 2485G.options=I; 2486G.containerId=E; 2487G.domEvt=D; 2488G.form=A; 2489if(I.timeout){G.setRequestTimeout(I.timeout) 2490}G.onready=A4J.AJAX.processResponse; 2491if(I.onerror){G._onerror=I.onerror 2492}else{if(typeof (A4J.AJAX.onError)=="function"){G._onerror=A4J.AJAX.onError 2493}}G.onfinish=A4J.AJAX.finishRequest; 2494A4J.AJAX.status(E,I.status,true); 2495G.send(); 2496if(I.eventsQueue){var C=A4J.AJAX._eventsQueues[I.eventsQueue]; 2497if(C){C.request=G 2498}}return false 2499}; 2500A4J.AJAX.processResponseAfterUpdateHeadElements=function(C,B){for(var A=0; 2501A<B.length; 2502A++){var D=B[A]; 2503LOG.debug("Update page part from call parameter for ID "+D); 2504C.updatePagePart(D,A==B.length-1) 2505}}; 2506A4J.AJAX.headElementsCounter=0; 2507A4J.AJAX.processResponse=function(A){A4J.AJAX.TestScriptEvaluation(); 2508var E=A.options; 2509var S=A.getResponseHeader("Ajax-Response"); 2510var Q=A.getResponseHeader("Ajax-Expired"); 2511if(Q&&typeof (A4J.AJAX.onExpired)=="function"){var I=A4J.AJAX.onExpired(window.location,Q); 2512if(I){window.location=I; 2513return 2514}}if(S!="true"){LOG.warn("No ajax response header "); 2515var I=A.getResponseHeader("Location"); 2516try{if(S=="redirect"&&I){window.location=I 2517}else{if(S=="reload"){window.location.reload(true) 2518}else{A4J.AJAX.replacePage(A) 2519}}}catch(N){LOG.error("Error redirect to new location ") 2520}}else{if(A.getParserStatus()==Sarissa.PARSED_OK){if(E.onbeforedomupdate){LOG.debug("Call request onbeforedomupdate function before replacing elemements"); 2521E.onbeforedomupdate(A,A.domEvt,A.getJSON("_ajax:data")) 2522}var B=A.getResponseHeader("Ajax-Update-Ids"); 2523var L; 2524var G=function(){if(A4J.AJAX.headElementsCounter!=0){LOG.debug("Script "+A4J.AJAX.headElementsCounter+" was loaded"); 2525--A4J.AJAX.headElementsCounter 2526}if(A4J.AJAX.headElementsCounter==0){A4J.AJAX.processResponseAfterUpdateHeadElements(A,L) 2527}}; 2528if(E.affected){L=E.affected; 2529A.appendNewHeadElements(G) 2530}else{if(B&&B!=""){LOG.debug("Update page by list of rendered areas from response "+B); 2531L=B.split(","); 2532A.appendNewHeadElements(G) 2533}else{LOG.warn("No information in response about elements to replace"); 2534A.doFinish() 2535}}var P=A.getElementById("ajax-view-state"); 2536LOG.debug("Hidden JSF state fields: "+P); 2537if(P!=null){var J=E.parameters["org.ajax4jsf.portlet.NAMESPACE"]; 2538LOG.debug("Namespace for hidden view-state input fields is "+J); 2539var H=J?window.document.getElementById(J):window.document; 2540var C=H.getElementsByTagName("input"); 2541try{var M=A.getElementsByTagName("input",P); 2542A4J.AJAX.replaceViewState(C,M) 2543}catch(N){LOG.warn("No elements 'input' in response") 2544}try{var M=A.getElementsByTagName("INPUT",P); 2545A4J.AJAX.replaceViewState(C,M) 2546}catch(N){LOG.warn("No elements 'INPUT' in response") 2547}}for(var K=0; 2548K<A4J.AJAX._listeners.length; 2549K++){var F=A4J.AJAX._listeners[K]; 2550if(F.onafterajax){var R=A.getJSON("_ajax:data"); 2551F.onafterajax(A,A.domEvt,R) 2552}}var O=A.getJSON("_A4J.AJAX.focus"); 2553if(O){LOG.debug("focus must be set to control "+O); 2554var D=false; 2555if(A.form){D=A.form.elements[O] 2556}if(!D){LOG.debug("No control element "+O+" in submitted form"); 2557D=document.getElementById(O) 2558}if(D){LOG.debug("Set focus to control "); 2559D.focus(); 2560if(D.select){D.select() 2561}}else{LOG.warn("Element for set focus not found") 2562}}
2562else{LOG.debug("No focus information in response") 2563}}else{LOG.error("Error parsing XML"); 2564LOG.error("Parse Error: "+A.getParserStatus()) 2565}}}; 2566A4J.AJAX.replacePage=function(B){if(!B.getResponseText()){LOG.warn("No content in response for replace current page"); 2567return 2568}LOG.debug("replace all page content with response"); 2569var A=Sarissa._SARISSA_IS_IE; 2570var C=window.document.open; 2571if(A){LOG.debug("setup custom document.open method"); 2572window.document.open=function(){C.apply(this,arguments) 2573} 2574}window.setTimeout(function(){var E=false; 2575try{window.document.open(B.getContentType(),true); 2576LOG.debug("window.document has opened for writing"); 2577E=true; 2578window.document.write(B.getResponseText()); 2579LOG.debug("window.document has been writed"); 2580window.document.close(); 2581LOG.debug("window.document has been closed for writing"); 2582if(A){window.location.reload(false) 2583}}catch(I){LOG.debug("exception during write page content "+I.Message); 2584if(E){window.document.close() 2585}var H=(new DOMParser()).parseFromString(B.getResponseText(),"text/xml"); 2586if(Sarissa.getParseErrorText(H)==Sarissa.PARSED_OK){LOG.debug("response has parsed as DOM documnet."); 2587Sarissa.clearChildNodes(window.document.documentElement); 2588var D=H.documentElement.childNodes; 2589for(var F=0; 2590F<D.length; 2591F++){if(D[F].nodeType==1){LOG.debug("append new node in document"); 2592var G=window.document.importNode(D[F],true); 2593window.document.documentElement.appendChild(G) 2594}}}else{LOG.error("Error parsing response",Sarissa.getParseErrorText(H)) 2595}}finally{window.document.open=C 2596}LOG.debug("page content has been replaced") 2597},0) 2598}; 2599A4J.AJAX.replaceViewState=function(A,E){LOG.debug("Replace value for inputs: "+A.length+" by new values: "+E.length); 2600if((E.length>0)&&(A.length>0)){for(var D=0; 2601D<E.length; 2602D++){var F=E[D]; 2603LOG.debug("Input in response: "+F.getAttribute("name")); 2604for(var C=0; 2605C<A.length; 2606C++){var B=A[C]; 2607if(B.name==F.getAttribute("name")){LOG.debug("Found same input on page with type: "+B.type); 2608B.value=F.getAttribute("value") 2609}}}}}; 2610A4J.AJAX.finishRequest=function(D){var B=D.options; 2611var A=D.getElementById("org.ajax4jsf.oncomplete"); 2612if(A){LOG.debug("Call request oncomplete function after processing updates"); 2613window.setTimeout(function(){var G=D.domEvt; 2614var H=D.getJSON("_ajax:data"); 2615try{var F=Sarissa.getText(A,true); 2616var E=new Function("request","event","data",F); 2617var J=null; 2618if(G){J=G.target?G.target:G.srcElement 2619}E.call(J,D,G,H) 2620}catch(I){LOG.error("Error evaluate oncomplete function "+I.Message) 2621}A4J.AJAX.status(D.containerId,B.status,false) 2622},0) 2623}else{if(B.oncomplete){LOG.debug("Call component oncomplete function after processing updates"); 2624window.setTimeout(function(){B.oncomplete(D,D.domEvt,D.getJSON("_ajax:data")); 2625A4J.AJAX.status(D.containerId,B.status,false) 2626},0) 2627}else{A4J.AJAX.status(D.containerId,B.status,false) 2628}}if(B.eventsQueue){var C=A4J.AJAX._eventsQueues[B.eventsQueue]; 2629if(C){if(C.wait){LOG.debug("Queue not empty, execute next request in queue "+B.eventsQueue); 2630A4J.AJAX.SubmiteventsQueue(C) 2631}else{A4J.AJAX._eventsQueues[B.eventsQueue]=false 2632}}}}; 2633A4J.AJAX.getCursorPos=function(D){if(D.selectionEnd!=null){return D.selectionEnd 2634}var C=document.selection.createRange(); 2635var B=C.compareEndPoints("StartToEnd",C)==0; 2636if(!B){C.collapse(false) 2637}var A=C.getBookmark(); 2638return A.charCodeAt(2)-2 2639}; 2640A4J.AJAX.locateForm=function(B){var A=B; 2641while(A&&A.nodeName.toLowerCase()!="form"){A=A.parentNode 2642}return A 2643}; 2644A4J.AJAX.getElementById=function(E,B){var D=B["org.ajax4jsf.portlet.NAMESPACE"]; 2645var A=D?window.document.getElementById(D):window.document; 2646var C; 2647if(A){C=A.getElementById(E) 2648}else{LOG.error("No root element for portlet namespace "+D+" on page") 2649}return C 2650}; 2651A4J.AJAX._requestsCounts={}; 2652A4J.AJAX.status=function(D,A,E){try{var B; 2653A=A||D+":status"; 2654A4J.AJAX._requestsCounts[A]=(A4J.AJAX._requestsCounts[A]||0)+(E?1:-1); 2655if(A4J.AJAX._requestsCounts[A]>0){B=document.getElementById(A+".stop"); 2656if(B){B.style.display="none" 2657}B=document.getElementById(A+".start"); 2658if(B){B.style.display=""; 2659if(typeof (B.onstart)=="function"){B.onstart() 2660}}}else{B=document.getElementById(A+".start"); 2661if(B){B.style.display="none" 2662}B=document.getElementById(A+".stop"); 2663if(B){B.style.display=""; 2664if(typeof (B.onstop)=="function"){B.onstop() 2665}}}}catch(C){LOG.error("Exception on status change: ") 2666}}; 2667A4J.Query=function(A,B){this._query={AJAXREQUEST:A}; 2668this._oldSubmit=null; 2669this._form=B; 2670this._actionUrl=(this._form.action)?this._form.action:this._form 2671}; 2672A4J.Query.prototype={_form:null,_actionUrl:null,_ext:"",_query:{},_oldSubmit:null,_pageBase:window.location.protocol+"//"+window.location.host,hidden:function(A){this._value_query(A); 2673if((A.name.length>4)&&(A.name.lastIndexOf("_idcl")==(A.name.length-5))){A.value="" 2674}else{if((A.name.length>12)&&(A.name.lastIndexOf("_link_hidden_")==(A.name.length-13))){A.value="" 2675}}},text:function(A){this._value_query(A) 2676},textarea:function(A){this._value_query(A) 2677},"select-one":function(A){if(A.selectedIndex!=-1){this._value_query(A) 2678}},password:function(A){this._value_query(A) 2679},file:function(A){this._value_query(A) 2680},radio:function(A){this._check_query(A) 2681},checkbox:function(A){this._check_query(A) 2682},"select-multiple":function(E){var B=E.name; 2683var A=E.options; 2684for(var C=0; 2685C<E.length; 2686C++){var D=A[C]; 2687this._addOption(B,D) 2688}},_addOption:function(A,B){if(B.selected){if(!this._query[A]){this._query[A]=[] 2689}this._query[A][this._query[A].length]=B.value 2690}},image:function(B,A){if(A){this._value_query(B) 2691}},button:function(B,A){if(A){this._value_query(B) 2692}},submit:function(B,A){if(A){this._value_query(B) 2693}},link:function(B,A){if(A){this._value_query(B); 2694if(B.parameters){this.appendParameters(B.parameters) 2695}}},input:function(B,A){if(A){this.link(B,A); 2696if(B.control){this.appendControl(B.control,A) 2697}}},appendControl:function(B,A){if(this[B.type]){this[B.type](B,A) 2698}else{this._appendById(B.id||B) 2699}},appendFormControls:function(F,D){try{var C=this._form.elements; 2700if(C){var B=0; 2701for(B=0; 2702B<C.length; 2703B++){var E=C[B]; 2704if(E==D){continue 2705}try{if(!F||E.type=="hidden"){this.appendControl(E,false) 2706}}catch(A){LOG.error("exception in building query ( append form control ) "+A) 2707}}}}catch(G){LOG.warn("Error with append form controls to query "+G) 2708}if(D){this.appendControl(D,true) 2709}},appendParameters:function(A){for(k in A){if(typeof Object.prototype[k]=="undefined"){LOG.debug("parameter "+k+" with value "+A[k]); 2710this.appendParameter(k,A[k]) 2711}}}
2711,setActionUrl:function(A){this._actionUrl=A 2712},getActionUrl:function(A){var B=this._actionUrl; 2713var C=B.indexOf("?"); 2714if(B.substring(0,1)=="/"){B=this._pageBase+B 2715}if(!A){A=this._ext 2716}if(C>=0){return B.substring(0,C)+A+B.substring(C) 2717}else{return B+A 2718}},getQueryString:function(){var A=""; 2719var D; 2720for(var C in this._query){if(typeof Object.prototype[C]=="undefined"){D=this._query[C]; 2721if(D instanceof Object){for(var B=0; 2722B<D.length; 2723B++){A+=this._encode(C)+"="+this._encode(D[B])+"&" 2724}}else{A+=this._encode(C)+"="+this._encode(D)+"&" 2725}}}LOG.debug("QueryString: "+A); 2726return A 2727},_appendById:function(A){this.appendParameter(this._form.id+"_link_hidden_",A) 2728},_value_query:function(A){if(A.name){LOG.debug("Append "+A.type+" control "+A.name+" with value ["+A.value+"] and value attribute ["+A.getAttribute("value")+"]"); 2729if(null!=A.value){this.appendParameter(A.name,A.value) 2730}}else{LOG.debug("Ignored "+A.type+" no-name control with value ["+A.value+"] and value attribute ["+A.getAttribute("value")+"]") 2731}},_check_query:function(A){if(A.checked){this.appendParameter(A.name,A.value?A.value:"on") 2732}},appendParameter:function(A,B){if(!this._query[A]){this._query[A]=B; 2733return 2734}else{if(!(this._query[A] instanceof Object)){this._query[A]=[this._query[A]] 2735}}this._query[A][this._query[A].length]=B 2736},_encode:function(A){try{return encodeURIComponent(A) 2737}catch(B){var C=escape(A); 2738return C.split("+").join("%2B") 2739}}}; 2740A4J.AJAX.getText=function(G,C){var E=""; 2741var B=G.childNodes; 2742for(var D=0; 2743D<B.length; 2744D++){var F=B[D]; 2745var A=F.nodeType; 2746if(A==Node.TEXT_NODE||A==Node.CDATA_SECTION_NODE||(C&&A==Node.COMMENT_NODE)){E+=F.data 2747}else{if(A==Node.ELEMENT_NODE||A==Node.DOCUMENT_NODE||A==Node.DOCUMENT_FRAGMENT_NODE){E+=arguments.callee(F,C) 2748}}}return E 2749}; 2750A4J.AJAX.isXhtmlScriptMode=function(){if(!this._xhtmlScriptMode){var A=document.createElement("div"); 2751A.innerHTML="<script type='text/javascript'><!--\r\n/**/\r\n//--><\/script>"; 2752var C=false; 2753var B=A.firstChild; 2754while(B){if(B.nodeType==Node.ELEMENT_NODE){var D=B.firstChild; 2755while(D){if(D.nodeType==Node.COMMENT_NODE){C=true; 2756break 2757}D=D.nextSibling 2758}break 2759}B=B.nextSibling 2760}if(C){this._xhtmlScriptMode=2 2761}else{this._xhtmlScriptMode=1 2762}}return this._xhtmlScriptMode>1 2763}; 2764A4J.AJAX._scriptEvaluated=false; 2765A4J.AJAX.TestScriptEvaluation=function(){if((!document.all||window.opera)&&!A4J.AJAX._scriptTested){try{var C=Sarissa.getDomDocument(); 2766var A=document.createElement("span"); 2767document.body.appendChild(A); 2768var F="<html xmlns='http://www.w3.org/1999/xhtml'><script>A4J.AJAX._scriptEvaluated=true;<\/script></html>"; 2769C=(new DOMParser()).parseFromString(F,"text/xml"); 2770var B=C.getElementsByTagName("script")[0]; 2771if(!window.opera&&A.outerHTML){A.outerHTML=new XMLSerializer().serializeToString(B) 2772}else{var E; 2773E=window.document.importNode(B,true); 2774document.body.replaceChild(E,A) 2775}}catch(D){}}A4J.AJAX._scriptTested=true 2776}; 2777if(!window.LOG){window.LOG={} 2778}LOG.Level=function(B,C,A){this.name=B; 2779this.priority=C; 2780if(A){this.color=A 2781}}; 2782LOG.OFF=new LOG.Level("off",1000); 2783LOG.FATAL=new LOG.Level("fatal",900,"red"); 2784LOG.ERROR=new LOG.Level("error",800,"red"); 2785LOG.WARN=new LOG.Level("warn",500,"yellow"); 2786LOG.INFO=new LOG.Level("info",400,"blue"); 2787LOG.DEBUG=new LOG.Level("debug",300,"darkblue"); 2788LOG.ALL=new LOG.Level("all",100); 2789LOG.A4J_DEBUG=new LOG.Level("a4j_debug",0,"green"); 2790LOG.LEVEL=LOG.OFF; 2791LOG._window=null; 2792LOG.transmitToServer=true; 2793LOG.consoleDivId="logConsole"; 2794LOG.styles={a4j_debug:"green",debug:"darkblue",info:"blue",warn:"yellow",error:"red",fatal:"red"}; 2795LOG.a4j_debug=function(B,A){LOG._log(B,LOG.A4J_DEBUG,A) 2796}; 2797LOG.debug=function(B,A){LOG._log(B,LOG.DEBUG,A) 2798}; 2799LOG.info=function(B,A){LOG._log(B,LOG.INFO,A) 2800}; 2801LOG.warn=function(B,A){LOG._log(B,LOG.WARN,A) 2802}; 2803LOG.error=function(B,A){LOG._log(B,LOG.ERROR,A) 2804}; 2805LOG.fatal=function(B,A){LOG._log(B,LOG.FATAL,A) 2806}; 2807LOG.registerPopup=function(B,C,E,A,F){if(!LOG._onkeydown){LOG._onkeydown=document.onkeydown 2808}var D=B.toUpperCase(); 2809document.onkeydown=function(G){if(window.event){G=window.event 2810}if(String.fromCharCode(G.keyCode)==D&G.shiftKey&G.ctrlKey){LOG.LEVEL=F; 2811LOG.openWindow(C,"width="+E+",height="+A+",toolbar=no,scrollbars=yes,location=no,statusbar=no,menubar=no,resizable=yes,left = "+((screen.width-E)/2)+",top ="+((screen.height-A)/2)) 2812}else{if(LOG._onkeydown){LOG._onkeydown(G) 2813}}} 2814}; 2815LOG.clear=function(){if(LOG._window&&LOG._window.document){consoleDiv=LOG._window.document.body 2816}else{consoleDiv=window.document.getElementById(LOG.consoleDivId) 2817}consoleDiv.innerHTML='<button onclick="LOG.clear()">Clear</button><br />' 2818}; 2819LOG.openWindow=function(B,C){if(LOG._window){LOG._window.focus() 2820}else{LOG._window=window.open("",B,C); 2821LOG._window.LOG=LOG; 2822LOG.clear(); 2823var A=LOG; 2824LOG._window.onunload=function(){A._window.LOG=null; 2825A._window=null; 2826A.LEVEL=A.OFF; 2827A=undefined 2828} 2829}}; 2830LOG._log=function(C,A,B){if(A.priority>=LOG.LEVEL.priority){LOG._logToConsole(C,A,B); 2831if(LOG.transmitToServer){LOG._logToServer(C,A) 2832}}}; 2833LOG._time=function(){var D=new Date(); 2834var A=D.getHours(); 2835var C=D.getMinutes(); 2836if(C<10){C="0"+C 2837}var E=D.getSeconds(); 2838if(E<10){E="0"+E 2839}var B=D.getTime()%1000; 2840if(B<100){B="0"+B 2841}if(B<10){B="0"+B 2842}return A+":"+C+":"+E+","+B 2843}; 2844LOG._logToConsole=function(C,B,E){var F; 2845var G; 2846if(LOG._window&&LOG._window.document){G=LOG._window.document; 2847F=LOG._window.document.body 2848}else{G=window.document; 2849F=window.document.getElementById(LOG.consoleDivId) 2850}if(F){var H=G.createElement("span"); 2851H.style.color=B.color; 2852H.appendChild(G.createTextNode(B.name+"["+LOG._time()+"]: ")); 2853var A=G.createElement("div"); 2854var I=G.createTextNode(C);
2855A.appendChild(H); 2856A.appendChild(I); 2857if(E){var D=G.createElement("span"); 2858I=G.createTextNode(E); 2859D.appendChild(I); 2860A.appendChild(D) 2861}F.appendChild(A) 2862}else{}}; 2863LOG._logToServer=function(C,A){var B=A.name.substring(0,1)+C 2864}; 2865LOG._requestCallBack=function(){}; 2866if(!window.RichFaces){window.RichFaces={} 2867}if(!window.RichFaces.Memory){window.RichFaces.Memory={cleaners:{},addCleaner:function(A,B){this.cleaners[A]=B 2868},applyCleaners:function(B){for(var A in this.cleaners){this.cleaners[A](B) 2869}},clean:function(E){if(E){this.applyCleaners(E); 2870var B=E.all; 2871if(B){var A=0; 2872var D=B.length; 2873for(var A=0; 2874A<D; 2875A++){this.applyCleaners(B[A]) 2876}}else{var C=E.firstChild; 2877while(C){this.clean(C); 2878C=C.nextSibling 2879}}}}}; 2880window.RichFaces.Memory.addCleaner("richfaces",function(D){var B=D.component; 2881if(B){var C=B["rich:destructor"]; 2882if(C){var A=B[C]; 2883if(A){A.call(B) 2884}}}}); 2885if(window.attachEvent){window.attachEvent("onunload",function(){var A=window.RichFaces.Memory; 2886A.clean(document); 2887A.clean(window) 2888}) 2889}} 2890var Builder={NODEMAP:{AREA:"map",CAPTION:"table",COL:"table",COLGROUP:"table",LEGEND:"fieldset",OPTGROUP:"select",OPTION:"select",PARAM:"object",TBODY:"table",TD:"table",TFOOT:"table",TH:"table",THEAD:"table",TR:"table"},node:function(A){A=A.toUpperCase(); 2891var F=this.NODEMAP[A]||"div"; 2892var B=document.createElement(F); 2893try{B.innerHTML="<"+A+"></"+A+">" 2894}catch(E){}var D=B.firstChild||null; 2895if(D&&(D.tagName.toUpperCase()!=A)){D=D.getElementsByTagName(A)[0] 2896}if(!D){D=document.createElement(A) 2897}if(!D){return 2898}if(arguments[1]){if(this._isStringOrNumber(arguments[1])||(arguments[1] instanceof Array)||arguments[1].tagName){this._children(D,arguments[1]) 2899}else{var C=this._attributes(arguments[1]); 2900if(C.length){try{B.innerHTML="<"+A+" "+C+"></"+A+">" 2901}catch(E){}D=B.firstChild||null; 2902if(!D){D=document.createElement(A); 2903for(attr in arguments[1]){D[attr=="class"?"className":attr]=arguments[1][attr] 2904}}if(D.tagName.toUpperCase()!=A){D=B.getElementsByTagName(A)[0] 2905}}}}if(arguments[2]){this._children(D,arguments[2]) 2906}return D 2907},_text:function(A){return document.createTextNode(A) 2908},ATTR_MAP:{"className":"class","htmlFor":"for"},_attributes:function(A){var B=[]; 2909for(attribute in A){B.push((attribute in this.ATTR_MAP?this.ATTR_MAP[attribute]:attribute)+'="'+A[attribute].toString().escapeHTML().gsub(/"/,""")+'"') 2910}return B.join(" ") 2911},_children:function(B,A){if(A.tagName){B.appendChild(A); 2912return 2913}if(typeof A=="object"){A.flatten().each(function(C){if(typeof C=="object"){B.appendChild(C) 2914}else{if(Builder._isStringOrNumber(C)){B.appendChild(Builder._text(C)) 2915}}}) 2916}else{if(Builder._isStringOrNumber(A)){B.appendChild(Builder._text(A)) 2917}}},_isStringOrNumber:function(A){return(typeof A=="string"||typeof A=="number") 2918},build:function(B){var A=this.node("div"); 2919$(A).update(B.strip()); 2920return A.down() 2921},dump:function(B){if(typeof B!="object"&&typeof B!="function"){B=window 2922}var A=("A ABBR ACRONYM ADDRESS APPLET AREA B BASE BASEFONT BDO BIG BLOCKQUOTE BODY BR BUTTON CAPTION CENTER CITE CODE COL COLGROUP DD DEL DFN DIR DIV DL DT EM FIELDSET FONT FORM FRAME FRAMESET H1 H2 H3 H4 H5 H6 HEAD HR HTML I IFRAME IMG INPUT INS ISINDEX KBD LABEL LEGEND LI LINK MAP MENU META NOFRAMES NOSCRIPT OBJECT OL OPTGROUP OPTION P PARAM PRE Q S SAMP SCRIPT SELECT SMALL SPAN STRIKE STRONG STYLE SUB SUP TABLE TBODY TD TEXTAREA TFOOT TH THEAD TITLE TR TT U UL VAR").split(/\s+/); 2923A.each(function(C){B[C]=function(){return Builder.node.apply(Builder,[C].concat($A(arguments))) 2924} 2925}) 2926}}; 2927String.prototype.parseColor=function(){var A="#"; 2928if(this.slice(0,4)=="rgb("){var C=this.slice(4,this.length-1).split(","); 2929var B=0; 2930do{A+=parseInt(C[B]).toColorPart() 2931}while(++B<3) 2932}else{if(this.slice(0,1)=="#"){if(this.length==4){for(var B=1; 2933B<4; 2934B++){A+=(this.charAt(B)+this.charAt(B)).toLowerCase() 2935}}if(this.length==7){A=this.toLowerCase() 2936}}}return(A.length==7?A:(arguments[0]||this)) 2937}; 2938Element.collectTextNodes=function(A){return $A($(A).childNodes).collect(function(B){return(B.nodeType==3?B.nodeValue:(B.hasChildNodes()?Element.collectTextNodes(B):"")) 2939}).flatten().join("") 2940}; 2941Element.collectTextNodesIgnoreClass=function(A,B){return $A($(A).childNodes).collect(function(C){return(C.nodeType==3?C.nodeValue:((C.hasChildNodes()&&!Element.hasClassName(C,B))?Element.collectTextNodesIgnoreClass(C,B):"")) 2942}).flatten().join("") 2943}; 2944Element.setContentZoom=function(A,B){A=$(A); 2945A.setStyle({fontSize:(B/100)+"em"}); 2946if(Prototype.Browser.WebKit){window.scrollBy(0,0) 2947}return A 2948}; 2949Element.getInlineOpacity=function(A){return $(A).style.opacity||"" 2950}; 2951Element.forceRerendering=function(A){try{A=$(A); 2952var C=document.createTextNode(" "); 2953A.appendChild(C); 2954A.removeChild(C) 2955}catch(B){}}; 2956var Effect={_elementDoesNotExistError:{name:"ElementDoesNotExistError",message:"The specified DOM element does not exist, but is required for this effect to operate"},Transitions:{linear:Prototype.K,sinoidal:function(A){return(-Math.cos(A*Math.PI)/2)+0.5 2957},reverse:function(A){return 1-A 2958},flicker:function(A){var A=((-Math.cos(A*Math.PI)/4)+0.75)+Math.random()/4; 2959return A>1?1:A 2960},wobble:function(A){return(-Math.cos(A*Math.PI*(9*A))/2)+0.5 2961},pulse:function(B,A){A=A||5; 2962return(((B%(1/A))*A).round()==0?((B*A*2)-(B*A*2).floor()):1-((B*A*2)-(B*A*2).floor())) 2963},spring:function(A){return 1-(Math.cos(A*4.5*Math.PI)*Math.exp(-A*6)) 2964},none:function(A){return 0 2965},full:function(A){return 1 2966}},DefaultOptions:{duration:1,fps:100,sync:false,from:0,to:1,delay:0,queue:"parallel"},tagifyText:function(A){var B="position:relative"; 2967if(Prototype.Browser.IE){B+=";zoom:1" 2968}A=$(A); 2969$A(A.childNodes).each(function(C){if(C.nodeType==3){C.nodeValue.toArray().each(function(D){A.insertBefore(new Element("span",{style:B}
2969).update(D==" "?String.fromCharCode(160):D),C) 2970}); 2971Element.remove(C) 2972}}) 2973},multiple:function(B,C){var E; 2974if(((typeof B=="object")||Object.isFunction(B))&&(B.length)){E=B 2975}else{E=$(B).childNodes 2976}var A=Object.extend({speed:0.1,delay:0},arguments[2]||{}); 2977var D=A.delay; 2978$A(E).each(function(G,F){new C(G,Object.extend(A,{delay:F*A.speed+D})) 2979}) 2980},PAIRS:{"slide":["SlideDown","SlideUp"],"blind":["BlindDown","BlindUp"],"appear":["Appear","Fade"]},toggle:function(B,C){B=$(B); 2981C=(C||"appear").toLowerCase(); 2982var A=Object.extend({queue:{position:"end",scope:(B.id||"global"),limit:1}},arguments[2]||{}); 2983Effect[B.visible()?Effect.PAIRS[C][1]:Effect.PAIRS[C][0]](B,A) 2984}}; 2985Effect.DefaultOptions.transition=Effect.Transitions.sinoidal; 2986Effect.ScopedQueue=Class.create(Enumerable,{initialize:function(){this.effects=[]; 2987this.interval=null 2988},_each:function(A){this.effects._each(A) 2989},add:function(B){var C=new Date().getTime(); 2990var A=Object.isString(B.options.queue)?B.options.queue:B.options.queue.position; 2991switch(A){case"front":this.effects.findAll(function(D){return D.state=="idle" 2992}).each(function(D){D.startOn+=B.finishOn; 2993D.finishOn+=B.finishOn 2994}); 2995break; 2996case"with-last":C=this.effects.pluck("startOn").max()||C; 2997break; 2998case"end":C=this.effects.pluck("finishOn").max()||C; 2999break 3000}B.startOn+=C; 3001B.finishOn+=C; 3002if(!B.options.queue.limit||(this.effects.length<B.options.queue.limit)){this.effects.push(B) 3003}if(!this.interval){this.interval=setInterval(this.loop.bind(this),15) 3004}},remove:function(A){this.effects=this.effects.reject(function(B){return B==A 3005}); 3006if(this.effects.length==0){clearInterval(this.interval); 3007this.interval=null 3008}},loop:function(){var C=new Date().getTime(); 3009for(var B=0,A=this.effects.length; 3010B<A; 3011B++){this.effects[B]&&this.effects[B].loop(C) 3012}}}); 3013Effect.Queues={instances:$H(),get:function(A){if(!Object.isString(A)){return A 3014}return this.instances.get(A)||this.instances.set(A,new Effect.ScopedQueue()) 3015}}; 3016Effect.Queue=Effect.Queues.get("global"); 3017Effect.Base=Class.create({position:null,start:function(options){function codeForEvent(options,eventName){return((options[eventName+"Internal"]?"this.options."+eventName+"Internal(this);":"")+(options[eventName]?"this.options."+eventName+"(this);":"")) 3018}if(options&&options.transition===false){options.transition=Effect.Transitions.linear 3019}this.options=Object.extend(Object.extend({},Effect.DefaultOptions),options||{}); 3020this.currentFrame=0; 3021this.state="idle"; 3022this.startOn=this.options.delay*1000; 3023this.finishOn=this.startOn+(this.options.duration*1000); 3024this.fromToDelta=this.options.to-this.options.from; 3025this.totalTime=this.finishOn-this.startOn; 3026this.totalFrames=this.options.fps*this.options.duration; 3027eval('this.render = function(pos){ if (this.state=="idle"){this.state="running";'+codeForEvent(this.options,"beforeSetup")+(this.setup?"this.setup();":"")+codeForEvent(this.options,"afterSetup")+'};if (this.state=="running"){pos=this.options.transition(pos)*'+this.fromToDelta+"+"+this.options.from+";this.position=pos;"+codeForEvent(this.options,"beforeUpdate")+(this.update?"this.update(pos);":"")+codeForEvent(this.options,"afterUpdate")+"}}"); 3028this.event("beforeStart"); 3029if(!this.options.sync){Effect.Queues.get(Object.isString(this.options.queue)?"global":this.options.queue.scope).add(this) 3030}},loop:function(C){if(C>=this.startOn){if(C>=this.finishOn){this.render(1); 3031this.cancel(); 3032this.event("beforeFinish"); 3033if(this.finish){this.finish() 3034}this.event("afterFinish"); 3035return 3036}var B=(C-this.startOn)/this.totalTime,A=(B*this.totalFrames).round(); 3037if(A>this.currentFrame){this.render(B); 3038this.currentFrame=A 3039}}},cancel:function(){if(!this.options.sync){Effect.Queues.get(Object.isString(this.options.queue)?"global":this.options.queue.scope).remove(this) 3040}this.state="finished" 3041},event:function(A){if(this.options[A+"Internal"]){this.options[A+"Internal"](this) 3042}if(this.options[A]){this.options[A](this) 3043}},inspect:function(){var A=$H(); 3044for(property in this){if(!Object.isFunction(this[property])){A.set(property,this[property]) 3045}}return"#<Effect:"+A.inspect()+",options:"+$H(this.options).inspect()+">" 3046}}); 3047Effect.Parallel=Class.create(Effect.Base,{initialize:function(A){this.effects=A||[]; 3048this.start(arguments[1]) 3049},update:function(A){this.effects.invoke("render",A) 3050},finish:function(A){this.effects.each(function(B){B.render(1); 3051B.cancel(); 3052B.event("beforeFinish"); 3053if(B.finish){B.finish(A) 3054}B.event("afterFinish") 3055}) 3056}}); 3057Effect.Tween=Class.create(Effect.Base,{initialize:function(C,F,E){C=Object.isString(C)?$(C):C;
3058var B=$A(arguments),D=B.last(),A=B.length==5?B[3]:null; 3059this.method=Object.isFunction(D)?D.bind(C):Object.isFunction(C[D])?C[D].bind(C):function(G){C[D]=G 3060}; 3061this.start(Object.extend({from:F,to:E},A||{})) 3062},update:function(A){this.method(A) 3063}}); 3064Effect.Event=Class.create(Effect.Base,{initialize:function(){this.start(Object.extend({duration:0},arguments[0]||{})) 3065},update:Prototype.emptyFunction}); 3066Effect.Opacity=Class.create(Effect.Base,{initialize:function(B){this.element=$(B); 3067if(!this.element){throw (Effect._elementDoesNotExistError) 3068}if(Prototype.Browser.IE&&(!this.element.currentStyle.hasLayout)){this.element.setStyle({zoom:1}) 3069}var A=Object.extend({from:this.element.getOpacity()||0,to:1},arguments[1]||{}); 3070this.start(A) 3071},update:function(A){this.element.setOpacity(A) 3072}}); 3073Effect.Move=Class.create(Effect.Base,{initialize:function(B){this.element=$(B); 3074if(!this.element){throw (Effect._elementDoesNotExistError) 3075}var A=Object.extend({x:0,y:0,mode:"relative"},arguments[1]||{}); 3076this.start(A) 3077},setup:function(){this.element.makePositioned(); 3078this.originalLeft=parseFloat(this.element.getStyle("left")||"0"); 3079this.originalTop=parseFloat(this.element.getStyle("top")||"0"); 3080if(this.options.mode=="absolute"){this.options.x=this.options.x-this.originalLeft; 3081this.options.y=this.options.y-this.originalTop 3082}},update:function(A){this.element.setStyle({left:(this.options.x*A+this.originalLeft).round()+"px",top:(this.options.y*A+this.originalTop).round()+"px"}) 3083}}); 3084Effect.MoveBy=function(B,A,C){return new Effect.Move(B,Object.extend({x:C,y:A},arguments[3]||{})) 3085}; 3086Effect.Scale=Class.create(Effect.Base,{initialize:function(B,C){this.element=$(B); 3087if(!this.element){throw (Effect._elementDoesNotExistError) 3088}var A=Object.extend({scaleX:true,scaleY:true,scaleContent:true,scaleFromCenter:false,scaleMode:"box",scaleFrom:100,scaleTo:C},arguments[2]||{}); 3089this.start(A) 3090},setup:function(){this.restoreAfterFinish=this.options.restoreAfterFinish||false; 3091this.elementPositioning=this.element.getStyle("position"); 3092this.originalStyle={}; 3093["top","left","width","height","fontSize"].each(function(B){this.originalStyle[B]=this.element.style[B] 3094}.bind(this)); 3095this.originalTop=this.element.offsetTop; 3096this.originalLeft=this.element.offsetLeft; 3097var A=this.element.getStyle("font-size")||"100%"; 3098["em","px","%","pt"].each(function(B){if(A.indexOf(B)>0){this.fontSize=parseFloat(A); 3099this.fontSizeType=B 3100}}.bind(this)); 3101this.factor=(this.options.scaleTo-this.options.scaleFrom)/100; 3102this.dims=null; 3103if(this.options.scaleMode=="box"){this.dims=[this.element.offsetHeight,this.element.offsetWidth] 3104}if(/^content/.test(this.options.scaleMode)){this.dims=[this.element.scrollHeight,this.element.scrollWidth] 3105}if(!this.dims){this.dims=[this.options.scaleMode.originalHeight,this.options.scaleMode.originalWidth] 3106}},update:function(A){var B=(this.options.scaleFrom/100)+(this.factor*A); 3107if(this.options.scaleContent&&this.fontSize){this.element.setStyle({fontSize:this.fontSize*B+this.fontSizeType}) 3108}this.setDimensions(this.dims[0]*B,this.dims[1]*B) 3109},finish:function(A){if(this.restoreAfterFinish){this.element.setStyle(this.originalStyle) 3110}},setDimensions:function(A,D){var E={}; 3111if(this.options.scaleX){E.width=D.round()+"px" 3112}if(this.options.scaleY){E.height=A.round()+"px" 3113}if(this.options.scaleFromCenter){var C=(A-this.dims[0])/2; 3114var B=(D-this.dims[1])/2; 3115if(this.elementPositioning=="absolute"){if(this.options.scaleY){E.top=this.originalTop-C+"px" 3116}if(this.options.scaleX){E.left=this.originalLeft-B+"px" 3117}}else{if(this.options.scaleY){E.top=-C+"px" 3118}if(this.options.scaleX){E.left=-B+"px" 3119}}}this.element.setStyle(E) 3120}}); 3121Effect.Highlight=Class.create(Effect.Base,{initialize:function(B){this.element=$(B); 3122if(!this.element){throw (Effect._elementDoesNotExistError) 3123}var A=Object.extend({startcolor:"#ffff99"},arguments[1]||{}); 3124this.start(A) 3125},setup:function(){if(this.element.getStyle("display")=="none"){this.cancel(); 3126return 3127}this.oldStyle={}; 3128if(!this.options.keepBackgroundImage){this.oldStyle.backgroundImage=this.element.getStyle("background-image"); 3129this.element.setStyle({backgroundImage:"none"}) 3130}if(!this.options.endcolor){this.options.endcolor=this.element.getStyle("background-color").parseColor("#ffffff") 3131}if(!this.options.restorecolor){this.options.restorecolor=this.element.getStyle("background-color") 3132}this._base=$R(0,2).map(function(A){return parseInt(this.options.startcolor.slice(A*2+1,A*2+3),16) 3133}.bind(this)); 3134this._delta=$R(0,2).map(function(A){return parseInt(this.options.endcolor.slice(A*2+1,A*2+3),16)-this._base[A] 3135}.bind(this)) 3136},update:function(A){this.element.setStyle({backgroundColor:$R(0,2).inject("#",function(B,C,D){return B+((this._base[D]+(this._delta[D]*A)).round().toColorPart()) 3137}.bind(this))}) 3138},finish:function(){this.element.setStyle(Object.extend(this.oldStyle,{backgroundColor:this.options.restorecolor})) 3139}}); 3140Effect.ScrollTo=function(D){var C=arguments[1]||{},B=document.viewport.getScrollOffsets(),E=$(D).cumulativeOffset(),A=(window.height||document.body.scrollHeight)-document.viewport.getHeight();
3141if(C.offset){E[1]+=C.offset 3142}return new Effect.Tween(null,B.top,E[1]>A?A:E[1],C,function(F){scrollTo(B.left,F.round()) 3143}) 3144}; 3145Effect.Fade=function(C){C=$(C); 3146var A=C.getInlineOpacity(); 3147var B=Object.extend({from:C.getOpacity()||1,to:0,afterFinishInternal:function(D){if(D.options.to!=0){return 3148}D.element.hide().setStyle({opacity:A}) 3149}},arguments[1]||{}); 3150return new Effect.Opacity(C,B) 3151}; 3152Effect.Appear=function(B){B=$(B); 3153var A=Object.extend({from:(B.getStyle("display")=="none"?0:B.getOpacity()||0),to:1,afterFinishInternal:function(C){C.element.forceRerendering() 3154},beforeSetup:function(C){C.element.setOpacity(C.options.from).show() 3155}},arguments[1]||{}); 3156return new Effect.Opacity(B,A) 3157}; 3158Effect.Puff=function(B){B=$(B); 3159var A={opacity:B.getInlineOpacity(),position:B.getStyle("position"),top:B.style.top,left:B.style.left,width:B.style.width,height:B.style.height}; 3160return new Effect.Parallel([new Effect.Scale(B,200,{sync:true,scaleFromCenter:true,scaleContent:true,restoreAfterFinish:true}),new Effect.Opacity(B,{sync:true,to:0})],Object.extend({duration:1,beforeSetupInternal:function(C){Position.absolutize(C.effects[0].element) 3161},afterFinishInternal:function(C){C.effects[0].element.hide().setStyle(A) 3162}},arguments[1]||{})) 3163}; 3164Effect.BlindUp=function(A){A=$(A); 3165A.makeClipping(); 3166return new Effect.Scale(A,0,Object.extend({scaleContent:false,scaleX:false,restoreAfterFinish:true,afterFinishInternal:function(B){B.element.hide().undoClipping() 3167}},arguments[1]||{})) 3168}; 3169Effect.BlindDown=function(B){B=$(B); 3170var A=B.getDimensions(); 3171return new Effect.Scale(B,100,Object.extend({scaleContent:false,scaleX:false,scaleFrom:0,scaleMode:{originalHeight:A.height,originalWidth:A.width},restoreAfterFinish:true,afterSetup:function(C){C.element.makeClipping().setStyle({height:"0px"}).show() 3172},afterFinishInternal:function(C){C.element.undoClipping() 3173}},arguments[1]||{})) 3174}; 3175Effect.SwitchOff=function(B){B=$(B); 3176var A=B.getInlineOpacity(); 3177return new Effect.Appear(B,Object.extend({duration:0.4,from:0,transition:Effect.Transitions.flicker,afterFinishInternal:function(C){new Effect.Scale(C.element,1,{duration:0.3,scaleFromCenter:true,scaleX:false,scaleContent:false,restoreAfterFinish:true,beforeSetup:function(D){D.element.makePositioned().makeClipping() 3178},afterFinishInternal:function(D){D.element.hide().undoClipping().undoPositioned().setStyle({opacity:A}) 3179}}) 3180}},arguments[1]||{})) 3181}; 3182Effect.DropOut=function(B){B=$(B); 3183var A={top:B.getStyle("top"),left:B.getStyle("left"),opacity:B.getInlineOpacity()}; 3184return new Effect.Parallel([new Effect.Move(B,{x:0,y:100,sync:true}),new Effect.Opacity(B,{sync:true,to:0})],Object.extend({duration:0.5,beforeSetup:function(C){C.effects[0].element.makePositioned() 3185},afterFinishInternal:function(C){C.effects[0].element.hide().undoPositioned().setStyle(A) 3186}},arguments[1]||{})) 3187}; 3188Effect.Shake=function(D){D=$(D); 3189var B=Object.extend({distance:20,duration:0.5},arguments[1]||{}); 3190var E=parseFloat(B.distance); 3191var C=parseFloat(B.duration)/10; 3192var A={top:D.getStyle("top"),left:D.getStyle("left")}; 3193return new Effect.Move(D,{x:E,y:0,duration:C,afterFinishInternal:function(F){new Effect.Move(F.element,{x:-E*2,y:0,duration:C*2,afterFinishInternal:function(G){new Effect.Move(G.element,{x:E*2,y:0,duration:C*2,afterFinishInternal:function(H){new Effect.Move(H.element,{x:-E*2,y:0,duration:C*2,afterFinishInternal:function(I){new Effect.Move(I.element,{x:E*2,y:0,duration:C*2,afterFinishInternal:function(J){new Effect.Move(J.element,{x:-E,y:0,duration:C,afterFinishInternal:function(K){K.element.undoPositioned().setStyle(A) 3194}}) 3195}}) 3196}}) 3197}}) 3198}}) 3199}}) 3200}; 3201Effect.SlideDown=function(C){C=$(C).cleanWhitespace(); 3202var A=C.down().getStyle("bottom"); 3203var B=C.getDimensions(); 3204return new Effect.Scale(C,100,Object.extend({scaleContent:false,scaleX:false,scaleFrom:window.opera?0:1,scaleMode:{originalHeight:B.height,originalWidth:B.width},restoreAfterFinish:true,afterSetup:function(D){D.element.makePositioned(); 3205D.element.down().makePositioned(); 3206if(window.opera){D.element.setStyle({top:""}) 3207}D.element.makeClipping().setStyle({height:"0px"}).show() 3208},afterUpdateInternal:function(D){D.element.down().setStyle({bottom:(D.dims[0]-D.element.clientHeight)+"px"}) 3209},afterFinishInternal:function(D){D.element.undoClipping().undoPositioned(); 3210D.element.down().undoPositioned().setStyle({bottom:A}) 3211}},arguments[1]||{})) 3212}; 3213Effect.SlideUp=function(C){C=$(C).cleanWhitespace(); 3214var A=C.down().getStyle("bottom"); 3215var B=C.getDimensions(); 3216return new Effect.Scale(C,window.opera?0:1,Object.extend({scaleContent:false,scaleX:false,scaleMode:"box",scaleFrom:100,scaleMode:{originalHeight:B.height,originalWidth:B.width},restoreAfterFinish:true,afterSetup:function(D){D.element.makePositioned(); 3217D.element.down().makePositioned(); 3218if(window.opera){D.element.setStyle({top:""}) 3219}D.element.makeClipping().show() 3220},afterUpdateInternal:function(D){D.element.down().setStyle({bottom:(D.dims[0]-D.element.clientHeight)+"px"}) 3221},afterFinishInternal:function(D){D.element.hide().undoClipping().undoPositioned(); 3222D.element.down().undoPositioned().setStyle({bottom:A}) 3223}},arguments[1]||{})) 3224}; 3225Effect.Squish=function(A){return new Effect.Scale(A,window.opera?1:0,{restoreAfterFinish:true,beforeSetup:function(B){B.element.makeClipping() 3226},afterFinishInternal:function(B){B.element.hide().undoClipping() 3227}}) 3228}; 3229Effect.Grow=function(C){C=$(C); 3230var B=Object.extend({direction:"center",moveTransition:Effect.Transitions.sinoidal,scaleTransition:Effect.Transitions.sinoidal,opacityTransition:Effect.Transitions.full},arguments[1]||{});
3231var A={top:C.style.top,left:C.style.left,height:C.style.height,width:C.style.width,opacity:C.getInlineOpacity()}; 3232var G=C.getDimensions(); 3233var H,F; 3234var E,D; 3235switch(B.direction){case"top-left":H=F=E=D=0; 3236break; 3237case"top-right":H=G.width; 3238F=D=0; 3239E=-G.width; 3240break; 3241case"bottom-left":H=E=0; 3242F=G.height; 3243D=-G.height; 3244break; 3245case"bottom-right":H=G.width; 3246F=G.height; 3247E=-G.width; 3248D=-G.height; 3249break; 3250case"center":H=G.width/2; 3251F=G.height/2; 3252E=-G.width/2; 3253D=-G.height/2; 3254break 3255}return new Effect.Move(C,{x:H,y:F,duration:0.01,beforeSetup:function(I){I.element.hide().makeClipping().makePositioned() 3256},afterFinishInternal:function(I){new Effect.Parallel([new Effect.Opacity(I.element,{sync:true,to:1,from:0,transition:B.opacityTransition}),new Effect.Move(I.element,{x:E,y:D,sync:true,transition:B.moveTransition}),new Effect.Scale(I.element,100,{scaleMode:{originalHeight:G.height,originalWidth:G.width},sync:true,scaleFrom:window.opera?1:0,transition:B.scaleTransition,restoreAfterFinish:true})],Object.extend({beforeSetup:function(J){J.effects[0].element.setStyle({height:"0px"}).show() 3257},afterFinishInternal:function(J){J.effects[0].element.undoClipping().undoPositioned().setStyle(A) 3258}},B)) 3259}}) 3260}; 3261Effect.Shrink=function(C){C=$(C); 3262var B=Object.extend({direction:"center",moveTransition:Effect.Transitions.sinoidal,scaleTransition:Effect.Transitions.sinoidal,opacityTransition:Effect.Transitions.none},arguments[1]||{}); 3263var A={top:C.style.top,left:C.style.left,height:C.style.height,width:C.style.width,opacity:C.getInlineOpacity()}; 3264var F=C.getDimensions(); 3265var E,D; 3266switch(B.direction){case"top-left":E=D=0; 3267break; 3268case"top-right":E=F.width; 3269D=0; 3270break; 3271case"bottom-left":E=0; 3272D=F.height; 3273break; 3274case"bottom-right":E=F.width; 3275D=F.height; 3276break; 3277case"center":E=F.width/2; 3278D=F.height/2; 3279break 3280}return new Effect.Parallel([new Effect.Opacity(C,{sync:true,to:0,from:1,transition:B.opacityTransition}),new Effect.Scale(C,window.opera?1:0,{sync:true,transition:B.scaleTransition,restoreAfterFinish:true}),new Effect.Move(C,{x:E,y:D,sync:true,transition:B.moveTransition})],Object.extend({beforeStartInternal:function(G){G.effects[0].element.makePositioned().makeClipping() 3281},afterFinishInternal:function(G){G.effects[0].element.hide().undoClipping().undoPositioned().setStyle(A) 3282}},B)) 3283}; 3284Effect.Pulsate=function(C){C=$(C); 3285var B=arguments[1]||{}; 3286var A=C.getInlineOpacity(); 3287var E=B.transition||Effect.Transitions.sinoidal; 3288var D=function(F){return E(1-Effect.Transitions.pulse(F,B.pulses)) 3289}; 3290D.bind(E); 3291return new Effect.Opacity(C,Object.extend(Object.extend({duration:2,from:0,afterFinishInternal:function(F){F.element.setStyle({opacity:A}) 3292}},B),{transition:D})) 3293}; 3294Effect.Fold=function(B){B=$(B); 3295var A={top:B.style.top,left:B.style.left,width:B.style.width,height:B.style.height}; 3296B.makeClipping(); 3297return new Effect.Scale(B,5,Object.extend({scaleContent:false,scaleX:false,afterFinishInternal:function(C){new Effect.Scale(B,1,{scaleContent:false,scaleY:false,afterFinishInternal:function(D){D.element.hide().undoClipping().setStyle(A) 3298}}) 3299}},arguments[1]||{})) 3300}; 3301Effect.Morph=Class.create(Effect.Base,{initialize:function(C){this.element=$(C); 3302if(!this.element){throw (Effect._elementDoesNotExistError) 3303}var A=Object.extend({style:{}},arguments[1]||{}); 3304if(!Object.isString(A.style)){this.style=$H(A.style) 3305}else{if(A.style.include(":")){this.style=A.style.parseStyle() 3306}else{this.element.addClassName(A.style); 3307this.style=$H(this.element.getStyles()); 3308this.element.removeClassName(A.style); 3309var B=this.element.getStyles(); 3310this.style=this.style.reject(function(D){return D.value==B[D.key] 3311}); 3312A.afterFinishInternal=function(D){D.element.addClassName(D.options.style); 3313D.transforms.each(function(E){D.element.style[E.style]="" 3314}) 3315} 3316}}this.start(A) 3317},setup:function(){function A(B){if(!B||["rgba(0, 0, 0, 0)","transparent"].include(B)){B="#ffffff" 3318}B=B.parseColor(); 3319return $R(0,2).map(function(C){return parseInt(B.slice(C*2+1,C*2+3),16) 3320}) 3321}this.transforms=this.style.map(function(G){var F=G[0],E=G[1],D=null; 3322if(E.parseColor("#zzzzzz")!="#zzzzzz"){E=E.parseColor(); 3323D="color" 3324}else{if(F=="opacity"){E=parseFloat(E); 3325if(Prototype.Browser.IE&&(!this.element.currentStyle.hasLayout)){this.element.setStyle({zoom:1}) 3326}}else{if(Element.CSS_LENGTH.test(E)){var C=E.match(/^([\+\-]?[0-9\.]+)(.*)$/); 3327E=parseFloat(C[1]); 3328D=(C.length==3)?C[2]:null 3329}}}var B=this.element.getStyle(F); 3330return{style:F.camelize(),originalValue:D=="color"?A(B):parseFloat(B||0),targetValue:D=="color"?A(E):E,unit:D} 3331}.bind(this)).reject(function(B){return((B.originalValue==B.targetValue)||(B.unit!="color"&&(isNaN(B.originalValue)||isNaN(B.targetValue)))) 3332}) 3333},update:function(A){var D={},B,C=this.transforms.length; 3334while(C--){D[(B=this.transforms[C]).style]=B.unit=="color"?"#"+(Math.round(B.originalValue[0]+(B.targetValue[0]-B.originalValue[0])*A)).toColorPart()+(Math.round(B.originalValue[1]+(B.targetValue[1]-B.originalValue[1])*A)).toColorPart()+(Math.round(B.originalValue[2]+(B.targetValue[2]-B.originalValue[2])*A)).toColorPart():(B.originalValue+(B.targetValue-B.originalValue)*A).toFixed(3)+(B.unit===null?"":B.unit) 3335}this.element.setStyle(D,true) 3336}}); 3337Effect.Transform=Class.create({initialize:function(A){this.tracks=[]; 3338this.options=arguments[1]||{}; 3339this.addTracks(A) 3340},addTracks:function(A){A.each(function(B){B=$H(B); 3341var C=B.values().first(); 3342this.tracks.push($H({ids:B.keys().first(),effect:Effect.Morph,options:{style:C}})) 3343}.bind(this)); 3344return this 3345},play:function(){return new Effect.Parallel(this.tracks.map(function(A){var D=A.get("ids"),C=A.get("effect"),B=A.get("options"); 3346var E=[$(D)||$$(D)].flatten(); 3347return E.map(function(F){return new C(F,Object.extend({sync:true},B)) 3348}) 3349}).flatten(),this.options) 3350}}); 3351Element.CSS_PROPERTIES=$w("backgroundColor backgroundPosition borderBottomColor borderBottomStyle borderBottomWidth borderLeftColor borderLeftStyle borderLeftWidth borderRightColor borderRightStyle borderRightWidth borderSpacing borderTopColor borderTopStyle borderTopWidth bottom clip color fontSize fontWeight height left letterSpacing lineHeight marginBottom marginLeft marginRight marginTop markerOffset maxHeight maxWidth minHeight minWidth opacity outlineColor outlineOffset outlineWidth paddingBottom paddingLeft paddingRight paddingTop right textIndent top width wordSpacing zIndex"); 3352Element.CSS_LENGTH=/^(([\+\-]?[0-9\.]+)(em|ex|px|in|cm|mm|pt|pc|\%))|0$/; 3353String.__parseStyleElement=document.createElement("div"); 3354String.prototype.parseStyle=function(){var B,A=$H(); 3355if(Prototype.Browser.WebKit){B=new Element("div",{style:this}).style 3356}else{String.__parseStyleElement.innerHTML='<div style="'+this+'"></div>'; 3357B=String.__parseStyleElement.childNodes[0].style 3358}Element.CSS_PROPERTIES.each(function(C){if(B[C]){A.set(C,B[C]) 3359}}); 3360if(Prototype.Browser.IE&&this.include("opacity")){A.set("opacity",this.match(/opacity:\s*((?:0|1)?(?:\.\d*)?)/)[1]) 3361}return A 3362}; 3363if(document.defaultView&&document.defaultView.getComputedStyle){Element.getStyles=function(B){var A=document.defaultView.getComputedStyle($(B),null); 3364return Element.CSS_PROPERTIES.inject({},function(C,D){C[D]=A[D]; 3365return C 3366}) 3367} 3368}else{Element.getStyles=function(B){B=$(B); 3369var A=B.currentStyle,C; 3370C=Element.CSS_PROPERTIES.inject({},function(D,E){D[E]=A[E]; 3371return D 3372}); 3373if(!C.opacity){C.opacity=B.getOpacity() 3374}return C 3375} 3376}Effect.Methods={morph:function(A,B){A=$(A); 3377new Effect.Morph(A,Object.extend({style:B},arguments[2]||{})); 3378return A 3379},visualEffect:function(C,E,B){C=$(C); 3380var D=E.dasherize().camelize(),A=D.charAt(0).toUpperCase()+D.substring(1); 3381new Effect[A](C,B); 3382return C 3383},highlight:function(B,A){B=$(B); 3384new Effect.Highlight(B,A); 3385return B 3386}}; 3387$w("fade appear grow shrink fold blindUp blindDown slideUp slideDown pulsate shake puff squish switchOff dropOut").each(function(A){Effect.Methods[A]=function(C,B){C=$(C); 3388Effect[A.charAt(0).toUpperCase()+A.substring(1)](C,B); 3389return C 3390} 3391}); 3392$w("getInlineOpacity forceRerendering setContentZoom collectTextNodes collectTextNodesIgnoreClass getStyles").each(function(A){Effect.Methods[A]=Element[A] 3393}); 3394Element.addMethods(Effect.Methods); 3395if(Object.isUndefined(Effect)){throw ("dragdrop.js requires including script.aculo.us' effects.js library") 3396}var Droppables={drops:[],remove:function(A){this.drops=this.drops.reject(function(B){return B.element==$(A) 3397}) 3398},add:function(B){B=$(B); 3399var A=Object.extend({greedy:true,hoverclass:null,tree:false},arguments[1]||{}); 3400if(A.containment){A._containers=[]; 3401var C=A.containment; 3402if(Object.isArray(C)){C.each(function(D){A._containers.push($(D)) 3403}) 3404}else{A._containers.push($(C)) 3405}}if(A.accept){A.accept=[A.accept].flatten() 3406}Element.makePositioned(B); 3407A.element=B; 3408this.drops.push(A) 3409},findDeepestChild:function(A){deepest=A[0]; 3410for(i=1; 3411i<A.length; 3412++i){if(Element.isParent(A[i].element,deepest.element)){deepest=A[i] 3413}}return deepest 3414},isContained:function(B,A){var C; 3415if(A.tree){C=B.treeNode 3416}else{C=B.parentNode 3417}return A._containers.detect(function(D){return C==D 3418}) 3419},isAffected:function(A,C,B){return((B.element!=C)&&((!B._containers
3419)||this.isContained(C,B))&&((!B.accept)||(Element.classNames(C).detect(function(D){return B.accept.include(D) 3420})))&&Position.within(B.element,A[0],A[1])) 3421},deactivate:function(A){if(A.hoverclass){Element.removeClassName(A.element,A.hoverclass) 3422}this.last_active=null 3423},activate:function(A){if(A.hoverclass){Element.addClassName(A.element,A.hoverclass) 3424}this.last_active=A 3425},show:function(A,C){if(!this.drops.length){return 3426}var B,D=[]; 3427this.drops.each(function(E){if(Droppables.isAffected(A,C,E)){D.push(E) 3428}}); 3429if(D.length>0){B=Droppables.findDeepestChild(D) 3430}if(this.last_active&&this.last_active!=B){this.deactivate(this.last_active) 3431}if(B){Position.within(B.element,A[0],A[1]); 3432if(B.onHover){B.onHover(C,B.element,Position.overlap(B.overlap,B.element)) 3433}if(B!=this.last_active){Droppables.activate(B) 3434}}},fire:function(B,A){if(!this.last_active){return 3435}Position.prepare(); 3436if(this.isAffected([Event.pointerX(B),Event.pointerY(B)],A,this.last_active)){if(this.last_active.onDrop){this.last_active.onDrop(A,this.last_active.element,B); 3437return true 3438}}},reset:function(){if(this.last_active){this.deactivate(this.last_active) 3439}}}; 3440var Draggables={drags:[],observers:[],register:function(A){if(this.drags.length==0){this.eventMouseUp=this.endDrag.bindAsEventListener(this); 3441this.eventMouseMove=this.updateDrag.bindAsEventListener(this); 3442this.eventKeypress=this.keyPress.bindAsEventListener(this); 3443Event.observe(document,"mouseup",this.eventMouseUp); 3444Event.observe(document,"mousemove",this.eventMouseMove); 3445Event.observe(document,"keypress",this.eventKeypress) 3446}this.drags.push(A) 3447},unregister:function(A){this.drags=this.drags.reject(function(B){return B==A 3448}); 3449if(this.drags.length==0){Event.stopObserving(document,"mouseup",this.eventMouseUp); 3450Event.stopObserving(document,"mousemove",this.eventMouseMove); 3451Event.stopObserving(document,"keypress",this.eventKeypress) 3452}},activate:function(A){if(A.options.delay){this._timeout=setTimeout(function(){Draggables._timeout=null; 3453window.focus(); 3454Draggables.activeDraggable=A 3455}.bind(this),A.options.delay) 3456}else{window.focus(); 3457this.activeDraggable=A 3458}},deactivate:function(){this.activeDraggable=null 3459},updateDrag:function(A){if(!this.activeDraggable){return 3460}var B=[Event.pointerX(A),Event.pointerY(A)]; 3461if(this._lastPointer&&(this._lastPointer.inspect()==B.inspect())){return 3462}this._lastPointer=B; 3463this.activeDraggable.updateDrag(A,B) 3464},endDrag:function(A){if(this._timeout){clearTimeout(this._timeout); 3465this._timeout=null 3466}if(!this.activeDraggable){return 3467}this._lastPointer=null; 3468this.activeDraggable.endDrag(A); 3469this.activeDraggable=null 3470},keyPress:function(A){if(this.activeDraggable){this.activeDraggable.keyPress(A) 3471}},addObserver:function(A){this.observers.push(A); 3472this._cacheObserverCallbacks() 3473},removeObserver:function(A){this.observers=this.observers.reject(function(B){return B.element==A 3474}); 3475this._cacheObserverCallbacks() 3476},notify:function(B,A,C){if(this[B+"Count"]>0){this.observers.each(function(D){if(D[B]){D[B](B,A,C) 3477}}) 3478}if(A.options[B]){A.options[B](A,C) 3479}},_cacheObserverCallbacks:function(){["onStart","onEnd","onDrag"].each(function(A){Draggables[A+"Count"]=Draggables.observers.select(function(B){return B[A] 3480}).length 3481}) 3482}}; 3483var Draggable=Class.create({initialize:function(B){var C={handle:false,reverteffect:function(F,E,D){var G=Math.sqrt(Math.abs(E^2)+Math.abs(D^2))*0.02; 3484new Effect.Move(F,{x:-D,y:-E,duration:G,queue:{scope:"_draggable",position:"end"}}) 3485},endeffect:function(E){var D=Object.isNumber(E._opacity)?E._opacity:1; 3486new Effect.Opacity(E,{duration:0.2,from:0.7,to:D,queue:{scope:"_draggable",position:"end"},afterFinish:function(){Draggable._dragging[E]=false 3487}}) 3488},zindex:1000,revert:false,quiet:false,scroll:false,scrollSensitivity:20,scrollSpeed:15,snap:false,delay:0}; 3489if(!arguments[1]||Object.isUndefined(arguments[1].endeffect)){Object.extend(C,{starteffect:function(D){D._opacity=Element.getOpacity(D); 3490Draggable._dragging[D]=true; 3491new Effect.Opacity(D,{duration:0.2,from:D._opacity,to:0.7}) 3492}}) 3493}var A=Object.extend(C,arguments[1]||{}); 3494this.element=$(B); 3495if(A.handle&&Object.isString(A.handle)){this.handle=this.element.down("."+A.handle,0) 3496}if(!this.handle){this.handle=$(A.handle) 3497}if(!this.handle){this.handle=this.element 3498}if(A.scroll&&!A.scroll.scrollTo&&!A.scroll.outerHTML){A.scroll=$(A.scroll); 3499this._isScrollChild=Element.childOf(this.element,A.scroll) 3500}Element.makePositioned(this.element); 3501this.options=A; 3502this.dragging=false; 3503this.eventMouseDown=this.initDrag.bindAsEventListener(this); 3504Event.observe(this.handle,"mousedown",this.eventMouseDown); 3505Draggables.register(this) 3506}
3506,destroy:function(){Event.stopObserving(this.handle,"mousedown",this.eventMouseDown); 3507Draggables.unregister(this) 3508},currentDelta:function(){return([parseInt(Element.getStyle(this.element,"left")||"0"),parseInt(Element.getStyle(this.element,"top")||"0")]) 3509},initDrag:function(A){if(!Object.isUndefined(Draggable._dragging[this.element])&&Draggable._dragging[this.element]){return 3510}if(Event.isLeftClick(A)){var C=Event.element(A); 3511if((tag_name=C.tagName.toUpperCase())&&(tag_name=="INPUT"||tag_name=="SELECT"||tag_name=="OPTION"||tag_name=="BUTTON"||tag_name=="TEXTAREA")){return 3512}var B=[Event.pointerX(A),Event.pointerY(A)]; 3513var D=Position.cumulativeOffset(this.element); 3514this.offset=[0,1].map(function(E){return(B[E]-D[E]) 3515}); 3516Draggables.activate(this); 3517Event.stop(A) 3518}},startDrag:function(B){this.dragging=true; 3519if(!this.delta){this.delta=this.currentDelta() 3520}if(this.options.zindex){this.originalZ=parseInt(Element.getStyle(this.element,"z-index")||0); 3521this.element.style.zIndex=this.options.zindex 3522}if(this.options.ghosting){this._clone=this.element.cloneNode(true); 3523this.element._originallyAbsolute=(this.element.getStyle("position")=="absolute"); 3524if(!this.element._originallyAbsolute){Position.absolutize(this.element) 3525}this.element.parentNode.insertBefore(this._clone,this.element) 3526}if(this.options.scroll){if(this.options.scroll==window){var A=this._getWindowScroll(this.options.scroll); 3527this.originalScrollLeft=A.left; 3528this.originalScrollTop=A.top 3529}else{this.originalScrollLeft=this.options.scroll.scrollLeft; 3530this.originalScrollTop=this.options.scroll.scrollTop 3531}}Draggables.notify("onStart",this,B); 3532if(this.options.starteffect){this.options.starteffect(this.element) 3533}},updateDrag:function(event,pointer){if(!this.dragging){this.startDrag(event) 3534}if(!this.options.quiet){Position.prepare(); 3535Droppables.show(pointer,this.element) 3536}Draggables.notify("onDrag",this,event); 3537this.draw(pointer); 3538if(this.options.change){this.options.change(this) 3539}if(this.options.scroll){this.stopScrolling(); 3540var p; 3541if(this.options.scroll==window){with(this._getWindowScroll(this.options.scroll)){p=[left,top,left+width,top+height] 3542}}else{p=Position.page(this.options.scroll); 3543p[0]+=this.options.scroll.scrollLeft+Position.deltaX; 3544p[1]+=this.options.scroll.scrollTop+Position.deltaY; 3545p.push(p[0]+this.options.scroll.offsetWidth); 3546p.push(p[1]+this.options.scroll.offsetHeight) 3547}var speed=[0,0]; 3548if(pointer[0]<(p[0]+this.options.scrollSensitivity)){speed[0]=pointer[0]-(p[0]+this.options.scrollSensitivity) 3549}if(pointer[1]<(p[1]+this.options.scrollSensitivity)){speed[1]=pointer[1]-(p[1]+this.options.scrollSensitivity) 3550}if(pointer[0]>(p[2]-this.options.scrollSensitivity)){speed[0]=pointer[0]-(p[2]-this.options.scrollSensitivity) 3551}if(pointer[1]>(p[3]-this.options.scrollSensitivity)){speed[1]=pointer[1]-(p[3]-this.options.scrollSensitivity) 3552}this.startScrolling(speed) 3553}if(Prototype.Browser.WebKit){window.scrollBy(0,0) 3554}Event.stop(event) 3555},finishDrag:function(B,E){this.dragging=false; 3556if(this.options.quiet){Position.prepare(); 3557var D=[Event.pointerX(B),Event.pointerY(B)]; 3558Droppables.show(D,this.element) 3559}if(this.options.ghosting){if(!this.element._originallyAbsolute){Position.relativize(this.element) 3560}delete this.element._originallyAbsolute; 3561Element.remove(this._clone); 3562this._clone=null 3563}var F=false; 3564if(E){F=Droppables.fire(B,this.element); 3565if(!F){F=false 3566}}if(F&&this.options.onDropped){this.options.onDropped(this.element) 3567}Draggables.notify("onEnd",this,B); 3568var A=this.options.revert; 3569if(A&&Object.isFunction(A)){A=A(this.element) 3570}var C=this.currentDelta(); 3571if(A&&this.options.reverteffect){if(F==0||A!="failure"){this.options.reverteffect(this.element,C[1]-this.delta[1],C[0]-this.delta[0]) 3572}}else{this.delta=C 3573}if(this.options.zindex){this.element.style.zIndex=this.originalZ 3574}if(this.options.endeffect){this.options.endeffect(this.element) 3575}Draggables.deactivate(this); 3576Droppables.reset() 3577},keyPress:function(A){if(A.keyCode!=Event.KEY_ESC){return 3578}this.finishDrag(A,false); 3579Event.stop(A) 3580},endDrag:function(A){if(!this.dragging){return 3581}this.stopScrolling(); 3582this.finishDrag(A,true); 3583Event.stop(A) 3584},draw:function(A){var F=Position.cumulativeOffset(this.element); 3585if(this.options.ghosting){var C=Position.realOffset(this.element); 3586F[0]+=C[0]-Position.deltaX; 3587F[1]+=C[1]-Position.deltaY 3588}var E=this.currentDelta(); 3589F[0]-=E[0]; 3590F[1]-=E[1]; 3591if(this.options.scroll&&(this.options.scroll!=window&&this._isScrollChild)){F[0]-=this.options.scroll.
3591scrollLeft-this.originalScrollLeft; 3592F[1]-=this.options.scroll.scrollTop-this.originalScrollTop 3593}var D=[0,1].map(function(G){return(A[G]-F[G]-this.offset[G]) 3594}.bind(this)); 3595if(this.options.snap){if(Object.isFunction(this.options.snap)){D=this.options.snap(D[0],D[1],this) 3596}else{if(Object.isArray(this.options.snap)){D=D.map(function(G,H){return(G/this.options.snap[H]).round()*this.options.snap[H] 3597}.bind(this)) 3598}else{D=D.map(function(G){return(G/this.options.snap).round()*this.options.snap 3599}.bind(this)) 3600}}}var B=this.element.style; 3601if((!this.options.constraint)||(this.options.constraint=="horizontal")){B.left=D[0]+"px" 3602}if((!this.options.constraint)||(this.options.constraint=="vertical")){B.top=D[1]+"px" 3603}if(B.visibility=="hidden"){B.visibility="" 3604}},stopScrolling:function(){if(this.scrollInterval){clearInterval(this.scrollInterval); 3605this.scrollInterval=null; 3606Draggables._lastScrollPointer=null 3607}},startScrolling:function(A){if(!(A[0]||A[1])){return 3608}this.scrollSpeed=[A[0]*this.options.scrollSpeed,A[1]*this.options.scrollSpeed]; 3609this.lastScrolled=new Date(); 3610this.scrollInterval=setInterval(this.scroll.bind(this),10) 3611},scroll:function(){var current=new Date(); 3612var delta=current-this.lastScrolled; 3613this.lastScrolled=current; 3614if(this.options.scroll==window){with(this._getWindowScroll(this.options.scroll)){if(this.scrollSpeed[0]||this.scrollSpeed[1]){var d=delta/1000; 3615this.options.scroll.scrollTo(left+d*this.scrollSpeed[0],top+d*this.scrollSpeed[1]) 3616}}}else{this.options.scroll.scrollLeft+=this.scrollSpeed[0]*delta/1000; 3617this.options.scroll.scrollTop+=this.scrollSpeed[1]*delta/1000 3618}Position.prepare(); 3619Droppables.show(Draggables._lastPointer,this.element); 3620Draggables.notify("onDrag",this); 3621if(this._isScrollChild){Draggables._lastScrollPointer=Draggables._lastScrollPointer||$A(Draggables._lastPointer); 3622Draggables._lastScrollPointer[0]+=this.scrollSpeed[0]*delta/1000; 3623Draggables._lastScrollPointer[1]+=this.scrollSpeed[1]*delta/1000; 3624if(Draggables._lastScrollPointer[0]<0){Draggables._lastScrollPointer[0]=0 3625}if(Draggables._lastScrollPointer[1]<0){Draggables._lastScrollPointer[1]=0 3626}this.draw(Draggables._lastScrollPointer) 3627}if(this.options.change){this.options.change(this) 3628}},_getWindowScroll:function(w){var T,L,W,H; 3629with(w.document){if(w.document.documentElement&&documentElement.scrollTop){T=documentElement.scrollTop; 3630L=documentElement.scrollLeft 3631}else{if(w.document.body){T=body.scrollTop; 3632L=body.scrollLeft 3633}}if(w.innerWidth){W=w.innerWidth; 3634H=w.innerHeight 3635}else{if(w.document.documentElement&&documentElement.clientWidth){W=documentElement.clientWidth; 3636H=documentElement.clientHeight 3637}else{W=body.offsetWidth; 3638H=body.offsetHeight 3639}}}return{top:T,left:L,width:W,height:H} 3640}}); 3641Draggable._dragging={}; 3642var SortableObserver=Class.create({initialize:function(B,A){this.element=$(B); 3643this.observer=A; 3644this.lastValue=Sortable.serialize(this.element) 3645},onStart:function(){this.lastValue=Sortable.serialize(this.element) 3646},onEnd:function(){Sortable.unmark(); 3647if(this.lastValue!=Sortable.serialize(this.element)){this.observer(this.element) 3648}}}); 3649var Sortable={SERIALIZE_RULE:/^[^_\-](?:[A-Za-z0-9\-\_]*)[_](.*)$/,sortables:{},_findRootElement:function(A){while(A.tagName.toUpperCase()!="BODY"){if(A.id&&Sortable.sortables[A.id]){return A 3650}A=A.parentNode 3651}},options:function(A){A=Sortable._findRootElement($(A)); 3652if(!A){return 3653}return Sortable.sortables[A.id] 3654},destroy:function(A){var B=Sortable.options(A); 3655if(B){Draggables.removeObserver(B.element); 3656B.droppables.each(function(C){Droppables.remove(C) 3657}); 3658B.draggables.invoke("destroy"); 3659delete Sortable.sortables[B.element.id] 3660}},create:function(C){C=$(C); 3661var B=Object.extend({element:C,tag:"li",dropOnEmpty:false,tree:false,treeTag:"ul",overlap:"vertical",constraint:"vertical",containment:C,handle:false,only:false,delay:0,hoverclass:null,ghosting:false,quiet:false,scroll:false,scrollSensitivity:20,scrollSpeed:15,format:this.SERIALIZE_RULE,elements:false,handles:false,onChange:Prototype.emptyFunction,onUpdate:Prototype.emptyFunction},arguments[1]||{}); 3662this.destroy(C); 3663var A={revert:true,quiet:B.quiet,scroll:B.scroll,scrollSpeed:B.scrollSpeed,scrollSensitivity:B.scrollSensitivity,delay:B.delay,ghosting:
3663B.ghosting,constraint:B.constraint,handle:B.handle}; 3664if(B.starteffect){A.starteffect=B.starteffect 3665}if(B.reverteffect){A.reverteffect=B.reverteffect 3666}else{if(B.ghosting){A.reverteffect=function(F){F.style.top=0; 3667F.style.left=0 3668} 3669}}if(B.endeffect){A.endeffect=B.endeffect 3670}if(B.zindex){A.zindex=B.zindex 3671}var D={overlap:B.overlap,containment:B.containment,tree:B.tree,hoverclass:B.hoverclass,onHover:Sortable.onHover}; 3672var E={onHover:Sortable.onEmptyHover,overlap:B.overlap,containment:B.containment,hoverclass:B.hoverclass}; 3673Element.cleanWhitespace(C); 3674B.draggables=[]; 3675B.droppables=[]; 3676if(B.dropOnEmpty||B.tree){Droppables.add(C,E); 3677B.droppables.push(C) 3678}(B.elements||this.findElements(C,B)||[]).each(function(H,F){var G=B.handles?$(B.handles[F]):(B.handle?$(H).select("."+B.handle)[0]:H); 3679B.draggables.push(new Draggable(H,Object.extend(A,{handle:G}))); 3680Droppables.add(H,D); 3681if(B.tree){H.treeNode=C 3682}B.droppables.push(H) 3683}); 3684if(B.tree){(Sortable.findTreeElements(C,B)||[]).each(function(F){Droppables.add(F,E); 3685F.treeNode=C; 3686B.droppables.push(F) 3687}) 3688}this.sortables[C.id]=B; 3689Draggables.addObserver(new SortableObserver(C,B.onUpdate)) 3690},findElements:function(B,A){return Element.findChildren(B,A.only,A.tree?true:false,A.tag) 3691},findTreeElements:function(B,A){return Element.findChildren(B,A.only,A.tree?true:false,A.treeTag) 3692},onHover:function(E,D,A){if(Element.isParent(D,E)){return 3693}if(A>0.33&&A<0.66&&Sortable.options(D).tree){return 3694}else{if(A>0.5){Sortable.mark(D,"before"); 3695if(D.previousSibling!=E){var B=E.parentNode; 3696E.style.visibility="hidden"; 3697D.parentNode.insertBefore(E,D); 3698if(D.parentNode!=B){Sortable.options(B).onChange(E) 3699}Sortable.options(D.parentNode).onChange(E) 3700}}else{Sortable.mark(D,"after"); 3701var C=D.nextSibling||null; 3702if(C!=E){var B=E.parentNode; 3703E.style.visibility="hidden"; 3704D.parentNode.insertBefore(E,C); 3705if(D.parentNode!=B){Sortable.options(B).onChange(E) 3706}Sortable.options(D.parentNode).onChange(E) 3707}}}},onEmptyHover:function(E,G,H){var I=E.parentNode; 3708var A=Sortable.options(G); 3709if(!Element.isParent(G,E)){var F; 3710var C=Sortable.findElements(G,{tag:A.tag,only:A.only}); 3711var B=null; 3712if(C){var D=Element.offsetSize(G,A.overlap)*(1-H); 3713for(F=0; 3714F<C.length; 3715F+=1){if(D-Element.offsetSize(C[F],A.overlap)>=0){D-=Element.offsetSize(C[F],A.overlap) 3716}else{if(D-(Element.offsetSize(C[F],A.overlap)/2)>=0){B=F+1<C.length?C[F+1]:null; 3717break 3718}else{B=C[F]; 3719break 3720}}}}G.insertBefore(E,B); 3721Sortable.options(I).onChange(E); 3722A.onChange(E) 3723}},unmark:function(){if(Sortable._marker){Sortable._marker.hide() 3724}},mark:function(B,A){var D=Sortable.options(B.parentNode); 3725if(D&&!D.ghosting){return 3726}if(!Sortable._marker){Sortable._marker=($("dropmarker")||Element.extend(document.createElement("DIV"))).hide().addClassName("dropmarker").setStyle({position:"absolute"}); 3727document.getElementsByTagName("body").item(0).appendChild(Sortable._marker) 3728}var C=Position.cumulativeOffset(B); 3729Sortable._marker.setStyle({left:C[0]+"px",top:C[1]+"px"}); 3730if(A=="after"){if(D.overlap=="horizontal"){Sortable._marker.setStyle({left:(C[0]+B.clientWidth)+"px"}) 3731}else{Sortable._marker.setStyle({top:(C[1]+B.clientHeight)+"px"}) 3732}}Sortable._marker.show() 3733},_tree:function(E,B,F){var D=Sortable.findElements(E,B)||[]; 3734for(var C=0; 3735C<D.length; 3736++C){var A=D[C].id.match(B.format); 3737if(!A){continue 3738}var G={id:encodeURIComponent(A?A[1]:null),element:E,parent:F,children:[],position:F.children.length,container:$(D[C]).down(B.treeTag)}; 3739if(G.container){this._tree(G.container,B,G) 3740}F.children.push(G) 3741}return F 3742},tree:function(D){D=$(D); 3743var C=this.options(D); 3744var B=Object.extend({tag:C.tag,treeTag:C.treeTag,only:C.only,name:D.id,format:C.format},arguments[1]||{}); 3745var A={id:null,parent:null,children:[],container:D,position:0}; 3746return Sortable._tree(D,B,A) 3747},_constructIndex:function(B){var A=""; 3748do{if(B.id){A="["+B.position+"]"+A 3749}}while((B=B.parent)!=null); 3750return A 3751},sequence:function(B){B=$(B); 3752var A=Object.extend(this.options(B),arguments[1]||{}); 3753return $(this.findElements(B,A)||[]).map(function(C){return C.id.match(A.format)?C.id.match(A.format)[1]:"" 3754}) 3755},setSequence:function(B,C){B=$(B); 3756var A=Object.extend(this.options(B),arguments[2]||{}); 3757var D={}; 3758this.findElements(B,A).each(function(E){if(E.id.match(A.format)){D[E.id.match(A.format)[1]]=[E,E.parentNode] 3759}E.parentNode.removeChild(E) 3760}); 3761C.each(function(E){var F=D[E]; 3762if(F){F[1].appendChild(F[0]); 3763delete D[E] 3764}}) 3765},serialize:function(C){C=$(C);
3766var B=Object.extend(Sortable.options(C),arguments[1]||{}); 3767var A=encodeURIComponent((arguments[1]&&arguments[1].name)?arguments[1].name:C.id); 3768if(B.tree){return Sortable.tree(C,arguments[1]).children.map(function(D){return[A+Sortable._constructIndex(D)+"[id]="+encodeURIComponent(D.id)].concat(D.children.map(arguments.callee)) 3769}).flatten().join("&") 3770}else{return Sortable.sequence(C,arguments[1]).map(function(D){return A+"[]="+encodeURIComponent(D) 3771}).join("&") 3772}}}; 3773Element.isParent=function(B,A){if(!B.parentNode||B==A){return false 3774}if(B.parentNode==A){return true 3775}return Element.isParent(B.parentNode,A) 3776}; 3777Element.findChildren=function(D,B,A,C){if(!D.hasChildNodes()){return null 3778}C=C.toUpperCase(); 3779if(B){B=[B].flatten() 3780}var E=[]; 3781$A(D.childNodes).each(function(G){if(G.tagName&&G.tagName.toUpperCase()==C&&(!B||(Element.classNames(G).detect(function(H){return B.include(H) 3782})))){E.push(G) 3783}if(A){var F=Element.findChildren(G,B,A,C); 3784if(F){E.push(F) 3785}}}); 3786return(E.length>0?E.flatten():[]) 3787}; 3788Element.offsetSize=function(A,B){return A["offset"+((B=="vertical"||B=="height")?"Height":"Width")] 3789}; 3790if(typeof Effect=="undefined"){throw ("controls.js requires including script.aculo.us' effects.js library") 3791}var Autocompleter={}; 3792Autocompleter.Base=Class.create({baseInitialize:function(B,C,A){B=$(B); 3793this.element=B; 3794this.update=$(C); 3795this.hasFocus=false; 3796this.changed=false; 3797this.active=false; 3798this.index=0; 3799this.entryCount=0; 3800this.oldElementValue=this.element.value; 3801if(this.setOptions){this.setOptions(A) 3802}else{this.options=A||{} 3803}this.options.paramName=this.options.paramName||this.element.name; 3804this.options.tokens=this.options.tokens||[]; 3805this.options.frequency=this.options.frequency||0.4; 3806this.options.minChars=this.options.minChars||1; 3807this.options.onShow=this.options.onShow||function(D,E){if(!E.style.position||E.style.position=="absolute"){E.style.position="absolute"; 3808Position.clone(D,E,{setHeight:false,offsetTop:D.offsetHeight}) 3809}Effect.Appear(E,{duration:0.15}) 3810}; 3811this.options.onHide=this.options.onHide||function(D,E){new Effect.Fade(E,{duration:0.15}) 3812}; 3813if(typeof (this.options.tokens)=="string"){this.options.tokens=new Array(this.options.tokens) 3814}if(!this.options.tokens.include("\n")){this.options.tokens.push("\n") 3815}this.observer=null; 3816this.element.setAttribute("autocomplete","off"); 3817Element.hide(this.update); 3818Event.observe(this.element,"blur",this.onBlur.bindAsEventListener(this)); 3819Event.observe(this.element,"keydown",this.onKeyPress.bindAsEventListener(this)) 3820},show:function(){if(Element.getStyle(this.update,"display")=="none"){this.options.onShow(this.element,this.update) 3821}if(!this.iefix&&(Prototype.Browser.IE)&&(Element.getStyle(this.update,"position")=="absolute")){new Insertion.After(this.update,'<iframe id="'+this.update.id+'_iefix" style="display:none;position:absolute;filter:progid:DXImageTransform.Microsoft.Alpha(opacity=0);" src="javascript:false;" frameborder="0" scrolling="no"></iframe>'); 3822this.iefix=$(this.update.id+"_iefix") 3823}if(this.iefix){setTimeout(this.fixIEOverlapping.bind(this),50) 3824}},fixIEOverlapping:function(){Position.clone(this.update,this.iefix,{setTop:(!this.update.style.height)}); 3825this.iefix.style.zIndex=1; 3826this.update.style.zIndex=2; 3827Element.show(this.iefix) 3828},hide:function(){this.stopIndicator(); 3829if(Element.getStyle(this.update,"display")!="none"){this.options.onHide(this.element,this.update) 3830}if(this.iefix){Element.hide(this.iefix) 3831}},startIndicator:function(){if(this.options.indicator){Element.show(this.options.indicator) 3832}},stopIndicator:function(){if(this.options.indicator){Element.hide(this.options.indicator) 3833}},onKeyPress:function(A){if(this.active){switch(A.keyCode){case Event.KEY_TAB:case Event.KEY_RETURN:this.selectEntry(); 3834Event.stop(A); 3835case Event.KEY_ESC:this.hide(); 3836this.active=false; 3837Event.stop(A); 3838return ; 3839case Event.KEY_LEFT:case Event.KEY_RIGHT:return ;
3840case Event.KEY_UP:this.markPrevious(); 3841this.render(); 3842Event.stop(A); 3843return ; 3844case Event.KEY_DOWN:this.markNext(); 3845this.render(); 3846Event.stop(A); 3847return 3848}}else{if(A.keyCode==Event.KEY_TAB||A.keyCode==Event.KEY_RETURN||(Prototype.Browser.WebKit>0&&A.keyCode==0)){return 3849}}this.changed=true; 3850this.hasFocus=true; 3851if(this.observer){clearTimeout(this.observer) 3852}this.observer=setTimeout(this.onObserverEvent.bind(this),this.options.frequency*1000) 3853},activate:function(){this.changed=false; 3854this.hasFocus=true; 3855this.getUpdatedChoices() 3856},onHover:function(B){var A=Event.findElement(B,"LI"); 3857if(this.index!=A.autocompleteIndex){this.index=A.autocompleteIndex; 3858this.render() 3859}Event.stop(B) 3860},onClick:function(B){var A=Event.findElement(B,"LI"); 3861this.index=A.autocompleteIndex; 3862this.selectEntry(); 3863this.hide() 3864},onBlur:function(A){setTimeout(this.hide.bind(this),250); 3865this.hasFocus=false; 3866this.active=false 3867},render:function(){if(this.entryCount>0){for(var A=0; 3868A<this.entryCount; 3869A++){this.index==A?Element.addClassName(this.getEntry(A),"selected"):Element.removeClassName(this.getEntry(A),"selected") 3870}if(this.hasFocus){this.show(); 3871this.active=true 3872}}else{this.active=false; 3873this.hide() 3874}},markPrevious:function(){if(this.index>0){this.index-- 3875}else{this.index=this.entryCount-1 3876}this.getEntry(this.index).scrollIntoView(true) 3877},markNext:function(){if(this.index<this.entryCount-1){this.index++ 3878}else{this.index=0 3879}this.getEntry(this.index).scrollIntoView(false) 3880},getEntry:function(A){return this.update.firstChild.childNodes[A] 3881},getCurrentEntry:function(){return this.getEntry(this.index) 3882},selectEntry:function(){this.active=false; 3883this.updateElement(this.getCurrentEntry()) 3884},updateElement:function(F){if(this.options.updateElement){this.options.updateElement(F); 3885return 3886}var D=""; 3887if(this.options.select){var A=$(F).select("."+this.options.select)||[]; 3888if(A.length>0){D=Element.collectTextNodes(A[0],this.options.select) 3889}}else{D=Element.collectTextNodesIgnoreClass(F,"informal") 3890}var C=this.getTokenBounds(); 3891if(C[0]!=-1){var E=this.element.value.substr(0,C[0]); 3892var B=this.element.value.substr(C[0]).match(/^\s+/); 3893if(B){E+=B[0] 3894}this.element.value=E+D+this.element.value.substr(C[1]) 3895}else{this.element.value=D 3896}this.oldElementValue=this.element.value; 3897this.element.focus(); 3898if(this.options.afterUpdateElement){this.options.afterUpdateElement(this.element,F) 3899}},updateChoices:function(C){if(!this.changed&&this.hasFocus){this.update.innerHTML=C; 3900Element.cleanWhitespace(this.update); 3901Element.cleanWhitespace(this.update.down()); 3902if(this.update.firstChild&&this.update.down().childNodes){this.entryCount=this.update.down().childNodes.length; 3903for(var A=0; 3904A<this.entryCount; 3905A++){var B=this.getEntry(A); 3906B.autocompleteIndex=A; 3907this.addObservers(B) 3908}}else{this.entryCount=0 3909}this.stopIndicator(); 3910this.index=0; 3911if(this.entryCount==1&&this.options.autoSelect){this.selectEntry(); 3912this.hide() 3913}else{this.render() 3914}}},addObservers:function(A){Event.observe(A,"mouseover",this.onHover.bindAsEventListener(this)); 3915Event.observe(A,"click",this.onClick.bindAsEventListener(this)) 3916},onObserverEvent:function(){this.changed=false; 3917this.tokenBounds=null; 3918if(this.getToken().length>=this.options.minChars){this.getUpdatedChoices() 3919}else{this.active=false; 3920this.hide() 3921}this.oldElementValue=this.element.value 3922},getToken:function(){var A=this.getTokenBounds(); 3923return this.element.value.substring(A[0],A[1]).strip() 3924},getTokenBounds:function(){if(null!=this.tokenBounds){return this.tokenBounds 3925}var E=this.element.value; 3926if(E.strip().empty()){return[-1,0] 3927}var F=arguments.callee.getFirstDifferencePos(E,this.oldElementValue); 3928var H=(F==this.oldElementValue.length?1:0); 3929var D=-1,C=E.length; 3930var G; 3931for(var B=0,A=this.options.tokens.length; 3932B<A; 3933++B){G=E.lastIndexOf(this.options.tokens[B],F+H-1); 3934if(G>D){D=G 3935}G=E.indexOf(this.options.tokens[B],F+H); 3936if(-1!=G&&G<C){C=G 3937}}return(this.tokenBounds=[D+1,C]) 3938}}); 3939Autocompleter.Base.prototype.getTokenBounds.getFirstDifferencePos=function(C,A){var D=Math.min(C.length,A.length); 3940for(var B=0; 3941B<D; 3942++B){if(C[B]!=A[B]){return B 3943}}return D 3944}; 3945Ajax.Autocompleter=Class.create(Autocompleter.Base,{initialize:function(C,D,B,A){this.baseInitialize(C,D,A); 3946this.options.asynchronous=true; 3947this.options.onComplete=this.onComplete.bind(this); 3948this.options.defaultParams=this.options.parameters||null; 3949this.url=B 3950}
3950,getUpdatedChoices:function(){this.startIndicator(); 3951var A=encodeURIComponent(this.options.paramName)+"="+encodeURIComponent(this.getToken()); 3952this.options.parameters=this.options.callback?this.options.callback(this.element,A):A; 3953if(this.options.defaultParams){this.options.parameters+="&"+this.options.defaultParams 3954}new Ajax.Request(this.url,this.options) 3955},onComplete:function(A){this.updateChoices(A.responseText) 3956}}); 3957Autocompleter.Local=Class.create(Autocompleter.Base,{initialize:function(B,D,C,A){this.baseInitialize(B,D,A); 3958this.options.array=C 3959},getUpdatedChoices:function(){this.updateChoices(this.options.selector(this)) 3960},setOptions:function(A){this.options=Object.extend({choices:10,partialSearch:true,partialChars:2,ignoreCase:true,fullSearch:false,selector:function(B){var D=[]; 3961var C=[]; 3962var H=B.getToken(); 3963var G=0; 3964for(var E=0; 3965E<B.options.array.length&&D.length<B.options.choices; 3966E++){var F=B.options.array[E]; 3967var I=B.options.ignoreCase?F.toLowerCase().indexOf(H.toLowerCase()):F.indexOf(H); 3968while(I!=-1){if(I==0&&F.length!=H.length){D.push("<li><strong>"+F.substr(0,H.length)+"</strong>"+F.substr(H.length)+"</li>"); 3969break 3970}else{if(H.length>=B.options.partialChars&&B.options.partialSearch&&I!=-1){if(B.options.fullSearch||/\s/.test(F.substr(I-1,1))){C.push("<li>"+F.substr(0,I)+"<strong>"+F.substr(I,H.length)+"</strong>"+F.substr(I+H.length)+"</li>"); 3971break 3972}}}I=B.options.ignoreCase?F.toLowerCase().indexOf(H.toLowerCase(),I+1):F.indexOf(H,I+1) 3973}}if(C.length){D=D.concat(C.slice(0,B.options.choices-D.length)) 3974}return"<ul>"+D.join("")+"</ul>" 3975}},A||{}) 3976}}); 3977Field.scrollFreeActivate=function(A){setTimeout(function(){Field.activate(A) 3978},1) 3979}; 3980Ajax.InPlaceEditor=Class.create({initialize:function(C,B,A){this.url=B; 3981this.element=C=$(C); 3982this.prepareOptions(); 3983this._controls={}; 3984arguments.callee.dealWithDeprecatedOptions(A); 3985Object.extend(this.options,A||{}); 3986if(!this.options.formId&&this.element.id){this.options.formId=this.element.id+"-inplaceeditor"; 3987if($(this.options.formId)){this.options.formId="" 3988}}if(this.options.externalControl){this.options.externalControl=$(this.options.externalControl) 3989}if(!this.options.externalControl){this.options.externalControlOnly=false 3990}this._originalBackground=this.element.getStyle("background-color")||"transparent"; 3991this.element.title=this.options.clickToEditText; 3992this._boundCancelHandler=this.handleFormCancellation.bind(this); 3993this._boundComplete=(this.options.onComplete||Prototype.emptyFunction).bind(this); 3994this._boundFailureHandler=this.handleAJAXFailure.bind(this); 3995this._boundSubmitHandler=this.handleFormSubmission.bind(this); 3996this._boundWrapperHandler=this.wrapUp.bind(this); 3997this.registerListeners() 3998},checkForEscapeOrReturn:function(A){if(!this._editing||A.ctrlKey||A.altKey||A.shiftKey){return 3999}if(Event.KEY_ESC==A.keyCode){this.handleFormCancellation(A) 4000}else{if(Event.KEY_RETURN==A.keyCode){this.handleFormSubmission(A) 4001}}},createControl:function(G,C,B){var E=this.options[G+"Control"]; 4002var F=this.options[G+"Text"]; 4003if("button"==E){var A=document.createElement("input"); 4004A.type="submit"; 4005A.value=F; 4006A.className="editor_"+G+"_button"; 4007if("cancel"==G){A.onclick=this._boundCancelHandler 4008}this._form.appendChild(A); 4009this._controls[G]=A 4010}else{if("link"==E){var D=document.createElement("a"); 4011D.href="#"; 4012D.appendChild(document.createTextNode(F)); 4013D.onclick="cancel"==G?this._boundCancelHandler:this._boundSubmitHandler; 4014D.className="editor_"+G+"_link"; 4015if(B){D.className+=" "+B 4016}this._form.appendChild(D); 4017this._controls[G]=D 4018}}},createEditField:function(){var C=(this.options.loadTextURL?this.options.loadingText:this.getText()); 4019var B; 4020if(1>=this.options.rows&&!/\r|\n/.test(this.getText())){B=document.createElement("input"); 4021B.type="text"; 4022var A=this.options.size||this.options.cols||0; 4023if(0<A){B.size=A 4024}}else{B=document.createElement("textarea"); 4025B.rows=(1>=this.options.rows?this.options.autoRows:this.options.rows); 4026B.cols=this.options.cols||40 4027}B.name=this.options.paramName; 4028B.value=C; 4029B.className="editor_field"; 4030if(this.options.submitOnBlur){B.onblur=this._boundSubmitHandler 4031}this._controls.editor=B; 4032if(this.options.loadTextURL){this.loadExternalText() 4033}this._form.appendChild(this._controls.editor) 4034},createForm:function(){var B=this; 4035function A(D,E){var C=B.options["text"+D+"Controls"]; 4036if(!C||E===false){return 4037}B._form.appendChild(document.createTextNode(C)) 4038}this._form=$(document.createElement("form")); 4039this._form.id=this.options.formId; 4040this._form.addClassName(this.options.formClassName); 4041this._form.onsubmit=this._boundSubmitHandler; 4042this.createEditField(); 4043if("textarea"==this._controls.editor.tagName.toLowerCase()){this._form.appendChild(document.createElement("br")) 4044}if(this.options.onFormCustomization){this.options.onFormCustomization(this,this._form) 4045}A("Before",this.options.okControl||this.options.cancelControl); 4046this.createControl("ok",this._boundSubmitHandler); 4047A("Between",this.options.okControl&&this.options.cancelControl); 4048this.createControl("cancel",this._boundCancelHandler,"editor_cancel"); 4049A("After",this.options.okControl||this.options.cancelControl) 4050},destroy:function(){if(this._oldInnerHTML){this.element.innerHTML=this._oldInnerHTML 4051}this.leaveEditMode(); 4052this.unregisterListeners() 4053},enterEditMode:function(A){if(this._saving||this._editing){return 4054}this._editing=true; 4055this.triggerCallback("onEnterEditMode"); 4056if(this.options.externalControl){this.options.externalControl.hide() 4057}this.element.hide(); 4058this.createForm(); 4059this.element.parentNode.insertBefore(this._form,this.element); 4060if(!this.options.loadTextURL){this.postProcessEditField() 4061}if(A){Event.stop(A) 4062}},enterHover:function(A){if(this.options.hoverClassName){this.element.addClassName(this.options.hoverClassName) 4063}if(this._saving){return 4064}this.triggerCallback("onEnterHover") 4065},getText:function(){return this.element.innerHTML 4066},handleAJAXFailure:function(A){this.triggerCallback("onFailure",A); 4067if(this._oldInnerHTML){this.element.innerHTML=this._oldInnerHTML; 4068this._oldInnerHTML=null 4069}},handleFormCancellation:function(A){this.wrapUp(); 4070if(A){Event.stop(A) 4071}},handleFormSubmission:function(D){var B=this._form; 4072var C=$F(this._controls.editor); 4073this.prepareSubmission(); 4074var E=this.options.callback(B,C)||""; 4075if(Object.isString(E)){E=E.toQueryParams() 4076}
4076E.editorId=this.element.id; 4077if(this.options.htmlResponse){var A=Object.extend({evalScripts:true},this.options.ajaxOptions); 4078Object.extend(A,{parameters:E,onComplete:this._boundWrapperHandler,onFailure:this._boundFailureHandler}); 4079new Ajax.Updater({success:this.element},this.url,A) 4080}else{var A=Object.extend({method:"get"},this.options.ajaxOptions); 4081Object.extend(A,{parameters:E,onComplete:this._boundWrapperHandler,onFailure:this._boundFailureHandler}); 4082new Ajax.Request(this.url,A) 4083}if(D){Event.stop(D) 4084}},leaveEditMode:function(){this.element.removeClassName(this.options.savingClassName); 4085this.removeForm(); 4086this.leaveHover(); 4087this.element.style.backgroundColor=this._originalBackground; 4088this.element.show(); 4089if(this.options.externalControl){this.options.externalControl.show() 4090}this._saving=false; 4091this._editing=false; 4092this._oldInnerHTML=null; 4093this.triggerCallback("onLeaveEditMode") 4094},leaveHover:function(A){if(this.options.hoverClassName){this.element.removeClassName(this.options.hoverClassName) 4095}if(this._saving){return 4096}this.triggerCallback("onLeaveHover") 4097},loadExternalText:function(){this._form.addClassName(this.options.loadingClassName); 4098this._controls.editor.disabled=true; 4099var A=Object.extend({method:"get"},this.options.ajaxOptions); 4100Object.extend(A,{parameters:"editorId="+encodeURIComponent(this.element.id),onComplete:Prototype.emptyFunction,onSuccess:function(C){this._form.removeClassName(this.options.loadingClassName); 4101var B=C.responseText; 4102if(this.options.stripLoadedTextTags){B=B.stripTags() 4103}this._controls.editor.value=B; 4104this._controls.editor.disabled=false; 4105this.postProcessEditField() 4106}.bind(this),onFailure:this._boundFailureHandler}); 4107new Ajax.Request(this.options.loadTextURL,A) 4108},postProcessEditField:function(){var A=this.options.fieldPostCreation; 4109if(A){$(this._controls.editor)["focus"==A?"focus":"activate"]() 4110}},prepareOptions:function(){this.options=Object.clone(Ajax.InPlaceEditor.DefaultOptions); 4111Object.extend(this.options,Ajax.InPlaceEditor.DefaultCallbacks); 4112[this._extraDefaultOptions].flatten().compact().each(function(A){Object.extend(this.options,A) 4113}.bind(this)) 4114},prepareSubmission:function(){this._saving=true; 4115this.removeForm(); 4116this.leaveHover(); 4117this.showSaving() 4118},registerListeners:function(){this._listeners={}; 4119var A; 4120$H(Ajax.InPlaceEditor.Listeners).each(function(B){A=this[B.value].bind(this); 4121this._listeners[B.key]=A; 4122if(!this.options.externalControlOnly){this.element.observe(B.key,A) 4123}if(this.options.externalControl){this.options.externalControl.observe(B.key,A) 4124}}.bind(this)) 4125},removeForm:function(){if(!this._form){return 4126}this._form.remove(); 4127this._form=null; 4128this._controls={} 4129},showSaving:function(){this._oldInnerHTML=this.element.innerHTML; 4130this.element.innerHTML=this.options.savingText; 4131this.element.addClassName(this.options.savingClassName); 4132this.element.style.backgroundColor=this._originalBackground; 4133this.element.show() 4134},triggerCallback:function(B,A){if("function"==typeof this.options[B]){this.options[B](this,A) 4135}},unregisterListeners:function(){$H(this._listeners).each(function(A){if(!this.options.externalControlOnly){this.element.stopObserving(A.key,A.value) 4136}if(this.options.externalControl){this.options.externalControl.stopObserving(A.key,A.value) 4137}}.bind(this)) 4138},wrapUp:function(A){this.leaveEditMode(); 4139this._boundComplete(A,this.element) 4140}}); 4141Object.extend(Ajax.InPlaceEditor.prototype,{dispose:Ajax.InPlaceEditor.prototype.destroy}); 4142Ajax.InPlaceCollectionEditor=Class.create(Ajax.InPlaceEditor,{initialize:function($super,C,B,A){this._extraDefaultOptions=Ajax.InPlaceCollectionEditor.DefaultOptions; 4143$super(C,B,A) 4144},createEditField:function(){var A=document.createElement("select"); 4145A.name=this.options.paramName; 4146A.size=1; 4147this._controls.editor=A; 4148this._collection=this.options.collection||[]; 4149if(this.options.loadCollectionURL){this.loadCollection() 4150}else{this.checkForExternalText() 4151}this._form.appendChild(this._controls.editor) 4152},loadCollection:function(){this._form.addClassName(this.options.loadingClassName); 4153this.showLoadingText(this.options.loadingCollectionText); 4154var options=Object.extend({method:"get"},this.options.ajaxOptions); 4155Object.extend(options,{parameters:"editorId="+encodeURIComponent(this.element.i
4155d),onComplete:Prototype.emptyFunction,onSuccess:function(transport){var js=transport.responseText.strip(); 4156if(!/^\[.*\]$/.test(js)){throw"Server returned an invalid collection representation." 4157}this._collection=eval(js); 4158this.checkForExternalText() 4159}.bind(this),onFailure:this.onFailure}); 4160new Ajax.Request(this.options.loadCollectionURL,options) 4161},showLoadingText:function(B){this._controls.editor.disabled=true; 4162var A=this._controls.editor.firstChild; 4163if(!A){A=document.createElement("option"); 4164A.value=""; 4165this._controls.editor.appendChild(A); 4166A.selected=true 4167}A.update((B||"").stripScripts().stripTags()) 4168},checkForExternalText:function(){this._text=this.getText(); 4169if(this.options.loadTextURL){this.loadExternalText() 4170}else{this.buildOptionList() 4171}},loadExternalText:function(){this.showLoadingText(this.options.loadingText); 4172var A=Object.extend({method:"get"},this.options.ajaxOptions); 4173Object.extend(A,{parameters:"editorId="+encodeURIComponent(this.element.id),onComplete:Prototype.emptyFunction,onSuccess:function(B){this._text=B.responseText.strip(); 4174this.buildOptionList() 4175}.bind(this),onFailure:this.onFailure}); 4176new Ajax.Request(this.options.loadTextURL,A) 4177},buildOptionList:function(){this._form.removeClassName(this.options.loadingClassName); 4178this._collection=this._collection.map(function(D){return 2===D.length?D:[D,D].flatten() 4179}); 4180var B=("value" in this.options)?this.options.value:this._text; 4181var A=this._collection.any(function(D){return D[0]==B 4182}.bind(this)); 4183this._controls.editor.update(""); 4184var C; 4185this._collection.each(function(E,D){C=document.createElement("option"); 4186C.value=E[0]; 4187C.selected=A?E[0]==B:0==D; 4188C.appendChild(document.createTextNode(E[1])); 4189this._controls.editor.appendChild(C) 4190}.bind(this)); 4191this._controls.editor.disabled=false; 4192Field.scrollFreeActivate(this._controls.editor) 4193}}); 4194Ajax.InPlaceEditor.prototype.initialize.dealWithDeprecatedOptions=function(A){if(!A){return 4195}function B(C,D){if(C in A||D===undefined){return 4196}A[C]=D 4197}B("cancelControl",(A.cancelLink?"link":(A.cancelButton?"button":A.cancelLink==A.cancelButton==false?false:undefined))); 4198B("okControl",(A.okLink?"link":(A.okButton?"button":A.okLink==A.okButton==false?false:undefined))); 4199B("highlightColor",A.highlightcolor); 4200B("highlightEndColor",A.highlightendcolor) 4201}; 4202Object.extend(Ajax.InPlaceEditor,{DefaultOptions:{ajaxOptions:{},autoRows:3,cancelControl:"link",cancelText:"cancel",clickToEditText:"Click to edit",externalControl:null,externalControlOnly:false,fieldPostCreation:"activate",formClassName:"inplaceeditor-form",formId:null,highlightColor:"#ffff99",highlightEndColor:"#ffffff",hoverClassName:"",htmlResponse:true,loadingClassName:"inplaceeditor-loading",loadingText:"Loading...",okControl:"button",okText:"ok",paramName:"value",rows:1,savingClassName:"inplaceeditor-saving",savingText:"Saving...",size:0,stripLoadedTextTags:false,submitOnBlur:false,textAfterControls:"",textBeforeControls:"",textBetweenControls:""},DefaultCallbacks:{callback:function(A){return Form.serialize(A) 4203},onComplete:function(B,A){new Effect.Highlight(A,{startcolor:this.options.highlightColor,keepBackgroundImage:true}) 4204},onEnterEditMode:null,onEnterHover:function(A){A.element.style.backgroundColor=A.options.highlightColor; 4205if(A._effect){A._effect.cancel() 4206}},onFailure:function(B,A){alert("Error communication with the server: "+B.responseText.stripTags()) 4207},onFormCustomization:null,onLeaveEditMode:null,onLeaveHover:function(A){A._effect=new Effect.Highlight(A.element,{startcolor:A.options.highlightColor,endcolor:A.options.highlightEndColor,restorecolor:A._originalBackground,keepBackgroundImage:true}) 4208}},Listeners:{click:"enterEditMode",keydown:"checkForEscapeOrReturn",mouseover:"enterHover",mouseout:"leaveHover"}}); 4209Ajax.InPlaceCollectionEditor.DefaultOptions={loadingCollectionText:"Loading options..."}; 4210Form.Element.DelayedObserver=Class.create({initialize:function(B,A,C){this.delay=A||0.5; 4211this.element=$(B); 4212this.callback=C; 4213this.timer=null; 4214this.lastValue=$F(this.element); 4215Event.observe(this.element,"keyup",this.delayedListener.bindAsEventListener(this)) 4216},delayedListener:function(A){if(this.lastValue==$F(this.element)){return 4217}if(this.timer){clearTimeout(this.timer) 4218}this.timer=setTimeout(this.onTimerEvent.bind(this),this.delay*1000); 4219this.lastValue=$F(this.element) 4220},onTimerEvent:function(){this.timer=null; 4221this.callback(this.element,$F(this.element)) 4222}});
4223if(!Control){var Control={} 4224}Control.Slider=Class.create({initialize:function(D,A,B){var C=this; 4225if(Object.isArray(D)){this.handles=D.collect(function(E){return $(E) 4226}) 4227}else{this.handles=[$(D)] 4228}this.track=$(A); 4229this.options=B||{}; 4230this.axis=this.options.axis||"horizontal"; 4231this.increment=this.options.increment||1; 4232this.step=parseInt(this.options.step||"1"); 4233this.range=this.options.range||$R(0,1); 4234this.value=0; 4235this.values=this.handles.map(function(){return 0 4236}); 4237this.spans=this.options.spans?this.options.spans.map(function(E){return $(E) 4238}):false; 4239this.options.startSpan=$(this.options.startSpan||null); 4240this.options.endSpan=$(this.options.endSpan||null); 4241this.restricted=this.options.restricted||false; 4242this.maximum=this.options.maximum||this.range.end; 4243this.minimum=this.options.minimum||this.range.start; 4244this.alignX=parseInt(this.options.alignX||"0"); 4245this.alignY=parseInt(this.options.alignY||"0"); 4246this.trackLength=this.maximumOffset()-this.minimumOffset(); 4247this.handleLength=this.isVertical()?(this.handles[0].offsetHeight!=0?this.handles[0].offsetHeight:this.handles[0].style.height.replace(/px$/,"")):(this.handles[0].offsetWidth!=0?this.handles[0].offsetWidth:this.handles[0].style.width.replace(/px$/,"")); 4248this.active=false; 4249this.dragging=false; 4250this.disabled=false; 4251if(this.options.disabled){this.setDisabled() 4252}this.allowedValues=this.options.values?this.options.values.sortBy(Prototype.K):false; 4253if(this.allowedValues){this.minimum=this.allowedValues.min(); 4254this.maximum=this.allowedValues.max() 4255}this.eventMouseDown=this.startDrag.bindAsEventListener(this); 4256this.eventMouseUp=this.endDrag.bindAsEventListener(this); 4257this.eventMouseMove=this.update.bindAsEventListener(this); 4258this.handles.each(function(F,E){E=C.handles.length-1-E; 4259C.setValue(parseFloat((Object.isArray(C.options.sliderValue)?C.options.sliderValue[E]:C.options.sliderValue)||C.range.start),E); 4260F.makePositioned().observe("mousedown",C.eventMouseDown) 4261}); 4262this.track.observe("mousedown",this.eventMouseDown); 4263document.observe("mouseup",this.eventMouseUp); 4264document.observe("mousemove",this.eventMouseMove); 4265this.initialized=true 4266},dispose:function(){var A=this; 4267Event.stopObserving(this.track,"mousedown",this.eventMouseDown); 4268Event.stopObserving(document,"mouseup",this.eventMouseUp); 4269Event.stopObserving(document,"mousemove",this.eventMouseMove);
4270this.handles.each(function(B){Event.stopObserving(B,"mousedown",A.eventMouseDown) 4271}) 4272},setDisabled:function(){this.disabled=true 4273},setEnabled:function(){this.disabled=false 4274},getNearestValue:function(A){if(this.allowedValues){if(A>=this.allowedValues.max()){return(this.allowedValues.max()) 4275}if(A<=this.allowedValues.min()){return(this.allowedValues.min()) 4276}var C=Math.abs(this.allowedValues[0]-A); 4277var B=this.allowedValues[0]; 4278this.allowedValues.each(function(D){var E=Math.abs(D-A); 4279if(E<=C){B=D; 4280C=E 4281}}); 4282return B 4283}if(A>this.range.end){return this.range.end 4284}if(A<this.range.start){return this.range.start 4285}return A 4286},setValue:function(B,A){if(!this.active){this.activeHandleIdx=A||0; 4287this.activeHandle=this.handles[this.activeHandleIdx]; 4288this.updateStyles() 4289}A=A||this.activeHandleIdx||0; 4290if(this.initialized&&this.restricted){if((A>0)&&(B<this.values[A-1])){B=this.values[A-1] 4291}if((A<(this.handles.length-1))&&(B>this.values[A+1])){B=this.values[A+1] 4292}}B=this.getNearestValue(B); 4293this.values[A]=B; 4294this.value=this.values[0]; 4295this.handles[A].style[this.isVertical()?"top":"left"]=this.translateToPx(B); 4296this.drawSpans(); 4297if(!this.dragging||!this.event){this.updateFinished() 4298}},setValueBy:function(B,A){this.setValue(this.values[A||this.activeHandleIdx||0]+B,A||this.activeHandleIdx||0) 4299},translateToPx:function(A){return Math.round(((this.trackLength-this.handleLength)/(this.range.end-this.range.start))*(A-this.range.start))+"px" 4300},translateToValue:function(A){return((A/(this.trackLength-this.handleLength)*(this.range.end-this.range.start))+this.range.start) 4301},getRange:function(B){var A=this.values.sortBy(Prototype.K); 4302B=B||0; 4303return $R(A[B],A[B+1]) 4304},minimumOffset:function(){return(this.isVertical()?this.alignY:this.alignX) 4305},maximumOffset:function(){return(this.isVertical()?(this.track.offsetHeight!=0?this.track.offsetHeight:this.track.style.height.replace(/px$/,""))-this.alignY:(this.track.offsetWidth!=0?this.track.offsetWidth:this.track.style.width.replace(/px$/,""))-this.alignX) 4306},isVertical:function(){return(this.axis=="vertical") 4307},drawSpans:function(){var A=this; 4308if(this.spans){$R(0,this.spans.length-1).each(function(B){A.setSpan(A.spans[B],A.getRange(B)) 4309}) 4310}if(this.options.startSpan){this.setSpan(this.options.startSpan,$R(0,this.values.length>1?this.getRange(0).min():this.value)) 4311}if(this.options.endSpan){this.setSpan(this.options.endSpan,$R(this.values.length>1?this.getRange(this.spans.length-1).max():this.value,this.maximum)) 4312}},setSpan:function(B,A){if(this.isVertical()){B.style.top=this.translateToPx(A.start); 4313B.style.height=this.translateToPx(A.end-A.start+this.range.start) 4314}else{B.style.left=this.translateToPx(A.start); 4315B.style.width=this.translateToPx(A.end-A.start+this.range.start) 4316}},updateStyles:function(){this.handles.each(function(A){Element.removeClassName(A,"selected") 4317}); 4318Element.addClassName(this.activeHandle,"selected") 4319},startDrag:function(C){if(Event.isLeftClick(C)){if(!this.disabled){this.active=true; 4320var D=Event.element(C); 4321var E=[Event.pointerX(C),Event.pointerY(C)]; 4322var A=D; 4323if(A==this.track){var B=Position.cumulativeOffset(this.track); 4324this.event=C; 4325this.setValue(this.translateToValue((this.isVertical()?E[1]-B[1]:E[0]-B[0])-(this.handleLength/2))); 4326var B=Position.cumulativeOffset(this.activeHandle); 4327this.offsetX=(E[0]-B[0]); 4328this.offsetY=(E[1]-B[1]) 4329}else{while((this.handles.indexOf(D)==-1)&&D.parentNode){D=D.parentNode 4330}if(this.handles.indexOf(D)!=-1){this.activeHandle=D; 4331this.activeHandleIdx=this.handles.indexOf(this.activeHandle); 4332this.updateStyles(); 4333var B=Position.cumulativeOffset(this.activeHandle); 4334this.offsetX=(E[0]-B[0]); 4335this.offsetY=(E[1]-B[1]) 4336}}}Event.stop(C) 4337}},update:function(A){if(this.active){if(!this.dragging){this.dragging=true 4338}this.draw(A); 4339if(Prototype.Browser.WebKit){window.scrollBy(0,0) 4340}Event.stop(A) 4341}},draw:function(B){var C=[Event.pointerX(B),Event.pointerY(B)]; 4342var A=Position.cumulativeOffset(this.track); 4343C[0]-=this.offsetX+A[0]; 4344C[1]-=this.offsetY+A[1]; 4345this.event=B; 4346this.setValue(this.translateToValue(this.isVertical()?C[1]:C[0])); 4347if(this.initialized&&this.options.onSlide){this.options.onSlide(this.values.length>1?this.values:this.value,this) 4348}},endDrag:function(A){if(this.active&&this.dragging){this.finishDrag(A,true); 4349Event.stop(A) 4350}this.active=false; 4351this.dragging=false 4352},finishDrag:function(A,B){this.active=false; 4353this.dragging=false; 4354this.updateFinished() 4355},updateFinished:function(){if(this.initialized&&this.options.onChange){this.options.onChange(this.values.length>1?this.values:this.value,this) 4356}this.event=null 4357}}); 4358Sound={tracks:{},_enabled:true,template:new Template('<embed style="height:0" id="sound_#{track}_#{id}" src="#{url}" loop="false" autostart="true" hidden="true"/>'),enable:function(){Sound._enabled=true 4359},disable:function(){Sound._enabled=false 4360},play:function(B){if(!Sound._enabled){return 4361}var A=Object.extend({track:"global",url:B,replace:false},arguments[1]||{}); 4362if(A.replace&&this.tracks[A.track]){$R(0,this.tracks[A.track].id).each(function(D){var C=$("sound_"+A.track+"_"+D); 4363C.Stop&&C.Stop(); 4364C.remove() 4365}); 4366this.tracks[A.track]=null 4367}if(!this.tracks[A.track]){this.tracks[A.track]={id:0} 4368}else{this.tracks[A.track].id++ 4369}A.id=this.tracks[A.track].id;
4370$$("body")[0].insert(Prototype.Browser.IE?new Element("bgsound",{id:"sound_"+A.track+"_"+A.id,src:A.url,loop:1,autostart:true}):Sound.template.evaluate(A)) 4371}}; 4372if(Prototype.Browser.Gecko&&navigator.userAgent.indexOf("Win")>0){if(navigator.plugins&&$A(navigator.plugins).detect(function(A){return A.name.indexOf("QuickTime")!=-1 4373})){Sound.template=new Template('<object id="sound_#{track}_#{id}" width="0" height="0" type="audio/mpeg" data="#{url}"/>') 4374}else{Sound.play=function(){} 4375}} 4376(function(){var _jQuery=window.jQuery,_$=window.$; 4377var jQuery=window.jQuery=window.$=function(selector,context){if(arguments[0]==arguments.callee){return arguments.callee 4378}return new jQuery.fn.init(selector,context) 4379}; 4380var quickExpr=/^[^<]*(<(.|\s)+>)[^>]*$|^#(\w+)$/,isSimple=/^.[^:#\[\.]*$/,undefined; 4381jQuery.fn=jQuery.prototype={init:function(selector,context){selector=selector||document; 4382if(selector.nodeType){this[0]=selector; 4383this.length=1; 4384return this 4385}if(typeof selector=="string"){var match=quickExpr.exec(selector); 4386if(match&&(match[1]||!context)){if(match[1]){selector=jQuery.clean([match[1]],context) 4387}else{var elem=document.getElementById(match[3]); 4388if(elem){if(elem.id!=match[3]){return jQuery().find(selector) 4389}return jQuery(elem) 4390}selector=[] 4391}}else{return jQuery(context).find(selector) 4392}}else{if(jQuery.isFunction(selector)){return jQuery(document)[jQuery.fn.ready?"ready":"load"](selector) 4393}}return this.setArray(jQuery.makeArray(selector)) 4394},jquery:"1.2.6",size:function(){return this.length 4395},length:0,get:function(num){return num==undefined?jQuery.makeArray(this):this[num] 4396},pushStack:function(elems){var ret=jQuery(elems); 4397ret.prevObject=this; 4398return ret 4399},setArray:function(elems){this.length=0; 4400Array.prototype.push.apply(this,elems); 4401return this 4402},each:function(callback,args){return jQuery.each(this,callback,args) 4403},index:function(elem){var ret=-1; 4404return jQuery.inArray(elem&&elem.jquery?elem[0]:elem,this) 4405},attr:function(name,value,type){var options=name; 4406if(name.constructor==String){if(value===undefined){return this[0]&&jQuery[type||"attr"](this[0],name) 4407}else{options={}; 4408options[name]=value 4409}}return this.each(function(i){for(name in options){jQuery.attr(type?this.style:this,name,jQuery.prop(this,options[name],type,i,name)) 4410}}) 4411},css:function(key,value){if((key=="width"||key=="height")&&parseFloat(value)<0){value=undefined 4412}return this.attr(key,value,"curCSS") 4413},text:function(text){if(typeof text!="object"&&text!=null){return this.empty().append((this[0]&&this[0].ownerDocument||document).createTextNode(text)) 4414}var ret=""; 4415jQuery.each(text||this,function(){jQuery.each(this.childNodes,function(){if(this.nodeType!=8){ret+=this.nodeType!=1?this.nodeValue:jQuery.fn.text([this]) 4416}}) 4417}); 4418return ret 4419},wrapAll:function(html){if(this[0]){jQuery(html,this[0].ownerDocument).clone().insertBefore(this[0]).map(function(){var elem=this; 4420while(elem.firstChild){elem=elem.firstChild 4421}return elem 4422}).append(this) 4423}return this 4424},wrapInner:function(html){return this.each(function(){jQuery(this).contents().wrapAll(html) 4425}) 4426},wrap:function(html){return this.each(function(){jQuery(this).wrapAll(html) 4427}) 4428},append:function(){return this.domManip(arguments,true,false,function(elem){if(this.nodeType==1){this.appendChild(elem) 4429}}) 4430},prepend:function(){return this.domManip(arguments,true,true,function(elem){if(this.nodeType==1){this.insertBefore(elem,this.firstChild) 4431}}) 4432},before:function(){return this.domManip(arguments,false,false,function(elem){this.parentNode.insertBefore(elem,this) 4433}) 4434},after:function(){return this.domManip(arguments,false,true,function(elem){this.parentNode.insertBefore(elem,this.nextSibling) 4435}) 4436},end:function(){return this.prevObject||jQuery([]) 4437},find:function(selector){var elems=jQuery.map(this,function(elem){return jQuery.find(selector,elem) 4438}); 4439return this.pushStack(/[^+>] [^+>]/.test(selector)||selector.indexOf("..")>-1?jQuery.unique(elems):elems) 4440},clone:function(events){var ret=this.map(function(){if(jQuery.browser.msie&&!jQuery.isXMLDoc(this)){var clone=this.cloneNode(true),container=document.createElement("div"); 4441container.appendChild(clone);
4442return jQuery.clean([container.innerHTML])[0] 4443}else{return this.cloneNode(true) 4444}}); 4445var clone=ret.find("*").andSelf().each(function(){if(this[expando]!=undefined){this[expando]=null 4446}}); 4447if(events===true){this.find("*").andSelf().each(function(i){if(this.nodeType==3){return 4448}var events=jQuery.data(this,"events"); 4449for(var type in events){for(var handler in events[type]){jQuery.event.add(clone[i],type,events[type][handler],events[type][handler].data) 4450}}}) 4451}return ret 4452},filter:function(selector){return this.pushStack(jQuery.isFunction(selector)&&jQuery.grep(this,function(elem,i){return selector.call(elem,i) 4453})||jQuery.multiFilter(selector,this)) 4454},not:function(selector){if(selector.constructor==String){if(isSimple.test(selector)){return this.pushStack(jQuery.multiFilter(selector,this,true)) 4455}else{selector=jQuery.multiFilter(selector,this) 4456}}var isArrayLike=selector.length&&selector[selector.length-1]!==undefined&&!selector.nodeType; 4457return this.filter(function(){return isArrayLike?jQuery.inArray(this,selector)<0:this!=selector 4458}) 4459},add:function(selector){return this.pushStack(jQuery.unique(jQuery.merge(this.get(),typeof selector=="string"?jQuery(selector):jQuery.makeArray(selector)))) 4460},is:function(selector){return !!selector&&jQuery.multiFilter(selector,this).length>0 4461},hasClass:function(selector){return this.is("."+selector) 4462},val:function(value){if(value==undefined){if(this.length){var elem=this[0]; 4463if(jQuery.nodeName(elem,"select")){var index=elem.selectedIndex,values=[],options=elem.options,one=elem.type=="select-one"; 4464if(index<0){return null 4465}for(var i=one?index:0,max=one?index+1:options.length; 4466i<max; 4467i++){var option=options[i]; 4468if(option.selected){value=jQuery.browser.msie&&!option.attributes.value.specified?option.text:option.value; 4469if(one){return value 4470}values.push(value) 4471}}return values 4472}else{return(this[0].value||"").replace(/\r/g,"") 4473}}return undefined 4474}if(value.constructor==Number){value+="" 4475}return this.each(function(){if(this.nodeType!=1){return 4476}if(value.constructor==Array&&/radio|checkbox/.test(this.type)){this.checked=(jQuery.inArray(this.value,value)>=0||jQuery.inArray(this.name,value)>=0) 4477}else{if(jQuery.nodeName(this,"select")){var values=jQuery.makeArray(value); 4478jQuery("option",this).each(function(){this.selected=(jQuery.inArray(this.value,values)>=0||jQuery.inArray(this.text,values)>=0) 4479}); 4480if(!values.length){this.selectedIndex=-1 4481}}else{this.value=value 4482}}}) 4483},html:function(value){return value==undefined?(this[0]?this[0].innerHTML:null):this.empty().append(value) 4484},replaceWith:function(value){return this.after(value).remove() 4485},eq:function(i){return this.slice(i,i+1) 4486},slice:function(){return this.pushStack(Array.prototype.slice.apply(this,arguments)) 4487},map:function(callback){return this.pushStack(jQuery.map(this,function(elem,i){return callback.call(elem,i,elem) 4488})) 4489},andSelf:function(){return this.add(this.prevObject) 4490},data:function(key,value){var parts=key.split("."); 4491parts[1]=parts[1]?"."+parts[1]:""; 4492if(value===undefined){var data=this.triggerHandler("getData"+parts[1]+"!",[parts[0]]); 4493if(data===undefined&&this.length){data=jQuery.data(this[0],key) 4494}return data===undefined&&parts[1]?this.data(parts[0]):data 4495}else{return this.trigger("setData"+parts[1]+"!",[parts[0],value]).each(function(){jQuery.data(this,key,value) 4496}) 4497}},removeData:function(key){return this.each(function(){jQuery.removeData(this,key) 4498}) 4499},domManip:function(args,table,reverse,callback){var clone=this.length>1,elems; 4500return this.each(function(){if(!elems){elems=jQuery.clean(args,this.ownerDocument); 4501if(reverse){elems.reverse() 4502}}var obj=this; 4503if(table&&jQuery.nodeName(this,"table")&&jQuery.nodeName(elems[0],"tr")){obj=this.getElementsByTagName("tbody")[0]||this.appendChild(this.ownerDocument.createElement("tbody")) 4504}var scripts=jQuery([]); 4505jQuery.each(elems,function(){var elem=clone?jQuery(this).clone(true)[0]:this; 4506if(jQuery.nodeName(elem,"script")){scripts=scripts.add(elem) 4507}else{if(elem.nodeType==1){scripts=scripts.add(jQuery("script",elem).remove()) 4508}callback.call(obj,elem) 4509}}); 4510scripts.each(evalScript) 4511}) 4512}}; 4513jQuery.fn.init.prototype=jQuery.fn; 4514function evalScript(i,elem){if(elem.src){jQuery.ajax({url:elem.src,async:false,dataType:"script"}) 4515}else{jQuery.globalEval(elem.text||elem.textContent||elem.innerHTML||"") 4516}if(elem.parentNode){elem.parentNode.removeChild(elem) 4517}}function now(){return +new Date 4518}jQuery.extend=jQuery.fn.extend=function(){var target=arguments[0]||{},i=1,length=arguments.length,deep=false,options; 4519if(target.constructor==Boolean){deep=target; 4520target=arguments[1]||{}; 4521i=2 4522}if(typeof target!="object"&&typeof target!="function"){target={} 4523}if(length==i){target=this; 4524--i 4525}for(; 4526i<length; 4527i++){if((options=arguments[i])!=null){for(var name in options){var src=target[name],copy=options[name]; 4528if(target===copy){continue 4529}if(deep&©&&typeof copy=="object"&&!copy.nodeType){target[name]=jQuery.extend(deep,src||(copy.length!=null?[]:{}),copy) 4530}
4530else{if(copy!==undefined){target[name]=copy 4531}}}}}return target 4532}; 4533var expando="jQuery"+now(),uuid=0,windowData={},exclude=/z-?index|font-?weight|opacity|zoom|line-?height/i,defaultView=document.defaultView||{}; 4534jQuery.extend({noConflict:function(deep){window.$=_$; 4535if(deep){window.jQuery=_jQuery 4536}return jQuery 4537},isFunction:function(fn){return !!fn&&typeof fn!="string"&&!fn.nodeName&&fn.constructor!=Array&&/^[\s[]?function/.test(fn+"") 4538},isXMLDoc:function(elem){return elem.documentElement&&!elem.body||elem.tagName&&elem.ownerDocument&&!elem.ownerDocument.body 4539},globalEval:function(data){data=jQuery.trim(data); 4540if(data){var head=document.getElementsByTagName("head")[0]||document.documentElement,script=document.createElement("script"); 4541script.type="text/javascript"; 4542if(jQuery.browser.msie){script.text=data 4543}else{script.appendChild(document.createTextNode(data)) 4544}head.insertBefore(script,head.firstChild); 4545head.removeChild(script) 4546}},nodeName:function(elem,name){return elem.nodeName&&elem.nodeName.toUpperCase()==name.toUpperCase() 4547},cache:{},data:function(elem,name,data){elem=elem==window?windowData:elem; 4548var id=elem[expando]; 4549if(!id){id=elem[expando]=++uuid 4550}if(name&&!jQuery.cache[id]){jQuery.cache[id]={} 4551}if(data!==undefined){jQuery.cache[id][name]=data 4552}return name?jQuery.cache[id][name]:id 4553},removeData:function(elem,name){elem=elem==window?windowData:elem; 4554var id=elem[expando]; 4555if(name){if(jQuery.cache[id]){delete jQuery.cache[id][name]; 4556name=""; 4557for(name in jQuery.cache[id]){break 4558}if(!name){jQuery.removeData(elem) 4559}}}else{try{delete elem[expando] 4560}catch(e){if(elem.removeAttribute){elem.removeAttribute(expando) 4561}}delete jQuery.cache[id] 4562}},each:function(object,callback,args){var name,i=0,length=object.length; 4563if(args){if(length==undefined){for(name in object){if(callback.apply(object[name],args)===false){break 4564}}}else{for(; 4565i<length; 4566){if(callback.apply(object[i++],args)===false){break 4567}}}}else{if(length==undefined){for(name in object){if(callback.call(object[name],name,object[name])===false){break 4568}}}else{for(var value=object[0]; 4569i<length&&callback.call(value,i,value)!==false; 4570value=object[++i]){}}}return object 4571},prop:function(elem,value,type,i,name){if(jQuery.isFunction(value)){value=value.call(elem,i) 4572}return value&&value.constructor==Number&&type=="curCSS"&&!exclude.test(name)?value+"px":value 4573},className:{add:function(elem,classNames){jQuery.each((classNames||"").split(/\s+/),function(i,className){if(elem.nodeType==1&&!jQuery.className.has(elem.className,className)){elem.className+=(elem.className?" ":"")+className 4574}}) 4575},remove:function(elem,classNames){if(elem.nodeType==1){elem.className=classNames!=undefined?jQuery.grep(elem.className.split(/\s+/),function(className){return !jQuery.className.has(classNames,className) 4576}).join(" "):"" 4577}},has:function(elem,className){return jQuery.inArray(className,(elem.className||elem).toString().split(/\s+/))>-1 4578}},swap:function(elem,options,callback){var old={}; 4579for(var name in options){old[name]=elem.style[name]; 4580elem.style[name]=options[name] 4581}callback.call(elem); 4582for(var name in options){elem.style[name]=old[name] 4583}},css:function(elem,name,force){if(name=="width"||name=="height"){var val,props={position:"absolute",visibility:"hidden",display:"block"},which=name=="width"?["Left","Right"]:["Top","Bottom"]; 4584function getWH(){val=name=="width"?elem.offsetWidth:elem.offsetHeight; 4585var padding=0,border=0; 4586jQuery.each(which,function(){padding+=parseFloat(jQuery.curCSS(elem,"padding"+this,true))||0; 4587border+=parseFloat(jQuery.curCSS(elem,"border"+this+"Width",true))||0 4588}); 4589val-=Math.round(padding+border) 4590}if(jQuery(elem).is(":visible")){getWH() 4591}else{jQuery.swap(elem,props,getWH) 4592}return Math.max(0,val) 4593}return jQuery.curCSS(elem,name,force) 4594},curCSS:function(elem,name,force){var ret,style=elem.style; 4595function color(elem){if(!jQuery.browser.safari){return false 4596}var ret=defaultView.getComputedStyle(elem,null); 4597return !ret||ret.getPropertyValue("color")=="" 4598}if(name=="opacity"&&jQuery.browser.msie){ret=jQuery.attr(style,"opacity"); 4599return ret==""?"1":ret 4600}if(jQuery.browser.opera&&name=="display"){var save=style.outline; 4601style.outline="0 solid black"; 4602style.outline=save 4603}if(name.match(/float/i)){name=styleFloat 4604}if(!force&&style&&style[name]){ret=style[name] 4605}else{if(defaultView.getComputedStyle){if(name.match(/float/i)){name="float" 4606}name=name.replace(/([A-Z])/g,"-$1").toLowerCase(); 4607var computedStyle=defaultView.getComputedStyle(elem,null); 4608if(computedStyle&&!color(elem)){ret=computedStyle.getPropertyValue(name) 4609}else{var swap=[],stack=[],a=elem,i=0; 4610for(; 4611a&&color(a); 4612a=a.parentNode){stack.unshift(a) 4613}for(; 4614i<stack.length; 4615i++){if(color(stack[i])){swap[i]=stack[i].style.display; 4616stack[i].style.display="block" 4617}}ret=name=="display"&&swap[stack.length-1]!=null?"none":(computedStyle&&computedStyle.getPropertyValue(name))||""; 4618for(i=0; 4619i<swap.length; 4620i++){if(swap[i]!=null){stack[i].style.display=swap[i] 4621}}}if(name=="opacity"&&ret==""){ret="1" 4622}}
4622else{if(elem.currentStyle){var camelCase=name.replace(/\-(\w)/g,function(all,letter){return letter.toUpperCase() 4623}); 4624ret=elem.currentStyle[name]||elem.currentStyle[camelCase]; 4625if(!/^\d+(px)?$/i.test(ret)&&/^\d/.test(ret)){var left=style.left,rsLeft=elem.runtimeStyle.left; 4626elem.runtimeStyle.left=elem.currentStyle.left; 4627style.left=ret||0; 4628ret=style.pixelLeft+"px"; 4629style.left=left; 4630elem.runtimeStyle.left=rsLeft 4631}}}}return ret 4632},clean:function(elems,context){var ret=[]; 4633context=context||document; 4634if(typeof context.createElement=="undefined"){context=context.ownerDocument||context[0]&&context[0].ownerDocument||document 4635}jQuery.each(elems,function(i,elem){if(!elem){return 4636}if(elem.constructor==Number){elem+="" 4637}if(typeof elem=="string"){elem=elem.replace(/(<(\w+)[^>]*?)\/>/g,function(all,front,tag){return tag.match(/^(abbr|br|col|img|input|link|meta|param|hr|area|embed)$/i)?all:front+"></"+tag+">" 4638}); 4639var tags=jQuery.trim(elem).toLowerCase(),div=context.createElement("div"); 4640var wrap=!tags.indexOf("<opt")&&[1,"<select multiple='multiple'>","</select>"]||!tags.indexOf("<leg")&&[1,"<fieldset>","</fieldset>"]||tags.match(/^<(thead|tbody|tfoot|colg|cap)/)&&[1,"<table>","</table>"]||!tags.indexOf("<tr")&&[2,"<table><tbody>","</tbody></table>"]||(!tags.indexOf("<td")||!tags.indexOf("<th"))&&[3,"<table><tbody><tr>","</tr></tbody></table>"]||!tags.indexOf("<col")&&[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"]||jQuery.browser.msie&&[1,"div<div>","</div>"]||[0,"",""]; 4641div.innerHTML=wrap[1]+elem+wrap[2]; 4642while(wrap[0]--){div=div.lastChild 4643}if(jQuery.browser.msie){var tbody=!tags.indexOf("<table")&&tags.indexOf("<tbody")<0?div.firstChild&&div.firstChild.childNodes:wrap[1]=="<table>"&&tags.indexOf("<tbody")<0?div.childNodes:[]; 4644for(var j=tbody.length-1; 4645j>=0; 4646--j){if(jQuery.nodeName(tbody[j],"tbody")&&!tbody[j].childNodes.length){tbody[j].parentNode.removeChild(tbody[j]) 4647}}if(/^\s/.test(elem)){div.insertBefore(context.createTextNode(elem.match(/^\s*/)[0]),div.firstChild) 4648}}elem=jQuery.makeArray(div.childNodes) 4649}if(elem.length===0&&(!jQuery.nodeName(elem,"form")&&!jQuery.nodeName(elem,"select"))){return 4650}if(elem[0]==undefined||jQuery.nodeName(elem,"form")||elem.options){ret.push(elem) 4651}else{ret=jQuery.merge(ret,elem) 4652}}); 4653return ret 4654},attr:function(elem,name,value){if(!elem||elem.nodeType==3||elem.nodeType==8){return undefined 4655}var notxml=!jQuery.isXMLDoc(elem),set=value!==undefined,msie=jQuery.browser.msie; 4656name=notxml&&jQuery.props[name]||name; 4657if(elem.tagName){var special=/href|src|style/.test(name); 4658if(name=="selected"&&jQuery.browser.safari){elem.parentNode.selectedIndex 4659}if(name in elem&¬xml&&!special){if(set){if(name=="type"&&jQuery.nodeName(elem,"input")&&elem.parentNode){throw"type property can't be changed" 4660}elem[name]=value 4661}if(jQuery.nodeName(elem,"form")&&elem.getAttributeNode(name)){return elem.getAttributeNode(name).nodeValue 4662}return elem[name] 4663}if(msie&¬xml&&name=="style"){return jQuery.attr(elem.style,"cssText",value) 4664}if(set){elem.setAttribute(name,""+value) 4665}var attr=msie&¬xml&&special?elem.getAttribute(name,2):elem.getAttribute(name); 4666return attr===null?undefined:attr 4667}if(msie&&name=="opacity"){if(set){elem.zoom=1; 4668elem.filter=(elem.filter||"").replace(/alpha\([^)]*\)/,"")+(parseInt(value)+""=="NaN"?"":"alpha(opacity="+value*100+")") 4669}return elem.filter&&elem.filter.indexOf("opacity=")>=0?(parseFloat(elem.filter.match(/opacity=([^)]*)/)[1])/100)+"":"" 4670}name=name.replace(/-([a-z])/ig,function(all,letter){return letter.toUpperCase() 4671}); 4672if(set){elem[name]=value 4673}return elem[name] 4674},trim:function(text){return(text||"").replace(/^\s+|\s+$/g,"") 4675},makeArray:function(array){var ret=[]; 4676if(array!=null){var i=array.length; 4677if(i==null||array.split||array.setInterval||array.call){ret[0]=array 4678}else{while(i){ret[--i]=array[i] 4679}}}return ret 4680},inArray:function(elem,array){for(var i=0,length=array.length; 4681i<length; 4682i++){if(array[i]===elem){return i 4683}}return -1 4684},merge:function(first,second){var i=0,elem,pos=first.length; 4685if(jQuery.browser.msie){while(elem=second[i++]){if(elem.nodeType!=8){first[pos++]=elem 4686}}}else{while(elem=second[i++]){first[pos++]=elem 4687}}return first 4688},unique:function(array){var ret=[],done={}; 4689try{for(var i=0,length=array.length; 4690i<length; 4691i++){var id=jQuery.data(array[i]); 4692if(!done[id]){done[id]=true; 4693ret.push(array[i]) 4694}}}catch(e){ret=array 4695}return ret 4696},grep:function(elems,callback,inv){var ret=[]; 4697for(var i=0,length=elems.length; 4698i<length; 4699i++){if(!inv!=!callback(elems[i],i)){ret.push(elems[i]) 4700}}return ret 4701},map:function(elems,callback){var ret=[]; 4702for(var i=0,length=elems.length; 4703i<length; 4704i++){var value=callback(elems[i],i); 4705if(value!=null){ret[ret.length]=value 4706}}return ret.concat.apply([],ret) 4707}}); 4708var userAgent=navigator.userAgent.toLowerCase(); 4709jQuery.browser={version:(userAgent.match(/.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/)||[])[1],safari:/webkit/.test(userAgent),opera:/opera/.test(userAgent),msie:/msie/.test(userAgent)&&!/opera/.test(userAgent),mozilla:/mozilla/.test(userAgent)&&!/(compatible|webkit)/.test(userAgent)}; 4710var styleFloat=jQuery.browser.msie?"styleFloat":"cssFloat";
4711jQuery.extend({boxModel:!jQuery.browser.msie||document.compatMode=="CSS1Compat",props:{"for":"htmlFor","class":"className","float":styleFloat,cssFloat:styleFloat,styleFloat:styleFloat,readonly:"readOnly",maxlength:"maxLength",cellspacing:"cellSpacing"}}); 4712jQuery.each({parent:function(elem){return elem.parentNode 4713},parents:function(elem){return jQuery.dir(elem,"parentNode") 4714},next:function(elem){return jQuery.nth(elem,2,"nextSibling") 4715},prev:function(elem){return jQuery.nth(elem,2,"previousSibling") 4716},nextAll:function(elem){return jQuery.dir(elem,"nextSibling") 4717},prevAll:function(elem){return jQuery.dir(elem,"previousSibling") 4718},siblings:function(elem){return jQuery.sibling(elem.parentNode.firstChild,elem) 4719},children:function(elem){return jQuery.sibling(elem.firstChild) 4720},contents:function(elem){return jQuery.nodeName(elem,"iframe")?elem.contentDocument||elem.contentWindow.document:jQuery.makeArray(elem.childNodes) 4721}},function(name,fn){jQuery.fn[name]=function(selector){var ret=jQuery.map(this,fn); 4722if(selector&&typeof selector=="string"){ret=jQuery.multiFilter(selector,ret) 4723}return this.pushStack(jQuery.unique(ret)) 4724} 4725}); 4726jQuery.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(name,original){jQuery.fn[name]=function(){var args=arguments; 4727return this.each(function(){for(var i=0,length=args.length; 4728i<length; 4729i++){jQuery(args[i])[original](this) 4730}}) 4731} 4732}); 4733jQuery.each({removeAttr:function(name){jQuery.attr(this,name,""); 4734if(this.nodeType==1){this.removeAttribute(name) 4735}},addClass:function(classNames){jQuery.className.add(this,classNames) 4736},removeClass:function(classNames){jQuery.className.remove(this,classNames) 4737},toggleClass:function(classNames){jQuery.className[jQuery.className.has(this,classNames)?"remove":"add"](this,classNames) 4738},remove:function(selector){if(!selector||jQuery.filter(selector,[this]).r.length){jQuery("*",this).add(this).each(function(){jQuery.event.remove(this); 4739jQuery.removeData(this) 4740}); 4741if(this.parentNode){this.parentNode.removeChild(this) 4742}}},empty:function(){jQuery(">*",this).remove(); 4743while(this.firstChild){this.removeChild(this.firstChild) 4744}}},function(name,fn){jQuery.fn[name]=function(){return this.each(fn,arguments) 4745} 4746}); 4747jQuery.each(["Height","Width"],function(i,name){var type=name.toLowerCase(); 4748jQuery.fn[type]=function(size){return this[0]==window?jQuery.browser.opera&&document.body["client"+name]||jQuery.browser.safari&&window["inner"+name]||document.compatMode=="CSS1Compat"&&document.documentElement["client"+name]||document.body["client"+name]:this[0]==document?Math.max(Math.max(document.body["scroll"+name],document.documentElement["scroll"+name]),Math.max(document.body["offset"+name],document.documentElement["offset"+name])):size==undefined?(this.length?jQuery.css(this[0],type):null):this.css(type,size.constructor==String?size:size
4748+"px") 4749} 4750}); 4751function num(elem,prop){return elem[0]&&parseInt(jQuery.curCSS(elem[0],prop,true),10)||0 4752}var chars=jQuery.browser.safari&&parseInt(jQuery.browser.version)<417?"(?:[\\w*_-]|\\\\.)":"(?:[\\w\u0128-\uFFFF*_-]|\\\\.)",quickChild=new RegExp("^>\\s*("+chars+"+)"),quickID=new RegExp("^("+chars+"+)(#)("+chars+"+)"),quickClass=new RegExp("^([#.]?)("+chars+"*)"); 4753jQuery.extend({expr:{"":function(a,i,m){return m[2]=="*"||jQuery.nodeName(a,m[2]) 4754},"#":function(a,i,m){return a.getAttribute("id")==m[2] 4755},":":{lt:function(a,i,m){return i<m[3]-0 4756},gt:function(a,i,m){return i>m[3]-0 4757},nth:function(a,i,m){return m[3]-0==i 4758},eq:function(a,i,m){return m[3]-0==i 4759},first:function(a,i){return i==0 4760},last:function(a,i,m,r){return i==r.length-1 4761},even:function(a,i){return i%2==0 4762},odd:function(a,i){return i%2 4763},"first-child":function(a){return a.parentNode.getElementsByTagName("*")[0]==a 4764},"last-child":function(a){return jQuery.nth(a.parentNode.lastChild,1,"previousSibling")==a 4765},"only-child":function(a){return !jQuery.nth(a.parentNode.lastChild,2,"previousSibling") 4766},parent:function(a){return a.firstChild 4767},empty:function(a){return !a.firstChild 4768},contains:function(a,i,m){return(a.textContent||a.innerText||jQuery(a).text()||"").indexOf(m[3])>=0 4769},visible:function(a){return"hidden"!=a.type&&jQuery.css(a,"display")!="none"&&jQuery.css(a,"visibility")!="hidden" 4770},hidden:function(a){return"hidden"==a.type||jQuery.css(a,"display")=="none"||jQuery.css(a,"visibility")=="hidden" 4771},enabled:function(a){return !a.disabled 4772},disabled:function(a){return a.disabled 4773},checked:function(a){return a.checked 4774},selected:function(a){return a.selected||jQuery.attr(a,"selected") 4775},text:function(a){return"text"==a.type 4776},radio:function(a){return"radio"==a.type 4777},checkbox:function(a){return"checkbox"==a.type 4778},file:function(a){return"file"==a.type 4779},password:function(a){return"password"==a.type 4780},submit:function(a){return"submit"==a.type 4781},image:function(a){return"image"==a.type 4782},reset:function(a){return"reset"==a.type 4783},button:function(a){return"button"==a.type||jQuery.nodeName(a,"button") 4784},input:function(a){return/input|select|textarea|button/i.test(a.nodeName) 4785},has:function(a,i,m){return jQuery.find(m[3],a).length 4786},header:function(a){return/h\d/i.test(a.nodeName) 4787},animated:function(a){return jQuery.grep(jQuery.timers,function(fn){return a==fn.elem 4788}).length 4789}}},parse:[/^(\[) *@?([\w-]+) *([!*$^~=]*) *('?"?)(.*?)\4 *\]/,/^(:)([\w-]+)\("?'?(.*?(\(.*?\))?[^(]*?)"?'?\)/,new RegExp("^([:.#]*)("+chars+"+)")],multiFilter:function(expr,elems,not){var old,cur=[]; 4790while(expr&&expr!=old){old=expr; 4791var f=jQuery.filter(expr,elems,not); 4792expr=f.t.replace(/^\s*,\s*/,""); 4793cur=not?elems=f.r:jQuery.merge(cur,f.r) 4794}return cur 4795},find:function(t,context){if(typeof t!="string"){return[t] 4796}if(context&&context.nodeType!=1&&context.nodeType!=9){return[] 4797}context=context||document; 4798var ret=[context],done=[],last,nodeName; 4799while(t&&last!=t){var r=[]; 4800last=t; 4801t=jQuery.trim(t); 4802var foundToken=false,re=quickChild,m=re.exec(t); 4803if(m){nodeName=m[1].toUpperCase(); 4804for(var i=0; 4805ret[i]; 4806i++){for(var c=ret[i].firstChild; 4807c; 4808c=c.nextSibling){if(c.nodeType==1&&(nodeName=="*"||c.nodeName.toUpperCase()==nodeName)){r.push(c) 4809}}}ret=r; 4810t=t.replace(re,""); 4811if(t.indexOf(" ")==0){continue 4812}foundToken=true 4813}else{re=/^([>+~])\s*(\w*)/i; 4814if((m=re.exec(t))!=null){r=[]; 4815var merge={}; 4816nodeName=m[2].toUpperCase(); 4817m=m[1]; 4818for(var j=0,rl=ret.length; 4819j<rl; 4820j++){var n=m=="~"||m=="+"?ret[j].nextSibling:ret[j].firstChild; 4821for(; 4822n; 4823n=n.nextSibling){if(n.nodeType==1){var id=jQuery.data(n); 4824if(m=="~"&&merge[id]){break 4825}if(!nodeName||n.nodeName.toUpperCase()==nodeName){if(m=="~"){merge[id]=true 4826}r.push(n) 4827}if(m=="+"){break 4828}}}}ret=r; 4829t=jQuery.trim(t.replace(re,"")); 4830foundToken=true 4831}}if(t&&!foundToken){if(!t.indexOf(",")){if(context==ret[0]){ret.shift() 4832}done=jQuery.merge(done,ret); 4833r=ret=[context]; 4834t=" "+t.substr(1,t.length) 4835}else{var re2=quickID; 4836var m=re2.exec(t); 4837if(m){m=[0,m[2],m[3],m[1]] 4838}else{re2=quickClass; 4839m=re2.exec(t) 4840}m[2]=m[2].replace(/\\/g,""); 4841var elem=ret[ret.length-1]; 4842if(m[1]=="#"&&elem&&elem.getElementById&&!jQuery.isXMLDoc(elem)){var oid=elem.getElementById(m[2]); 4843if((jQuery.browser.msie||jQuery.browser.opera)&&oid&&typeof oid.id=="string"&&oid.id!=m[2]){oid=jQuery('[@id="'+m[2]+'"]',elem)[0] 4844}ret=r=oid&&(!m[3]||jQuery.nodeName(oid,m[3]))?[oid]:[] 4845}else{for(var i=0; 4846ret[i]; 4847i++){var tag=m[1]=="#"&&m[3]?m[3]:m[1]!=""||m[0]==""?"*":m[2]; 4848if(tag=="*"&&ret[i].nodeName.toLowerCase()=="object"){tag="param" 4849}r=jQuery.merge(r,ret[i].getElementsByTagName(tag)) 4850}if(m[1]=="."){r=jQuery.classFilter(r,m[2]) 4851}if(m[1]=="#"){var tmp=[]; 4852for(var i=0; 4853r[i]; 4854i++){if(r[i].getAttribute("id")==m[2]){tmp=[r[i]]; 4855break 4856}}r=tmp 4857}ret=r 4858}t=t.replace(re2,"") 4859}}if(t){var val=jQuery.filter(t,r); 4860ret=r=val.r; 4861t=jQuery.trim(val.t) 4862}}if(t){ret=[] 4863}if(ret&&context==ret[0]){ret.shift() 4864}done=jQuery.merge(done,ret); 4865return done 4866},classFilter:function(r,m,not){m=" "+m+" "; 4867var tmp=[]; 4868for(var i=0; 4869r[i]; 4870i++){var pass=(" "+r[i].className+" ").indexOf(m)>=0; 4871if(!not&&pass||not&&!pass){tmp.push(r[i]) 4872}}return tmp 4873},filter:function(t,r,not){var last; 4874while(t&&t!=last){last=t; 4875var p=jQuery.parse,m; 4876for(var i=0; 4877p[i]; 4878i++){m=p[i].exec(t); 4879if(m){t=t.substring(m[0].length); 4880m[2]=m[2].replace(/\\/g,""); 4881break 4882}}if(!m){break 4883}if(m[1]==":"&&m[2]=="not"){r=isSimple.test(m[3])?jQuery.filter(m[3],r,true).r:jQuery(r).not(m[3]) 4884}else{if(m[1]=="."){r=jQuery.classFilter(r,m[2],not) 4885}else{if(m[1]=="["){var tmp=[],type=m[3]; 4886for(var i=0,rl=r.length; 4887i<rl; 4888i++){var a=r[i],z=a[jQuery.props[m[2]]||m[2]];
4889if(z==null||/href|src|selected/.test(m[2])){z=jQuery.attr(a,m[2])||"" 4890}if((type==""&&!!z||type=="="&&z==m[5]||type=="!="&&z!=m[5]||type=="^="&&z&&!z.indexOf(m[5])||type=="$="&&z.substr(z.length-m[5].length)==m[5]||(type=="*="||type=="~=")&&z.indexOf(m[5])>=0)^not){tmp.push(a) 4891}}r=tmp 4892}else{if(m[1]==":"&&m[2]=="nth-child"){var merge={},tmp=[],test=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(m[3]=="even"&&"2n"||m[3]=="odd"&&"2n+1"||!/\D/.test(m[3])&&"0n+"+m[3]||m[3]),first=(test[1]+(test[2]||1))-0,last=test[3]-0; 4893for(var i=0,rl=r.length; 4894i<rl; 4895i++){var node=r[i],parentNode=node.parentNode,id=jQuery.data(parentNode); 4896if(!merge[id]){var c=1; 4897for(var n=parentNode.firstChild; 4898n; 4899n=n.nextSibling){if(n.nodeType==1){n.nodeIndex=c++ 4900}}merge[id]=true 4901}var add=false; 4902if(first==0){if(node.nodeIndex==last){add=true 4903}}else{if((node.nodeIndex-last)%first==0&&(node.nodeIndex-last)/first>=0){add=true 4904}}if(add^not){tmp.push(node) 4905}}r=tmp 4906}else{var fn=jQuery.expr[m[1]]; 4907if(typeof fn=="object"){fn=fn[m[2]] 4908}if(typeof fn=="string"){fn=eval("false||function(a,i){return "+fn+";}") 4909}r=jQuery.grep(r,function(elem,i){return fn(elem,i,m,r) 4910},not) 4911}}}}}return{r:r,t:t} 4912},dir:function(elem,dir){var matched=[],cur=elem[dir]; 4913while(cur&&cur!=document){if(cur.nodeType==1){matched.push(cur) 4914}cur=cur[dir] 4915}return matched 4916},nth:function(cur,result,dir,elem){result=result||1; 4917var num=0; 4918for(; 4919cur; 4920cur=cur[dir]){if(cur.nodeType==1&&++num==result){break 4921}}return cur 4922},sibling:function(n,elem){var r=[]; 4923for(; 4924n; 4925n=n.nextSibling){if(n.nodeType==1&&n!=elem){r.push(n) 4926}}return r 4927}}); 4928jQuery.event={add:function(elem,types,handler,data){if(elem.nodeType==3||elem.nodeType==8){return 4929}if(jQuery.browser.msie&&elem.setInterval){elem=window 4930}if(!handler.guid){handler.guid=this.guid++ 4931}if(data!=undefined){var fn=handler; 4932handler=this.proxy(fn,function(){return fn.apply(this,arguments) 4933}); 4934handler.data=data 4935}var events=jQuery.data(elem,"events")||jQuery.data(elem,"events",{}),handle=jQuery.data(elem,"handle")||jQuery.data(elem,"handle",function(){if(typeof jQuery!="undefined"&&!jQuery.event.triggered){return jQuery.event.handle.apply(arguments.callee.elem,arguments) 4936}}); 4937handle.elem=elem; 4938jQuery.each(types.split(/\s+/),function(index,type){var parts=type.split("."); 4939type=parts[0]; 4940handler.type=parts[1]; 4941var handlers=events[type]; 4942if(!handlers){handlers=events[type]={}; 4943if(!jQuery.event.special[type]||jQuery.event.special[type].setup.call(elem)===false){if(elem.addEventListener){elem.addEventListener(type,handle,false) 4944}else{if(elem.attachEvent){elem.attachEvent("on"+type,handle) 4945}}}}handlers[handler.guid]=handler; 4946jQuery.event.global[type]=true 4947}); 4948elem=null 4949},guid:1,global:{},remove:function(elem,types,handler){if(elem.nodeType==3||elem.nodeType==8){return 4950}var events=jQuery.data(elem,"events"),ret,index; 4951if(events){if(types==undefined||(typeof types=="string"&&types.charAt(0)==".")){for(var type in events){this.remove(elem,type+(types||"")) 4952}}else{if(types.type){handler=types.handler; 4953types=types.type 4954}jQuery.each(types.split(/\s+/),function(index,type){var parts=type.split("."); 4955type=parts[0]; 4956if(events[type]){if(handler){delete events[type][handler.guid] 4957}else{for(handler in events[type]){if(!parts[1]||events[type][handler].type==parts[1]){delete events[type][handler] 4958}}}for(ret in events[type]){break 4959}if(!ret){if(!jQuery.event.special[type]||jQuery.event.special[type].teardown.call(elem)===false){if(elem.removeEventListener){elem.removeEventListener(type,jQuery.data(elem,"handle"),false) 4960}else{if(elem.detachEvent){elem.detachEvent("on"+type,jQuery.data(elem,"handle")) 4961}}}ret=null; 4962delete events[type] 4963}}}) 4964}for(ret in events){break 4965}if(!ret){var handle=jQuery.data(elem,"handle"); 4966if(handle){handle.elem=null 4967}jQuery.removeData(elem,"events"); 4968jQuery.removeData(elem,"handle") 4969}}},trigger:function(type,data,elem,donative,extra){data=jQuery.makeArray(data); 4970if(type.indexOf("!")>=0){type=type.slice(0,-1); 4971var exclusive=true 4972}if(!elem){if(this.global[type]){jQuery("*").add([window,document]).trigger(type,data) 4973}}else{if(elem.nodeType==3||elem.nodeType==8){return undefined 4974}var val,ret,fn=jQuery.isFunction(elem[type]||null),event=!data[0]||!data[0].preventDefault; 4975if(event){data.unshift({type:type,target:elem,preventDefault:function(){},stopPropagation:function(){},timeStamp:now()}); 4976data[0][expando]=true 4977}data[0].type=type; 4978if(exclusive){data[0].exclusive=true 4979}var handle=jQuery.data(elem,"handle"); 4980if(handle){val=handle.apply(elem,data) 4981}if((!fn||(jQuery.nodeName(elem,"a")&&type=="click"))&&elem["on"+type]&&elem["on"+type].apply(elem,data)===false){val=false 4982}if(event){data.shift() 4983}if(extra&&jQuery.isFunction(extra)){ret=extra.apply(elem,val==null?data:data.concat(val)); 4984if(ret!==undefined){val=ret 4985}}if(fn&&donative!==false&&val!==false&&!(jQuery.nodeName(elem,"a")&&type=="click")){this.triggered=true; 4986try{elem[type]() 4987}catch(e){}}this.triggered=false 4988}return val 4989},handle:function(event){var val,ret,namespace,all,handlers; 4990event=arguments[0]=jQuery.event.fix(event||window.event); 4991namespace=event.type.split("."); 4992event.type=namespace[0]; 4993namespace=namespace[1]; 4994all=!namespace&&!event.exclusive; 4995handlers=(jQuery.data(this,"events")||{})[event.type]; 4996for(var j in handlers){var handler=handlers[j]; 4997if(all||handler.type==namespace){event.handler=handler; 4998event.data=handler.data; 4999ret=handler.apply(this,arguments); 5000if(val!==false){val=ret 5001}if(ret===false){event.preventDefault(); 5002event.stopPropagation() 5003}}}return val 5004},fix:function(event){if(event[expando]==true){return event 5005}var originalEvent=event; 5006event={originalEvent:originalEvent}; 5007var props="altKey attrChange attrName bubbles button cancelable charCo
5007de clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode metaKey newValue originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target timeStamp toElement type view wheelDelta which".split(" "); 5008for(var i=props.length-1; 5009i>=0; 5010i--){event[props[i]]=originalEvent[props[i]] 5011}event[expando]=true; 5012event.preventDefault=function(){if(originalEvent.preventDefault){originalEvent.preventDefault() 5013}originalEvent.returnValue=false 5014}; 5015event.stopPropagation=function(){if(originalEvent.stopPropagation){originalEvent.stopPropagation() 5016}originalEvent.cancelBubble=true 5017}; 5018event.timeStamp=event.timeStamp||now(); 5019if(!event.target){event.target=event.srcElement||document 5020}if(event.target.nodeType==3){event.target=event.target.parentNode 5021}if(!event.relatedTarget&&event.fromElement){event.relatedTarget=event.fromElement==event.target?event.toElement:event.fromElement 5022}if(event.pageX==null&&event.clientX!=null){var doc=document.documentElement,body=document.body; 5023event.pageX=event.clientX+(doc&&doc.scrollLeft||body&&body.scrollLeft||0)-(doc.clientLeft||0); 5024event.pageY=event.clientY+(doc&&doc.scrollTop||body&&body.scrollTop||0)-(doc.clientTop||0) 5025}if(!event.which&&((event.charCode||event.charCode===0)?event.charCode:event.keyCode)){event.which=event.charCode||event.keyCode 5026}if(!event.metaKey&&event.ctrlKey){event.metaKey=event.ctrlKey 5027}if(!event.which&&event.button){event.which=(event.button&1?1:(event.button&2?3:(event.button&4?2:0))) 5028}return event 5029},proxy:function(fn,proxy){proxy.guid=fn.guid=fn.guid||proxy.guid||this.guid++; 5030return proxy 5031},special:{ready:{setup:function(){bindReady(); 5032return 5033},teardown:function(){return 5034}},mouseenter:{setup:function(){if(jQuery.browser.msie){return false 5035}jQuery(this).bind("mouseover",jQuery.event.special.mouseenter.handler); 5036return true 5037},teardown:function(){if(jQuery.browser.msie){return false 5038}jQuery(this).unbind("mouseover",jQuery.event.special.mouseenter.handler); 5039return true 5040},handler:function(event){if(withinElement(event,this)){return true 5041}event.type="mouseenter"; 5042return jQuery.event.handle.apply(this,arguments) 5043}},mouseleave:{setup:function(){if(jQuery.browser.msie){return false 5044}jQuery(this).bind("mouseout",jQuery.event.special.mouseleave.handler); 5045return true 5046},teardown:function(){if(jQuery.browser.msie){return false 5047}jQuery(this).unbind("mouseout",jQuery.event.special.mouseleave.handler); 5048return true 5049},handler:function(event){if(withinElement(event,this)){return true 5050}event.type="mouseleave"; 5051return jQuery.event.handle.apply(this,arguments) 5052}}}}; 5053jQuery.fn.extend({bind:function(type,data,fn){return type=="unload"?this.one(type,data,fn):this.each(function(){jQuery.event.add(this,type,fn||data,fn&&data) 5054}) 5055},one:function(type,data,fn){var one=jQuery.event.proxy(fn||data,function(event){jQuery(this).unbind(event,one); 5056return(fn||data).apply(this,arguments) 5057}); 5058return this.each(function(){jQuery.event.add(this,type,one,fn&&data) 5059}) 5060},unbind:function(type,fn){return this.each(function(){jQuery.event.remove(this,type,fn) 5061}) 5062},trigger:function(type,data,fn){return this.each(function(){jQuery.event.trigger(type,data,this,true,fn) 5063}) 5064},triggerHandler:function(type,data,fn){return this[0]&&jQuery.event.trigger(type,data,this[0],false,fn) 5065},toggle:function(fn){var args=arguments,i=1; 5066while(i<args.length){jQuery.event.proxy(fn,args[i++]) 5067}return this.click(jQuery.event.proxy(fn,function(event){this.lastToggle=(this.lastToggle||0)%i; 5068event.preventDefault(); 5069return args[this.lastToggle++].apply(this,arguments)||false 5070})) 5071},hover:function(fnOver,fnOut){return this.bind("mouseenter",fnOver).bind("mouseleave",fnOut) 5072},ready:function(fn){bindReady(); 5073if(jQuery.isReady){fn.call(document,jQuery) 5074}else{jQuery.readyList.push(function(){return fn.call(this,jQuery) 5075}) 5076}return this 5077}}); 5078jQuery.extend({isReady:false,readyList:[],ready:function(){if(!jQuery.isReady){jQuery.isReady=true; 5079if(jQuery.readyList){jQuery.each(jQuery.readyList,function(){this.call(document) 5080}); 5081jQuery.readyList=null 5082}jQuery(document).triggerHandler("ready") 5083}}}); 5084var readyBound=false; 5085function bindReady(){if(readyBound){return 5086}readyBound=true; 5087if(document.addEventListener&&!jQuery.browser.opera){document.addEventListener("DOMContentLoaded",jQuery.ready,false) 5088}if(jQuery.browser.msie&&window==top){(function(){if(jQuery.isReady){return 5089}try{document.documentElement.doScroll("left") 5090}catch(error){setTimeout(arguments.callee,0); 5091return 5092}jQuery.ready() 5093}
5093)() 5094}if(jQuery.browser.opera){document.addEventListener("DOMContentLoaded",function(){if(jQuery.isReady){return 5095}for(var i=0; 5096i<document.styleSheets.length; 5097i++){if(document.styleSheets[i].disabled){setTimeout(arguments.callee,0); 5098return 5099}}jQuery.ready() 5100},false) 5101}if(jQuery.browser.safari){var numStyles; 5102(function(){if(jQuery.isReady){return 5103}if(document.readyState!="loaded"&&document.readyState!="complete"){setTimeout(arguments.callee,0); 5104return 5105}if(numStyles===undefined){numStyles=jQuery("style, link[rel=stylesheet]").length 5106}if(document.styleSheets.length!=numStyles){setTimeout(arguments.callee,0); 5107return 5108}jQuery.ready() 5109})() 5110}jQuery.event.add(window,"load",jQuery.ready) 5111}jQuery.each(("blur,focus,load,resize,scroll,unload,click,dblclick,mousedown,mouseup,mousemove,mouseover,mouseout,change,select,submit,keydown,keypress,keyup,error").split(","),function(i,name){jQuery.fn[name]=function(fn){return fn?this.bind(name,fn):this.trigger(name) 5112} 5113}); 5114var withinElement=function(event,elem){var parent=event.relatedTarget; 5115while(parent&&parent!=elem){try{parent=parent.parentNode 5116}catch(error){parent=elem 5117}}return parent==elem 5118}; 5119jQuery(window).bind("unload",function(){jQuery("*").add(document).unbind() 5120}); 5121jQuery.fn.extend({_load:jQuery.fn.load,load:function(url,params,callback){if(typeof url!="string"){return this._load(url) 5122}var off=url.indexOf(" "); 5123if(off>=0){var selector=url.slice(off,url.length); 5124url=url.slice(0,off) 5125}callback=callback||function(){}; 5126var type="GET"; 5127if(params){if(jQuery.isFunction(params)){callback=params; 5128params=null 5129}else{params=jQuery.param(params); 5130type="POST" 5131}}var self=this; 5132jQuery.ajax({url:url,type:type,dataType:"html",data:params,complete:function(res,status){if(status=="success"||status=="notmodified"){self.html(selector?jQuery("<div/>").append(res.responseText.replace(/<script(.|\s)*?\/script>/g,"")).find(selector):res.responseText) 5133}self.each(callback,[res.responseText,status,res]) 5134}}); 5135return this 5136},serialize:function(){return jQuery.param(this.serializeArray()) 5137},serializeArray:function(){return this.map(function(){return jQuery.nodeName(this,"form")?jQuery.makeArray(this.elements):this 5138}).filter(function(){return this.name&&!this.disabled&&(this.checked||/select|textarea/i.test(this.nodeName)||/text|hidden|password/i.test(this.type)) 5139}).map(function(i,elem){var val=jQuery(this).val(); 5140return val==null?null:val.constructor==Array?jQuery.map(val,function(val,i){return{name:elem.name,value:val} 5141}):{name:elem.name,value:val} 5142}).get() 5143}}); 5144jQuery.each("ajaxStart,ajaxStop,ajaxComplete,ajaxError,ajaxSuccess,ajaxSend".split(","),function(i,o){jQuery.fn[o]=function(f){return this.bind(o,f) 5145} 5146}); 5147var jsc=now(); 5148jQuery.extend({get:function(url,data,callback,type){if(jQuery.isFunction(data)){callback=data; 5149data=null 5150}return jQuery.ajax({type:"GET",url:url,data:data,success:callback,dataType:type}) 5151},getScript:function(url,callback){return jQuery.get(url,null,callback,"script") 5152},getJSON:function(url,data,callback){return jQuery.get(url,data,callback,"json") 5153},post:function(url,data,callback,type){if(jQuery.isFunction(data)){callback=data; 5154data={} 5155}return jQuery.ajax({type:"POST",url:url,data:data,success:callback,dataType:type}) 5156},ajaxSetup:function(settings){jQuery.extend(jQuery.ajaxSettings,settings) 5157},ajaxSettings:{url:location.href,global:true,type:"GET",timeout:0,contentType:"application/x-www-form-urlencoded",processData:true,async:true,data:null,username:null,password:null,accepts:{xml:"application/xml, text/xml",html:"text/html",script:"text/javascript, application/javascript",json:"application/json, text/javascript",text:"text/plain",_default:"*/*"}},lastModified:{},ajax:function(s){s=jQuery.extend(true,s,jQuery.extend(true,{},jQuery.ajaxSettings,s)); 5158var jsonp,jsre=/=\?(&|$)/g,status,data,type=s.type.toUpperCase(); 5159if(s.data&&s.processData&&typeof s.data!="string"){s.data=jQuery.param(s.data) 5160}if(s.dataType=="jsonp"){if(type=="GET"){if(!s.url.match(jsre)){s.url+=(s.url.match(/\?/)?"&":"?")+(s.jsonp||"callback")+"=?" 5161}}else{if(!s.data||!s.data.match(jsre)){s.data=(s.data?s.data+"&":"")+(s.jsonp||"callback")+"=?" 5162}}s.dataType="json" 5163}if(s.dataType=="json"&&(s.data&&s.data.match(jsre)||s.url.match(jsre))){jsonp="jsonp"+jsc++; 5164if(s.data){s.data=(s.data+"").replace(jsre,"="+jsonp+"$1") 5165}s.url=s.url.replace(jsre,"="+jsonp+"$1"); 5166s.dataType="script"; 5167window[jsonp]=function(tmp){data=tmp; 5168success(); 5169complete(); 5170window[jsonp]=undefined; 5171try{delete window[jsonp] 5172}catch(e){}if(head){head.removeChild(script) 5173}} 5174}if(s.dataType=="script"&&s.cache==null){s.cache=false 5175}if(s.cache===false&&type=="GET"){var ts=now(); 5176var ret=s.url.replace(/(\?|&)_=.*?(&|$)/,"$1_="+ts+"$2"); 5177s.url=ret+((ret==s.url)?(s.url.match(/\?/)?"&":"?")+"_="+ts:"") 5178}if(s.data&&type=="GET"){s.url+=(s.url.match(/\?/)?"&":"?")+s.data; 5179s.data=null 5180}if(s.global&&!jQuery.active++){jQuery.event.trigger("ajaxStart") 5181}var remote=/^(?:\w+:)?\/\/([^\/?#]+)/; 5182if(s.dataType=="script"&&type=="GET"&&remote.test(s.url)&&remote.exec(s.url)[1]!=location.host){var head=document.getElementsByTagName("head")[0]; 5183var script=document.createElement("script"); 5184script.src=s.url; 5185if(s.scriptCharset){script.charset=s.scriptCharset 5186}if(!jsonp){var done=false; 5187script.onload=script.onreadystatechange=function(){if(!done&&(!this.readyState||this.readyState=="loaded"||this.readyState=="complete")){done=true; 5188success(); 5189complete(); 5190head.removeChild(script) 5191}} 5192}head.appendChild(script); 5193return undefined 5194}var requestDone=false; 5195var xhr=window.ActiveXObject?new ActiveXObject("Microsoft.XMLHTTP"):new XMLHttpRequest(); 5196if(s.username){xhr.open(type,s.url,s.async,s.username,s.password) 5197}else{xhr.open(type,s.url,s.async) 5198}
5198try{if(s.data){xhr.setRequestHeader("Content-Type",s.contentType) 5199}if(s.ifModified){xhr.setRequestHeader("If-Modified-Since",jQuery.lastModified[s.url]||"Thu, 01 Jan 1970 00:00:00 GMT") 5200}xhr.setRequestHeader("X-Requested-With","XMLHttpRequest"); 5201xhr.setRequestHeader("Accept",s.dataType&&s.accepts[s.dataType]?s.accepts[s.dataType]+", */*":s.accepts._default) 5202}catch(e){}if(s.beforeSend&&s.beforeSend(xhr,s)===false){s.global&&jQuery.active--; 5203xhr.abort(); 5204return false 5205}if(s.global){jQuery.event.trigger("ajaxSend",[xhr,s]) 5206}var onreadystatechange=function(isTimeout){if(!requestDone&&xhr&&(xhr.readyState==4||isTimeout=="timeout")){requestDone=true; 5207if(ival){clearInterval(ival); 5208ival=null 5209}status=isTimeout=="timeout"&&"timeout"||!jQuery.httpSuccess(xhr)&&"error"||s.ifModified&&jQuery.httpNotModified(xhr,s.url)&&"notmodified"||"success"; 5210if(status=="success"){try{data=jQuery.httpData(xhr,s.dataType,s.dataFilter) 5211}catch(e){status="parsererror" 5212}}if(status=="success"){var modRes; 5213try{modRes=xhr.getResponseHeader("Last-Modified") 5214}catch(e){}if(s.ifModified&&modRes){jQuery.lastModified[s.url]=modRes 5215}if(!jsonp){success() 5216}}else{jQuery.handleError(s,xhr,status) 5217}complete(); 5218if(s.async){xhr=null 5219}}}; 5220if(s.async){var ival=setInterval(onreadystatechange,13); 5221if(s.timeout>0){setTimeout(function(){if(xhr){xhr.abort(); 5222if(!requestDone){onreadystatechange("timeout") 5223}}},s.timeout) 5224}}try{xhr.send(s.data) 5225}catch(e){jQuery.handleError(s,xhr,null,e) 5226}if(!s.async){onreadystatechange() 5227}function success(){if(s.success){s.success(data,status) 5228}if(s.global){jQuery.event.trigger("ajaxSuccess",[xhr,s]) 5229}}function complete(){if(s.complete){s.complete(xhr,status) 5230}if(s.global){jQuery.event.trigger("ajaxComplete",[xhr,s]) 5231}if(s.global&&!--jQuery.active){jQuery.event.trigger("ajaxStop") 5232}}return xhr 5233},handleError:function(s,xhr,status,e){if(s.error){s.error(xhr,status,e) 5234}if(s.global){jQuery.event.trigger("ajaxError",[xhr,s,e]) 5235}},active:0,httpSuccess:function(xhr){try{return !xhr.status&&location.protocol=="file:"||(xhr.status>=200&&xhr.status<300)||xhr.status==304||xhr.status==1223||jQuery.browser.safari&&xhr.status==undefined 5236}catch(e){}return false 5237},httpNotModified:function(xhr,url){try{var xhrRes=xhr.getResponseHeader("Last-Modified"); 5238return xhr.status==304||xhrRes==jQuery.lastModified[url]||jQuery.browser.safari&&xhr.status==undefined 5239}catch(e){}return false 5240},httpData:function(xhr,type,filter){var ct=xhr.getResponseHeader("content-type"),xml=type=="xml"||!type&&ct&&ct.indexOf("xml")>=0,data=xml?xhr.responseXML:xhr.responseText; 5241if(xml&&data.documentElement.tagName=="parsererror"){throw"parsererror" 5242}if(filter){data=filter(data,type) 5243}if(type=="script"){jQuery.globalEval(data) 5244}if(type=="json"){data=eval("("+data+")") 5245}return data 5246},param:function(a){var s=[]; 5247if(a.constructor==Array||a.jquery){jQuery.each(a,function(){s.push(encodeURIComponent(this.name)+"="+encodeURIComponent(this.value)) 5248}) 5249}else{for(var j in a){if(a[j]&&a[j].constructor==Array){jQuery.each(a[j],function(){s.push(encodeURIComponent(j)+"="+encodeURIComponent(this)) 5250}) 5251}else{s.push(encodeURIComponent(j)+"="+encodeURIComponent(jQuery.isFunction(a[j])?a[j]():a[j])) 5252}}}return s.join("&").replace(/%20/g,"+") 5253}}); 5254jQuery.fn.extend({show:function(speed,callback){return speed?this.animate({height:"show",width:"show",opacity:"show"},speed,callback):this.filter(":hidden").each(function(){this.style.display=this.oldblock||""; 5255if(jQuery.css(this,"display")=="none"){var elem=jQuery("<"+this.tagName+" />").appendTo("body"); 5256this.style.display=elem.css("display"); 5257if(this.style.display=="none"){this.style.display="block" 5258}elem.remove() 5259}}).end() 5260},hide:function(speed,callback){return speed?this.animate({height:"hide",width:"hide",opacity:"hide"},speed,callback):this.filter(":visible").each(function(){this.oldblock=this.oldblock||jQuery.css(this,"display"); 5261this.style.display="none" 5262}).end() 5263},_toggle:jQuery.fn.toggle,toggle:function(fn,fn2){return jQuery.isFunction(fn)&&jQuery.isFunction(fn2)?this._toggle.apply(this,arguments):fn?this.animate({height:"toggle",width:"toggle",opacity:"toggle"},fn,fn2):this.each(function(){jQuery(this)[jQuery(this).is(":hidden")?"show":"hide"]() 5264}) 5265},slideDown:function(speed,callback){return this.animate({height:"show"},speed,callback) 5266},slideUp:function(speed,callback){return this.animate({height:"hide"},speed,callback) 5267},slideToggle:function(speed,callback){return this.animate({height:"toggle"},speed,callback) 5268},fadeIn:function(speed,callback){return this.animate({opacity:"show"},speed,callback) 5269},fadeOut:function(speed,callback){return this.animate({opacity:"hide"},speed,callback) 5270},fadeTo:function(speed,to,callback){return this.animate({opacity:to},speed,callback) 5271},animate:function(prop,speed,easing,callback){var optall=jQuery.speed(speed,easing,callback); 5272return this[optall.queue===false?"each":"queue"](function(){if(this.nodeType!=1){return false 5273}var opt=jQuery.extend({},optall),p,hidden=jQuery(this).is(":hidden"),self=this; 5274for(p in prop){if(prop[p]=="hide"&&hidden||prop[p]=="show"&&!hidden){return opt.complete.call(this) 5275}if(p=="height"||p=="width"){opt.display=jQuery.css(this,"display"); 5276opt.overflow=this.style.overflow 5277}}if(opt.overflow!=null){this.style.overflow="hidden" 5278}opt.curAnim=jQuery.extend({},prop); 5279jQuery.each(prop,function(name,val){var e=new jQuery.fx(self,opt,name); 5280if(/toggle|show|hide/.test(val)){e[val=="toggle"?hidden?"show":"hide":val](prop) 5281}else{var parts=val.toString().match(/^([+-]=)?([\d+-.]+)(.*)$/),start=e.cur(true)||0; 5282if(parts){var end=parseFloat(parts[2]),unit=parts[3]||"px"; 5283if(unit!="px"){self.style[name]=(end||1)+unit; 5284start=((end||1)/e.cur(true))*start; 5285self.style[name]=start+unit 5286}
5286if(parts[1]){end=((parts[1]=="-="?-1:1)*end)+start 5287}e.custom(start,end,unit) 5288}else{e.custom(start,val,"") 5289}}}); 5290return true 5291}) 5292},queue:function(type,fn){if(jQuery.isFunction(type)||(type&&type.constructor==Array)){fn=type; 5293type="fx" 5294}if(!type||(typeof type=="string"&&!fn)){return queue(this[0],type) 5295}return this.each(function(){if(fn.constructor==Array){queue(this,type,fn) 5296}else{queue(this,type).push(fn); 5297if(queue(this,type).length==1){fn.call(this) 5298}}}) 5299},stop:function(clearQueue,gotoEnd){var timers=jQuery.timers; 5300if(clearQueue){this.queue([]) 5301}this.each(function(){for(var i=timers.length-1; 5302i>=0; 5303i--){if(timers[i].elem==this){if(gotoEnd){timers[i](true) 5304}timers.splice(i,1) 5305}}}); 5306if(!gotoEnd){this.dequeue() 5307}return this 5308}}); 5309var queue=function(elem,type,array){if(elem){type=type||"fx"; 5310var q=jQuery.data(elem,type+"queue"); 5311if(!q||array){q=jQuery.data(elem,type+"queue",jQuery.makeArray(array)) 5312}}return q 5313}; 5314jQuery.fn.dequeue=function(type){type=type||"fx"; 5315return this.each(function(){var q=queue(this,type); 5316q.shift(); 5317if(q.length){q[0].call(this) 5318}}) 5319}; 5320jQuery.extend({speed:function(speed,easing,fn){var opt=speed&&speed.constructor==Object?speed:{complete:fn||!fn&&easing||jQuery.isFunction(speed)&&speed,duration:speed,easing:fn&&easing||easing&&easing.constructor!=Function&&easing}; 5321opt.duration=(opt.duration&&opt.duration.constructor==Number?opt.duration:jQuery.fx.speeds[opt.duration])||jQuery.fx.speeds.def; 5322opt.old=opt.complete; 5323opt.complete=function(){if(opt.queue!==false){jQuery(this).dequeue() 5324}if(jQuery.isFunction(opt.old)){opt.old.call(this) 5325}}; 5326return opt 5327},easing:{linear:function(p,n,firstNum,diff){return firstNum+diff*p 5328},swing:function(p,n,firstNum,diff){return((-Math.cos(p*Math.PI)/2)+0.5)*diff+firstNum 5329}},timers:[],timerId:null,fx:function(elem,options,prop){this.options=options; 5330this.elem=elem; 5331this.prop=prop; 5332if(!options.orig){options.orig={} 5333}}}); 5334jQuery.fx.prototype={update:function(){if(this.options.step){this.options.step.call(this.elem,this.now,this) 5335}(jQuery.fx.step[this.prop]||jQuery.fx.step._default)(this); 5336if(this.prop=="height"||this.prop=="width"){this.elem.style.display="block" 5337}},cur:function(force){if(this.elem[this.prop]!=null&&this.elem.style[this.prop]==null){return this.elem[this.prop] 5338}var r=parseFloat(jQuery.css(this.elem,this.prop,force)); 5339return r&&r>-10000?r:parseFloat(jQuery.curCSS(this.elem,this.prop))||0 5340},custom:function(from,to,unit){this.startTime=now(); 5341this.start=from; 5342this.end=to; 5343this.unit=unit||this.unit||"px"; 5344this.now=this.start; 5345this.pos=this.state=0; 5346this.update(); 5347var self=this; 5348function t(gotoEnd){return self.step(gotoEnd) 5349}t.elem=this.elem; 5350jQuery.timers.push(t); 5351if(jQuery.timerId==null){jQuery.timerId=setInterval(function(){var timers=jQuery.timers; 5352for(var i=0; 5353i<timers.length; 5354i++){if(!timers[i]()){timers.splice(i--,1) 5355}}if(!timers.length){clearInterval(jQuery.timerId); 5356jQuery.timerId=null 5357}},13) 5358}},show:function(){this.options.orig[this.prop]=jQuery.attr(this.elem.style,this.prop); 5359this.options.show=true; 5360this.custom(0,this.cur()); 5361if(this.prop=="width"||this.prop=="height"){this.elem.style[this.prop]="1px" 5362}jQuery(this.elem).show() 5363},hide:function(){this.options.orig[this.prop]=jQuery.attr(this.elem.style,this.prop); 5364this.options.hide=true; 5365this.custom(this.cur(),0) 5366},step:function(gotoEnd){var t=now(); 5367if(gotoEnd||t>this.options.duration+this.startTime){this.now=this.end; 5368this.pos=this.state=1; 5369this.update(); 5370this.options.curAnim[this.prop]=true; 5371var done=true; 5372for(var i in this.options.curAnim){if(this.options.curAnim[i]!==true){done=false 5373}}if(done){if(this.options.display!=null){this.elem.style.overflow=this.options.overflow; 5374this.elem.style.display=this.options.display; 5375if(jQuery.css(this.elem,"display")=="none"){this.elem.style.display="block" 5376}}if(this.options.hide){this.elem.style.display="none" 5377}if(this.options.hide||this.options.show){for(var p in this.options.curAnim){jQuery.attr(this.elem.style,p,this.options.orig[p]) 5378}}}if(done){this.options.complete.call(this.elem) 5379}return false 5380}else{var n=t-this.startTime; 5381this.state=n/this.options.duration; 5382this.pos=jQuery.easing[this.options.easing||(jQuery.easing.swing?"swing":"linear")](this.state,n,0,1,this.options.duration); 5383this.now=this.start+((this.end-this.start)*this.pos); 5384this.update() 5385}return true 5386}}; 5387jQuery.extend(jQuery.fx,{speeds:{slow:600,fast:200,def:400},step:{scrollLeft:function(fx){fx.elem.scrollLeft=fx.now 5388},scrollTop:function(fx){fx.elem.scrollTop=fx.now 5389},opacity:function(fx){jQuery.attr(fx.elem.style,"opacity",fx.now) 5390},_default:function(fx){fx.elem.style[fx.prop]=fx.now+fx.unit 5391}}}); 5392jQuery.fn.offset=function(){var left=0,top=0,elem=this[0],results; 5393if(elem){with(jQuery.browser){var parent=elem.parentNode,offsetChild=elem,offsetParent=elem.offsetParent,doc=elem.ownerDocument,safari2=safari&&parseInt(version)<522&&!/adobeair/i.test(userAgent),css=jQuery.curCSS,fixed=css(elem,"position")=="fixed"; 5394if(elem.getBoundingClientRect){var box=elem.getBoundingClientRect(); 5395add(box.left+Math.max(doc.documentElement.scrollLeft,doc.body.scrollLeft),box.top+Math.max(doc.documentElement.scrollTop,doc.body.scrollTop)); 5396add(-doc.documentElement.clientLeft,-doc.documentElement.clientTop) 5397}else{add(elem.offsetLeft,elem.offsetTop); 5398while(offsetParent){add(offsetParent.offsetLeft,offsetParent.offsetTop); 5399if(mozilla&&!/^t(able|d|h)$/i.test(offsetParent.tagName)||safari&&!safari2){border(offsetParent) 5400}if(!fixed&&css(offsetParent,"position")=="fixed"){fixed=true 5401}offsetChild=/^body$/i.test(offsetParent.tagName)?offsetChild:offsetParent; 5402offsetParent=offsetParent.offsetParent 5403}while(parent&&parent.tagName&&!/^body|html$/i.test(parent.tagName)){if(!/^inline|table.*$/i.test(css(parent,"display"))){add(-parent.scrollLeft,-parent.scrollTop) 5404}if(mozilla&&css(parent,"overflow")!="visible"){border(parent) 5405}parent=parent.parentNode 5406}if((safari2&&(fixed||css(offsetChild,"position")=="absolute"))||(mozilla&&css(offsetChild,"position")!="absolute")){add(-doc.body.offsetLeft,-doc.body.offsetTop) 5407}if(fixed){add(Math.max(doc.documentElement.scrollLeft,doc.body.scrollLeft),Math.max(doc.documentElement.scrollTop,doc.body.scrollTop)) 5408}}results={top:top,left:left} 5409}}function border(elem){add(jQuery.curCSS(elem,"borderLeftWidth",true),jQuery.curCSS(elem,"borderTopWidth",true)) 5410}function add(l,t){left+=parseInt(l,10)||0; 5411top+=parseInt(t,10)||0 5412}return results 5413}; 5414jQuery.fn.extend({position:function(){var left=0,top=0,results; 5415if(this[0]){var offsetParent=this.offsetParent(),offset=this.offset(),parentOffset=/^body|html$/i.test(offsetParent[0].tagName)?{top:0,left:0}:offsetParent.offset(); 5416offset.top-=num(this,"marginTop"); 5417offset.left-=num(this,"marginLeft"); 5418parentOffset.top+=num(offsetParent,"borderTopWidth"); 5419parentOffset.left+=num(offsetParent,"borderLeftWidth");
5420results={top:offset.top-parentOffset.top,left:offset.left-parentOffset.left} 5421}return results 5422},offsetParent:function(){var offsetParent=this[0].offsetParent; 5423while(offsetParent&&(!/^body|html$/i.test(offsetParent.tagName)&&jQuery.css(offsetParent,"position")=="static")){offsetParent=offsetParent.offsetParent 5424}return jQuery(offsetParent) 5425}}); 5426jQuery.each(["Left","Top"],function(i,name){var method="scroll"+name; 5427jQuery.fn[method]=function(val){if(!this[0]){return 5428}return val!=undefined?this.each(function(){this==window||this==document?window.scrollTo(!i?val:jQuery(window).scrollLeft(),i?val:jQuery(window).scrollTop()):this[method]=val 5429}):this[0]==window||this[0]==document?self[i?"pageYOffset":"pageXOffset"]||jQuery.boxModel&&document.documentElement[method]||document.body[method]:this[0][method] 5430} 5431}); 5432jQuery.each(["Height","Width"],function(i,name){var tl=i?"Left":"Top",br=i?"Right":"Bottom"; 5433jQuery.fn["inner"+name]=function(){return this[name.toLowerCase()]()+num(this,"padding"+tl)+num(this,"padding"+br) 5434}; 5435jQuery.fn["outer"+name]=function(margin){return this["inner"+name]()+num(this,"border"+tl+"Width")+num(this,"border"+br+"Width")+(margin?num(this,"margin"+tl)+num(this,"margin"+br):0) 5436} 5437}) 5438})(); 5439jQuery.noConflict(); 5440if(!window.RichFaces){window.RichFaces={} 5441}if(!window.RichFaces.Memory){window.RichFaces.Memory={cleaners:{},addCleaner:function(A,B){this.cleaners[A]=B 5442},applyCleaners:function(B){for(var A in this.cleaners){this.cleaners[A](B) 5443}},clean:function(E){if(E){this.applyCleaners(E); 5444var B=E.all; 5445if(B){var A=0; 5446var D=B.length; 5447for(var A=0; 5448A<D; 5449A++){this.applyCleaners(B[A]) 5450}}else{var C=E.firstChild; 5451while(C){this.clean(C); 5452C=C.nextSibling 5453}}}}}; 5454window.RichFaces.Memory.addCleaner("richfaces",function(D){var B=D.component; 5455if(B){var C=B["rich:destructor"]; 5456if(C){var A=B[C]; 5457if(A){A.call(B) 5458}}}}); 5459if(window.attachEvent){window.attachEvent("onunload",function(){var A=window.RichFaces.Memory; 5460A.clean(document); 5461A.clean(window) 5462}) 5463}}if(!window.RichFaces){window.RichFaces={} 5464}if(!window.RichFaces.isJQueryWrapped){var oldJQuery=jQuery; 5465if(window.RichFaces&&window.RichFaces.Memory){window.RichFaces.Memory.addCleaner("jquery",function(A){if(A&&A[oldJQuery.expando]){oldJQuery.event.remove(A) 5466}}) 5467}window.RichFaces.isJQueryWrapped=true 5468} 5469var DnD={CODE_ACCEPT:"accept",CODE_DEFAULT:"default",CODE_REJECT:"reject",startDrag:function(A){if(!window.drag){this.init(); 5470window.drag=A; 5471Event.observe(document,"mousemove",this.mousemove); 5472Event.observe(document,"mouseup",this.mouseup) 5473}else{alert("drag in progress") 5474}},endDrag:function(C){Event.stopObserving(document,"mousemove",this.mousemove); 5475Event.stopObserving(document,"mouseup",this.mouseup); 5476var B=window.drag; 5477if(B){window.drag=null; 5478var A=B.dropzone; 5479B.source.endDrag(C,B); 5480if(A){A.onbeforedrag(C,B); 5481if(A.accept(B)){A.drop(C,B) 5482}A.onafterdrag(C) 5483}}},updateDrag:function(C){var B=window.drag; 5484if(!B.source.onupdatedrag||(B.source.onupdatedrag(C)!=false)){var A=Event.pointerX(C); 5485var D=Event.pointerY(C); 5486B.indicator.position(A+5,D+14); 5487Event.stop(C) 5488}},initialized:false,init:function(){if(!this.initialized){this.mousemove=this.updateDrag.bindAsEventListener(this); 5489this.mouseup=this.endDrag.bindAsEventListener(this); 5490this.initialized=true 5491}}}; 5492DnD.Drag=Class.create(); 5493DnD.Drag.prototype={initialize:function(C,A,B){this.source=C; 5494this.indicator=A; 5495this.type=B; 5496this.params={} 5497},dragged:false,dropzone:null,getParameters:function(){var A={}; 5498Object.extend(A,this.params); 5499return A 5500}} 5501 5502A4J_Command=Class.create(); 5503A4J_Command.prototype={initialize:function(B,C,A){this.form=Event.findElement(B,"form"); 5504this.target=A; 5505this.objectsCreated=new Array(); 5506this.oldValuesOfExistingInputs={}; 5507this.appendParameters(C); 5508this.processClick(); 5509this.cleanUp() 5510},processClick:function(){var B=this.form; 5511var A=B.target; 5512$A(this.objectsCreated).each(function(C){B.appendChild(C) 5513}); 5514if(this.target){B.target=this.target 5515}B.submit(); 5516B.target=A 5517},appendParameters:function(B){var A=this; 5518$H(B).each(function(C){A.createOrInitHiddenInput(C.key,C.value) 5519}) 5520},cleanUp:function(){var A=this.form;
5521$H(this.oldValuesOfExistingInputs).each(function(B){($(B.key)||A[B.key]).value=B.value 5522}); 5523$A(this.objectsCreated).each(function(B){A.removeChild(B) 5524}); 5525delete (this.objectsCreated) 5526},createOrInitHiddenInput:function(B,C){var A=$(B)||this.form[B]; 5527if(!A){A=document.createElement("input"); 5528A.setAttribute("type","hidden"); 5529A.setAttribute("name",B); 5530A.setAttribute("id",B); 5531this.objectsCreated.push(A) 5532}else{this.oldValuesOfExistingInputs[B]=A.value 5533}A.value=C 5534}} 5535 5536if(!window.A4J){window.A4J={} 5537}if(!A4J.findForm){function _JSFFormSubmit(I,K,F,J){var C=(typeof K=="string"?document.getElementById(K):K); 5538if(C){var B=[]; 5539var G=C.target; 5540if(F){C.target=F 5541}if(J){for(var D in J){B.push(D); 5542if(C.elements[D]){C.elements[D].value=J[D] 5543}else{var H=document.createElement("input"); 5544H.type="hidden"; 5545H.id=D; 5546H.name=D; 5547H.value=J[D]; 5548C.appendChild(H) 5549}}}var E; 5550if(C.fireEvent){E=C.fireEvent("onsubmit") 5551}else{var A=document.createEvent("HTMLEvents"); 5552A.initEvent("submit",true,true); 5553E=C.dispatchEvent(A) 5554}if(E){C.submit() 5555}_clearJSFFormParameters(K,G,B) 5556}else{alert("Form "+K+" not found in document") 5557}return false 5558}
5558function _clearJSFFormParameters(D,G,A){var E=(typeof D=="string"?document.getElementById(D):D); 5559if(E){if(G){E.target=G 5560}else{E.target="" 5561}if(A){for(var C=0; 5562C<A.length; 5563C++){var F=E.elements[A[C]]; 5564if(F){var B=F.parentNode; 5565if(B){B.removeChild(F) 5566}}}}}}function clearFormHiddenParams(B,C,A){_clearJSFFormParameters(B,C,A) 5567}A4J.findForm=function(A){var B=A; 5568do{B=B.parentNode 5569}while(B&&B.nodeName.toLowerCase()!="form"); 5570if(!B){B={reset:function(){},submit:function(){}} 5571}return B 5572}; 5573A4J._formInput=null; 5574A4J.setupForm=function(C){var B=(typeof C=="string"?window.document.getElementById(C):C); 5575var A="click"; 5576if(B.addEventListener){B.addEventListener(A,A4J._observer,false) 5577}else{if(B.attachEvent){B.attachEvent("on"+A,A4J._observer) 5578}}}; 5579A4J._observer=function(A){var B=A.target||A.srcElement; 5580if(B&&B.nodeName.toUpperCase()=="INPUT"&&B.type.toUpperCase()=="SUBMIT"){A4J._formInput=B 5581}else{A4J._formInput=null 5582}} 5583} 5584if(!window.Richfaces){window.Richfaces={} 5585}Richfaces.setImages=function(B,A){B=$(B); 5586if(!B){return 5587}for(imageSrc in A){if(typeof imageSrc!="function"){B[imageSrc]=new Image(); 5588B[imageSrc].src=A[imageSrc] 5589}}} 5590 5591if(!window.Richfaces){window.Richfaces={} 5592}if(!Richfaces.SmartPosition){Richfaces.SmartPosition={options:$H({"positionX":["right","left","center"],"positionY":["bottom","top"],positionFloat:true}),getBase:function(){return(document.compatMode&&document.compatMode.toLowerCase()=="css1compat"&&!/Netscape|Opera/.test(navigator.userAgent))?document.documentElement:(document.body||null) 5593},screenOffset:function(G,A){G=$(G); 5594var B=this.getBase(); 5595var C=/Opera/.test(navigator.userAgent); 5596var D=0,H=0; 5597var I=""; 5598var E=G; 5599do{I+="element: "+E.tagName+", offsetTop = "+E.offsetTop+", offsetLeft = "+E.offsetLeft+"\n"; 5600D+=E.offsetTop||0; 5601H+=E.offsetLeft||0; 5602I+="valueT = "+D+", valueL = "+H+"\n"; 5603if(E.offsetParent==B&&Element.getStyle(E,"position")=="absolute"){break 5604}}while(E=E.offsetParent); 5605I+="\n\n"; 5606E=G; 5607do{I+="element: "+E.tagName+", scrollTop = "+E.scrollTop+", scrollLeft = "+E.scrollLeft+"\n"; 5608if(!C||(E.tagName!=undefined&&(E.tagName.toLowerCase()!="tr"&&E!=G&&E!=G.parentNode))){D-=E.scrollTop||0; 5609H-=E.scrollLeft||0 5610}I+="valueT = "+D+", valueL = "+H+"\n"; 5611if(E==B){break 5612}}while(E=E.parentNode); 5613var F=[H,D]; 5614if(arguments.length>1&&A){alert(I+"\n\noffset = "+F) 5615}G=$(G); 5616if(!C&&G.tagName.toLowerCase()=="input"){F[0]+=G.scrollLeft 5617}return F 5618},getVSpaces:function(B){var D=this.getBase(); 5619if(this.isElement(B)){var F=this.screenOffset(B); 5620var C=Element.getDimensions(B); 5621var E=F[1]; 5622var A=D.clientHeight-F[1]-C.height 5623}else{var E=B[1]-D.scrollTop; 5624var A=D.clientHeight-(B[1]-D.scrollTop) 5625}return{top:E,bottom:A} 5626},getHSpaces:function(B){var D=this.getBase(); 5627if(this.isElement(B)){var F=this.screenOffset(B); 5628var C=Element.getDimensions(B); 5629var E=F[0]+C.width; 5630var A=D.clientWidth-F[0] 5631}else{var E=B[0]-D.scrollLeft; 5632var A=D.clientWidth-(B[0]-D.scrollLeft) 5633}return{left:E,right:A} 5634},getPosition:function(D,A,J){var B=this.getBase(); 5635var F=[$(A).offsetWidth,$(A).offsetHeight]; 5636var C=this.getHSpaces(D); 5637var G=this.getVSpaces(D); 5638if(this.isElement(D)){var E=this.screenOffset(D); 5639var I={width:$(D).offsetWidth,height:$(D).offsetHeight}; 5640var H=[E[0],E[1]+I.height] 5641}else{var H=[D[0],D[1]] 5642}if(C.right<F[0]&&C.left>=F[0]){if(this.isElement(D)){H[0]=E[0]+I.width-F[0] 5643}else{H[0]=D[0]-F[0] 5644}}if(this.isElement(D)){H[0]+=B.scrollLeft 5645}if(G.bottom<F[1]&&G.top>=F[1]){if(this.isElement(D)){H[1]=E[1]-F[1] 5646}else{H[1]=H[1]-F[1] 5647}}if(this.isElement(D)){H[1]+=B.scrollTop 5648}return H 5649},getOption:function(A){if(A){return $H(A) 5650}else{return this.options 5651}},calcSizes:function(A){if(A.tagName.toLowerCase()=="table"){A.style.width="0px"; 5652A.style.height="0px"; 5653return{width:A.offsetWidth,height:A.offsetHeight} 5654}},isElement:function(A){return(A.length==undefined) 5655}} 5656} 5657if(!document.observe){throw"prototype.js is required!" 5658}if(!A4J||!A4J.AJAX||!A4J.AJAX.AddListener){throw"AJAX script is required!" 5659}if(!window.Richfaces){window.Richfaces={} 5660}Object.extend(Richfaces,function(){var D=0; 5661var B={}; 5662var G=false; 5663var J=null; 5664var F=function(L,N){if(N instanceof Array){for(var M=0; 5665M<N.length; 5666M++){N[M](L) 5667}}else{N(L) 5668}}; 5669var H=function(){if(G){Event.stopObserving(document,"mouseover",K,true); 5670Event.stopObserving(document,"focus",K,true); 5671Event.stopObserving(document,"focusin",K,true); 5672G=false; 5673J=null 5674}}; 5675var K=function(N){var L=Event.element(N); 5676while(L){var P=L.id; 5677if(P){if(!J){J=P 5678}else{if(J==P){break 5679}}var M=B[P]; 5680if(M){try{F(L,M) 5681}catch(O){A(); 5682throw O 5683}delete B[P]; 5684if(--D==0){H(); 5685break 5686}}}L=L.parentNode 5687}}; 5688var C=function(){if(!G){Event.observe(document,"mousemove",K,true); 5689Event.observe(document,"focus",K,true); 5690Event.observe(document,"focusin",K,true); 5691G=true 5692}}; 5693var A=function(){try{H(); 5694D=0; 5695B={} 5696}catch(L){LOG.error("Error occured during cleanup: "+L) 5697}}; 5698var I=function(){try{for(var M in B){var L=$(M); 5699if(L){F(L,B[M]) 5700}else{LOG.error("Element with id = "+M+" hasn't been found!") 5701}}}finally{A() 5702}}; 5703var E=function(O,P){var N=$(O); 5704if(N){P(N) 5705}else{var L=B[O]; 5706if(!L){B[O]=P; 5707J=null; 5708D++; 5709C() 5710}else{if(L instanceof Array){L.push(P) 5711}
5711else{var M=new Array(); 5712M.push(L); 5713M.push(P); 5714B[O]=M 5715}}}}; 5716A4J.AJAX.AddListener(I); 5717document.observe("dom:loaded",I); 5718return{onAvailable:E} 5719}()) 5720 5721if(!window.RichFaces){window.RichFaces={} 5722}RichFaces.MSIE=0; 5723RichFaces.FF=1; 5724RichFaces.OPERA=2; 5725RichFaces.NETSCAPE=3; 5726RichFaces.SAFARI=4; 5727RichFaces.KONQ=5; 5728RichFaces.navigatorType=function(){var A=navigator.userAgent.toLowerCase(); 5729if(A.indexOf("msie")>=0||A.indexOf("explorer")>=0){return RichFaces.MSIE 5730}if(A.indexOf("firefox")>=0||A.indexOf("iceweasel")>=0){return RichFaces.FF 5731}if(A.indexOf("opera")>=0){return RichFaces.OPERA 5732}if(A.indexOf("netscape")>=0){return RichFaces.NETSCAPE 5733}if(A.indexOf("safari")>=0){return RichFaces.SAFARI 5734}if(A.indexOf("konqueror")>=0){return RichFaces.KONQ 5735}return"OTHER" 5736}; 5737RichFaces.getOperaVersion=function(){var B=navigator.userAgent.toLowerCase(); 5738var A=B.indexOf("opera"); 5739if(A==-1){return 5740}return parseFloat(B.substring(A+6)) 5741}; 5742RichFaces.getIEVersion=function(){var C="msie"; 5743var D=navigator.userAgent.toLowerCase(); 5744var A=D.indexOf(C); 5745if(A!=-1){var E=D.indexOf(";",A); 5746var B; 5747if(E!=-1){B=D.substring(A+C.length,E) 5748}else{B=D.substring(A+C.length) 5749}return parseFloat(B) 5750}else{return undefined 5751}} 5752 5753DnD.getDnDDefaultParams=function(B){var A=Richfaces.getNSAttribute("defaultdndparams",B); 5754if(A){var C=A.parseJSON(EventHandlersWalk); 5755if(C){return C 5756}}return{} 5757}; 5758DnD.getDnDMergedParams=function(C,B){var E=DnD.getDnDDefaultParams(C); 5759var A=Richfaces.getNSAttribute(B,C); 5760if(A){var D=A.parseJSON(EventHandlersWalk); 5761if(E){if(D){Object.extend(E,D) 5762}}else{E=D 5763}}return E 5764}; 5765DnD.getDnDDragParams=function(A){return DnD.getDnDMergedParams(A,"dragdndparams") 5766}; 5767DnD.getDnDDropParams=function(A){return DnD.getDnDMergedParams(A,"dropdndparams") 5768}; 5769DnD.setDefaultDnDParams=function(B){if(B){if(drag&&drag.source&&drag.source.getDraggableItems&&drag.source.getDraggableItems()>1){var A=drag.source.getDraggableItems(); 5770B["count"]=A; 5771if(!B["label"]){B["label"]=B["count"]+" "+(B["units"]?B["units"]:"items") 5772}}}} 5773 5774DnD.Draggable=function(){}; 5775DnD.ieReleaseCapture=function(){if(document.releaseCapture){document.releaseCapture() 5776}}; 5777DnD.DragEndListener=Class.create(); 5778DnD.DragEndListener.prototype={initialize:function(A){this.callback=A; 5779this.onmoveBound=this.onmove.bindAsEventListener(this); 5780this.onupBound=this.onup.bindAsEventListener(this) 5781},activate:function(A){Event.observe(document,"mousemove",this.onmoveBound); 5782Event.observe(document,"mouseup",this.onupBound); 5783if(A.type=="mousemove"){this.onmoveBound(A) 5784}},onmove:function(A){if("mousemove"==A.type){if(!this.mouseMoveProvidesButtonChecked){this.mouseMoveProvidesButtonChecked=true; 5785if(!this.mouseMoveProvidesButton){this.mouseMoveProvidesButton=A.button!=0 5786}}if(this.mouseMoveProvidesButton&&!Event.isLeftClick(A)&&RichFaces.getIEVersion()!=6){this.endDrag(A) 5787}}},onup:function(A){this.endDrag(A) 5788},endDrag:function(A){this.deactivate(); 5789this.callback(A) 5790},deactivate:function(){Event.stopObserving(document,"mousemove",this.onmoveBound); 5791Event.stopObserving(document,"mouseup",this.onupBound) 5792}}; 5793DnD.Cursor=Class.create(); 5794DnD.Cursor.prototype={initialize:function(A,B){this.element=A; 5795this.cursor=B; 5796this.visible=false; 5797if(this.element.style.cursor&&this.element.style.cursor!=""){this.oldcursor=this.element.style.cursor 5798}},showCursor:function(){var A=this.element; 5799this.element.style.cursor=this.cursor; 5800this.visible=true 5801},hideCursor:function(){var A=this.element; 5802A.style.cursor=""; 5803this.visible=false; 5804if(this.oldcursor){this.element.style.cursor=this.oldcursor 5805}}}; 5806DnD.Draggable.prototype={getElement:function(){return $(this.id) 5807},getDraggableOptions:function(){return null 5808},getDnDDefaultParams:function(){return DnD.getDnDDefaultParams(this.getElement()) 5809},getDnDDragParams:function(){return DnD.getDnDDragParams(this.getElement()) 5810},getContentType:function(){return null 5811},getIndicator:function(){return null 5812},getOrCreateDefaultIndicator:function(){var A=$("_rfDefaultDragIndicator"); 5813if(!A){A=document.createElement("div"); 5814A.id="_rfDefaultDragIndicatorLeft"; 5815Element.setStyle(A,{"fontSize":"0px","lineHeight":"0px","zIndex":1000}); 5816document.body.appendChild(A); 5817A=document.createElement("div"); 5818A.id="_rfDefaultDragIndicatorRight"; 5819Element.setStyle(A,{"fontSize":"0px","lineHeight":"0px","zIndex":1000}); 5820document.body.appendChild(A); 5821A=document.createElement("div"); 5822A.id="_rfDefaultDragIndicatorBottom"; 5823Element.setStyle(A,{"fontSize":"0px","lineHeight":"0px","zIndex":1000}); 5824document.body.appendChild(A); 5825A=document.createElement("div"); 5826A.id="_rfDefaultDragIndicator"; 5827Element.setStyle(A,{"fontSize":"0px","lineHeight":"0px","zIndex":1000}); 5828Object.extend(A,DefaultDragIndicator); 5829document.body.appendChild(A) 5830}DefaultDragIndicator.changeIndicatorColor(A,"black"); 5831return A 5832},setIndicator:function(C){var A=this.getIndicator(); 5833if(A){var B=this.getDnDDragParams(); 5834DnD.setDefaultDnDParams(B); 5835if(this.getDraggableItems&&this.getDraggableItems()>1){A.setContent("default",false,B) 5836}else{A.setContent("default",true,B) 5837}}},moveDrag:function(B){var A=Event.pointerX(B); 5838var C=Event.pointerY(B); 5839if(!window.drag&&(Math.abs(this.lastDragX-A)+Math.abs(this.lastDragY-C))>2){this.updateDrag(B) 5840}},startDrag:function(A){var B=this.getContentType(); 5841if(B){if(this.grabbingCursor){if(this.grabCursor&&this.grabCursor.visible){this.grabCursor.hideCursor() 5842}this.grabbingCursor.showCursor() 5843}if(!this.endDragListener){this.dragTrigger=this.moveDrag.bindAsEventListener(this);
5844this.endDragListener=new DnD.DragEndListener(function(C){Event.stopObserving(document,"mousemove",this.dragTrigger); 5845DnD.endDrag(C,window.drag) 5846}.bind(this)) 5847}this.endDragListener.activate(A); 5848Event.observe(document,"mousemove",this.dragTrigger); 5849this.lastDragX=Event.pointerX(A); 5850this.lastDragY=Event.pointerY(A); 5851this.onSelectStartHandler=document.onselectstart; 5852this.onDragStartHandler=document.ondragstart; 5853document.onselectstart=function(){return false 5854}; 5855document.ondragstart=function(){DnD.ieReleaseCapture(); 5856return false 5857}; 5858if(document.releaseCapture){Event.observe(document,"mousemove",DnD.ieReleaseCapture) 5859}}},updateDrag:function(F){var E=this.getContentType(); 5860var A=this.getIndicator(); 5861var D=new DnD.Drag(this,A,E); 5862if(A.id.indexOf("_rfDefaultDragIndicator")!=-1){var G=D.source.getElement(); 5863var C=Position.cumulativeOffset(G); 5864A.indicatorWidth=Element.getWidth(G); 5865A.indicatorHeight=Element.getHeight(G); 5866A.position(C[0],C[1]); 5867A.removalX=Event.pointerX(F)-C[0]; 5868A.removalY=Event.pointerY(F)-C[1] 5869}DnD.startDrag(D); 5870DnD.updateDrag(F); 5871this.ondragstart(F,D); 5872if(A){A.show() 5873}var B=this.getDraggableOptions(); 5874if(B&&B.ondragstart){B.ondragstart(F) 5875}},endDrag:function(E,D){DnD.endDrag(E); 5876this.lastDragX=undefined; 5877this.lastDragY=undefined; 5878document.onselectstart=this.onSelectStartHandler; 5879document.ondragstart=this.onDragStartHandler; 5880if(document.releaseCapture){Event.stopObserving(document,"mousemove",DnD.ieReleaseCapture) 5881}if(this.endDragListener){this.endDragListener.deactivate() 5882}if(D){var A=D.indicator; 5883if(A){A.hide() 5884}this.ondragend(E,D) 5885}var C=this.getCurrentGrabbingCursor(); 5886if(C){if(C.visible){C.hideCursor() 5887}}var B=this.getDraggableOptions(); 5888if(B&&B.ondragend){B.ondragend(E) 5889}},attachCursor:function(){this.cursor=new DnD.Cursor() 5890},ondragstart:function(B,A){},ondragend:function(B,A){},ondragover:function(B){var A=this.getCurrentGrabCursor(); 5891if(!document.body.style.cursor){if(A){if(!A.visible){A.showCursor() 5892}}}},ondragout:function(B){var A=this.getCurrentGrabCursor(); 5893if(A){if(A.visible){A.hideCursor() 5894}}},getCurrentGrabbingCursor:function(){var B=window.drag; 5895var A=this.grabbingCursor; 5896if(B){A=B.source.grabbingCursor 5897}return A 5898},getCurrentGrabCursor:function(){var B=window.drag; 5899var A=this.grabCursor; 5900if(B){A=B.source.grabCursor 5901}return A 5902},onmouseup:function(C){var B=this.getCurrentGrabbingCursor(); 5903var A=this.grabCursor; 5904if(B&&B.visible){B.hideCursor() 5905}if(A){A.showCursor() 5906}},ondropover:function(C,B){var A=this.getDraggableOptions(); 5907if(A&&A.ondropover){C.drag=B; 5908A.ondropover(C) 5909}},ondropout:function(C,B){var A=this.getDraggableOptions(); 5910if(A&&A.ondropout){C.drag=B; 5911A.ondropout(C) 5912}},enableDraggableCursors:function(A,B){var C=this.getElement(); 5913if(A){this.dragOutBound=this.ondragout.bindAsEventListener(this); 5914this.dragOverBound=this.ondragover.bindAsEventListener(this); 5915this.dragUpBound=this.onmouseup.bindAsEventListener(this); 5916Event.observe(C,"mouseout",this.dragOutBound); 5917Event.observe(C,"mouseover",this.dragOverBound); 5918Event.observe(C,"mouseup",this.dragUpBound); 5919this.grabCursor=new DnD.Cursor(C,A) 5920}if(B){this.grabbingCursor=new DnD.Cursor(document.body,B) 5921}},disableDraggableCursors:function(){var A=this.getElement(); 5922if(this.dragOutBound&&this.dragOverBound){Event.stopObserving(A,"mouseover",this.dragOutBound); 5923Event.stopObserving(A,"mouseout",this.dragOverBound) 5924}else{return false 5925}return true 5926},isDraggableCursorsEnabled:function(){if(this.isCursorsEnabled){this.isCursorsEnabled=true 5927}else{this.isCursorsEnabled=false 5928}return this.isCursorsEnabled 5929}}; 5930DefaultDragIndicator={setContent:function(A,C,B){},show:function(){if(window.drag&&window.drag.source){var B=window.drag.source.getElement(); 5931Element.setStyle(this,{"width":Element.getWidth(B)+"px","height":"1px"}); 5932Element.show(this); 5933this.style.position="absolute"; 5934var A=$("_rfDefaultDragIndicatorLeft"); 5935if(A){Element.setStyle(A,{"width":"1px","height":Element.getHeight(B)+"px"}); 5936Element.show(A); 5937A.style.position="absolute" 5938}A=$("_rfDefaultDragIndicatorRight"); 5939if(A){Element.setStyle(A,{"width":"1px","height":Element.getHeight(B)+"px"}); 5940Element.show(A); 5941A.style.position="absolute" 5942}A=$("_rfDefaultDragIndicatorBottom"); 5943if(A){Element.setStyle(A,{"width":Element.getWidth(B)+"px","height":"1px"}); 5944Element.show(A); 5945A.style.position="absolute" 5946}}},hide:function(){Element.hide(this); 5947this.style.position=""; 5948var A=$("_rfDefaultDragIndicatorLeft"); 5949if(A){Element.hide(A); 5950A.style.position="" 5951}A=$("_rfDefaultDragIndicatorRight"); 5952if(A){Element.hide(A); 5953A.style.position="" 5954}A=$("_rfDefaultDragIndicatorBottom"); 5955if(A){Element.hide(A); 5956A.style.position="" 5957}},position:function(A,C){if(this.removalX&&this.removalY){A-=(this.removalX+5); 5958C-=(this.removalY+14) 5959}
5959Element.setStyle(this,{"left":A+"px","top":C+"px"}); 5960var B=$("_rfDefaultDragIndicatorLeft"); 5961if(B){Element.setStyle(B,{"left":A+"px","top":C+"px"}) 5962}A+=this.indicatorWidth; 5963B=$("_rfDefaultDragIndicatorRight"); 5964if(B){Element.setStyle(B,{"left":A+"px","top":C+"px"}) 5965}A-=this.indicatorWidth; 5966C+=this.indicatorHeight; 5967B=$("_rfDefaultDragIndicatorBottom"); 5968if(B){Element.setStyle(B,{"left":A+"px","top":C+"px"}) 5969}},accept:function(){this.changeIndicatorColor(this,"green") 5970},reject:function(){this.changeIndicatorColor(this,"red") 5971},leave:function(){this.changeIndicatorColor(this,"black") 5972},changeIndicatorColor:function(A,B){Element.setStyle(A,{"borderTop":"1px dashed "+B}); 5973var C=$("_rfDefaultDragIndicatorLeft"); 5974if(C){Element.setStyle(C,{"borderLeft":"1px dashed "+B}) 5975}C=$("_rfDefaultDragIndicatorRight"); 5976if(C){Element.setStyle(C,{"borderRight":"1px dashed "+B}) 5977}C=$("_rfDefaultDragIndicatorBottom"); 5978if(C){Element.setStyle(C,{"borderBottom":"1px dashed "+B}) 5979}}} 5980 5981DnD.Dropzone=function(){}; 5982DnD.Dropzone.DROP_TARGET_ID="dropTargetId"; 5983DnD.Dropzone.prototype={getElement:function(){return $(this.id) 5984},getDropzoneOptions:function(){return null 5985},getDnDDefaultParams:function(){return DnD.getDnDDefaultParams(this.getElement()) 5986},getDnDDropParams:function(){return DnD.getDnDDropParams(this.getElement()) 5987},accept:function(A){return DnD.CLIENT_VALIDATION_OFF||this.getAcceptedTypes().indexOf(A.type)>-1 5988},getAcceptedTypes:function(){return[] 5989},getTypeMapping:function(){return{} 5990},getCursorTypeMapping:function(){return{} 5991},drop:function(B,A){},getIconCodeForType:function(B){var A=this.getTypeMapping(); 5992if(B&&A){return A[B] 5993}return null 5994},getCursorForType:function(B){var A=this.getCursorTypeMapping(); 5995if(B&&A){return A[B] 5996}},dragEnter:function(C){var F=window.drag; 5997F.dropzone=this; 5998F.source.ondropover(C,F); 5999var H=F.indicator; 6000var B=this.accept(F); 6001if(B){var I=this.getCursorForType(F.type); 6002if(I){this.acceptMappingCursor=new DnD.Cursor(this.getElement(),I); 6003this.acceptMappingCursor.showCursor() 6004}else{if(this.acceptCursor){this.acceptCursor.showCursor() 6005}}}else{if(this.rejectCursor){this.rejectCursor.showCursor() 6006}}if(H){var G=this.getIconCodeForType(F.type); 6007var D=F.source.getDnDDragParams(); 6008if(D){Object.extend(D,this.getDnDDropParams()) 6009}else{D=this.getDnDDropParams() 6010}if(D){if(G){D["marker"]=D[G] 6011}else{D["marker"]=null 6012}}var E=B?"accept":"reject"; 6013DnD.setDefaultDnDParams(D); 6014if(F.source.getDraggableItems&&F.source.getDraggableItems()>1){H.setContent(E,false,D) 6015}else{H.setContent(E,true,D) 6016}if(B){H.accept() 6017}else{H.reject() 6018}}var A=this.getDropzoneOptions(); 6019if(A&&A.ondragenter){A.ondragenter.call(C) 6020}},dragLeave:function(D){var B=window.drag; 6021B.dropzone=null; 6022B.source.ondropout(D,B); 6023B.source.setIndicator(D); 6024var A=B.indicator; 6025if(A){A.leave() 6026}var C=this.getDropzoneOptions(); 6027if(C&&C.ondragexit){C.ondragexit(D) 6028}if(this.acceptCursor){if(this.acceptCursor.visible){this.acceptCursor.hideCursor() 6029}}if(this.rejectCursor){if(this.rejectCursor.visible){this.rejectCursor.hideCursor() 6030}}if(this.acceptMappingCursor){if(this.acceptMappingCursor.visible){this.acceptMappingCursor.hideCursor() 6031}}},dragUp:function(B){this.ondropend(B); 6032if(this.acceptCursor){if(this.acceptCursor.visible){this.acceptCursor.hideCursor() 6033}}if(this.rejectCursor){if(this.rejectCursor.visible){this.rejectCursor.hideCursor() 6034}}if(this.acceptMappingCursor){if(this.acceptMappingCursor.visible){this.acceptMappingCursor.hideCursor() 6035}}var A=this.getDropzoneOptions(); 6036if(A&&A.ondropend){A.ondropend() 6037}},enableDropzoneCursors:function(B,A){if(B){this.acceptCursor=new DnD.Cursor(this.getElement(),B) 6038}if(A){this.rejectCursor=new DnD.Cursor(this.getElement(),A) 6039}},ondropend:function(A){},onafterdrag:function(A){},onbeforedrag:function(B,A){},ondragenter:function(A){},ondragexit:function(A){}} 6040 6041if(!window.Richfaces){window.Richfaces={} 6042}Richfaces.SYNTHETIC_EVENT="Richfaces.SYNTHETIC_EVENT"; 6043Richfaces.createEvent=function(F,D,C,E){var G; 6044if(document.createEventObject){if(C){G=document.createEventObject(C) 6045}else{G=document.createEventObject() 6046}}else{var B=C&&C.bubbles||false; 6047var A=C&&C.cancelable||true; 6048switch(F){case"abort":case"blur":case"change":case"error":case"focus":case"load":case"reset":case"resize":case"scroll":case"select":case"submit":case"unload":G=document.createEvent("HTMLEvents"); 6049G.initEvent(F,B,A); 6050break; 6051case"DOMActivate":case"DOMFocusIn":case"DOMFocusOut":case"keydown":case"keypress":case"keyup":G=document.createEvent("UIEvents"); 6052if(C){G.initUIEvent(F,B,A,C.windowObject,C.detail) 6053}else{G.initEvent(F,B,A) 6054}break; 6055case"click":case"mousedown":case"mousemove":case"mouseout":case"mouseover":case"mouseup":G=document.createEvent("MouseEvents"); 6056if(C){G.initMouseEvent(F,B,A,C.windowObject,C.detail,C.screenX,C.screenY,C.clientX,C.clientY,C.ctrlKey,C.altKey,C.shift
6056Key,C.metaKey,C.button,C.relatedTarget) 6057}else{G.initEvent(F,B,A) 6058}break; 6059case"DOMAttrModified":case"DOMNodeInserted":case"DOMNodeRemoved":case"DOMCharacterDataModified":case"DOMNodeInsertedIntoDocument":case"DOMNodeRemovedFromDocument":case"DOMSubtreeModified":G=document.createEvent("MutationEvents"); 6060if(C){G.initMutationEvent(F,B,A,C.relatedNode,C.prevValue,C.newValue,C.attrName,C.attrChange) 6061}else{G.initEvent(F,B,A) 6062}break; 6063default:G=document.createEvent("Events"); 6064G.initEvent(F,B,A) 6065}}if(E){Object.extend(G,E) 6066}G[Richfaces.SYNTHETIC_EVENT]=true; 6067return{event:G,fire:function(){if(D.fireEvent){D.fireEvent("on"+F,this.event) 6068}else{D.dispatchEvent(this.event) 6069}}} 6070}; 6071Richfaces.eventIsSynthetic=function(A){if(A){return new Boolean(A[Richfaces.SYNTHETIC_EVENT]).valueOf() 6072}return false 6073} 6074 6075if(!window.Richfaces){window.Richfaces={} 6076}Richfaces.jsFormSubmit=function(F,B,D,E){var C=document.getElementById(B); 6077if(C){var A=C.target; 6078var H=new Array(); 6079if(E){for(var G in E){H.push(G) 6080}}_JSFFormSubmit(F,B,D,E); 6081_clearJSFFormParameters(B,A,H) 6082}} 6083 6084JSNode=function(){}; 6085JSNode.prototype={tag:null,attrs:{},childs:[],value:"",_symbols:{"&":"&","<":"<",">":">",'"':""","'":"'","\u00A0":" "},getInnerHTML:function(F){var B=""; 6086for(var A=0; 6087A<this.childs.length; 6088A++){B+=this.childs[A].getContent(F) 6089}return B 6090},xmlEscape:function(A){var B=A?A.toString():""; 6091return B.escapeHTML() 6092}}; 6093E=function(F,A,B){this.tag=F; 6094if(A){this.attrs=A 6095}if(B){this.childs=B 6096}}; 6097E.prototype=new JSNode(); 6098E.prototype.getContent=function(G){var F="<"+this.tag; 6099var A=this.getInnerHTML(G); 6100if(A==""){this.isEmpty=true 6101}else{this.isEmpty=false 6102}for(var B in this.attrs){if(!this.attrs.hasOwnProperty(B)){continue 6103}var H=this.attrs[B]; 6104if(typeof H=="function"){H=H.call(this,G) 6105}if(H){F+=" "+(B=="className"?"class":B)+'="'+this.xmlEscape(H)+'"' 6106}}F+=">"+A+"</"+this.tag+">"; 6107return F 6108}; 6109ET=function(A){this.value=A 6110}; 6111ET.prototype.getContent=function(A){var B=this.value; 6112if(typeof B=="function"){B=B(A) 6113}if(B&&B.getContent){B=B.getContent(A) 6114}if(B){return B 6115}return"" 6116}; 6117T=function(A){this.value=A 6118}; 6119T.prototype=new JSNode(); 6120T.prototype.getContent=function(A){var B=this.value; 6121if(typeof B=="function"){B=B(A) 6122}if(B){return this.xmlEscape(B) 6123}return"" 6124}; 6125C=function(A){this.value=A 6126}; 6127C.prototype.getContent=function(A){return"<!--"+this.value+"-->" 6128}; 6129D=function(A){this.value=A 6130}; 6131D.prototype.getContent=function(A){return"<![CDATA["+this.value+"]]>" 6132} 6133 6134if(!String.prototype.parseJSON){String.prototype.parseJSON=function(hook){try{if(!/[^,:{}\[\]0-9.\-+Eaeflnr-u \n\r\t]/.test(this.replace(/("(\\.|[^"\\])*")|('(\\.|[^'\\])*')/g,""))){var j=eval("("+this+")"); 6135if(typeof hook==="function"){function walk(v){if(v&&typeof v==="object"){for(var i in v){if(v.hasOwnProperty(i)){v[i]=walk(v[i]) 6136}}}return hook(v) 6137}return walk(j) 6138}return j 6139}}catch(e){}throw new SyntaxError("parseJSON") 6140} 6141}EventHandlersWalk=function(v){if(v&&typeof v=="object"){var names=new Array(); 6142for(var i in v){if(v.hasOwnProperty(i)){if(i.length>2&&i.substring(0,2)=="on"){names.push(i) 6143}}}for(var i=0; 6144i<names.length; 6145i++){var name=names[i]; 6146var value=v[name]; 6147if(value&&typeof value!="function"){var f=eval("(["+v[name]+"])")[0]; 6148if(typeof f=="function"){v[name]=f 6149}}}}return v 6150} 6151 6152var mediaName="rich-extended-skinning"; 6153var skipNavigator=window.opera||navigator.userAgent.indexOf("AppleWebKit/")>-1; 6154if(!skipNavigator){var resetMedia=function(A){var B=A.getAttribute("media"); 6155if(mediaName==B){A.removeAttribute("media") 6156}}; 6157if(!window._RICH_FACES_SKINNING_ADDED_TO_BODY){var getElementByTagName=function(B,A){var E; 6158try{E=B.selectNodes('.//*[local-name()="'+A+'"]') 6159}catch(C){try{E=B.getElementsByTagName(A) 6160}catch(D){}}return E 6161}; 6162var f=function(){if(window.RICH_FACES_EXTENDED_SKINNING_ON){var D=getElementByTagName(document,"link"); 6163if(D){var A=D.length; 6164for(var C=0; 6165C<A; 6166C++){var B=D[C]; 6167resetMedia(B) 6168}}}}; 6169if(window.addEventListener){window.addEventListener("load",f,false) 6170}else{window.attachEvent("onload",f) 6171}window._RICH_FACES_SKINNING_ADDED_TO_BODY=true 6172}if(!window._RICH_FACES_SKINNING_ADDED_TO_AJAX&&typeof A4J!="undefined"&&A4J.AJAX){A4J.AJAX.AddHeadElementTransformer(function(A){if(window.RICH_FACES_EXTENDED_SKINNING_ON){if(A.tagName&&A.tagName.toLowerCase()=="link"){resetMedia(A) 6173}}}); 6174window._RICH_FACES_SKINNING_ADDED_TO_AJAX=true 6175}} 6176if(!window.Richfaces){window.Richfaces={} 6177}Richfaces.getComputedStyle=function(D,A){var B=$(D); 6178if(B.nodeType!=Node.ELEMENT_NODE){return"" 6179}if(B.currentStyle){return B.currentStyle[A] 6180}if(document.defaultView&&document.defaultView.getComputedStyle){var C=document.defaultView.getComputedStyle(B,null); 6181if(C){return C.getPropertyValue(A) 6182}}return"" 6183}; 6184Richfaces.getComputedStyleSize=function(B,A){var C=Richfaces.getComputedStyle(B,A); 6185if(C){C=C.strip(); 6186C=C.replace(/px$/,""); 6187return parseFloat(C) 6188}return 0 6189}; 6190Richfaces.getWindowSize=function(){var B=0,A=0; 6191if(typeof (window.innerWidth)=="number"){B=window.innerWidth; 6192A=window.innerHeight 6193}else{if(document.documentElement&&(document.documentElement.clientWidth||document.documentElement.clientHeight)){B=document.documentElement.clientWidth; 6194A=document.documentElement.clientHeight 6195}else{if(document.body&&(document.body.clientWidth||document.body.clientHeight)){B=document.body.clientWidth; 6196A=document.body.clientHeight 6197}}}return{"width":B,"height":A} 6198}; 6199Richfaces.removePX=function(B){var A=B.indexOf("px"); 6200if(A==-1){return B 6201}return B.substr(0,A) 6202}; 6203Richfaces.visitTree=function(A,D){var B=A; 6204if(!B){B=document 6205}
6205D.call(this,B); 6206var C=B.firstChild; 6207while(C){Richfaces.visitTree(C,D); 6208C=C.nextSibling 6209}}; 6210Richfaces.getNSAttribute=function(C,E){if(E.getAttributeNS){var A=E.getAttributeNS("http://richfaces.ajax4jsf.org/rich",C); 6211if(A){return A 6212}}var B=E.attributes; 6213var D="rich:"+C; 6214var A=B[D]; 6215if(A){return A.nodeValue 6216}return null 6217}; 6218Richfaces.VARIABLE_NAME_PATTERN=/^\s*[_,A-Z,a-z][\w,_\.]*\s*$/; 6219Richfaces.getObjectValue=function(D,B){var A=D.split("."); 6220var C=B[A[0]]; 6221var E=1; 6222while(C&&E<A.length){C=C[A[E++]] 6223}return(C?C:"") 6224}; 6225Richfaces.evalMacro=function(template,object){var value=""; 6226if(Richfaces.VARIABLE_NAME_PATTERN.test(template)){if(template.indexOf(".")==-1){value=object[template]; 6227if(!value){value=window[template] 6228}}else{value=Richfaces.getObjectValue(template,object); 6229if(!value){value=Richfaces.getObjectValue(template,window) 6230}}if(value&&typeof value=="function"){value=value(object) 6231}if(!value){value="" 6232}}else{try{if(Richfaces.browser.isObjectEval){value=object.eval(template) 6233}else{with(object){value=eval(template) 6234}}if(typeof value=="function"){value=value(object) 6235}}catch(e){LOG.warn("Exception: "+e.Message+"\n["+template+"]") 6236}}return value 6237}; 6238Richfaces.evalSimpleMacro=function(B,A){var C=A[B]; 6239if(!C){C=window[B]; 6240if(!C){C="" 6241}}return C 6242}; 6243Richfaces.getComponent=function(A,B){var D="richfacesComponent"; 6244var C="richfaces:"+A; 6245while(B.parentNode){if(B[D]&&B[D]==C){return B.component 6246}else{B=B.parentNode 6247}}}; 6248Richfaces.browser={isIE:(!window.opera&&/MSIE/.test(navigator.userAgent)),isIE6:(!window.opera&&/MSIE\s*[6][\d,\.]+;/.test(navigator.userAgent)),isSafari:/Safari/.test(navigator.userAgent),isOpera:!!window.opera,isObjectEval:(Richfaces.eval!=undefined),isFF3:(!window.opera&&/Firefox\s*[\/]3[\.]/.test(navigator.userAgent))}; 6249Richfaces.eval=function(template,object){var value=""; 6250try{with(object){value=eval(template) 6251}}catch(e){LOG.warn("Exception: "+e.message+"\n["+template+"]") 6252}return value 6253}; 6254Richfaces.interpolate=function(A,D){for(var C in D){var B=D[C]; 6255var E=new RegExp("\\{"+C+"\\}","g"); 6256A=A.replace(E,B) 6257}return A 6258}; 6259if(!Richfaces.position){Richfaces.Position={} 6260}Richfaces.Position.setElementPosition=function(D,M,H,K,C){var P=Richfaces.Position.getOffsetDimensions(D); 6261var L=Richfaces.Position.getOffsetDimensions(M); 6262var F=Richfaces.Position.getWindowViewport(); 6263var N=Position.cumulativeOffset(M); 6264var B=N[0]; 6265var A=N[1]; 6266var O=/^(top|bottom)-(left|right)$/; 6267var E; 6268if(typeof H=="object"){B=H.x; 6269A=H.y 6270}else{if(H&&(E=H.toLowerCase().match(O))!=null){if(E[2]=="right"){B+=L.width 6271}if(E[1]=="bottom"){A+=L.height 6272}}else{}}if(K&&(E=K.toLowerCase().match(O))!=null){var G=K.toLowerCase().split("-"); 6273if(E[2]=="left"){B-=P.width+C.x 6274}else{B+=C.x 6275}if(E[1]=="top"){A-=P.height+C.y 6276}else{A+=C.y 6277}}else{var J={square:0}; 6278var I={right:N[0]+L.width,top:N[1]+L.height}; 6279I.left=I.right-P.width; 6280I.bottom=I.top+P.height; 6281B=I.left; 6282A=I.top; 6283var Q=Richfaces.Position.checkCollision(I,F); 6284if(Q!=0){if(B>=0&&A>=0&&J.square<Q){J={x:B,y:A,square:Q} 6285}I={right:N[0]+L.width,bottom:N[1]}; 6286I.left=I.right-P.width; 6287I.top=I.bottom-P.height; 6288B=I.left; 6289A=I.top; 6290Q=Richfaces.Position.checkCollision(I,F); 6291if(Q!=0){if(B>=0&&A>=0&&J.square<Q){J={x:B,y:A,square:Q} 6292}I={left:N[0],top:N[1]+L.height}; 6293I.right=I.left+P.width; 6294I.bottom=I.top+P.height; 6295B=I.left; 6296A=I.top; 6297Q=Richfaces.Position.checkCollision(I,F); 6298if(Q!=0){if(B>=0&&A>=0&&J.square<Q){J={x:B,y:A,square:Q} 6299}I={left:N[0],bottom:N[1]}; 6300I.right=I.left+P.width; 6301I.top=I.bottom-P.height; 6302B=I.left; 6303A=I.top; 6304Q=Richfaces.Position.checkCollision(I,F); 6305if(Q!=0){if(B<0||A<0||J.square>Q){B=J.x; 6306A=J.y 6307}}}}}}D.style.left=B+"px"; 6308D.style.top=A+"px" 6309}; 6310Richfaces.Position.getOffsetDimensions=function(C){C=$(C); 6311var G=$(C).getStyle("display"); 6312if(G!="none"&&G!=null){return{width:C.offsetWidth,height:C.offsetHeight} 6313}var B=C.style; 6314var F=B.visibility; 6315var D=B.position; 6316var A=B.display; 6317B.visibility="hidden"; 6318B.position="absolute"; 6319B.display="block"; 6320var H=C.offsetWidth; 6321var E=C.offsetHeight; 6322B.display=A; 6323B.position=D; 6324B.visibility=F; 6325return{width:H,height:E} 6326}; 6327Richfaces.Position.checkCollision=function(A,B,D){if(A.left>=B.left&&A.top>=B.top&&A.right<=B.right&&A.bottom<=B.bottom){return 0 6328}var C={left:(A.left>B.left?A.left:B.left),top:(A.top>B.top?A.top:B.top),right:(A.right<B.right?A.right:B.right),bottom:(A.bottom<B.bottom?A.bottom:B.bottom)}; 6329return(C.right-C.left)*(C.bottom-C.top) 6330}; 6331Richfaces.Position.getWindowDimensions=function(){var A=self.innerWidth||document.documentElement.clientWidth||document.body.clientWidth||0;
6332var B=self.innerHeight||document.documentElement.clientHeight||document.body.clientHeight||0; 6333return{width:A,height:B} 6334}; 6335Richfaces.Position.getWindowScrollOffset=function(){var B=window.pageXOffset||document.documentElement.scrollLeft||document.body.scrollLeft||0; 6336var A=window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0; 6337return{left:B,top:A} 6338}; 6339Richfaces.Position.getWindowViewport=function(){var B=Richfaces.Position.getWindowDimensions(); 6340var A=Richfaces.Position.getWindowScrollOffset(); 6341return{left:A.left,top:A.top,right:B.width+A.left,bottom:B.height+A.top} 6342}; 6343Richfaces.firstDescendant=function(A){var B=A.firstChild; 6344while(B&&B.nodeType!=1){B=B.nextSibling 6345}return B 6346}; 6347Richfaces.lastDescendant=function(A){var B=A.lastChild; 6348while(B&&B.nodeType!=1){B=B.previousSibling 6349}return B 6350}; 6351Richfaces.next=function(A){var B=A; 6352do{B=B.nextSibling 6353}while(B&&B.nodeType!=1); 6354return B 6355}; 6356Richfaces.previous=function(A){var B=A; 6357do{B=B.previousSibling 6358}while(B&&B.nodeType!=1); 6359return B 6360}; 6361Richfaces.removeNode=function(B){if(B){var A=B.parentNode; 6362if(A){A.removeChild(B) 6363}}}; 6364Richfaces.readAttribute=function(C,B){var A=null; 6365var D=C.getAttributeNode(B); 6366if(D){A=D.nodeValue 6367}return A 6368}; 6369Richfaces.writeAttribute=function(B,A,D){var C=B.getAttributeNode(A); 6370if(D!==null){if(C){C.nodeValue=D 6371}else{C=document.createAttribute(A); 6372C.nodeValue=D; 6373B.setAttributeNode(C) 6374}}else{if(C){B.removeAttributeNode(C) 6375}}} 6376
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.