diff options
Diffstat (limited to 'framework/Web/Javascripts/js/prado.js')
-rw-r--r-- | framework/Web/Javascripts/js/prado.js | 2381 |
1 files changed, 2381 insertions, 0 deletions
diff --git a/framework/Web/Javascripts/js/prado.js b/framework/Web/Javascripts/js/prado.js new file mode 100644 index 00000000..6df4abd0 --- /dev/null +++ b/framework/Web/Javascripts/js/prado.js @@ -0,0 +1,2381 @@ +var Prototype={Version:"1.4.0",ScriptFragment:"(?:<script.*?>)((\n|\r|.)*?)(?:</script>)",emptyFunction:function(){ +},K:function(x){ +return x; +}}; +
+var Class={create:function(){ +return function(){ +this.initialize.apply(this,arguments); +}; +}}; +var Abstract=new Object(); +Object.extend=function(_1,_2){ +for(property in _2){ +_1[property]=_2[property]; +} +return _1; +}; +Object.inspect=function(_3){ +try{ +if(_3==undefined){ +return "undefined"; +} +if(_3==null){ +return "null"; +} +return _3.inspect?_3.inspect():_3.toString(); +} +catch(e){ +if(e instanceof RangeError){ +return "..."; +} +throw e; +} +}; +Function.prototype.bind=function(){ +var _4=this,args=$A(arguments),object=args.shift(); +return function(){ +return _4.apply(object,args.concat($A(arguments))); +}; +}; +Function.prototype.bindAsEventListener=function(_5){ +var _6=this; +return function(_7){ +return _6.call(_5,_7||window.event); +}; +}; +Object.extend(Number.prototype,{toColorPart:function(){ +var _8=this.toString(16); +if(this<16){ +return "0"+_8; +} +return _8; +},succ:function(){ +return this+1; +},times:function(_9){ +$R(0,this,true).each(_9); +return this; +}}); +var Try={these:function(){ +var _10; +for(var i=0;i<arguments.length;i++){ +var _12=arguments[i]; +try{ +_10=_12(); +break; +} +catch(e){ +} +} +return _10; +}}; +var PeriodicalExecuter=Class.create(); +PeriodicalExecuter.prototype={initialize:function(_13,_14){ +this.callback=_13; +this.frequency=_14; +this.currentlyExecuting=false; +this.registerCallback(); +},registerCallback:function(){ +setInterval(this.onTimerEvent.bind(this),this.frequency*1000); +},onTimerEvent:function(){ +if(!this.currentlyExecuting){ +try{ +this.currentlyExecuting=true; +this.callback(); +} +finally{ +this.currentlyExecuting=false; +} +} +}}; +function $(){ +var _15=new Array(); +for(var i=0;i<arguments.length;i++){ +var _16=arguments[i]; +if(typeof _16=="string"){ +_16=document.getElementById(_16); +} +if(arguments.length==1){ +return _16; +} +_15.push(_16); +} +return _15; +} +
+function isAlien(a){ +return isObject(a)&&typeof a.constructor!="function"; +} +function isArray(a){ +return isObject(a)&&a.constructor==Array; +} +function isBoolean(a){ +return typeof a=="boolean"; +} +function isFunction(a){ +return typeof a=="function"; +} +function isNull(a){ +return typeof a=="object"&&!a; +} +function isNumber(a){ +return typeof a=="number"&&isFinite(a); +} +function isObject(a){ +return (a&&typeof a=="object")||isFunction(a); +} +function isRegexp(a){ +return a&&a.constructor==RegExp; +} +function isString(a){ +return typeof a=="string"; +} +function isUndefined(a){ +return typeof a=="undefined"; +} +function isEmpty(o){ +var i,v; +if(isObject(o)){ +for(i in o){ +v=o[i]; +if(isUndefined(v)&&isFunction(v)){ +return false; +} +} +} +return true; +} +function undef(v){ +return isUndefined(v); +} +function isdef(v){ +return !isUndefined(v); +} +function isElement(o,_5){ +return o&&isObject(o)&&((!_5&&(o==window||o==document))||o.nodeType==1); +} +function isList(o){ +return o&&isObject(o)&&(isArray(o)||o.item); +} +
+function isElement(o,_2){ +return o&&isObject(o)&&((!_2&&(o==window||o==document))||o.nodeType==1); +} +function $(n,d){ +if(isElement(n)){ +return n; +} +if(isString(n)==false){ +return null; +} +var p,i,x; +if(!d){ +d=document; +} +if((p=n.indexOf("?"))>0&&parent.frames.length){ +d=parent.frames[n.substring(p+1)].document; +n=n.substring(0,p); +} +if(!(x=d[n])&&d.all){ +x=d.all[n]; +} +for(i=0;!x&&i<d.forms.length;i++){ +x=d.forms[i][n]; +} +for(i=0;!x&&d.layers&&i<d.layers.length;i++){ +x=DOM.find(n,d.layers[i].document); +} +if(!x&&d.getElementById){ +x=d.getElementById(n); +} +return x; +} +Function.prototype.bindEvent=function(){ +var _6=this,args=$A(arguments),object=args.shift(); +return function(_7){ +return _6.call(object,[_7||window.event].concat(args)); +}; +}; +
+Object.extend(String.prototype,{stripTags:function(){ +return this.replace(/<\/?[^>]+>/gi,""); +},stripScripts:function(){ +return this.replace(new RegExp(Prototype.ScriptFragment,"img"),""); +},extractScripts:function(){ +var _1=new RegExp(Prototype.ScriptFragment,"img"); +var _2=new RegExp(Prototype.ScriptFragment,"im"); +return (this.match(_1)||[]).map(function(_3){ +return (_3.match(_2)||["",""])[1]; +}); +},evalScripts:function(){ +return this.extractScripts().map(eval); +},escapeHTML:function(){ +var _4=document.createElement("div"); +var _5=document.createTextNode(this); +_4.appendChild(_5); +return _4.innerHTML; +},unescapeHTML:function(){ +var _6=document.createElement("div"); +_6.innerHTML=this.stripTags(); +return _6.childNodes[0]?_6.childNodes[0].nodeValue:""; +},toQueryParams:function(){ +var _7=this.match(/^\??(.*)$/)[1].split("&"); +return _7.inject({},function(_8,_9){ +var _10=_9.split("="); +_8[_10[0]]=_10[1]; +return _8; +}); +},toArray:function(){ +return this.split(""); +},camelize:function(){ +var _11=this.split("-"); +if(_11.length==1){ +return _11[0]; +} +var _12=this.indexOf("-")==0?_11[0].charAt(0).toUpperCase()+_11[0].substring(1):_11[0]; +for(var i=1,len=_11.length;i<len;i++){ +var s=_11[i]; +_12+=s.charAt(0).toUpperCase()+s.substring(1); +} +return _12; +},inspect:function(){ +return "'"+this.replace("\\","\\\\").replace("'","\\'")+"'"; +}}); +String.prototype.parseQuery=String.prototype.toQueryParams; +
+Object.extend(String.prototype,{pad:function(_1,_2,_3){ +if(!_3){ +_3=" "; +} +var s=this; +var _5=_1.toLowerCase()=="left"; +while(s.length<_2){ +s=_5?_3+s:s+_3; +} +return s; +},padLeft:function(_6,_7){ +return this.pad("left",_6,_7); +},padRight:function(_8,_9){ +return this.pad("right",_8,_9); +},zerofill:function(len){ +var s=this; +var ix=/^[+-]/.test(s)?1:0; +while(s.length<len){ +s=s.insert(ix,"0"); +} +return s; +},trim:function(){ +return this.replace(/^\s+|\s+$/g,""); +},trimLeft:function(){ +return this.replace(/^\s+/,""); +},trimRight:function(){ +return this.replace(/\s+$/,""); +},toFunction:function(){ +var _12=this.split(/\./); +var _13=window; +_12.each(function(_14){ +if(_13[new String(_14)]){ +_13=_13[new String(_14)]; +} +}); +if(isFunction(_13)){ +return _13; +}else{ +if(typeof Logger!="undefined"){ +Logger.error("Missing function",this); +} +return Prototype.emptyFunction; +} +},toInteger:function(){ +var exp=/^\s*[-\+]?\d+\s*$/; +if(this.match(exp)==null){ +return null; +} +var num=parseInt(this,10); +return (isNaN(num)?null:num); +},toDouble:function(_17){ +_17=_17||"."; +var exp=new RegExp("^\\s*([-\\+])?(\\d+)?(\\"+_17+"(\\d+))?\\s*$"); +var m=this.match(exp); +if(m==null){ +return null; +} +var _19=m[1]+(m[2].length>0?m[2]:"0")+"."+m[4]; +var num=parseFloat(_19); +return (isNaN(num)?null:num); +},toCurrency:function(_20,_21,_22){ +_20=_20||","; +_22=_22||"."; +_21=typeof (_21)=="undefined"?2:_21; +var exp=new RegExp("^\\s*([-\\+])?(((\\d+)\\"+_20+")*)(\\d+)"+((_21>0)?"(\\"+_22+"(\\d{1,"+_21+"}))?":"")+"\\s*$"); +var m=this.match(exp); +if(m==null){ +return null; +} +var _23=m[2]+m[5]; +var _24=m[1]+_23.replace(new RegExp("(\\"+_20+")","g"),"")+((_21>0)?"."+m[7]:""); +var num=parseFloat(_24); +return (isNaN(num)?null:num); +}}); +
+var $break=new Object(); +var $continue=new Object(); +var Enumerable={each:function(_1){ +var _2=0; +try{ +this._each(function(_3){ +try{ +_1(_3,_2++); +} +catch(e){ +if(e!=$continue){ +throw e; +} +} +}); +} +catch(e){ +if(e!=$break){ +throw e; +} +} +},all:function(_4){ +var _5=true; +this.each(function(_6,_7){ +_5=_5&&!!(_4||Prototype.K)(_6,_7); +if(!_5){ +throw $break; +} +}); +return _5; +},any:function(_8){ +var _9=true; +this.each(function(_10,_11){ +if(_9=!!(_8||Prototype.K)(_10,_11)){ +throw $break; +} +}); +return _9; +},collect:function(_12){ +var _13=[]; +this.each(function(_14,_15){ +_13.push(_12(_14,_15)); +}); +return _13; +},detect:function(_16){ +var _17; +this.each(function(_18,_19){ +if(_16(_18,_19)){ +_17=_18; +throw $break; +} +}); +return _17; +},findAll:function(_20){ +var _21=[]; +this.each(function(_22,_23){ +if(_20(_22,_23)){ +_21.push(_22); +} +}); +return _21; +},grep:function(_24,_25){ +var _26=[]; +this.each(function(_27,_28){ +var _29=_27.toString(); +if(_29.match(_24)){ +_26.push((_25||Prototype.K)(_27,_28)); +} +}); +return _26; +},include:function(_30){ +var _31=false; +this.each(function(_32){ +if(_32==_30){ +_31=true; +throw $break; +} +}); +return _31; +},inject:function(_33,_34){ +this.each(function(_35,_36){ +_33=_34(_33,_35,_36); +}); +return _33; +},invoke:function(_37){ +var _38=$A(arguments).slice(1); +return this.collect(function(_39){ +return _39[_37].apply(_39,_38); +}); +},max:function(_40){ +var _41; +this.each(function(_42,_43){ +_42=(_40||Prototype.K)(_42,_43); +if(_42>=(_41||_42)){ +_41=_42; +} +}); +return _41; +},min:function(_44){ +var _45; +this.each(function(_46,_47){ +_46=(_44||Prototype.K)(_46,_47); +if(_46<=(_45||_46)){ +_45=_46; +} +}); +return _45; +},partition:function(_48){ +var _49=[],falses=[]; +this.each(function(_50,_51){ +((_48||Prototype.K)(_50,_51)?_49:falses).push(_50); +}); +return [_49,falses]; +},pluck:function(_52){ +var _53=[]; +this.each(function(_54,_55){ +_53.push(_54[_52]); +}); +return _53; +},reject:function(_56){ +var _57=[]; +this.each(function(_58,_59){ +if(!_56(_58,_59)){ +_57.push(_58); +} +}); +return _57; +},sortBy:function(_60){ +return this.collect(function(_61,_62){ +return {value:_61,criteria:_60(_61,_62)}; +}).sort(function(_63,_64){ +var a=_63.criteria,b=_64.criteria; +return a<b?-1:a>b?1:0; +}).pluck("value"); +},toArray:function(){ +return this.collect(Prototype.K); +},zip:function(){ +var _66=Prototype.K,args=$A(arguments); +if(typeof args.last()=="function"){ +_66=args.pop(); +} +var _67=[this].concat(args).map($A); +return this.map(function(_68,_69){ +_66(_68=_67.pluck(_69)); +return _68; +}); +},inspect:function(){ +return "#<Enumerable:"+this.toArray().inspect()+">"; +}}; +Object.extend(Enumerable,{map:Enumerable.collect,find:Enumerable.detect,select:Enumerable.findAll,member:Enumerable.include,entries:Enumerable.toArray}); +
+var $A=Array.from=function(_1){ +if(!_1){ +return []; +} +if(_1.toArray){ +return _1.toArray(); +}else{ +var _2=[]; +for(var i=0;i<_1.length;i++){ +_2.push(_1[i]); +} +return _2; +} +}; +Object.extend(Array.prototype,Enumerable); +Array.prototype._reverse=Array.prototype.reverse; +Object.extend(Array.prototype,{_each:function(_4){ +for(var i=0;i<this.length;i++){ +_4(this[i]); +} +},clear:function(){ +this.length=0; +return this; +},first:function(){ +return this[0]; +},last:function(){ +return this[this.length-1]; +},compact:function(){ +return this.select(function(_5){ +return _5!=undefined||_5!=null; +}); +},flatten:function(){ +return this.inject([],function(_6,_7){ +return _6.concat(_7.constructor==Array?_7.flatten():[_7]); +}); +},without:function(){ +var _8=$A(arguments); +return this.select(function(_9){ +return !_8.include(_9); +}); +},indexOf:function(_10){ +for(var i=0;i<this.length;i++){ +if(this[i]==_10){ +return i; +} +} +return -1; +},reverse:function(_11){ +return (_11!==false?this:this.toArray())._reverse(); +},shift:function(){ +var _12=this[0]; +for(var i=0;i<this.length-1;i++){ +this[i]=this[i+1]; +} +this.length--; +return _12; +},inspect:function(){ +return "["+this.map(Object.inspect).join(", ")+"]"; +}}); +
+var Hash={_each:function(_1){ +for(key in this){ +var _2=this[key]; +if(typeof _2=="function"){ +continue; +} +var _3=[key,_2]; +_3.key=key; +_3.value=_2; +_1(_3); +} +},keys:function(){ +return this.pluck("key"); +},values:function(){ +return this.pluck("value"); +},merge:function(_4){ +return $H(_4).inject($H(this),function(_5,_6){ +_5[_6.key]=_6.value; +return _5; +}); +},toQueryString:function(){ +return this.map(function(_7){ +return _7.map(encodeURIComponent).join("="); +}).join("&"); +},inspect:function(){ +return "#<Hash:{"+this.map(function(_8){ +return _8.map(Object.inspect).join(": "); +}).join(", ")+"}>"; +}}; +function $H(_9){ +var _10=Object.extend({},_9||{}); +Object.extend(_10,Enumerable); +Object.extend(_10,Hash); +return _10; +} +
+ObjectRange=Class.create(); +Object.extend(ObjectRange.prototype,Enumerable); +Object.extend(ObjectRange.prototype,{initialize:function(_1,_2,_3){ +this.start=_1; +this.end=_2; +this.exclusive=_3; +},_each:function(_4){ +var _5=this.start; +do{ +_4(_5); +_5=_5.succ(); +}while(this.include(_5)); +},include:function(_6){ +if(_6<this.start){ +return false; +} +if(this.exclusive){ +return _6<this.end; +} +return _6<=this.end; +}}); +var $R=function(_7,_8,_9){ +return new ObjectRange(_7,_8,_9); +}; +
+document.getElementsByClassName=function(_1,_2){ +var _3=($(_2)||document.body).getElementsByTagName("*"); +return $A(_3).inject([],function(_4,_5){ +if(_5.className.match(new RegExp("(^|\\s)"+_1+"(\\s|$)"))){ +_4.push(_5); +} +return _4; +}); +}; +if(!window.Element){ +var Element=new Object(); +} +Object.extend(Element,{visible:function(_6){ +return $(_6).style.display!="none"; +},toggle:function(){ +for(var i=0;i<arguments.length;i++){ +var _8=$(arguments[i]); +Element[Element.visible(_8)?"hide":"show"](_8); +} +},hide:function(){ +for(var i=0;i<arguments.length;i++){ +var _9=$(arguments[i]); +_9.style.display="none"; +} +},show:function(){ +for(var i=0;i<arguments.length;i++){ +var _10=$(arguments[i]); +_10.style.display=""; +} +},remove:function(_11){ +_11=$(_11); +_11.parentNode.removeChild(_11); +},update:function(_12,_13){ +$(_12).innerHTML=_13.stripScripts(); +setTimeout(function(){ +_13.evalScripts(); +},10); +},getHeight:function(_14){ +_14=$(_14); +return _14.offsetHeight; +},classNames:function(_15){ +return new Element.ClassNames(_15); +},hasClassName:function(_16,_17){ +if(!(_16=$(_16))){ +return; +} +return Element.classNames(_16).include(_17); +},addClassName:function(_18,_19){ +if(!(_18=$(_18))){ +return; +} +return Element.classNames(_18).add(_19); +},removeClassName:function(_20,_21){ +if(!(_20=$(_20))){ +return; +} +return Element.classNames(_20).remove(_21); +},cleanWhitespace:function(_22){ +_22=$(_22); +for(var i=0;i<_22.childNodes.length;i++){ +var _23=_22.childNodes[i]; +if(_23.nodeType==3&&!/\S/.test(_23.nodeValue)){ +Element.remove(_23); +} +} +},empty:function(_24){ +return $(_24).innerHTML.match(/^\s*$/); +},scrollTo:function(_25){ +_25=$(_25); +var x=_25.x?_25.x:_25.offsetLeft,y=_25.y?_25.y:_25.offsetTop; +window.scrollTo(x,y); +},getStyle:function(_27,_28){ +_27=$(_27); +var _29=_27.style[_28.camelize()]; +if(!_29){ +if(document.defaultView&&document.defaultView.getComputedStyle){ +var css=document.defaultView.getComputedStyle(_27,null); +_29=css?css.getPropertyValue(_28):null; +}else{ +if(_27.currentStyle){ +_29=_27.currentStyle[_28.camelize()]; +} +} +} +if(window.opera&&["left","top","right","bottom"].include(_28)){ +if(Element.getStyle(_27,"position")=="static"){ +_29="auto"; +} +} +return _29=="auto"?null:_29; +},setStyle:function(_31,_32){ +_31=$(_31); +for(name in _32){ +_31.style[name.camelize()]=_32[name]; +} +},getDimensions:function(_33){ +_33=$(_33); +if(Element.getStyle(_33,"display")!="none"){ +return {width:_33.offsetWidth,height:_33.offsetHeight}; +} +var els=_33.style; +var _35=els.visibility; +var _36=els.position; +els.visibility="hidden"; +els.position="absolute"; +els.display=""; +var _37=_33.clientWidth; +var _38=_33.clientHeight; +els.display="none"; +els.position=_36; +els.visibility=_35; +return {width:_37,height:_38}; +},makePositioned:function(_39){ +_39=$(_39); +var pos=Element.getStyle(_39,"position"); +if(pos=="static"||!pos){ +_39._madePositioned=true; +_39.style.position="relative"; +if(window.opera){ +_39.style.top=0; +_39.style.left=0; +} +} +},undoPositioned:function(_41){ +_41=$(_41); +if(_41._madePositioned){ +_41._madePositioned=undefined; +_41.style.position=_41.style.top=_41.style.left=_41.style.bottom=_41.style.right=""; +} +},makeClipping:function(_42){ +_42=$(_42); +if(_42._overflow){ +return; +} +_42._overflow=_42.style.overflow; +if((Element.getStyle(_42,"overflow")||"visible")!="hidden"){ +_42.style.overflow="hidden"; +} +},undoClipping:function(_43){ +_43=$(_43); +if(_43._overflow){ +return; +} +_43.style.overflow=_43._overflow; +_43._overflow=undefined; +}}); +var Toggle=new Object(); +Toggle.display=Element.toggle; +Abstract.Insertion=function(_44){ +this.adjacency=_44; +}; +Abstract.Insertion.prototype={initialize:function(_45,_46){ +this.element=$(_45); +this.content=_46.stripScripts(); +if(this.adjacency&&this.element.insertAdjacentHTML){ +try{ +this.element.insertAdjacentHTML(this.adjacency,this.content); +} +catch(e){ +if(this.element.tagName.toLowerCase()=="tbody"){ +this.insertContent(this.contentFromAnonymousTable()); +}else{ +throw e; +} +} +}else{ +this.range=this.element.ownerDocument.createRange(); +if(this.initializeRange){ +this.initializeRange(); +} +this.insertContent([this.range.createContextualFragment(this.content)]); +} +setTimeout(function(){ +_46.evalScripts(); +},10); +},contentFromAnonymousTable:function(){ +var div=document.createElement("div"); +div.innerHTML="<table><tbody>"+this.content+"</tbody></table>"; +return $A(div.childNodes[0].childNodes[0].childNodes); +}}; +var Insertion=new Object(); +Insertion.Before=Class.create(); +Insertion.Before.prototype=Object.extend(new Abstract.Insertion("beforeBegin"),{initializeRange:function(){ +this.range.setStartBefore(this.element); +},insertContent:function(_48){ +_48.each((function(_49){ +this.element.parentNode.insertBefore(_49,this.element); +}).bind(this)); +}}); +Insertion.Top=Class.create(); +Insertion.Top.prototype=Object.extend(new Abstract.Insertion("afterBegin"),{initializeRange:function(){ +this.range.selectNodeContents(this.element); +this.range.collapse(true); +},insertContent:function(_50){ +_50.reverse(false).each((function(_51){ +this.element.insertBefore(_51,this.element.firstChild); +}).bind(this)); +}}); +Insertion.Bottom=Class.create(); +Insertion.Bottom.prototype=Object.extend(new Abstract.Insertion("beforeEnd"),{initializeRange:function(){ +this.range.selectNodeContents(this.element); +this.range.collapse(this.element); +},insertContent:function(_52){ +_52.each((function(_53){ +this.element.appendChild(_53); +}).bind(this)); +}}); +Insertion.After=Class.create(); +Insertion.After.prototype=Object.extend(new Abstract.Insertion("afterEnd"),{initializeRange:function(){ +this.range.setStartAfter(this.element); +},insertContent:function(_54){ +_54.each((function(_55){ +this.element.parentNode.insertBefore(_55,this.element.nextSibling); +}).bind(this)); +}}); +Element.ClassNames=Class.create(); +Element.ClassNames.prototype={initialize:function(_56){ +this.element=$(_56); +},_each:function(_57){ +this.element.className.split(/\s+/).select(function(_58){ +return _58.length>0; +})._each(_57); +},set:function(_59){ +this.element.className=_59; +},add:function(_60){ +if(this.include(_60)){ +return; +} +this.set(this.toArray().concat(_60).join(" ")); +},remove:function(_61){ +if(!this.include(_61)){ +return; +} +this.set(this.select(function(_62){ +return _62!=_61; +}).join(" ")); +},toString:function(){ +return this.toArray().join(" "); +}}; +Object.extend(Element.ClassNames.prototype,Enumerable); +
+Object.extend(Element,{condClassName:function(_1,_2,_3){ +(_3?Element.addClassName:Element.removeClassName)(_1,_2); +}}); +
+var Field={clear:function(){ +for(var i=0;i<arguments.length;i++){ +$(arguments[i]).value=""; +} +},focus:function(_2){ +$(_2).focus(); +},present:function(){ +for(var i=0;i<arguments.length;i++){ +if($(arguments[i]).value==""){ +return false; +} +} +return true; +},select:function(_3){ +$(_3).select(); +},activate:function(_4){ +_4=$(_4); +_4.focus(); +if(_4.select){ +_4.select(); +} +}}; +var Form={serialize:function(_5){ +var _6=Form.getElements($(_5)); +var _7=new Array(); +for(var i=0;i<_6.length;i++){ +var _8=Form.Element.serialize(_6[i]); +if(_8){ +_7.push(_8); +} +} +return _7.join("&"); +},getElements:function(_9){ +_9=$(_9); +var _10=new Array(); +for(tagName in Form.Element.Serializers){ +var _11=_9.getElementsByTagName(tagName); +for(var j=0;j<_11.length;j++){ +_10.push(_11[j]); +} +} +return _10; +},getInputs:function(_13,_14,_15){ +_13=$(_13); +var _16=_13.getElementsByTagName("input"); +if(!_14&&!_15){ +return _16; +} +var _17=new Array(); +for(var i=0;i<_16.length;i++){ +var _18=_16[i]; +if((_14&&_18.type!=_14)||(_15&&_18.name!=_15)){ +continue; +} +_17.push(_18); +} +return _17; +},disable:function(_19){ +var _20=Form.getElements(_19); +for(var i=0;i<_20.length;i++){ +var _21=_20[i]; +_21.blur(); +_21.disabled="true"; +} +},enable:function(_22){ +var _23=Form.getElements(_22); +for(var i=0;i<_23.length;i++){ +var _24=_23[i]; +_24.disabled=""; +} +},findFirstElement:function(_25){ +return Form.getElements(_25).find(function(_26){ +return _26.type!="hidden"&&!_26.disabled&&["input","select","textarea"].include(_26.tagName.toLowerCase()); +}); +},focusFirstElement:function(_27){ +Field.activate(Form.findFirstElement(_27)); +},reset:function(_28){ +$(_28).reset(); +}}; +Form.Element={serialize:function(_29){ +_29=$(_29); +var _30=_29.tagName.toLowerCase(); +var _31=Form.Element.Serializers[_30](_29); +if(_31){ +var key=encodeURIComponent(_31[0]); +if(key.length==0){ +return; +} +if(_31[1].constructor!=Array){ +_31[1]=[_31[1]]; +} +return _31[1].map(function(_33){ +return key+"="+encodeURIComponent(_33); +}).join("&"); +} +},getValue:function(_34){ +_34=$(_34); +var _35=_34.tagName.toLowerCase(); +var _36=Form.Element.Serializers[_35](_34); +if(_36){ +return _36[1]; +} +}}; +Form.Element.Serializers={input:function(_37){ +switch(_37.type.toLowerCase()){ +case "submit": +case "hidden": +case "password": +case "text": +return Form.Element.Serializers.textarea(_37); +case "checkbox": +case "radio": +return Form.Element.Serializers.inputSelector(_37); +} +return false; +},inputSelector:function(_38){ +if(_38.checked){ +return [_38.name,_38.value]; +} +},textarea:function(_39){ +return [_39.name,_39.value]; +},select:function(_40){ +return Form.Element.Serializers[_40.type=="select-one"?"selectOne":"selectMany"](_40); +},selectOne:function(_41){ +var _42="",opt,index=_41.selectedIndex; +if(index>=0){ +opt=_41.options[index]; +_42=opt.value; +if(!_42&&!("value" in opt)){ +_42=opt.text; +} +} +return [_41.name,_42]; +},selectMany:function(_43){ +var _44=new Array(); +for(var i=0;i<_43.length;i++){ +var opt=_43.options[i]; +if(opt.selected){ +var _46=opt.value; +if(!_46&&!("value" in opt)){ +_46=opt.text; +} +_44.push(_46); +} +} +return [_43.name,_44]; +}}; +var $F=Form.Element.getValue; +Abstract.TimedObserver=function(){ +}; +Abstract.TimedObserver.prototype={initialize:function(_47,_48,_49){ +this.frequency=_48; +this.element=$(_47); +this.callback=_49; +this.lastValue=this.getValue(); +this.registerCallback(); +},registerCallback:function(){ +setInterval(this.onTimerEvent.bind(this),this.frequency*1000); +},onTimerEvent:function(){ +var _50=this.getValue(); +if(this.lastValue!=_50){ +this.callback(this.element,_50); +this.lastValue=_50; +} +}}; +Form.Element.Observer=Class.create(); +Form.Element.Observer.prototype=Object.extend(new Abstract.TimedObserver(),{getValue:function(){ +return Form.Element.getValue(this.element); +}}); +Form.Observer=Class.create(); +Form.Observer.prototype=Object.extend(new Abstract.TimedObserver(),{getValue:function(){ +return Form.serialize(this.element); +}}); +Abstract.EventObserver=function(){ +}; +Abstract.EventObserver.prototype={initialize:function(_51,_52){ +this.element=$(_51); +this.callback=_52; +this.lastValue=this.getValue(); +if(this.element.tagName.toLowerCase()=="form"){ +this.registerFormCallbacks(); +}else{ +this.registerCallback(this.element); +} +},onElementEvent:function(){ +var _53=this.getValue(); +if(this.lastValue!=_53){ +this.callback(this.element,_53); +this.lastValue=_53; +} +},registerFormCallbacks:function(){ +var _54=Form.getElements(this.element); +for(var i=0;i<_54.length;i++){ +this.registerCallback(_54[i]); +} +},registerCallback:function(_55){ +if(_55.type){ +switch(_55.type.toLowerCase()){ +case "checkbox": +case "radio": +Event.observe(_55,"click",this.onElementEvent.bind(this)); +break; +case "password": +case "text": +case "textarea": +case "select-one": +case "select-multiple": +Event.observe(_55,"change",this.onElementEvent.bind(this)); +break; +} +} +}}; +Form.Element.EventObserver=Class.create(); +Form.Element.EventObserver.prototype=Object.extend(new Abstract.EventObserver(),{getValue:function(){ +return Form.Element.getValue(this.element); +}}); +Form.EventObserver=Class.create(); +Form.EventObserver.prototype=Object.extend(new Abstract.EventObserver(),{getValue:function(){ +return Form.serialize(this.element); +}}); +
+if(!window.Event){ +var Event=new Object(); +} +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,element:function(_1){ +return _1.target||_1.srcElement; +},isLeftClick:function(_2){ +return (((_2.which)&&(_2.which==1))||((_2.button)&&(_2.button==1))); +},pointerX:function(_3){ +return _3.pageX||(_3.clientX+(document.documentElement.scrollLeft||document.body.scrollLeft)); +},pointerY:function(_4){ +return _4.pageY||(_4.clientY+(document.documentElement.scrollTop||document.body.scrollTop)); +},stop:function(_5){ +if(_5.preventDefault){ +_5.preventDefault(); +_5.stopPropagation(); +}else{ +_5.returnValue=false; +_5.cancelBubble=true; +} +},findElement:function(_6,_7){ +var _8=Event.element(_6); +while(_8.parentNode&&(!_8.tagName||(_8.tagName.toUpperCase()!=_7.toUpperCase()))){ +_8=_8.parentNode; +} +return _8; +},observers:false,_observeAndCache:function(_9,_10,_11,_12){ +if(!this.observers){ +this.observers=[]; +} +if(_9.addEventListener){ +this.observers.push([_9,_10,_11,_12]); +_9.addEventListener(_10,_11,_12); +}else{ +if(_9.attachEvent){ +this.observers.push([_9,_10,_11,_12]); +_9.attachEvent("on"+_10,_11); +} +} +},unloadCache:function(){ +if(!Event.observers){ +return; +} +for(var i=0;i<Event.observers.length;i++){ +Event.stopObserving.apply(this,Event.observers[i]); +Event.observers[i][0]=null; +} +Event.observers=false; +},observe:function(_14,_15,_16,_17){ +var _14=$(_14); +_17=_17||false; +if(_15=="keypress"&&(navigator.appVersion.match(/Konqueror|Safari|KHTML/)||_14.attachEvent)){ +_15="keydown"; +} +this._observeAndCache(_14,_15,_16,_17); +},stopObserving:function(_18,_19,_20,_21){ +var _18=$(_18); +_21=_21||false; +if(_19=="keypress"&&(navigator.appVersion.match(/Konqueror|Safari|KHTML/)||_18.detachEvent)){ +_19="keydown"; +} +if(_18.removeEventListener){ +_18.removeEventListener(_19,_20,_21); +}else{ +if(_18.detachEvent){ +_18.detachEvent("on"+_19,_20); +} +} +}}); +Event.observe(window,"unload",Event.unloadCache,false); +
+Object.extend(Event,{OnLoad:function(fn){ +var w=document.addEventListener&&!window.addEventListener?document:window; +Event.__observe(w,"load",fn); +},observe:function(_3,_4,_5,_6){ +if(!isList(_3)){ +return this.__observe(_3,_4,_5,_6); +} +for(var i=0;i<_3.length;i++){ +this.__observe(_3[i],_4,_5,_6); +} +},__observe:function(_8,_9,_10,_11){ +var _8=$(_8); +_11=_11||false; +if(_9=="keypress"&&((navigator.appVersion.indexOf("AppleWebKit")>0)||_8.attachEvent)){ +_9="keydown"; +} +this._observeAndCache(_8,_9,_10,_11); +},keyCode:function(e){ +return e.keyCode!=null?e.keyCode:e.charCode; +},fireEvent:function(el,_14){ +if(document.createEvent){ +var evt=document.createEvent("HTMLEvents"); +evt.initEvent(_14,true,true); +el.dispatchEvent(evt); +}else{ +if(el.fireEvent){ +el.fireEvent("on"+_14); +el[_14](); +}else{ +el[_14](); +} +} +}}); +
+var Position={includeScrollOffsets:false,prepare:function(){ +this.deltaX=window.pageXOffset||document.documentElement.scrollLeft||document.body.scrollLeft||0; +this.deltaY=window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0; +},realOffset:function(_1){ +var _2=0,valueL=0; +do{ +_2+=_1.scrollTop||0; +valueL+=_1.scrollLeft||0; +_1=_1.parentNode; +}while(_1); +return [valueL,_2]; +},cumulativeOffset:function(_3){ +var _4=0,valueL=0; +do{ +_4+=_3.offsetTop||0; +valueL+=_3.offsetLeft||0; +_3=_3.offsetParent; +}while(_3); +return [valueL,_4]; +},positionedOffset:function(_5){ +var _6=0,valueL=0; +do{ +_6+=_5.offsetTop||0; +valueL+=_5.offsetLeft||0; +_5=_5.offsetParent; +if(_5){ +p=Element.getStyle(_5,"position"); +if(p=="relative"||p=="absolute"){ +break; +} +} +}while(_5); +return [valueL,_6]; +},offsetParent:function(_7){ +if(_7.offsetParent){ +return _7.offsetParent; +} +if(_7==document.body){ +return _7; +} +while((_7=_7.parentNode)&&_7!=document.body){ +if(Element.getStyle(_7,"position")!="static"){ +return _7; +} +} +return document.body; +},within:function(_8,x,y){ +if(this.includeScrollOffsets){ +return this.withinIncludingScrolloffsets(_8,x,y); +} +this.xcomp=x; +this.ycomp=y; +this.offset=this.cumulativeOffset(_8); +return (y>=this.offset[1]&&y<this.offset[1]+_8.offsetHeight&&x>=this.offset[0]&&x<this.offset[0]+_8.offsetWidth); +},withinIncludingScrolloffsets:function(_11,x,y){ +var _12=this.realOffset(_11); +this.xcomp=x+_12[0]-this.deltaX; +this.ycomp=y+_12[1]-this.deltaY; +this.offset=this.cumulativeOffset(_11); +return (this.ycomp>=this.offset[1]&&this.ycomp<this.offset[1]+_11.offsetHeight&&this.xcomp>=this.offset[0]&&this.xcomp<this.offset[0]+_11.offsetWidth); +},overlap:function(_13,_14){ +if(!_13){ +return 0; +} +if(_13=="vertical"){ +return ((this.offset[1]+_14.offsetHeight)-this.ycomp)/_14.offsetHeight; +} +if(_13=="horizontal"){ +return ((this.offset[0]+_14.offsetWidth)-this.xcomp)/_14.offsetWidth; +} +},clone:function(_15,_16){ +_15=$(_15); +_16=$(_16); +_16.style.position="absolute"; +var _17=this.cumulativeOffset(_15); +_16.style.top=_17[1]+"px"; +_16.style.left=_17[0]+"px"; +_16.style.width=_15.offsetWidth+"px"; +_16.style.height=_15.offsetHeight+"px"; +},page:function(_18){ +var _19=0,valueL=0; +var _20=_18; +do{ +_19+=_20.offsetTop||0; +valueL+=_20.offsetLeft||0; +if(_20.offsetParent==document.body){ +if(Element.getStyle(_20,"position")=="absolute"){ +break; +} +} +}while(_20=_20.offsetParent); +_20=_18; +do{ +_19-=_20.scrollTop||0; +valueL-=_20.scrollLeft||0; +}while(_20=_20.parentNode); +return [valueL,_19]; +},clone:function(_21,_22){ +var _23=Object.extend({setLeft:true,setTop:true,setWidth:true,setHeight:true,offsetTop:0,offsetLeft:0},arguments[2]||{}); +_21=$(_21); +var p=Position.page(_21); +_22=$(_22); +var _25=[0,0]; +var _26=null; +if(Element.getStyle(_22,"position")=="absolute"){ +_26=Position.offsetParent(_22); +_25=Position.page(_26); +} +if(_26==document.body){ +_25[0]-=document.body.offsetLeft; +_25[1]-=document.body.offsetTop; +} +if(_23.setLeft){ +_22.style.left=(p[0]-_25[0]+_23.offsetLeft)+"px"; +} +if(_23.setTop){ +_22.style.top=(p[1]-_25[1]+_23.offsetTop)+"px"; +} +if(_23.setWidth){ +_22.style.width=_21.offsetWidth+"px"; +} +if(_23.setHeight){ +_22.style.height=_21.offsetHeight+"px"; +} +},absolutize:function(_27){ +_27=$(_27); +if(_27.style.position=="absolute"){ +return; +} +Position.prepare(); +var _28=Position.positionedOffset(_27); +var top=_28[1]; +var _30=_28[0]; +var _31=_27.clientWidth; +var _32=_27.clientHeight; +_27._originalLeft=_30-parseFloat(_27.style.left||0); +_27._originalTop=top-parseFloat(_27.style.top||0); +_27._originalWidth=_27.style.width; +_27._originalHeight=_27.style.height; +_27.style.position="absolute"; +_27.style.top=top+"px"; +_27.style.left=_30+"px"; +_27.style.width=_31+"px"; +_27.style.height=_32+"px"; +},relativize:function(_33){ +_33=$(_33); +if(_33.style.position=="relative"){ +return; +} +Position.prepare(); +_33.style.position="relative"; +var top=parseFloat(_33.style.top||0)-(_33._originalTop||0); +var _34=parseFloat(_33.style.left||0)-(_33._originalLeft||0); +_33.style.top=top+"px"; +_33.style.left=_34+"px"; +_33.style.height=_33._originalHeight; +_33.style.width=_33._originalWidth; +}}; +if(/Konqueror|Safari|KHTML/.test(navigator.userAgent)){ +Position.cumulativeOffset=function(_35){ +var _36=0,valueL=0; +do{ +_36+=_35.offsetTop||0; +valueL+=_35.offsetLeft||0; +if(_35.offsetParent==document.body){ +if(Element.getStyle(_35,"position")=="absolute"){ +break; +} +} +_35=_35.offsetParent; +}while(_35); +return [valueL,_36]; +}; +} +
+function getAllChildren(e){ +return e.all?e.all:e.getElementsByTagName("*"); +} +document.getElementsBySelector=function(_2){ +if(!document.getElementsByTagName){ +return new Array(); +} +var _3=_2.split(" "); +var _4=new Array(document); +for(var i=0;i<_3.length;i++){ +token=_3[i].replace(/^\s+/,"").replace(/\s+$/,""); +if(token.indexOf("#")>-1){ +var _6=token.split("#"); +var _7=_6[0]; +var id=_6[1]; +var _9=document.getElementById(id); +if(_7&&_9.nodeName.toLowerCase()!=_7){ +return new Array(); +} +_4=new Array(_9); +continue; +} +if(token.indexOf(".")>-1){ +var _6=token.split("."); +var _7=_6[0]; +var _10=_6[1]; +if(!_7){ +_7="*"; +} +var _11=new Array; +var _12=0; +for(var h=0;h<_4.length;h++){ +var _14; +if(_7=="*"){ +_14=getAllChildren(_4[h]); +}else{ +_14=_4[h].getElementsByTagName(_7); +} +for(var j=0;j<_14.length;j++){ +_11[_12++]=_14[j]; +} +} +_4=new Array; +var _16=0; +for(var k=0;k<_11.length;k++){ +if(_11[k].className&&_11[k].className.match(new RegExp("\\b"+_10+"\\b"))){ +_4[_16++]=_11[k]; +} +} +continue; +} +if(token.match(/^(\w*)\[(\w+)([=~\|\^\$\*]?)=?"?([^\]"]*)"?\]$/)){ +var _7=RegExp.$1; +var _18=RegExp.$2; +var _19=RegExp.$3; +var _20=RegExp.$4; +if(!_7){ +_7="*"; +} +var _11=new Array; +var _12=0; +for(var h=0;h<_4.length;h++){ +var _14; +if(_7=="*"){ +_14=getAllChildren(_4[h]); +}else{ +_14=_4[h].getElementsByTagName(_7); +} +for(var j=0;j<_14.length;j++){ +_11[_12++]=_14[j]; +} +} +_4=new Array; +var _16=0; +var _21; +switch(_19){ +case "=": +_21=function(e){ +return (e.getAttribute(_18)==_20); +}; +break; +case "~": +_21=function(e){ +return (e.getAttribute(_18).match(new RegExp("\\b"+_20+"\\b"))); +}; +break; +case "|": +_21=function(e){ +return (e.getAttribute(_18).match(new RegExp("^"+_20+"-?"))); +}; +break; +case "^": +_21=function(e){ +return (e.getAttribute(_18).indexOf(_20)==0); +}; +break; +case "$": +_21=function(e){ +return (e.getAttribute(_18).lastIndexOf(_20)==e.getAttribute(_18).length-_20.length); +}; +break; +case "*": +_21=function(e){ +return (e.getAttribute(_18).indexOf(_20)>-1); +}; +break; +default: +_21=function(e){ +return e.getAttribute(_18); +}; +} +_4=new Array; +var _16=0; +for(var k=0;k<_11.length;k++){ +if(_21(_11[k])){ +_4[_16++]=_11[k]; +} +} +continue; +} +_7=token; +var _11=new Array; +var _12=0; +for(var h=0;h<_4.length;h++){ +var _14=_4[h].getElementsByTagName(_7); +for(var j=0;j<_14.length;j++){ +_11[_12++]=_14[j]; +} +} +_4=_11; +} +return _4; +}; +
+var Behaviour={list:new Array,register:function(_1){ +Behaviour.list.push(_1); +},start:function(){ +Event.OnLoad(Behaviour.apply); +},apply:function(){ +for(h=0;sheet=Behaviour.list[h];h++){ +for(selector in sheet){ +list=document.getElementsBySelector(selector); +if(!list){ +continue; +} +for(i=0;element=list[i];i++){ +sheet[selector](element); +} +} +} +}}; +Behaviour.start(); +
+Object.debug=function(_1){ +var _2=[]; +if(typeof _1 in ["string","number"]){ +return _1; +}else{ +for(property in _1){ +if(typeof _1[property]!="function"){ +_2.push(property+" => "+(typeof _1[property]=="string"?"\""+_1[property]+"\"":_1[property])); +} +} +} +return ("'"+_1+"' #"+typeof _1+": {"+_2.join(", ")+"}"); +}; +String.prototype.toArray=function(){ +var _3=[]; +for(var i=0;i<this.length;i++){ +_3.push(this.charAt(i)); +} +return _3; +}; +var 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(_5){ +_5=_5.toUpperCase(); +var _6=this.NODEMAP[_5]||"div"; +var _7=document.createElement(_6); +_7.innerHTML="<"+_5+"></"+_5+">"; +var _8=_7.firstChild||null; +if(_8&&(_8.tagName!=_5)){ +_8=_8.getElementsByTagName(_5)[0]; +} +if(!_8){ +_8=document.createElement(_5); +} +if(!_8){ +return; +} +if(arguments[1]){ +if(this._isStringOrNumber(arguments[1])||(arguments[1] instanceof Array)){ +this._children(_8,arguments[1]); +}else{ +var _9=this._attributes(arguments[1]); +if(_9.length){ +_7.innerHTML="<"+_5+" "+_9+"></"+_5+">"; +_8=_7.firstChild||null; +if(!_8){ +_8=document.createElement(_5); +for(attr in arguments[1]){ +_8[attr=="class"?"className":attr]=arguments[1][attr]; +} +} +if(_8.tagName!=_5){ +_8=_7.getElementsByTagName(_5)[0]; +} +} +} +} +if(arguments[2]){ +this._children(_8,arguments[2]); +} +return _8; +},_text:function(_10){ +return document.createTextNode(_10); +},_attributes:function(_11){ +var _12=[]; +for(attribute in _11){ +_12.push((attribute=="className"?"class":attribute)+"=\""+_11[attribute].toString().escapeHTML()+"\""); +} +return _12.join(" "); +},_children:function(_13,_14){ +if(typeof _14=="object"){ +_14.flatten().each(function(e){ +if(typeof e=="object"){ +_13.appendChild(e); +}else{ +if(Builder._isStringOrNumber(e)){ +_13.appendChild(Builder._text(e)); +} +} +}); +}else{ +if(Builder._isStringOrNumber(_14)){ +_13.appendChild(Builder._text(_14)); +} +} +},_isStringOrNumber:function(_16){ +return (typeof _16=="string"||typeof _16=="number"); +}}; +String.prototype.camelize=function(){ +var _17=this.split("-"); +if(_17.length==1){ +return _17[0]; +} +var ret=this.indexOf("-")==0?_17[0].charAt(0).toUpperCase()+_17[0].substring(1):_17[0]; +for(var i=1,len=_17.length;i<len;i++){ +var s=_17[i]; +ret+=s.charAt(0).toUpperCase()+s.substring(1); +} +return ret; +}; +Element.getStyle=function(_20,_21){ +_20=$(_20); +var _22=_20.style[_21.camelize()]; +if(!_22){ +if(document.defaultView&&document.defaultView.getComputedStyle){ +var css=document.defaultView.getComputedStyle(_20,null); +_22=(css!=null)?css.getPropertyValue(_21):null; +}else{ +if(_20.currentStyle){ +_22=_20.currentStyle[_21.camelize()]; +} +} +} +if(window.opera&&(_21=="left"||_21=="top"||_21=="right"||_21=="bottom")){ +if(Element.getStyle(_20,"position")=="static"){ +_22="auto"; +} +} +if(_22=="auto"){ +_22=null; +} +return _22; +}; +String.prototype.parseColor=function(){ +color="#"; +if(this.slice(0,4)=="rgb("){ +var _24=this.slice(4,this.length-1).split(","); +var i=0; +do{ +color+=parseInt(_24[i]).toColorPart(); +}while(++i<3); +}else{ +if(this.slice(0,1)=="#"){ +if(this.length==4){ +for(var i=1;i<4;i++){ +color+=(this.charAt(i)+this.charAt(i)).toLowerCase(); +} +} +if(this.length==7){ +color=this.toLowerCase(); +} +} +} +return (color.length==7?color:(arguments[0]||this)); +}; +Element.makePositioned=function(_25){ +_25=$(_25); +var pos=Element.getStyle(_25,"position"); +if(pos=="static"||!pos){ +_25._madePositioned=true; +_25.style.position="relative"; +if(window.opera){ +_25.style.top=0; +_25.style.left=0; +} +} +}; +Element.undoPositioned=function(_27){ +_27=$(_27); +if(typeof _27._madePositioned!="undefined"){ +_27._madePositioned=undefined; +_27.style.position=""; +_27.style.top=""; +_27.style.left=""; +_27.style.bottom=""; +_27.style.right=""; +} +}; +Element.makeClipping=function(_28){ +_28=$(_28); +if(typeof _28._overflow!="undefined"){ +return; +} +_28._overflow=_28.style.overflow; +if((Element.getStyle(_28,"overflow")||"visible")!="hidden"){ +_28.style.overflow="hidden"; +} +}; +Element.undoClipping=function(_29){ +_29=$(_29); +if(typeof _29._overflow=="undefined"){ +return; +} +_29.style.overflow=_29._overflow; +_29._overflow=undefined; +}; +Element.collectTextNodesIgnoreClass=function(_30,_31){ +var _32=$(_30).childNodes; +var _33=""; +var _34=new RegExp("^([^ ]+ )*"+_31+"( [^ ]+)*$","i"); +for(var i=0;i<_32.length;i++){ +if(_32[i].nodeType==3){ +_33+=_32[i].nodeValue; +}else{ +if((!_32[i].className.match(_34))&&_32[i].hasChildNodes()){ +_33+=Element.collectTextNodesIgnoreClass(_32[i],_31); +} +} +} +return _33; +}; +Element.setContentZoom=function(_35,_36){ +_35=$(_35); +_35.style.fontSize=(_36/100)+"em"; +if(navigator.appVersion.indexOf("AppleWebKit")>0){ +window.scrollBy(0,0); +} +}; +Element.getOpacity=function(_37){ +var _38; +if(_38=Element.getStyle(_37,"opacity")){ +return parseFloat(_38); +} +if(_38=(Element.getStyle(_37,"filter")||"").match(/alpha\(opacity=(.*)\)/)){ +if(_38[1]){ +return parseFloat(_38[1])/100; +} +} +return 1; +}; +Element.setOpacity=function(_39,_40){ +_39=$(_39); +var els=_39.style; +if(_40==1){ +els.opacity="0.999999"; +if(/MSIE/.test(navigator.userAgent)){ +els.filter=Element.getStyle(_39,"filter").replace(/alpha\([^\)]*\)/gi,""); +} +}else{ +if(_40<0.00001){ +_40=0; +} +els.opacity=_40; +if(/MSIE/.test(navigator.userAgent)){ +els.filter=Element.getStyle(_39,"filter").replace(/alpha\([^\)]*\)/gi,"")+"alpha(opacity="+_40*100+")"; +} +} +}; +Element.getInlineOpacity=function(_42){ +_42=$(_42); +var op; +op=_42.style.opacity; +if(typeof op!="undefined"&&op!=""){ +return op; +} +return ""; +}; +Element.setInlineOpacity=function(_44,_45){ +_44=$(_44); +var els=_44.style; +els.opacity=_45; +}; +Element.getDimensions=function(_46){ +_46=$(_46); +if(Element.getStyle(_46,"display")=="none"){ +var els=_46.style; +var _47=els.visibility; +var _48=els.position; +els.visibility="hidden"; +els.position="absolute"; +els.display=""; +var _49=_46.clientWidth; +var _50=_46.clientHeight; +els.display="none"; +els.position=_48; +els.visibility=_47; +return {width:_49,height:_50}; +} +return {width:_46.offsetWidth,height:_46.offsetHeight}; +}; +Position.positionedOffset=function(_51){ +var _52=0,valueL=0; +do{ +_52+=_51.offsetTop||0; +valueL+=_51.offsetLeft||0; +_51=_51.offsetParent; +if(_51){ +p=Element.getStyle(_51,"position"); +if(p=="relative"||p=="absolute"){ +break; +} +} +}while(_51); +return [valueL,_52]; +}; +if(/Konqueror|Safari|KHTML/.test(navigator.userAgent)){ +Position.cumulativeOffset=function(_53){ +var _54=0,valueL=0; +do{ +_54+=_53.offsetTop||0; +valueL+=_53.offsetLeft||0; +if(_53.offsetParent==document.body){ +if(Element.getStyle(_53,"position")=="absolute"){ +break; +} +} +_53=_53.offsetParent; +}while(_53); +return [valueL,_54]; +}; +} +Position.page=function(_55){ +var _56=0,valueL=0; +var _57=_55; +do{ +_56+=_57.offsetTop||0; +valueL+=_57.offsetLeft||0; +if(_57.offsetParent==document.body){ +if(Element.getStyle(_57,"position")=="absolute"){ +break; +} +} +}while(_57=_57.offsetParent); +_57=_55; +do{ +_56-=_57.scrollTop||0; +valueL-=_57.scrollLeft||0; +}while(_57=_57.parentNode); +return [valueL,_56]; +}; +Position.offsetParent=function(_58){ +if(_58.offsetParent){ +return _58.offsetParent; +} +if(_58==document.body){ +return _58; +} +while((_58=_58.parentNode)&&_58!=document.body){ +if(Element.getStyle(_58,"position")!="static"){ +return _58; +} +} +return document.body; +}; +Position.clone=function(_59,_60){ +var _61=Object.extend({setLeft:true,setTop:true,setWidth:true,setHeight:true,offsetTop:0,offsetLeft:0},arguments[2]||{}); +_59=$(_59); +var p=Position.page(_59); +_60=$(_60); +var _63=[0,0]; +var _64=null; +if(Element.getStyle(_60,"position")=="absolute"){ +_64=Position.offsetParent(_60); +_63=Position.page(_64); +} +if(_64==document.body){ +_63[0]-=document.body.offsetLeft; +_63[1]-=document.body.offsetTop; +} +if(_61.setLeft){ +_60.style.left=(p[0]-_63[0]+_61.offsetLeft)+"px"; +} +if(_61.setTop){ +_60.style.top=(p[1]-_63[1]+_61.offsetTop)+"px"; +} +if(_61.setWidth){ +_60.style.width=_59.offsetWidth+"px"; +} +if(_61.setHeight){ +_60.style.height=_59.offsetHeight+"px"; +} +}; +Position.absolutize=function(_65){ +_65=$(_65); +if(_65.style.position=="absolute"){ +return; +} +Position.prepare(); +var _66=Position.positionedOffset(_65); +var top=_66[1]; +var _68=_66[0]; +var _69=_65.clientWidth; +var _70=_65.clientHeight; +_65._originalLeft=_68-parseFloat(_65.style.left||0); +_65._originalTop=top-parseFloat(_65.style.top||0); +_65._originalWidth=_65.style.width; +_65._originalHeight=_65.style.height; +_65.style.position="absolute"; +_65.style.top=top+"px"; +_65.style.left=_68+"px"; +_65.style.width=_69+"px"; +_65.style.height=_70+"px"; +}; +Position.relativize=function(_71){ +_71=$(_71); +if(_71.style.position=="relative"){ +return; +} +Position.prepare(); +_71.style.position="relative"; +var top=parseFloat(_71.style.top||0)-(_71._originalTop||0); +var _72=parseFloat(_71.style.left||0)-(_71._originalLeft||0); +_71.style.top=top+"px"; +_71.style.left=_72+"px"; +_71.style.height=_71._originalHeight; +_71.style.width=_71._originalWidth; +}; +Element.Class={toggle:function(_73,_74){ +if(Element.Class.has(_73,_74)){ +Element.Class.remove(_73,_74); +if(arguments.length==3){ +Element.Class.add(_73,arguments[2]); +} +}else{ +Element.Class.add(_73,_74); +if(arguments.length==3){ +Element.Class.remove(_73,arguments[2]); +} +} +},get:function(_75){ +return $(_75).className.split(" "); +},remove:function(_76){ +_76=$(_76); +var _77=arguments; +$R(1,arguments.length-1).each(function(_78){ +_76.className=_76.className.split(" ").reject(function(_79){ +return (_79==_77[_78]); +}).join(" "); +}); +},add:function(_80){ +_80=$(_80); +for(var i=1;i<arguments.length;i++){ +Element.Class.remove(_80,arguments[i]); +_80.className+=(_80.className.length>0?" ":"")+arguments[i]; +} +},has:function(_81){ +_81=$(_81); +if(!_81||!_81.className){ +return false; +} +var _82; +for(var i=1;i<arguments.length;i++){ +if((typeof arguments[i]=="object")&&(arguments[i].constructor==Array)){ +for(var j=0;j<arguments[i].length;j++){ +_82=new RegExp("(^|\\s)"+arguments[i][j]+"(\\s|$)"); +if(!_82.test(_81.className)){ +return false; +} +} +}else{ +_82=new RegExp("(^|\\s)"+arguments[i]+"(\\s|$)"); +if(!_82.test(_81.className)){ +return false; +} +} +} +return true; +},has_any:function(_84){ +_84=$(_84); +if(!_84||!_84.className){ +return false; +} +var _85; +for(var i=1;i<arguments.length;i++){ +if((typeof arguments[i]=="object")&&(arguments[i].constructor==Array)){ +for(var j=0;j<arguments[i].length;j++){ +_85=new RegExp("(^|\\s)"+arguments[i][j]+"(\\s|$)"); +if(_85.test(_84.className)){ +return true; +} +} +}else{ +_85=new RegExp("(^|\\s)"+arguments[i]+"(\\s|$)"); +if(_85.test(_84.className)){ +return true; +} +} +} +return false; +},childrenWith:function(_86,_87){ +var _88=$(_86).getElementsByTagName("*"); +var _89=new Array(); +for(var i=0;i<_88.length;i++){ +if(Element.Class.has(_88[i],_87)){ +_89.push(_88[i]); +} +} +return _89; +}}; +
+Object.extend(Date.prototype,{SimpleFormat:function(_1){ +var _2=new Array(); +_2["d"]=this.getDate(); +_2["dd"]=Prado.Util.pad(this.getDate(),2); +_2["M"]=this.getMonth()+1; +_2["MM"]=Prado.Util.pad(this.getMonth()+1,2); +var _3=""+this.getFullYear(); +_3=(_3.length==2)?"19"+_3:_3; +_2["yyyy"]=_3; +_2["yy"]=_2["yyyy"].toString().substr(2,2); +var _4=new String(_1); +for(var _5 in _2){ +var _6=new RegExp("\\b"+_5+"\\b","g"); +_4=_4.replace(_6,_2[_5]); +} +return _4; +},toISODate:function(){ +var y=this.getFullYear(); +var m=Prado.Util.pad(this.getMonth()+1); +var d=Prado.Util.pad(this.getDate()); +return String(y)+String(m)+String(d); +}}); +Object.extend(Date,{SimpleParse:function(_10,_11){ +val=String(_10); +_11=String(_11); +if(val.length<=0){ +return null; +} +if(_11.length<=0){ +return new Date(_10); +} +var _12=function(val){ +var _14="1234567890"; +for(var i=0;i<val.length;i++){ +if(_14.indexOf(val.charAt(i))==-1){ +return false; +} +} +return true; +}; +var _16=function(str,i,_18,_19){ +for(var x=_19;x>=_18;x--){ +var _21=str.substring(i,i+x); +if(_21.length<_18){ +return null; +} +if(_12(_21)){ +return _21; +} +} +return null; +}; +var _22=0; +var _23=0; +var c=""; +var _25=""; +var _26=""; +var x,y; +var now=new Date(); +var _28=now.getFullYear(); +var _29=now.getMonth()+1; +var _30=1; +while(_23<_11.length){ +c=_11.charAt(_23); +_25=""; +while((_11.charAt(_23)==c)&&(_23<_11.length)){ +_25+=_11.charAt(_23++); +} +if(_25=="yyyy"||_25=="yy"||_25=="y"){ +if(_25=="yyyy"){ +x=4; +y=4; +} +if(_25=="yy"){ +x=2; +y=2; +} +if(_25=="y"){ +x=2; +y=4; +} +_28=_16(val,_22,x,y); +if(_28==null){ +return null; +} +_22+=_28.length; +if(_28.length==2){ +if(_28>70){ +_28=1900+(_28-0); +}else{ +_28=2000+(_28-0); +} +} +}else{ +if(_25=="MM"||_25=="M"){ +_29=_16(val,_22,_25.length,2); +if(_29==null||(_29<1)||(_29>12)){ +return null; +} +_22+=_29.length; +}else{ +if(_25=="dd"||_25=="d"){ +_30=_16(val,_22,_25.length,2); +if(_30==null||(_30<1)||(_30>31)){ +return null; +} +_22+=_30.length; +}else{ +if(val.substring(_22,_22+_25.length)!=_25){ +return null; +}else{ +_22+=_25.length; +} +} +} +} +} +if(_22!=val.length){ +return null; +} +if(_29==2){ +if(((_28%4==0)&&(_28%100!=0))||(_28%400==0)){ +if(_30>29){ +return null; +} +}else{ +if(_30>28){ +return null; +} +} +} +if((_29==4)||(_29==6)||(_29==9)||(_29==11)){ +if(_30>30){ +return null; +} +} +var _31=new Date(_28,_29-1,_30,0,0,0); +return _31; +}}); +
+var Prado={Version:"3.0a"}; +
+Prado.Focus=Class.create(); +Prado.Focus.setFocus=function(id){ +var _2=document.getElementById?document.getElementById(id):document.all[id]; +if(_2&&!Prado.Focus.canFocusOn(_2)){ +_2=Prado.Focus.findTarget(_2); +} +if(_2){ +try{ +_2.focus(); +_2.scrollIntoView(false); +if(window.__smartNav){ +window.__smartNav.ae=_2.id; +} +} +catch(e){ +} +} +}; +Prado.Focus.canFocusOn=function(_3){ +if(!_3||!(_3.tagName)){ +return false; +} +var _4=_3.tagName.toLowerCase(); +return !_3.disabled&&(!_3.type||_3.type.toLowerCase()!="hidden")&&Prado.Focus.isFocusableTag(_4)&&Prado.Focus.isVisible(_3); +}; +Prado.Focus.isFocusableTag=function(_5){ +return (_5=="input"||_5=="textarea"||_5=="select"||_5=="button"||_5=="a"); +}; +Prado.Focus.findTarget=function(_6){ +if(!_6||!(_6.tagName)){ +return null; +} +var _7=_6.tagName.toLowerCase(); +if(_7=="undefined"){ +return null; +} +var _8=_6.childNodes; +if(_8){ +for(var i=0;i<_8.length;i++){ +try{ +if(Prado.Focus.canFocusOn(_8[i])){ +return _8[i]; +}else{ +var _10=Prado.Focus.findTarget(_8[i]); +if(_10){ +return _10; +} +} +} +catch(e){ +} +} +} +return null; +}; +Prado.Focus.isVisible=function(_11){ +var _12=_11; +while((typeof (_12)!="undefined")&&(_12!=null)){ +if(_12.disabled||(typeof (_12.style)!="undefined"&&((typeof (_12.style.display)!="undefined"&&_12.style.display=="none")||(typeof (_12.style.visibility)!="undefined"&&_12.style.visibility=="hidden")))){ +return false; +} +if(typeof (_12.parentNode)!="undefined"&&_12.parentNode!=null&&_12.parentNode!=_12&&_12.parentNode.tagName.toLowerCase()!="body"){ +_12=_12.parentNode; +}else{ +return true; +} +} +return true; +}; +Prado.doPostBack=function(_13,_14,_15,_16,_17,_18,_19,_20){ +if(typeof (_16)=="undefined"){ +var _16=false; +var _17=""; +var _18=null; +var _19=false; +var _20=true; +} +var _21=document.getElementById?document.getElementById(_13):document.forms[_13]; +var _22=true; +if(_16){ +_22=Prado.Validation.IsValid(_21); +} +if(_22){ +if(_18!=null&&(_18.length>0)){ +_21.action=_18; +} +if(_19){ +var _23=_21.elements["PRADO_LASTFOCUS"]; +if((typeof (_23)!="undefined")&&(_23!=null)){ +var _24=document.activeElement; +if(typeof (_24)=="undefined"){ +_23.value=_14; +}else{ +if((_24!=null)&&(typeof (_24.id)!="undefined")){ +if(_24.id.length>0){ +_23.value=_24.id; +}else{ +if(typeof (_24.name)!="undefined"){ +_23.value=_24.name; +} +} +} +} +} +} +if(!_20){ +_22=false; +} +} +if(_22&&(!_21.onsubmit||_21.onsubmit())){ +_21.PRADO_POSTBACK_TARGET.value=_14; +_21.PRADO_POSTBACK_PARAMETER.value=_15; +_21.submit(); +} +}; +
+Prado.Element={setValue:function(_1,_2){ +var el=$(_1); +if(el&&typeof (el.value)!="undefined"){ +el.value=_2; +} +},select:function(_4,_5,_6){ +var el=$(_4); +var _7=_4.indexOf("[]")>-1; +if(!el&&!_7){ +return; +} +_5=_7?"check"+_5:el.tagName.toLowerCase()+_5; +var _8=Prado.Element.Selection; +if(isFunction(_8[_5])){ +_8[_5](_7?_4:el,_6); +} +},click:function(_9){ +var el=$(_9); +if(!el){ +return; +} +if(document.createEvent){ +var evt=document.createEvent("HTMLEvents"); +evt.initEvent("click",true,true); +el.dispatchEvent(evt); +}else{ +if(el.fireEvent){ +el.fireEvent("onclick"); +if(isFunction(el.onclick)){ +el.onclick(); +} +} +} +},setAttribute:function(_11,_12,_13){ +var el=$(_11); +if(_12=="disabled"&&_13==false){ +el.removeAttribute(_12); +}else{ +el.setAttribute(_12,_13); +} +},setOptions:function(_14,_15){ +var el=$(_14); +if(el&&el.tagName.toLowerCase()=="select"){ +while(el.length>0){ +el.remove(0); +} +for(var i=0;i<_15.length;i++){ +el.options[el.options.length]=new Option(_15[i][0],_15[i][1]); +} +} +},focus:function(_17){ +var obj=$(_17); +if(isObject(obj)&&isdef(obj.focus)){ +setTimeout(function(){ +obj.focus(); +},100); +} +return false; +}}; +Prado.Element.Selection={inputValue:function(el,_19){ +switch(el.type.toLowerCase()){ +case "checkbox": +case "radio": +return el.checked=_19; +} +},selectValue:function(el,_20){ +$A(el.options).each(function(_21){ +_21.selected=_21.value==_20; +}); +},selectIndex:function(el,_22){ +if(el.type=="select-one"){ +el.selectedIndex=_22; +}else{ +for(var i=0;i<el.length;i++){ +if(i==_22){ +el.options[i].selected=true; +} +} +} +},selectClear:function(el){ +el.selectedIndex=-1; +},selectAll:function(el){ +$A(el.options).each(function(_23){ +_23.selected=true; +Logger.warn(_23.value); +}); +},selectInvert:function(el){ +$A(el.options).each(function(_24){ +_24.selected=!_24.selected; +}); +},checkValue:function(_25,_26){ +$A(document.getElementsByName(_25)).each(function(el){ +el.checked=el.value==_26; +}); +},checkIndex:function(_27,_28){ +var _29=$A(document.getElementsByName(_27)); +for(var i=0;i<_29.length;i++){ +if(i==_28){ +_29[i].checked=true; +} +} +},checkClear:function(_30){ +$A(document.getElementsByName(_30)).each(function(el){ +el.checked=false; +}); +},checkAll:function(_31){ +$A(document.getElementsByName(_31)).each(function(el){ +el.checked=true; +}); +},checkInvert:function(_32){ +$A(document.getElementsByName(_32)).each(function(el){ +el.checked=!el.checked; +}); +}}; +Object.extend(Prado.Element,{Insert:{After:function(_33,_34){ +new Insertion.After(_33,_34); +},Before:function(_35,_36){ +new Insertion.Before(_35.innerHTML); +},Below:function(_37,_38){ +new Insertion.Bottom(_37,_38); +},Above:function(_39,_40){ +new Insertion.Top(_39,_40); +}},CssClass:{set:function(_41,_42){ +_41=new Element.ClassNames(_41); +_41.set(_42); +}}}); +
+Prado.Button=Class.create(); +Object.extend(Prado.Button,{buttonFired:false,fireButton:function(e,_2){ +var _3=!this.buttonFired&&Event.keyCode(e)==Event.KEY_RETURN; +var _4=Event.element(e).targName.toLowerCase()=="textarea"; +if(_3&&!_4){ +var _5=$(_2); +if(_5){ +Prado.Button.buttonFired=true; +Event.fireEvent(_5,"click"); +Event.stop(e); +return false; +} +} +return true; +}}); +Prado.TextBox=Class.create(); +Object.extend(Prado.TextBox,{handleReturnKey:function(e){ +if(Event.keyCode(e)==Event.KEY_RETURN){ +var _6=Event.element(e); +if(_6){ +Event.fireEvent(_6,"change"); +Event.stop(e); +return false; +} +} +return true; +}}); +
|