/* Copyright (c) 2006, Yahoo! Inc. All rights reserved.Code licensed under the BSD License:http://developer.yahoo.net/yui/license.txt version: 0.12.0 */ if(typeof YAHOO=="undefined"){var YAHOO={};}YAHOO.namespace=function(){var a=arguments,o=null,i,j,d;for(i=0;i<a.length;++i){d=a[i].split(".");o=YAHOO;for(j=(d[0]=="YAHOO")?1:0;j<d.length;++j){o[d[j]]=o[d[j]]||{};o=o[d[j]];}}return o;};YAHOO.log=function(_2,_3,_4){var l=YAHOO.widget.Logger;if(l&&l.log){return l.log(_2,_3,_4);}else{return false;}};YAHOO.extend=function(_6,_7,_8){var F=function(){};F.prototype=_7.prototype;_6.prototype=new F();_6.prototype.constructor=_6;_6.superclass=_7.prototype;if(_7.prototype.constructor==Object.prototype.constructor){_7.prototype.constructor=_7;}if(_8){for(var i in _8){_6.prototype[i]=_8[i];}}};YAHOO.augment=function(r,s){var rp=r.prototype,sp=s.prototype,a=arguments,i,p;if(a[2]){for(i=2;i<a.length;++i){rp[a[i]]=sp[a[i]];}}else{for(p in sp){if(!rp[p]){rp[p]=sp[p];}}}};YAHOO.namespace("util","widget","example");
/* Copyright (c) 2006, Yahoo! Inc. All rights reserved.Code licensed under the BSD License:http://developer.yahoo.net/yui/license.txt version: 0.12.0 */(function(){var Y=YAHOO.util,getStyle,setStyle,id_counter=0,propertyCache={};var ua=navigator.userAgent.toLowerCase(),isOpera=(ua.indexOf('opera')>-1),isSafari=(ua.indexOf('safari')>-1),isGecko=(!isOpera&&!isSafari&&ua.indexOf('gecko')>-1),isIE=(!isOpera&&ua.indexOf('msie')>-1);var patterns={HYPHEN:/(-[a-z])/i};var toCamel=function(property){if(!patterns.HYPHEN.test(property)){return property;}if(propertyCache[property]){return propertyCache[property];}while(patterns.HYPHEN.exec(property)){property=property.replace(RegExp.$1,RegExp.$1.substr(1).toUpperCase());}propertyCache[property]=property;return property;};if(document.defaultView&&document.defaultView.getComputedStyle){getStyle=function(el,property){var value=null;var computed=document.defaultView.getComputedStyle(el,'');if(computed){value=computed[toCamel(property)];}return el.style[property]||value;};}else if(document.documentElement.currentStyle&&isIE){getStyle=function(el,property){switch(toCamel(property)){case'opacity':var val=100;try{val=el.filters['DXImageTransform.Microsoft.Alpha'].opacity;}catch(e){try{val=el.filters('alpha').opacity;}catch(e){}}return val/100;break;default:var value=el.currentStyle?el.currentStyle[property]:null;return(el.style[property]||value);}};}else{getStyle=function(el,property){return el.style[property];};}if(isIE){setStyle=function(el,property,val){switch(property){case'opacity':if(typeof el.style.filter=='string'){el.style.filter='alpha(opacity='+val*100+')';if(!el.currentStyle||!el.currentStyle.hasLayout){el.style.zoom=1;}}break;default:el.style[property]=val;}};}else{setStyle=function(el,property,val){el.style[property]=val;};}YAHOO.util.Dom={get:function(el){if(!el){return null;}if(typeof el!='string'&&!(el instanceof Array)){return el;}if(typeof el=='string'){return document.getElementById(el);}else{var collection=[];for(var i=0,len=el.length;i<len;++i){collection[collection.length]=Y.Dom.get(el[i]);}return collection;}return null;},getStyle:function(el,property){property=toCamel(property);var f=function(element){return getStyle(element,property);};return Y.Dom.batch(el,f,Y.Dom,true);},setStyle:function(el,property,val){property=toCamel(property);var f=function(element){setStyle(element,property,val);};Y.Dom.batch(el,f,Y.Dom,true);},getXY:function(el){var f=function(el){if(el.parentNode===null||el.offsetParent===null||this.getStyle(el,'display')=='none'){return false;}var parentNode=null;var pos=[];var box;if(el.getBoundingClientRect){box=el.getBoundingClientRect();var doc=document;if(!this.inDocument(el)&&parent.document!=document){doc=parent.document;if(!this.isAncestor(doc.documentElement,el)){return false;}}var scrollTop=Math.max(doc.documentElement.scrollTop,doc.body.scrollTop);var scrollLeft=Math.max(doc.documentElement.scrollLeft,doc.body.scrollLeft);return[box.left+scrollLeft,box.top+scrollTop];}else{pos=[el.offsetLeft,el.offsetTop];parentNode=el.offsetParent;if(parentNode!=el){while(parentNode){pos[0]+=parentNode.offsetLeft;pos[1]+=parentNode.offsetTop;parentNode=parentNode.offsetParent;}}if(isSafari&&this.getStyle(el,'position')=='absolute'){pos[0]-=document.body.offsetLeft;pos[1]-=document.body.offsetTop;}}if(el.parentNode){parentNode=el.parentNode;}else{parentNode=null;}while(parentNode&&parentNode.tagName.toUpperCase()!='BODY'&&parentNode.tagName.toUpperCase()!='HTML'){if(Y.Dom.getStyle(parentNode,'display')!='inline'){pos[0]-=parentNode.scrollLeft;pos[1]-=parentNode.scrollTop;}if(parentNode.parentNode){parentNode=parentNode.parentNode;}else{parentNode=null;}}return pos;};return Y.Dom.batch(el,f,Y.Dom,true);},getX:function(el){var f=function(el){return Y.Dom.getXY(el)[0];};return Y.Dom.batch(el,f,Y.Dom,true);},getY:function(el){var f=function(el){return Y.Dom.getXY(el)[1];};return Y.Dom.batch(el,f,Y.Dom,true);},setXY:function(el,pos,noRetry){var f=function(el){var style_pos=this.getStyle(el,'position');if(style_pos=='static'){this.setStyle(el,'position','relative');style_pos='relative';}var pageXY=this.getXY(el);if(pageXY===false){return false;}var delta=[parseInt(this.getStyle(el,'left'),10),parseInt(this.getStyle(el,'top'),10)];if(isNaN(delta[0])){delta[0]=(style_pos=='relative')?0:el.offsetLeft;}if(isNaN(delta[1])){delta[1]=(style_pos=='relative')?0:el.offsetTop;}if(pos[0]!==null){el.style.left=pos[0]-pageXY[0]+delta[0]+'px';}if(pos[1]!==null){el.style.top=pos[1]-pageXY[1]+delta[1]+'px';}var newXY=this.getXY(el);if(!noRetry&&(newXY[0]!=pos[0]||newXY[1]!=pos[1])){this.setXY(el,pos,true);}};Y.Dom.batch(el,f,Y.Dom,true);},setX:function(el,x){Y.Dom.setXY(el,[x,null]);},setY:function(el,y){Y.Dom.setXY(el,[null,y]);},getRegion:function(el){var f=function(el){var region=new Y.Region.getRegion(el);return region;};return Y.Dom.batch(el,f,Y.Dom,true);},getClientWidth:function(){return Y.Dom.getViewportWidth();},getClientHeight:function(){return Y.Dom.getViewportHeight();},getElementsByClassName:function(className,tag,root){var method=function(el){return Y.Dom.hasClass(el,className);};return Y.Dom.getElementsBy(method,tag,root);},hasClass:function(el,className){var re=new RegExp('(?:^|\\s+)'+className+'(?:\\s+|$)');var f=function(el){return re.test(el['className']);};return Y.Dom.batch(el,f,Y.Dom,true);},addClass:function(el,className){var f=function(el){if(this.hasClass(el,className)){return;}el['className']=[el['className'],className].join(' ');};Y.Dom.batch(el,f,Y.Dom,true);},removeClass:function(el,className){var re=new RegExp('(?:^|\\s+)'+className+'(?:\\s+|$)','g');var f=function(el){if(!this.hasClass(el,className)){return;}var c=el['className'];el['className']=c.replace(re,' ');if(this.hasClass(el,className)){this.removeClass(el,className);}};Y.Dom.batch(el,f,Y.Dom,true);},replaceClass:function(el,oldClassName,newClassName){if(oldClassName===newClassName){return false;}var re=new RegExp('(?:^|\\s+)'+oldClassName+'(?:\\s+|$)','g');var f=function(el){if(!this.hasClass(el,oldClassName)){this.addClass(el,newClassName);return;}el['className']=el['className'].replace(re,' '+newClassName+' ');if(this.hasClass(el,oldClassName)){this.replaceClass(el,oldClassName,newClassName);}};Y.Dom.batch(el,f,Y.Dom,true);},generateId:function(el,prefix){prefix=prefix||'yui-gen';el=el||{};var f=function(el){if(el){el=Y.Dom.get(el);}else{el={};}if(!el.id){el.id=prefix+id_counter++;}return el.id;};return Y.Dom.batch(el,f,Y.Dom,true);},isAncestor:function(haystack,needle){haystack=Y.Dom.get(haystack);if(!haystack||!needle){return false;}var f=function(needle){if(haystack.contains&&!isSafari){return haystack.contains(needle);}else if(haystack.compareDocumentPosition){return!!(haystack.compareDocumentPosition(needle)&16);}else{var parent=needle.parentNode;while(parent){if(parent==haystack){return true;}else if(!parent.tagName||parent.tagName.toUpperCase()=='HTML'){return false;}parent=parent.parentNode;}return false;}};return Y.Dom.batch(needle,f,Y.Dom,true);},inDocument:function(el){var f=function(el){return this.isAncestor(document.documentElement,el);};return Y.Dom.batch(el,f,Y.Dom,true);},getElementsBy:function(method,tag,root){tag=tag||'*';root=Y.Dom.get(root)||document;var nodes=[];var elements=root.getElementsByTagName(tag);if(!elements.length&&(tag=='*'&&root.all)){elements=root.all;}for(var i=0,len=elements.length;i<len;++i){if(method(elements[i])){nodes[nodes.length]=elements[i];}}return nodes;},batch:function(el,method,o,override){var id=el;el=Y.Dom.get(el);var scope=(override)?o:window;if(!el||el.tagName||!el.length){if(!el){return false;}return method.call(scope,el,o);}var collection=[];for(var i=0,len=el.length;i<len;++i){if(!el[i]){id=el[i];}collection[collection.length]=method.call(scope,el[i],o);}return collection;},getDocumentHeight:function(){var scrollHeight=(document.compatMode!='CSS1Compat')?document.body.scrollHeight:document.documentElement.scrollHeight;var h=Math.max(scrollHeight,Y.Dom.getViewportHeight());return h;},getDocumentWidth:function(){var scrollWidth=(document.compatMode!='CSS1Compat')?document.body.scrollWidth:document.documentElement.scrollWidth;var w=Math.max(scrollWidth,Y.Dom.getViewportWidth());return w;},getViewportHeight:function(){var height=self.innerHeight;var mode=document.compatMode;if((mode||isIE)&&!isOpera){height=(mode=='CSS1Compat')?document.documentElement.clientHeight:document.body.clientHeight;}return height;},getViewportWidth:function(){var width=self.innerWidth;var mode=document.compatMode;if(mode||isIE){width=(mode=='CSS1Compat')?document.documentElement.clientWidth:document.body.clientWidth;}return width;}};})();YAHOO.util.Region=function(t,r,b,l){this.top=t;this[1]=t;this.right=r;this.bottom=b;this.left=l;this[0]=l;};YAHOO.util.Region.prototype.contains=function(region){return(region.left>=this.left&&region.right<=this.right&&region.top>=this.top&&region.bottom<=this.bottom);};YAHOO.util.Region.prototype.getArea=function(){return((this.bottom-this.top)*(this.right-this.left));};YAHOO.util.Region.prototype.intersect=function(region){var t=Math.max(this.top,region.top);var r=Math.min(this.right,region.right);var b=Math.min(this.bottom,region.bottom);var l=Math.max(this.left,region.left);if(b>=t&&r>=l){return new YAHOO.util.Region(t,r,b,l);}else{return null;}};YAHOO.util.Region.prototype.union=function(region){var t=Math.min(this.top,region.top);var r=Math.max(this.right,region.right);var b=Math.max(this.bottom,region.bottom);var l=Math.min(this.left,region.left);return new YAHOO.util.Region(t,r,b,l);};YAHOO.util.Region.prototype.toString=function(){return("Region {"+"top: "+this.top+", right: "+this.right+", bottom: "+this.bottom+", left: "+this.left+"}");};YAHOO.util.Region.getRegion=function(el){var p=YAHOO.util.Dom.getXY(el);var t=p[1];var r=p[0]+el.offsetWidth;var b=p[1]+el.offsetHeight;var l=p[0];return new YAHOO.util.Region(t,r,b,l);};YAHOO.util.Point=function(x,y){if(x instanceof Array){y=x[1];x=x[0];}this.x=this.right=this.left=this[0]=x;this.y=this.top=this.bottom=this[1]=y;};YAHOO.util.Point.prototype=new YAHOO.util.Region();
/* Copyright (c) 2006, Yahoo! Inc. All rights reserved.Code licensed under the BSD License:http://developer.yahoo.net/yui/license.txt version: 0.12.0 */ YAHOO.util.CustomEvent=function(_1,_2,_3,_4){this.type=_1;this.scope=_2||window;this.silent=_3;this.signature=_4||YAHOO.util.CustomEvent.LIST;this.subscribers=[];if(!this.silent){}var _5="_YUICEOnSubscribe";if(_1!==_5){this.subscribeEvent=new YAHOO.util.CustomEvent(_5,this,true);}};YAHOO.util.CustomEvent.LIST=0;YAHOO.util.CustomEvent.FLAT=1;YAHOO.util.CustomEvent.prototype={subscribe:function(fn,_7,_8){if(this.subscribeEvent){this.subscribeEvent.fire(fn,_7,_8);}this.subscribers.push(new YAHOO.util.Subscriber(fn,_7,_8));},unsubscribe:function(fn,_9){var _10=false;for(var i=0,len=this.subscribers.length;i<len;++i){var s=this.subscribers[i];if(s&&s.contains(fn,_9)){this._delete(i);_10=true;}}return _10;},fire:function(){var len=this.subscribers.length;if(!len&&this.silent){return true;}var _14=[],ret=true,i;for(i=0;i<arguments.length;++i){_14.push(arguments[i]);}var _15=_14.length;if(!this.silent){}for(i=0;i<len;++i){var s=this.subscribers[i];if(s){if(!this.silent){}var _16=s.getScope(this.scope);if(this.signature==YAHOO.util.CustomEvent.FLAT){var _17=null;if(_14.length>0){_17=_14[0];}ret=s.fn.call(_16,_17,s.obj);}else{ret=s.fn.call(_16,this.type,_14,s.obj);}if(false===ret){if(!this.silent){}return false;}}}return true;},unsubscribeAll:function(){for(var i=0,len=this.subscribers.length;i<len;++i){this._delete(len-1-i);}},_delete:function(_18){var s=this.subscribers[_18];if(s){delete s.fn;delete s.obj;}this.subscribers.splice(_18,1);},toString:function(){return "CustomEvent: "+"'"+this.type+"', "+"scope: "+this.scope;}};YAHOO.util.Subscriber=function(fn,obj,_20){this.fn=fn;this.obj=obj||null;this.override=_20;};YAHOO.util.Subscriber.prototype.getScope=function(_21){if(this.override){if(this.override===true){return this.obj;}else{return this.override;}}return _21;};YAHOO.util.Subscriber.prototype.contains=function(fn,obj){if(obj){return (this.fn==fn&&this.obj==obj);}else{return (this.fn==fn);}};YAHOO.util.Subscriber.prototype.toString=function(){return "Subscriber { obj: "+(this.obj||"")+", override: "+(this.override||"no")+" }";};if(!YAHOO.util.Event){YAHOO.util.Event=function(){var _22=false;var _23=[];var _24=[];var _25=[];var _26=[];var _27=0;var _28=[];var _29=[];var _30=0;return {POLL_RETRYS:200,POLL_INTERVAL:20,EL:0,TYPE:1,FN:2,WFN:3,OBJ:3,ADJ_SCOPE:4,isSafari:(/Safari|Konqueror|KHTML/gi).test(navigator.userAgent),isIE:(!this.isSafari&&!navigator.userAgent.match(/opera/gi)&&navigator.userAgent.match(/msie/gi)),_interval:null,startInterval:function(){if(!this._interval){var _31=this;var _32=function(){_31._tryPreloadAttach();};this._interval=setInterval(_32,this.POLL_INTERVAL);}},onAvailable:function(_33,_34,_35,_36){_28.push({id:_33,fn:_34,obj:_35,override:_36,checkReady:false});_27=this.POLL_RETRYS;this.startInterval();},onContentReady:function(_37,_38,_39,_40){_28.push({id:_37,fn:_38,obj:_39,override:_40,checkReady:true});_27=this.POLL_RETRYS;this.startInterval();},addListener:function(el,_42,fn,obj,_43){if(!fn||!fn.call){return false;}if(this._isValidCollection(el)){var ok=true;for(var i=0,len=el.length;i<len;++i){ok=this.on(el[i],_42,fn,obj,_43)&&ok;}return ok;}else{if(typeof el=="string"){var oEl=this.getEl(el);if(oEl){el=oEl;}else{this.onAvailable(el,function(){YAHOO.util.Event.on(el,_42,fn,obj,_43);});return true;}}}if(!el){return false;}if("unload"==_42&&obj!==this){_24[_24.length]=[el,_42,fn,obj,_43];return true;}var _46=el;if(_43){if(_43===true){_46=obj;}else{_46=_43;}}var _47=function(e){return fn.call(_46,YAHOO.util.Event.getEvent(e),obj);};var li=[el,_42,fn,_47,_46];var _50=_23.length;_23[_50]=li;if(this.useLegacyEvent(el,_42)){var _51=this.getLegacyIndex(el,_42);if(_51==-1||el!=_25[_51][0]){_51=_25.length;_29[el.id+_42]=_51;_25[_51]=[el,_42,el["on"+_42]];_26[_51]=[];el["on"+_42]=function(e){YAHOO.util.Event.fireLegacyEvent(YAHOO.util.Event.getEvent(e),_51);};}_26[_51].push(li);}else{this._simpleAdd(el,_42,_47,false);}return true;},fireLegacyEvent:function(e,_52){var ok=true;var le=_26[_52];for(var i=0,len=le.length;i<len;++i){var li=le[i];if(li&&li[this.WFN]){var _54=li[this.ADJ_SCOPE];var ret=li[this.WFN].call(_54,e);ok=(ok&&ret);}}return ok;},getLegacyIndex:function(el,_56){var key=this.generateId(el)+_56;if(typeof _29[key]=="undefined"){return -1;}else{return _29[key];}},useLegacyEvent:function(el,_58){if(!el.addEventListener&&!el.attachEvent){return true;}else{if(this.isSafari){if("click"==_58||"dblclick"==_58){return true;}}}return false;},removeListener:function(el,_59,fn){var i,len;if(typeof el=="string"){el=this.getEl(el);}else{if(this._isValidCollection(el)){var ok=true;for(i=0,len=el.length;i<len;++i){ok=(this.removeListener(el[i],_59,fn)&&ok);}return ok;}}if(!fn||!fn.call){return this.purgeElement(el,false,_59);}if("unload"==_59){for(i=0,len=_24.length;i<len;i++){var li=_24[i];if(li&&li[0]==el&&li[1]==_59&&li[2]==fn){_24.splice(i,1);return true;}}return false;}var _60=null;var _61=arguments[3];if("undefined"==typeof _61){_61=this._getCacheIndex(el,_59,fn);}if(_61>=0){_60=_23[_61];}if(!el||!_60){return false;}if(this.useLegacyEvent(el,_59)){var _62=this.getLegacyIndex(el,_59);var _63=_26[_62];if(_63){for(i=0,len=_63.length;i<len;++i){li=_63[i];if(li&&li[this.EL]==el&&li[this.TYPE]==_59&&li[this.FN]==fn){_63.splice(i,1);break;}}}}else{this._simpleRemove(el,_59,_60[this.WFN],false);}delete _23[_61][this.WFN];delete _23[_61][this.FN];_23.splice(_61,1);return true;},getTarget:function(ev,_65){var t=ev.target||ev.srcElement;return this.resolveTextNode(t);},resolveTextNode:function(_67){if(_67&&3==_67.nodeType){return _67.parentNode;}else{return _67;}},getPageX:function(ev){var x=ev.pageX;if(!x&&0!==x){x=ev.clientX||0;if(this.isIE){x+=this._getScrollLeft();}}return x;},getPageY:function(ev){var y=ev.pageY;if(!y&&0!==y){y=ev.clientY||0;if(this.isIE){y+=this._getScrollTop();}}return y;},getXY:function(ev){return [this.getPageX(ev),this.getPageY(ev)];},getRelatedTarget:function(ev){var t=ev.relatedTarget;if(!t){if(ev.type=="mouseout"){t=ev.toElement;}else{if(ev.type=="mouseover"){t=ev.fromElement;}}}return this.resolveTextNode(t);},getTime:function(ev){if(!ev.time){var t=new Date().getTime();try{ev.time=t;}catch(e){return t;}}return ev.time;},stopEvent:function(ev){this.stopPropagation(ev);this.preventDefault(ev);},stopPropagation:function(ev){if(ev.stopPropagation){ev.stopPropagation();}else{ev.cancelBubble=true;}},preventDefault:function(ev){if(ev.preventDefault){ev.preventDefault();}else{ev.returnValue=false;}},getEvent:function(e){var ev=e||window.event;if(!ev){var c=this.getEvent.caller;while(c){ev=c.arguments[0];if(ev&&Event==ev.constructor){break;}c=c.caller;}}return ev;},getCharCode:function(ev){return ev.charCode||ev.keyCode||0;},_getCacheIndex:function(el,_71,fn){for(var i=0,len=_23.length;i<len;++i){var li=_23[i];if(li&&li[this.FN]==fn&&li[this.EL]==el&&li[this.TYPE]==_71){return i;}}return -1;},generateId:function(el){var id=el.id;if(!id){id="yuievtautoid-"+_30;++_30;el.id=id;}return id;},_isValidCollection:function(o){return (o&&o.length&&typeof o!="string"&&!o.tagName&&!o.alert&&typeof o[0]!="undefined");},elCache:{},getEl:function(id){return document.getElementById(id);},clearCache:function(){},_load:function(e){_22=true;var EU=YAHOO.util.Event;if(this.isIE){EU._simpleRemove(window,"load",EU._load);}},_tryPreloadAttach:function(){if(this.locked){return false;}this.locked=true;var _75=!_22;if(!_75){_75=(_27>0);}var _76=[];for(var i=0,len=_28.length;i<len;++i){var _77=_28[i];if(_77){var el=this.getEl(_77.id);if(el){if(!_77.checkReady||_22||el.nextSibling||(document&&document.body)){var _78=el;if(_77.override){if(_77.override===true){_78=_77.obj;}else{_78=_77.override;}}_77.fn.call(_78,_77.obj);delete _28[i];}}else{_76.push(_77);}}}_27=(_76.length===0)?0:_27-1;if(_75){this.startInterval();}else{clearInterval(this._interval);this._interval=null;}this.locked=false;return true;},purgeElement:function(el,_79,_80){var _81=this.getListeners(el,_80);if(_81){for(var i=0,len=_81.length;i<len;++i){var l=_81[i];this.removeListener(el,l.type,l.fn);}}if(_79&&el&&el.childNodes){for(i=0,len=el.childNodes.length;i<len;++i){this.purgeElement(el.childNodes[i],_79,_80);}}},getListeners:function(el,_83){var _84=[];if(_23&&_23.length>0){for(var i=0,len=_23.length;i<len;++i){var l=_23[i];if(l&&l[this.EL]===el&&(!_83||_83===l[this.TYPE])){_84.push({type:l[this.TYPE],fn:l[this.FN],obj:l[this.OBJ],adjust:l[this.ADJ_SCOPE],index:i});}}}return (_84.length)?_84:null;},_unload:function(e){var EU=YAHOO.util.Event,i,j,l,len,index;for(i=0,len=_24.length;i<len;++i){l=_24[i];if(l){var _85=window;if(l[EU.ADJ_SCOPE]){if(l[EU.ADJ_SCOPE]===true){_85=l[EU.OBJ];}else{_85=l[EU.ADJ_SCOPE];}}l[EU.FN].call(_85,EU.getEvent(e),l[EU.OBJ]);delete _24[i];l=null;_85=null;}}if(_23&&_23.length>0){j=_23.length;while(j){index=j-1;l=_23[index];if(l){EU.removeListener(l[EU.EL],l[EU.TYPE],l[EU.FN],index);}j=j-1;}l=null;EU.clearCache();}for(i=0,len=_25.length;i<len;++i){delete _25[i][0];delete _25[i];}EU._simpleRemove(window,"unload",EU._unload);},_getScrollLeft:function(){return this._getScroll()[1];},_getScrollTop:function(){return this._getScroll()[0];},_getScroll:function(){var dd=document.documentElement,db=document.body;if(dd&&(dd.scrollTop||dd.scrollLeft)){return [dd.scrollTop,dd.scrollLeft];}else{if(db){return [db.scrollTop,db.scrollLeft];}else{return [0,0];}}},_simpleAdd:function(){if(window.addEventListener){return function(el,_87,fn,_88){el.addEventListener(_87,fn,(_88));};}else{if(window.attachEvent){return function(el,_89,fn,_90){el.attachEvent("on"+_89,fn);};}else{return function(){};}}}(),_simpleRemove:function(){if(window.removeEventListener){return function(el,_91,fn,_92){el.removeEventListener(_91,fn,(_92));};}else{if(window.detachEvent){return function(el,_93,fn){el.detachEvent("on"+_93,fn);};}else{return function(){};}}}()};}();(function(){var EU=YAHOO.util.Event;EU.on=EU.addListener;if(document&&document.body){EU._load();}else{EU._simpleAdd(window,"load",EU._load);}EU._simpleAdd(window,"unload",EU._unload);EU._tryPreloadAttach();})();}YAHOO.util.EventProvider=function(){};YAHOO.util.EventProvider.prototype={__yui_events:null,__yui_subscribers:null,subscribe:function(_94,_95,_96,_97){this.__yui_events=this.__yui_events||{};var ce=this.__yui_events[_94];if(ce){ce.subscribe(_95,_96,_97);}else{this.__yui_subscribers=this.__yui_subscribers||{};var _99=this.__yui_subscribers;if(!_99[_94]){_99[_94]=[];}_99[_94].push({fn:_95,obj:_96,override:_97});}},unsubscribe:function(_100,p_fn,_102){this.__yui_events=this.__yui_events||{};var ce=this.__yui_events[_100];if(ce){return ce.unsubscribe(p_fn,_102);}else{return false;}},createEvent:function(_103,_104){this.__yui_events=this.__yui_events||{};var opts=_104||{};var _106=this.__yui_events;if(_106[_103]){}else{var _107=opts.scope||this;var _108=opts.silent||null;var ce=new YAHOO.util.CustomEvent(_103,_107,_108,YAHOO.util.CustomEvent.FLAT);_106[_103]=ce;if(opts.onSubscribeCallback){ce.subscribeEvent.subscribe(opts.onSubscribeCallback);}this.__yui_subscribers=this.__yui_subscribers||{};var qs=this.__yui_subscribers[_103];if(qs){for(var i=0;i<qs.length;++i){ce.subscribe(qs[i].fn,qs[i].obj,qs[i].override);}}}return _106[_103];},fireEvent:function(_110,arg1,arg2,etc){this.__yui_events=this.__yui_events||{};var ce=this.__yui_events[_110];if(ce){var args=[];for(var i=1;i<arguments.length;++i){args.push(arguments[i]);}return ce.fire.apply(ce,args);}else{return null;}},hasEvent:function(type){if(this.__yui_events){if(this.__yui_events[type]){return true;}}return false;}};
/* Copyright (c) 2006, Yahoo! Inc. All rights reserved.Code licensed under the BSD License:http://developer.yahoo.net/yui/license.txt version: 0.12.0 */ (function(){var _1=YAHOO.util.Event;var _2=YAHOO.util.Dom;YAHOO.util.DragDrop=function(id,_4,_5){if(id){this.init(id,_4,_5);}};YAHOO.util.DragDrop.prototype={id:null,config:null,dragElId:null,handleElId:null,invalidHandleTypes:null,invalidHandleIds:null,invalidHandleClasses:null,startPageX:0,startPageY:0,groups:null,locked:false,lock:function(){this.locked=true;},unlock:function(){this.locked=false;},isTarget:true,padding:null,_domRef:null,__ygDragDrop:true,constrainX:false,constrainY:false,minX:0,maxX:0,minY:0,maxY:0,maintainOffset:false,xTicks:null,yTicks:null,primaryButtonOnly:true,available:false,hasOuterHandles:false,b4StartDrag:function(x,y){},startDrag:function(x,y){},b4Drag:function(e){},onDrag:function(e){},onDragEnter:function(e,id){},b4DragOver:function(e){},onDragOver:function(e,id){},b4DragOut:function(e){},onDragOut:function(e,id){},b4DragDrop:function(e){},onDragDrop:function(e,id){},onInvalidDrop:function(e){},b4EndDrag:function(e){},endDrag:function(e){},b4MouseDown:function(e){},onMouseDown:function(e){},onMouseUp:function(e){},onAvailable:function(){},getEl:function(){if(!this._domRef){this._domRef=_2.get(this.id);}return this._domRef;},getDragEl:function(){return _2.get(this.dragElId);},init:function(id,_9,_10){this.initTarget(id,_9,_10);_1.on(this.id,"mousedown",this.handleMouseDown,this,true);},initTarget:function(id,_11,_12){this.config=_12||{};this.DDM=YAHOO.util.DDM;this.groups={};if(typeof id!=="string"){YAHOO.log("id is not a string, assuming it is an HTMLElement");id=_2.generateId(id);}this.id=id;this.addToGroup((_11)?_11:"default");this.handleElId=id;_1.onAvailable(id,this.handleOnAvailable,this,true);this.setDragElId(id);this.invalidHandleTypes={A:"A"};this.invalidHandleIds={};this.invalidHandleClasses=[];this.applyConfig();},applyConfig:function(){this.padding=this.config.padding||[0,0,0,0];this.isTarget=(this.config.isTarget!==false);this.maintainOffset=(this.config.maintainOffset);this.primaryButtonOnly=(this.config.primaryButtonOnly!==false);},handleOnAvailable:function(){this.available=true;this.resetConstraints();this.onAvailable();},setPadding:function(_13,_14,_15,_16){if(!_14&&0!==_14){this.padding=[_13,_13,_13,_13];}else{if(!_15&&0!==_15){this.padding=[_13,_14,_13,_14];}else{this.padding=[_13,_14,_15,_16];}}},setInitPosition:function(_17,_18){var el=this.getEl();if(!this.DDM.verifyEl(el)){return;}var dx=_17||0;var dy=_18||0;var p=_2.getXY(el);this.initPageX=p[0]-dx;this.initPageY=p[1]-dy;this.lastPageX=p[0];this.lastPageY=p[1];this.setStartPosition(p);},setStartPosition:function(pos){var p=pos||_2.getXY(this.getEl());this.deltaSetXY=null;this.startPageX=p[0];this.startPageY=p[1];},addToGroup:function(_24){this.groups[_24]=true;this.DDM.regDragDrop(this,_24);},removeFromGroup:function(_25){if(this.groups[_25]){delete this.groups[_25];}this.DDM.removeDDFromGroup(this,_25);},setDragElId:function(id){this.dragElId=id;},setHandleElId:function(id){if(typeof id!=="string"){YAHOO.log("id is not a string, assuming it is an HTMLElement");id=_2.generateId(id);}this.handleElId=id;this.DDM.regHandle(this.id,id);},setOuterHandleElId:function(id){if(typeof id!=="string"){YAHOO.log("id is not a string, assuming it is an HTMLElement");id=_2.generateId(id);}_1.on(id,"mousedown",this.handleMouseDown,this,true);this.setHandleElId(id);this.hasOuterHandles=true;},unreg:function(){_1.removeListener(this.id,"mousedown",this.handleMouseDown);this._domRef=null;this.DDM._remove(this);},isLocked:function(){return (this.DDM.isLocked()||this.locked);},handleMouseDown:function(e,oDD){var _27=e.which||e.button;if(this.primaryButtonOnly&&_27>1){return;}if(this.isLocked()){return;}this.DDM.refreshCache(this.groups);var pt=new YAHOO.util.Point(_1.getPageX(e),_1.getPageY(e));if(!this.hasOuterHandles&&!this.DDM.isOverTarget(pt,this)){}else{if(this.clickValidator(e)){this.setStartPosition();this.b4MouseDown(e);this.onMouseDown(e);this.DDM.handleMouseDown(e,this);this.DDM.stopEvent(e);}else{}}},clickValidator:function(e){var _29=_1.getTarget(e);return (this.isValidHandleChild(_29)&&(this.id==this.handleElId||this.DDM.handleWasClicked(_29,this.id)));},addInvalidHandleType:function(_30){var _31=_30.toUpperCase();this.invalidHandleTypes[_31]=_31;},addInvalidHandleId:function(id){if(typeof id!=="string"){YAHOO.log("id is not a string, assuming it is an HTMLElement");id=_2.generateId(id);}this.invalidHandleIds[id]=id;},addInvalidHandleClass:function(_32){this.invalidHandleClasses.push(_32);},removeInvalidHandleType:function(_33){var _34=_33.toUpperCase();delete this.invalidHandleTypes[_34];},removeInvalidHandleId:function(id){if(typeof id!=="string"){YAHOO.log("id is not a string, assuming it is an HTMLElement");id=_2.generateId(id);}delete this.invalidHandleIds[id];},removeInvalidHandleClass:function(_35){for(var i=0,len=this.invalidHandleClasses.length;i<len;++i){if(this.invalidHandleClasses[i]==_35){delete this.invalidHandleClasses[i];}}},isValidHandleChild:function(_37){var _38=true;var _39;try{_39=_37.nodeName.toUpperCase();}catch(e){_39=_37.nodeName;}_38=_38&&!this.invalidHandleTypes[_39];_38=_38&&!this.invalidHandleIds[_37.id];for(var i=0,len=this.invalidHandleClasses.length;_38&&i<len;++i){_38=!_2.hasClass(_37,this.invalidHandleClasses[i]);}return _38;},setXTicks:function(_40,_41){this.xTicks=[];this.xTickSize=_41;var _42={};for(var i=this.initPageX;i>=this.minX;i=i-_41){if(!_42[i]){this.xTicks[this.xTicks.length]=i;_42[i]=true;}}for(i=this.initPageX;i<=this.maxX;i=i+_41){if(!_42[i]){this.xTicks[this.xTicks.length]=i;_42[i]=true;}}this.xTicks.sort(this.DDM.numericSort);},setYTicks:function(_43,_44){this.yTicks=[];this.yTickSize=_44;var _45={};for(var i=this.initPageY;i>=this.minY;i=i-_44){if(!_45[i]){this.yTicks[this.yTicks.length]=i;_45[i]=true;}}for(i=this.initPageY;i<=this.maxY;i=i+_44){if(!_45[i]){this.yTicks[this.yTicks.length]=i;_45[i]=true;}}this.yTicks.sort(this.DDM.numericSort);},setXConstraint:function(_46,_47,_48){this.leftConstraint=_46;this.rightConstraint=_47;this.minX=this.initPageX-_46;this.maxX=this.initPageX+_47;if(_48){this.setXTicks(this.initPageX,_48);}this.constrainX=true;},clearConstraints:function(){this.constrainX=false;this.constrainY=false;this.clearTicks();},clearTicks:function(){this.xTicks=null;this.yTicks=null;this.xTickSize=0;this.yTickSize=0;},setYConstraint:function(iUp,_50,_51){this.topConstraint=iUp;this.bottomConstraint=_50;this.minY=this.initPageY-iUp;this.maxY=this.initPageY+_50;if(_51){this.setYTicks(this.initPageY,_51);}this.constrainY=true;},resetConstraints:function(){if(this.initPageX||this.initPageX===0){var dx=(this.maintainOffset)?this.lastPageX-this.initPageX:0;var dy=(this.maintainOffset)?this.lastPageY-this.initPageY:0;this.setInitPosition(dx,dy);}else{this.setInitPosition();}if(this.constrainX){this.setXConstraint(this.leftConstraint,this.rightConstraint,this.xTickSize);}if(this.constrainY){this.setYConstraint(this.topConstraint,this.bottomConstraint,this.yTickSize);}},getTick:function(val,_53){if(!_53){return val;}else{if(_53[0]>=val){return _53[0];}else{for(var i=0,len=_53.length;i<len;++i){var _54=i+1;if(_53[_54]&&_53[_54]>=val){var _55=val-_53[i];var _56=_53[_54]-val;return (_56>_55)?_53[i]:_53[_54];}}return _53[_53.length-1];}}},toString:function(){return ("DragDrop "+this.id);}};})();if(!YAHOO.util.DragDropMgr){YAHOO.util.DragDropMgr=function(){var _57=YAHOO.util.Event;return {ids:{},handleIds:{},dragCurrent:null,dragOvers:{},deltaX:0,deltaY:0,preventDefault:true,stopPropagation:true,initalized:false,locked:false,init:function(){this.initialized=true;},POINT:0,INTERSECT:1,mode:0,_execOnAll:function(_58,_59){for(var i in this.ids){for(var j in this.ids[i]){var oDD=this.ids[i][j];if(!this.isTypeOfDD(oDD)){continue;}oDD[_58].apply(oDD,_59);}}},_onLoad:function(){this.init();_57.on(document,"mouseup",this.handleMouseUp,this,true);_57.on(document,"mousemove",this.handleMouseMove,this,true);_57.on(window,"unload",this._onUnload,this,true);_57.on(window,"resize",this._onResize,this,true);},_onResize:function(e){this._execOnAll("resetConstraints",[]);},lock:function(){this.locked=true;},unlock:function(){this.locked=false;},isLocked:function(){return this.locked;},locationCache:{},useCache:true,clickPixelThresh:3,clickTimeThresh:1000,dragThreshMet:false,clickTimeout:null,startX:0,startY:0,regDragDrop:function(oDD,_61){if(!this.initialized){this.init();}if(!this.ids[_61]){this.ids[_61]={};}this.ids[_61][oDD.id]=oDD;},removeDDFromGroup:function(oDD,_62){if(!this.ids[_62]){this.ids[_62]={};}var obj=this.ids[_62];if(obj&&obj[oDD.id]){delete obj[oDD.id];}},_remove:function(oDD){for(var g in oDD.groups){if(g&&this.ids[g][oDD.id]){delete this.ids[g][oDD.id];}}delete this.handleIds[oDD.id];},regHandle:function(_65,_66){if(!this.handleIds[_65]){this.handleIds[_65]={};}this.handleIds[_65][_66]=_66;},isDragDrop:function(id){return (this.getDDById(id))?true:false;},getRelated:function(_67,_68){var _69=[];for(var i in _67.groups){for(j in this.ids[i]){var dd=this.ids[i][j];if(!this.isTypeOfDD(dd)){continue;}if(!_68||dd.isTarget){_69[_69.length]=dd;}}}return _69;},isLegalTarget:function(oDD,_71){var _72=this.getRelated(oDD,true);for(var i=0,len=_72.length;i<len;++i){if(_72[i].id==_71.id){return true;}}return false;},isTypeOfDD:function(oDD){return (oDD&&oDD.__ygDragDrop);},isHandle:function(_73,_74){return (this.handleIds[_73]&&this.handleIds[_73][_74]);},getDDById:function(id){for(var i in this.ids){if(this.ids[i][id]){return this.ids[i][id];}}return null;},handleMouseDown:function(e,oDD){this.currentTarget=YAHOO.util.Event.getTarget(e);this.dragCurrent=oDD;var el=oDD.getEl();this.startX=YAHOO.util.Event.getPageX(e);this.startY=YAHOO.util.Event.getPageY(e);this.deltaX=this.startX-el.offsetLeft;this.deltaY=this.startY-el.offsetTop;this.dragThreshMet=false;this.clickTimeout=setTimeout(function(){var DDM=YAHOO.util.DDM;DDM.startDrag(DDM.startX,DDM.startY);},this.clickTimeThresh);},startDrag:function(x,y){clearTimeout(this.clickTimeout);if(this.dragCurrent){this.dragCurrent.b4StartDrag(x,y);this.dragCurrent.startDrag(x,y);}this.dragThreshMet=true;},handleMouseUp:function(e){if(!this.dragCurrent){return;}clearTimeout(this.clickTimeout);if(this.dragThreshMet){this.fireEvents(e,true);}else{}this.stopDrag(e);this.stopEvent(e);},stopEvent:function(e){if(this.stopPropagation){YAHOO.util.Event.stopPropagation(e);}if(this.preventDefault){YAHOO.util.Event.preventDefault(e);}},stopDrag:function(e){if(this.dragCurrent){if(this.dragThreshMet){this.dragCurrent.b4EndDrag(e);this.dragCurrent.endDrag(e);}this.dragCurrent.onMouseUp(e);}this.dragCurrent=null;this.dragOvers={};},handleMouseMove:function(e){if(!this.dragCurrent){return true;}if(YAHOO.util.Event.isIE&&!e.button){this.stopEvent(e);return this.handleMouseUp(e);}if(!this.dragThreshMet){var _76=Math.abs(this.startX-YAHOO.util.Event.getPageX(e));var _77=Math.abs(this.startY-YAHOO.util.Event.getPageY(e));if(_76>this.clickPixelThresh||_77>this.clickPixelThresh){this.startDrag(this.startX,this.startY);}}if(this.dragThreshMet){this.dragCurrent.b4Drag(e);this.dragCurrent.onDrag(e);this.fireEvents(e,false);}this.stopEvent(e);return true;},fireEvents:function(e,_78){var dc=this.dragCurrent;if(!dc||dc.isLocked()){return;}var x=YAHOO.util.Event.getPageX(e);var y=YAHOO.util.Event.getPageY(e);var pt=new YAHOO.util.Point(x,y);var _80=[];var _81=[];var _82=[];var _83=[];var _84=[];for(var i in this.dragOvers){var ddo=this.dragOvers[i];if(!this.isTypeOfDD(ddo)){continue;}if(!this.isOverTarget(pt,ddo,this.mode)){_81.push(ddo);}_80[i]=true;delete this.dragOvers[i];}for(var _86 in dc.groups){if("string"!=typeof _86){continue;}for(i in this.ids[_86]){var oDD=this.ids[_86][i];if(!this.isTypeOfDD(oDD)){continue;}if(oDD.isTarget&&!oDD.isLocked()&&oDD!=dc){if(this.isOverTarget(pt,oDD,this.mode)){if(_78){_83.push(oDD);}else{if(!_80[oDD.id]){_84.push(oDD);}else{_82.push(oDD);}this.dragOvers[oDD.id]=oDD;}}}}}if(this.mode){if(_81.length){dc.b4DragOut(e,_81);dc.onDragOut(e,_81);}if(_84.length){dc.onDragEnter(e,_84);}if(_82.length){dc.b4DragOver(e,_82);dc.onDragOver(e,_82);}if(_83.length){dc.b4DragDrop(e,_83);dc.onDragDrop(e,_83);}}else{var len=0;for(i=0,len=_81.length;i<len;++i){dc.b4DragOut(e,_81[i].id);dc.onDragOut(e,_81[i].id);}for(i=0,len=_84.length;i<len;++i){dc.onDragEnter(e,_84[i].id);}for(i=0,len=_82.length;i<len;++i){dc.b4DragOver(e,_82[i].id);dc.onDragOver(e,_82[i].id);}for(i=0,len=_83.length;i<len;++i){dc.b4DragDrop(e,_83[i].id);dc.onDragDrop(e,_83[i].id);}}if(_78&&!_83.length){dc.onInvalidDrop(e);}},getBestMatch:function(dds){var _89=null;var len=dds.length;if(len==1){_89=dds[0];}else{for(var i=0;i<len;++i){var dd=dds[i];if(dd.cursorIsOver){_89=dd;break;}else{if(!_89||_89.overlap.getArea()<dd.overlap.getArea()){_89=dd;}}}}return _89;},refreshCache:function(_90){for(var _91 in _90){if("string"!=typeof _91){continue;}for(var i in this.ids[_91]){var oDD=this.ids[_91][i];if(this.isTypeOfDD(oDD)){var loc=this.getLocation(oDD);if(loc){this.locationCache[oDD.id]=loc;}else{delete this.locationCache[oDD.id];}}}}},verifyEl:function(el){try{if(el){var _93=el.offsetParent;if(_93){return true;}}}catch(e){}return false;},getLocation:function(oDD){if(!this.isTypeOfDD(oDD)){return null;}var el=oDD.getEl(),pos,x1,x2,y1,y2,t,r,b,l;try{pos=YAHOO.util.Dom.getXY(el);}catch(e){}if(!pos){return null;}x1=pos[0];x2=x1+el.offsetWidth;y1=pos[1];y2=y1+el.offsetHeight;t=y1-oDD.padding[0];r=x2+oDD.padding[1];b=y2+oDD.padding[2];l=x1-oDD.padding[3];return new YAHOO.util.Region(t,r,b,l);},isOverTarget:function(pt,_94,_95){var loc=this.locationCache[_94.id];if(!loc||!this.useCache){loc=this.getLocation(_94);this.locationCache[_94.id]=loc;}if(!loc){return false;}_94.cursorIsOver=loc.contains(pt);var dc=this.dragCurrent;if(!dc||!dc.getTargetCoord||(!_95&&!dc.constrainX&&!dc.constrainY)){return _94.cursorIsOver;}_94.overlap=null;var pos=dc.getTargetCoord(pt.x,pt.y);var el=dc.getDragEl();var _96=new YAHOO.util.Region(pos.y,pos.x+el.offsetWidth,pos.y+el.offsetHeight,pos.x);var _97=_96.intersect(loc);if(_97){_94.overlap=_97;return (_95)?true:_94.cursorIsOver;}else{return false;}},_onUnload:function(e,me){this.unregAll();},unregAll:function(){if(this.dragCurrent){this.stopDrag();this.dragCurrent=null;}this._execOnAll("unreg",[]);for(i in this.elementCache){delete this.elementCache[i];}this.elementCache={};this.ids={};},elementCache:{},getElWrapper:function(id){var _99=this.elementCache[id];if(!_99||!_99.el){_99=this.elementCache[id]=new this.ElementWrapper(YAHOO.util.Dom.get(id));}return _99;},getElement:function(id){return YAHOO.util.Dom.get(id);},getCss:function(id){var el=YAHOO.util.Dom.get(id);return (el)?el.style:null;},ElementWrapper:function(el){this.el=el||null;this.id=this.el&&el.id;this.css=this.el&&el.style;},getPosX:function(el){return YAHOO.util.Dom.getX(el);},getPosY:function(el){return YAHOO.util.Dom.getY(el);},swapNode:function(n1,n2){if(n1.swapNode){n1.swapNode(n2);}else{var p=n2.parentNode;var s=n2.nextSibling;if(s==n1){p.insertBefore(n1,n2);}else{if(n2==n1.nextSibling){p.insertBefore(n2,n1);}else{n1.parentNode.replaceChild(n2,n1);p.insertBefore(n1,s);}}}},getScroll:function(){var t,l,dde=document.documentElement,db=document.body;if(dde&&(dde.scrollTop||dde.scrollLeft)){t=dde.scrollTop;l=dde.scrollLeft;}else{if(db){t=db.scrollTop;l=db.scrollLeft;}else{YAHOO.log("could not get scroll property");}}return {top:t,left:l};},getStyle:function(el,_104){return YAHOO.util.Dom.getStyle(el,_104);},getScrollTop:function(){return this.getScroll().top;},getScrollLeft:function(){return this.getScroll().left;},moveToEl:function(_105,_106){var _107=YAHOO.util.Dom.getXY(_106);YAHOO.util.Dom.setXY(_105,_107);},getClientHeight:function(){return YAHOO.util.Dom.getViewportHeight();},getClientWidth:function(){return YAHOO.util.Dom.getViewportWidth();},numericSort:function(a,b){return (a-b);},_timeoutCount:0,_addListeners:function(){var DDM=YAHOO.util.DDM;if(YAHOO.util.Event&&document){DDM._onLoad();}else{if(DDM._timeoutCount>2000){}else{setTimeout(DDM._addListeners,10);if(document&&document.body){DDM._timeoutCount+=1;}}}},handleWasClicked:function(node,id){if(this.isHandle(id,node.id)){return true;}else{var p=node.parentNode;while(p){if(this.isHandle(id,p.id)){return true;}else{p=p.parentNode;}}}return false;}};}();YAHOO.util.DDM=YAHOO.util.DragDropMgr;YAHOO.util.DDM._addListeners();}YAHOO.util.DD=function(id,_111,_112){if(id){this.init(id,_111,_112);}};YAHOO.extend(YAHOO.util.DD,YAHOO.util.DragDrop,{scroll:true,autoOffset:function(_113,_114){var x=_113-this.startPageX;var y=_114-this.startPageY;this.setDelta(x,y);},setDelta:function(_115,_116){this.deltaX=_115;this.deltaY=_116;},setDragElPos:function(_117,_118){var el=this.getDragEl();this.alignElWithMouse(el,_117,_118);},alignElWithMouse:function(el,_119,_120){var _121=this.getTargetCoord(_119,_120);if(!this.deltaSetXY){var _122=[_121.x,_121.y];YAHOO.util.Dom.setXY(el,_122);var _123=parseInt(YAHOO.util.Dom.getStyle(el,"left"),10);var _124=parseInt(YAHOO.util.Dom.getStyle(el,"top"),10);this.deltaSetXY=[_123-_121.x,_124-_121.y];}else{YAHOO.util.Dom.setStyle(el,"left",(_121.x+this.deltaSetXY[0])+"px");YAHOO.util.Dom.setStyle(el,"top",(_121.y+this.deltaSetXY[1])+"px");}this.cachePosition(_121.x,_121.y);this.autoScroll(_121.x,_121.y,el.offsetHeight,el.offsetWidth);},cachePosition:function(_125,_126){if(_125){this.lastPageX=_125;this.lastPageY=_126;}else{var _127=YAHOO.util.Dom.getXY(this.getEl());this.lastPageX=_127[0];this.lastPageY=_127[1];}},autoScroll:function(x,y,h,w){if(this.scroll){var _130=this.DDM.getClientHeight();var _131=this.DDM.getClientWidth();var st=this.DDM.getScrollTop();var sl=this.DDM.getScrollLeft();var bot=h+y;var _135=w+x;var _136=(_130+st-y-this.deltaY);var _137=(_131+sl-x-this.deltaX);var _138=40;var _139=(document.all)?80:30;if(bot>_130&&_136<_138){window.scrollTo(sl,st+_139);}if(y<st&&st>0&&y-st<_138){window.scrollTo(sl,st-_139);}if(_135>_131&&_137<_138){window.scrollTo(sl+_139,st);}if(x<sl&&sl>0&&x-sl<_138){window.scrollTo(sl-_139,st);}}},getTargetCoord:function(_140,_141){var x=_140-this.deltaX;var y=_141-this.deltaY;if(this.constrainX){if(x<this.minX){x=this.minX;}if(x>this.maxX){x=this.maxX;}}if(this.constrainY){if(y<this.minY){y=this.minY;}if(y>this.maxY){y=this.maxY;}}x=this.getTick(x,this.xTicks);y=this.getTick(y,this.yTicks);return {x:x,y:y};},applyConfig:function(){YAHOO.util.DD.superclass.applyConfig.call(this);this.scroll=(this.config.scroll!==false);},b4MouseDown:function(e){this.autoOffset(YAHOO.util.Event.getPageX(e),YAHOO.util.Event.getPageY(e));},b4Drag:function(e){this.setDragElPos(YAHOO.util.Event.getPageX(e),YAHOO.util.Event.getPageY(e));},toString:function(){return ("DD "+this.id);}});YAHOO.util.DDProxy=function(id,_142,_143){if(id){this.init(id,_142,_143);this.initFrame();}};YAHOO.util.DDProxy.dragElId="ygddfdiv";YAHOO.extend(YAHOO.util.DDProxy,YAHOO.util.DD,{resizeFrame:true,centerFrame:false,createFrame:function(){var self=this;var body=document.body;if(!body||!body.firstChild){setTimeout(function(){self.createFrame();},50);return;}var div=this.getDragEl();if(!div){div=document.createElement("div");div.id=this.dragElId;var s=div.style;s.position="absolute";s.visibility="hidden";s.cursor="move";s.border="2px solid #aaa";s.zIndex=999;body.insertBefore(div,body.firstChild);}},initFrame:function(){this.createFrame();},applyConfig:function(){YAHOO.util.DDProxy.superclass.applyConfig.call(this);this.resizeFrame=(this.config.resizeFrame!==false);this.centerFrame=(this.config.centerFrame);this.setDragElId(this.config.dragElId||YAHOO.util.DDProxy.dragElId);},showFrame:function(_147,_148){var el=this.getEl();var _149=this.getDragEl();var s=_149.style;this._resizeProxy();if(this.centerFrame){this.setDelta(Math.round(parseInt(s.width,10)/2),Math.round(parseInt(s.height,10)/2));}this.setDragElPos(_147,_148);YAHOO.util.Dom.setStyle(_149,"visibility","visible");},_resizeProxy:function(){if(this.resizeFrame){var DOM=YAHOO.util.Dom;var el=this.getEl();var _151=this.getDragEl();var bt=parseInt(DOM.getStyle(_151,"borderTopWidth"),10);var br=parseInt(DOM.getStyle(_151,"borderRightWidth"),10);var bb=parseInt(DOM.getStyle(_151,"borderBottomWidth"),10);var bl=parseInt(DOM.getStyle(_151,"borderLeftWidth"),10);if(isNaN(bt)){bt=0;}if(isNaN(br)){br=0;}if(isNaN(bb)){bb=0;}if(isNaN(bl)){bl=0;}var _156=Math.max(0,el.offsetWidth-br-bl);var _157=Math.max(0,el.offsetHeight-bt-bb);DOM.setStyle(_151,"width",_156+"px");DOM.setStyle(_151,"height",_157+"px");}},b4MouseDown:function(e){var x=YAHOO.util.Event.getPageX(e);var y=YAHOO.util.Event.getPageY(e);this.autoOffset(x,y);this.setDragElPos(x,y);},b4StartDrag:function(x,y){this.showFrame(x,y);},b4EndDrag:function(e){YAHOO.util.Dom.setStyle(this.getDragEl(),"visibility","hidden");},endDrag:function(e){var DOM=YAHOO.util.Dom;var lel=this.getEl();var del=this.getDragEl();DOM.setStyle(del,"visibility","");DOM.setStyle(lel,"visibility","hidden");YAHOO.util.DDM.moveToEl(lel,del);DOM.setStyle(del,"visibility","hidden");DOM.setStyle(lel,"visibility","");},toString:function(){return ("DDProxy "+this.id);}});YAHOO.util.DDTarget=function(id,_160,_161){if(id){this.initTarget(id,_160,_161);}};YAHOO.extend(YAHOO.util.DDTarget,YAHOO.util.DragDrop,{toString:function(){return ("DDTarget "+this.id);}});
/* Copyright (c) 2006, Yahoo! Inc. All rights reserved.Code licensed under the BSD License:http://developer.yahoo.net/yui/license.txtversion: 0.12.0 */ YAHOO.util.Anim=function(el,attributes,duration,method){if(el){this.init(el,attributes,duration,method);}};YAHOO.util.Anim.prototype={toString:function(){var el=this.getEl();var id=el.id||el.tagName;return("Anim "+id);},patterns:{noNegatives:/width|height|opacity|padding/i,offsetAttribute:/^((width|height)|(top|left))$/,defaultUnit:/width|height|top$|bottom$|left$|right$/i,offsetUnit:/\d+(em|%|en|ex|pt|in|cm|mm|pc)$/i},doMethod:function(attr,start,end){return this.method(this.currentFrame,start,end-start,this.totalFrames);},setAttribute:function(attr,val,unit){if(this.patterns.noNegatives.test(attr)){val=(val>0)?val:0;}YAHOO.util.Dom.setStyle(this.getEl(),attr,val+unit);},getAttribute:function(attr){var el=this.getEl();var val=YAHOO.util.Dom.getStyle(el,attr);if(val!=='auto'&&!this.patterns.offsetUnit.test(val)){return parseFloat(val);}var a=this.patterns.offsetAttribute.exec(attr)||[];var pos=!!(a[3]);var box=!!(a[2]);if(box||(YAHOO.util.Dom.getStyle(el,'position')=='absolute'&&pos)){val=el['offset'+a[0].charAt(0).toUpperCase()+a[0].substr(1)];}else{val=0;}return val;},getDefaultUnit:function(attr){if(this.patterns.defaultUnit.test(attr)){return'px';}return'';},setRuntimeAttribute:function(attr){var start;var end;var attributes=this.attributes;this.runtimeAttributes[attr]={};var isset=function(prop){return(typeof prop!=='undefined');};if(!isset(attributes[attr]['to'])&&!isset(attributes[attr]['by'])){return false;}start=(isset(attributes[attr]['from']))?attributes[attr]['from']:this.getAttribute(attr);if(isset(attributes[attr]['to'])){end=attributes[attr]['to'];}else if(isset(attributes[attr]['by'])){if(start.constructor==Array){end=[];for(var i=0,len=start.length;i<len;++i){end[i]=start[i]+attributes[attr]['by'][i];}}else{end=start+attributes[attr]['by'];}}this.runtimeAttributes[attr].start=start;this.runtimeAttributes[attr].end=end;this.runtimeAttributes[attr].unit=(isset(attributes[attr].unit))?attributes[attr]['unit']:this.getDefaultUnit(attr);},init:function(el,attributes,duration,method){var isAnimated=false;var startTime=null;var actualFrames=0;el=YAHOO.util.Dom.get(el);this.attributes=attributes||{};this.duration=duration||1;this.method=method||YAHOO.util.Easing.easeNone;this.useSeconds=true;this.currentFrame=0;this.totalFrames=YAHOO.util.AnimMgr.fps;this.getEl=function(){return el;};this.isAnimated=function(){return isAnimated;};this.getStartTime=function(){return startTime;};this.runtimeAttributes={};this.animate=function(){if(this.isAnimated()){return false;}this.currentFrame=0;this.totalFrames=(this.useSeconds)?Math.ceil(YAHOO.util.AnimMgr.fps*this.duration):this.duration;YAHOO.util.AnimMgr.registerElement(this);};this.stop=function(finish){if(finish){this.currentFrame=this.totalFrames;this._onTween.fire();}YAHOO.util.AnimMgr.stop(this);};var onStart=function(){this.onStart.fire();this.runtimeAttributes={};for(var attr in this.attributes){this.setRuntimeAttribute(attr);}isAnimated=true;actualFrames=0;startTime=new Date();};var onTween=function(){var data={duration:new Date()-this.getStartTime(),currentFrame:this.currentFrame};data.toString=function(){return('duration: '+data.duration+', currentFrame: '+data.currentFrame);};this.onTween.fire(data);var runtimeAttributes=this.runtimeAttributes;for(var attr in runtimeAttributes){this.setAttribute(attr,this.doMethod(attr,runtimeAttributes[attr].start,runtimeAttributes[attr].end),runtimeAttributes[attr].unit);}actualFrames+=1;};var onComplete=function(){var actual_duration=(new Date()-startTime)/1000;var data={duration:actual_duration,frames:actualFrames,fps:actualFrames/actual_duration};data.toString=function(){return('duration: '+data.duration+', frames: '+data.frames+', fps: '+data.fps);};isAnimated=false;actualFrames=0;this.onComplete.fire(data);};this._onStart=new YAHOO.util.CustomEvent('_start',this,true);this.onStart=new YAHOO.util.CustomEvent('start',this);this.onTween=new YAHOO.util.CustomEvent('tween',this);this._onTween=new YAHOO.util.CustomEvent('_tween',this,true);this.onComplete=new YAHOO.util.CustomEvent('complete',this);this._onComplete=new YAHOO.util.CustomEvent('_complete',this,true);this._onStart.subscribe(onStart);this._onTween.subscribe(onTween);this._onComplete.subscribe(onComplete);}};YAHOO.util.AnimMgr=new function(){var thread=null;var queue=[];var tweenCount=0;this.fps=200;this.delay=1;this.registerElement=function(tween){queue[queue.length]=tween;tweenCount+=1;tween._onStart.fire();this.start();};this.unRegister=function(tween,index){tween._onComplete.fire();index=index||getIndex(tween);if(index!=-1){queue.splice(index,1);}tweenCount-=1;if(tweenCount<=0){this.stop();}};this.start=function(){if(thread===null){thread=setInterval(this.run,this.delay);}};this.stop=function(tween){if(!tween){clearInterval(thread);for(var i=0,len=queue.length;i<len;++i){if(queue[i].isAnimated()){this.unRegister(tween,i);}}queue=[];thread=null;tweenCount=0;}else{this.unRegister(tween);}};this.run=function(){for(var i=0,len=queue.length;i<len;++i){var tween=queue[i];if(!tween||!tween.isAnimated()){continue;}if(tween.currentFrame<tween.totalFrames||tween.totalFrames===null){tween.currentFrame+=1;if(tween.useSeconds){correctFrame(tween);}tween._onTween.fire();}else{YAHOO.util.AnimMgr.stop(tween,i);}}};var getIndex=function(anim){for(var i=0,len=queue.length;i<len;++i){if(queue[i]==anim){return i;}}return-1;};var correctFrame=function(tween){var frames=tween.totalFrames;var frame=tween.currentFrame;var expected=(tween.currentFrame*tween.duration*1000/tween.totalFrames);var elapsed=(new Date()-tween.getStartTime());var tweak=0;if(elapsed<tween.duration*1000){tweak=Math.round((elapsed/expected-1)*tween.currentFrame);}else{tweak=frames-(frame+1);}if(tweak>0&&isFinite(tweak)){if(tween.currentFrame+tweak>=frames){tweak=frames-(frame+1);}tween.currentFrame+=tweak;}};};YAHOO.util.Bezier=new function(){this.getPosition=function(points,t){var n=points.length;var tmp=[];for(var i=0;i<n;++i){tmp[i]=[points[i][0],points[i][1]];}for(var j=1;j<n;++j){for(i=0;i<n-j;++i){tmp[i][0]=(1-t)*tmp[i][0]+t*tmp[parseInt(i+1,10)][0];tmp[i][1]=(1-t)*tmp[i][1]+t*tmp[parseInt(i+1,10)][1];}}return[tmp[0][0],tmp[0][1]];};};(function(){YAHOO.util.ColorAnim=function(el,attributes,duration,method){YAHOO.util.ColorAnim.superclass.constructor.call(this,el,attributes,duration,method);};YAHOO.extend(YAHOO.util.ColorAnim,YAHOO.util.Anim);var Y=YAHOO.util;var superclass=Y.ColorAnim.superclass;var proto=Y.ColorAnim.prototype;proto.toString=function(){var el=this.getEl();var id=el.id||el.tagName;return("ColorAnim "+id);};proto.patterns.color=/color$/i;proto.patterns.rgb=/^rgb\(([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\)$/i;proto.patterns.hex=/^#?([0-9A-F]{2})([0-9A-F]{2})([0-9A-F]{2})$/i;proto.patterns.hex3=/^#?([0-9A-F]{1})([0-9A-F]{1})([0-9A-F]{1})$/i;proto.patterns.transparent=/^transparent|rgba\(0, 0, 0, 0\)$/;proto.parseColor=function(s){if(s.length==3){return s;}var c=this.patterns.hex.exec(s);if(c&&c.length==4){return[parseInt(c[1],16),parseInt(c[2],16),parseInt(c[3],16)];}c=this.patterns.rgb.exec(s);if(c&&c.length==4){return[parseInt(c[1],10),parseInt(c[2],10),parseInt(c[3],10)];}c=this.patterns.hex3.exec(s);if(c&&c.length==4){return[parseInt(c[1]+c[1],16),parseInt(c[2]+c[2],16),parseInt(c[3]+c[3],16)];}return null;};proto.getAttribute=function(attr){var el=this.getEl();if(this.patterns.color.test(attr)){var val=YAHOO.util.Dom.getStyle(el,attr);if(this.patterns.transparent.test(val)){var parent=el.parentNode;val=Y.Dom.getStyle(parent,attr);while(parent&&this.patterns.transparent.test(val)){parent=parent.parentNode;val=Y.Dom.getStyle(parent,attr);if(parent.tagName.toUpperCase()=='HTML'){val='#fff';}}}}else{val=superclass.getAttribute.call(this,attr);}return val;};proto.doMethod=function(attr,start,end){var val;if(this.patterns.color.test(attr)){val=[];for(var i=0,len=start.length;i<len;++i){val[i]=superclass.doMethod.call(this,attr,start[i],end[i]);}val='rgb('+Math.floor(val[0])+','+Math.floor(val[1])+','+Math.floor(val[2])+')';}else{val=superclass.doMethod.call(this,attr,start,end);}return val;};proto.setRuntimeAttribute=function(attr){superclass.setRuntimeAttribute.call(this,attr);if(this.patterns.color.test(attr)){var attributes=this.attributes;var start=this.parseColor(this.runtimeAttributes[attr].start);var end=this.parseColor(this.runtimeAttributes[attr].end);if(typeof attributes[attr]['to']==='undefined'&&typeof attributes[attr]['by']!=='undefined'){end=this.parseColor(attributes[attr].by);for(var i=0,len=start.length;i<len;++i){end[i]=start[i]+end[i];}}this.runtimeAttributes[attr].start=start;this.runtimeAttributes[attr].end=end;}};})();YAHOO.util.Easing={easeNone:function(t,b,c,d){return c*t/d+b;},easeIn:function(t,b,c,d){return c*(t/=d)*t+b;},easeOut:function(t,b,c,d){return-c*(t/=d)*(t-2)+b;},easeBoth:function(t,b,c,d){if((t/=d/2)<1)return c/2*t*t+b;return-c/2*((--t)*(t-2)-1)+b;},easeInStrong:function(t,b,c,d){return c*(t/=d)*t*t*t+b;},easeOutStrong:function(t,b,c,d){return-c*((t=t/d-1)*t*t*t-1)+b;},easeBothStrong:function(t,b,c,d){if((t/=d/2)<1)return c/2*t*t*t*t+b;return-c/2*((t-=2)*t*t*t-2)+b;},elasticIn:function(t,b,c,d,a,p){if(t==0)return b;if((t/=d)==1)return b+c;if(!p)p=d*.3;if(!a||a<Math.abs(c)){a=c;var s=p/4;}else var s=p/(2*Math.PI)*Math.asin(c/a);return-(a*Math.pow(2,10*(t-=1))*Math.sin((t*d-s)*(2*Math.PI)/p))+b;},elasticOut:function(t,b,c,d,a,p){if(t==0)return b;if((t/=d)==1)return b+c;if(!p)p=d*.3;if(!a||a<Math.abs(c)){a=c;var s=p/4;}else var s=p/(2*Math.PI)*Math.asin(c/a);return a*Math.pow(2,-10*t)*Math.sin((t*d-s)*(2*Math.PI)/p)+c+b;},elasticBoth:function(t,b,c,d,a,p){if(t==0)return b;if((t/=d/2)==2)return b+c;if(!p)p=d*(.3*1.5);if(!a||a<Math.abs(c)){a=c;var s=p/4;}else var s=p/(2*Math.PI)*Math.asin(c/a);if(t<1)return-.5*(a*Math.pow(2,10*(t-=1))*Math.sin((t*d-s)*(2*Math.PI)/p))+b;return a*Math.pow(2,-10*(t-=1))*Math.sin((t*d-s)*(2*Math.PI)/p)*.5+c+b;},backIn:function(t,b,c,d,s){if(typeof s=='undefined')s=1.70158;return c*(t/=d)*t*((s+1)*t-s)+b;},backOut:function(t,b,c,d,s){if(typeof s=='undefined')s=1.70158;return c*((t=t/d-1)*t*((s+1)*t+s)+1)+b;},backBoth:function(t,b,c,d,s){if(typeof s=='undefined')s=1.70158;if((t/=d/2)<1)return c/2*(t*t*(((s*=(1.525))+1)*t-s))+b;return c/2*((t-=2)*t*(((s*=(1.525))+1)*t+s)+2)+b;},bounceIn:function(t,b,c,d){return c-YAHOO.util.Easing.bounceOut(d-t,0,c,d)+b;},bounceOut:function(t,b,c,d){if((t/=d)<(1/2.75)){return c*(7.5625*t*t)+b;}else if(t<(2/2.75)){return c*(7.5625*(t-=(1.5/2.75))*t+.75)+b;}else if(t<(2.5/2.75)){return c*(7.5625*(t-=(2.25/2.75))*t+.9375)+b;}else{return c*(7.5625*(t-=(2.625/2.75))*t+.984375)+b;}},bounceBoth:function(t,b,c,d){if(t<d/2)return YAHOO.util.Easing.bounceIn(t*2,0,c,d)*.5+b;return YAHOO.util.Easing.bounceOut(t*2-d,0,c,d)*.5+c*.5+b;}};(function(){YAHOO.util.Motion=function(el,attributes,duration,method){if(el){YAHOO.util.Motion.superclass.constructor.call(this,el,attributes,duration,method);}};YAHOO.extend(YAHOO.util.Motion,YAHOO.util.ColorAnim);var Y=YAHOO.util;var superclass=Y.Motion.superclass;var proto=Y.Motion.prototype;proto.toString=function(){var el=this.getEl();var id=el.id||el.tagName;return("Motion "+id);};proto.patterns.points=/^points$/i;proto.setAttribute=function(attr,val,unit){if(this.patterns.points.test(attr)){unit=unit||'px';superclass.setAttribute.call(this,'left',val[0],unit);superclass.setAttribute.call(this,'top',val[1],unit);}else{superclass.setAttribute.call(this,attr,val,unit);}};proto.getAttribute=function(attr){if(this.patterns.points.test(attr)){var val=[superclass.getAttribute.call(this,'left'),superclass.getAttribute.call(this,'top')];}else{val=superclass.getAttribute.call(this,attr);}return val;};proto.doMethod=function(attr,start,end){var val=null;if(this.patterns.points.test(attr)){var t=this.method(this.currentFrame,0,100,this.totalFrames)/100;val=Y.Bezier.getPosition(this.runtimeAttributes[attr],t);}else{val=superclass.doMethod.call(this,attr,start,end);}return val;};proto.setRuntimeAttribute=function(attr){if(this.patterns.points.test(attr)){var el=this.getEl();var attributes=this.attributes;var start;var control=attributes['points']['control']||[];var end;var i,len;if(control.length>0&&!(control[0]instanceof Array)){control=[control];}else{var tmp=[];for(i=0,len=control.length;i<len;++i){tmp[i]=control[i];}control=tmp;}if(Y.Dom.getStyle(el,'position')=='static'){Y.Dom.setStyle(el,'position','relative');}if(isset(attributes['points']['from'])){Y.Dom.setXY(el,attributes['points']['from']);}else{Y.Dom.setXY(el,Y.Dom.getXY(el));}start=this.getAttribute('points');if(isset(attributes['points']['to'])){end=translateValues.call(this,attributes['points']['to'],start);var pageXY=Y.Dom.getXY(this.getEl());for(i=0,len=control.length;i<len;++i){control[i]=translateValues.call(this,control[i],start);}}else if(isset(attributes['points']['by'])){end=[start[0]+attributes['points']['by'][0],start[1]+attributes['points']['by'][1]];for(i=0,len=control.length;i<len;++i){control[i]=[start[0]+control[i][0],start[1]+control[i][1]];}}this.runtimeAttributes[attr]=[start];if(control.length>0){this.runtimeAttributes[attr]=this.runtimeAttributes[attr].concat(control);}this.runtimeAttributes[attr][this.runtimeAttributes[attr].length]=end;}else{superclass.setRuntimeAttribute.call(this,attr);}};var translateValues=function(val,start){var pageXY=Y.Dom.getXY(this.getEl());val=[val[0]-pageXY[0]+start[0],val[1]-pageXY[1]+start[1]];return val;};var isset=function(prop){return(typeof prop!=='undefined');};})();(function(){YAHOO.util.Scroll=function(el,attributes,duration,method){if(el){YAHOO.util.Scroll.superclass.constructor.call(this,el,attributes,duration,method);}};YAHOO.extend(YAHOO.util.Scroll,YAHOO.util.ColorAnim);var Y=YAHOO.util;var superclass=Y.Scroll.superclass;var proto=Y.Scroll.prototype;proto.toString=function(){var el=this.getEl();var id=el.id||el.tagName;return("Scroll "+id);};proto.doMethod=function(attr,start,end){var val=null;if(attr=='scroll'){val=[this.method(this.currentFrame,start[0],end[0]-start[0],this.totalFrames),this.method(this.currentFrame,start[1],end[1]-start[1],this.totalFrames)];}else{val=superclass.doMethod.call(this,attr,start,end);}return val;};proto.getAttribute=function(attr){var val=null;var el=this.getEl();if(attr=='scroll'){val=[el.scrollLeft,el.scrollTop];}else{val=superclass.getAttribute.call(this,attr);}return val;};proto.setAttribute=function(attr,val,unit){var el=this.getEl();if(attr=='scroll'){el.scrollLeft=val[0];el.scrollTop=val[1];}else{superclass.setAttribute.call(this,attr,val,unit);}};})();

YAHOO.util.Config=function(owner){if(owner){this.init(owner);}};var _PERF={addClass:function(obj,className){if(obj.classes)
obj.classes.push(className);else
YAHOO.util.Dom.addClass(obj,className);}};YAHOO.util.Config.prototype={owner:null,queueInProgress:false,checkBoolean:function(val){if(typeof val=='boolean'){return true;}else{return false;}},checkNumber:function(val){if(isNaN(val)){return false;}else{return true;}}};YAHOO.util.Config.prototype.init=function(owner){this.owner=owner;this.configChangedEvent=new YAHOO.util.CustomEvent("configChanged");this.queueInProgress=false;var config={};var initialConfig={};var eventQueue=[];var fireEvent=function(key,value){key=key.toLowerCase();var property=config[key];if(typeof property!='undefined'&&property.event){property.event.fire(value);}};this.addProperty=function(key,propertyObject){key=key.toLowerCase();config[key]=propertyObject;propertyObject.event=new YAHOO.util.CustomEvent(key);propertyObject.key=key;if(propertyObject.handler){propertyObject.event.subscribe(propertyObject.handler,this.owner,true);}
this.setProperty(key,propertyObject.value,true);if(!propertyObject.suppressEvent){this.queueProperty(key,propertyObject.value);}};this.getConfig=function(){var cfg={};for(var prop in config){var property=config[prop];if(typeof property!='undefined'&&property.event){cfg[prop]=property.value;}}
return cfg;};this.getProperty=function(key){key=key.toLowerCase();var property=config[key];if(typeof property!='undefined'&&property.event){return property.value;}else{return undefined;}};this.resetProperty=function(key){key=key.toLowerCase();var property=config[key];if(typeof property!='undefined'&&property.event){if(initialConfig[key]&&initialConfig[key]!='undefined'){this.setProperty(key,initialConfig[key]);}
return true;}else{return false;}};this.setProperty=function(key,value,silent){key=key.toLowerCase();if(this.queueInProgress&&!silent){this.queueProperty(key,value);return true;}else{var property=config[key];if(typeof property!='undefined'&&property.event){if(property.validator&&!property.validator(value)){return false;}else{property.value=value;if(!silent){fireEvent(key,value);this.configChangedEvent.fire([key,value]);}
return true;}}else{return false;}}};this.queueProperty=function(key,value){key=key.toLowerCase();var property=config[key];if(typeof property!='undefined'&&property.event){if(typeof value!='undefined'&&property.validator&&!property.validator(value)){return false;}else{if(typeof value!='undefined'){property.value=value;}else{value=property.value;}
var foundDuplicate=false;for(var i=0;i<eventQueue.length;i++){var queueItem=eventQueue[i];if(queueItem){var queueItemKey=queueItem[0];var queueItemValue=queueItem[1];if(queueItemKey.toLowerCase()==key){eventQueue[i]=null;eventQueue.push([key,(typeof value!='undefined'?value:queueItemValue)]);foundDuplicate=true;break;}}}
if(!foundDuplicate&&typeof value!='undefined'){eventQueue.push([key,value]);}}
if(property.supercedes){for(var s=0;s<property.supercedes.length;s++){var supercedesCheck=property.supercedes[s];for(var q=0;q<eventQueue.length;q++){var queueItemCheck=eventQueue[q];if(queueItemCheck){var queueItemCheckKey=queueItemCheck[0];var queueItemCheckValue=queueItemCheck[1];if(queueItemCheckKey.toLowerCase()==supercedesCheck.toLowerCase()){eventQueue.push([queueItemCheckKey,queueItemCheckValue]);eventQueue[q]=null;break;}}}}}
return true;}else{return false;}};this.refireEvent=function(key){key=key.toLowerCase();var property=config[key];if(typeof property!='undefined'&&property.event&&typeof property.value!='undefined'){if(this.queueInProgress){this.queueProperty(key);}else{fireEvent(key,property.value);}}};this.applyConfig=function(userConfig,init){if(init){initialConfig=userConfig;}
for(var prop in userConfig){this.queueProperty(prop,userConfig[prop]);}};this.refresh=function(){for(var prop in config){this.refireEvent(prop);}};this.fireQueue=function(){this.queueInProgress=true;for(var i=0;i<eventQueue.length;i++){var queueItem=eventQueue[i];if(queueItem){var key=queueItem[0];var value=queueItem[1];var property=config[key];property.value=value;fireEvent(key,value);}}
this.queueInProgress=false;eventQueue=[];};this.subscribeToConfigEvent=function(key,handler,obj,override){key=key.toLowerCase();var property=config[key];if(typeof property!='undefined'&&property.event){if(!YAHOO.util.Config.alreadySubscribed(property.event,handler,obj)){property.event.subscribe(handler,obj,override);}
return true;}else{return false;}};this.unsubscribeFromConfigEvent=function(key,handler,obj){key=key.toLowerCase();var property=config[key];if(typeof property!='undefined'&&property.event){return property.event.unsubscribe(handler,obj);}else{return false;}};this.toString=function(){var output="Config";if(this.owner){output+=" ["+this.owner.toString()+"]";}
return output;};this.outputEventQueue=function(){var output="";for(var q=0;q<eventQueue.length;q++){var queueItem=eventQueue[q];if(queueItem){output+=queueItem[0]+"="+queueItem[1]+", ";}}
return output;};};YAHOO.util.Config.alreadySubscribed=function(evt,fn,obj){for(var e=0;e<evt.subscribers.length;e++){var subsc=evt.subscribers[e];if(subsc&&subsc.obj==obj&&subsc.fn==fn){return true;}}
return false;};YAHOO.widget.DateMath={DAY:"D",WEEK:"W",YEAR:"Y",MONTH:"M",ONE_DAY_MS:1000*60*60*24,add:function(date,field,amount){var d=new Date(date.getTime());switch(field){case this.MONTH:var newMonth=date.getMonth()+amount;var years=0;if(newMonth<0){while(newMonth<0){newMonth+=12;years-=1;}}else if(newMonth>11){while(newMonth>11){newMonth-=12;years+=1;}}
d.setMonth(newMonth);d.setFullYear(date.getFullYear()+years);break;case this.DAY:d.setDate(date.getDate()+amount);break;case this.YEAR:d.setFullYear(date.getFullYear()+amount);break;case this.WEEK:d.setDate(date.getDate()+(amount*7));break;}
return d;},subtract:function(date,field,amount){return this.add(date,field,(amount*-1));},before:function(date,compareTo){var ms=compareTo.getTime();if(date.getTime()<ms){return true;}else{return false;}},after:function(date,compareTo){var ms=compareTo.getTime();if(date.getTime()>ms){return true;}else{return false;}},between:function(date,dateBegin,dateEnd){if(this.after(date,dateBegin)&&this.before(date,dateEnd)){return true;}else{return false;}},getJan1:function(calendarYear){return new Date(calendarYear,0,1);},getDayOffset:function(date,calendarYear){var beginYear=this.getJan1(calendarYear);var dayOffset=Math.ceil((date.getTime()-beginYear.getTime())/this.ONE_DAY_MS);return dayOffset;},getWeekNumber:function(date,calendarYear){date=this.clearTime(date);var nearestThurs=new Date(date.getTime()+(4*this.ONE_DAY_MS)-((date.getDay())*this.ONE_DAY_MS));var jan1=new Date(nearestThurs.getFullYear(),0,1);var dayOfYear=((nearestThurs.getTime()-jan1.getTime())/this.ONE_DAY_MS)-1;var weekNum=Math.ceil((dayOfYear)/7);return weekNum;},isYearOverlapWeek:function(weekBeginDate){var overlaps=false;var nextWeek=this.add(weekBeginDate,this.DAY,6);if(nextWeek.getFullYear()!=weekBeginDate.getFullYear()){overlaps=true;}
return overlaps;},isMonthOverlapWeek:function(weekBeginDate){var overlaps=false;var nextWeek=this.add(weekBeginDate,this.DAY,6);if(nextWeek.getMonth()!=weekBeginDate.getMonth()){overlaps=true;}
return overlaps;},findMonthStart:function(date){var start=new Date(date.getFullYear(),date.getMonth(),1);return start;},findMonthEnd:function(date){var start=this.findMonthStart(date);var nextMonth=this.add(start,this.MONTH,1);var end=this.subtract(nextMonth,this.DAY,1);return end;},clearTime:function(date){date.setHours(12,0,0,0);return date;}};YAHOO.widget.Calendar=function(id,containerId,config){this.init(id,containerId,config);};YAHOO.widget.Calendar.IMG_ROOT=(window.location.href.toLowerCase().indexOf("https")===0?"https://a248.e.akamai.net/sec.yimg.com/i/":"http://us.i1.yimg.com/us.yimg.com/i/");YAHOO.widget.Calendar.DATE="D";YAHOO.widget.Calendar.MONTH_DAY="MD";YAHOO.widget.Calendar.WEEKDAY="WD";YAHOO.widget.Calendar.RANGE="R";YAHOO.widget.Calendar.MONTH="M";YAHOO.widget.Calendar.DISPLAY_DAYS=42;YAHOO.widget.Calendar.STOP_RENDER="S";YAHOO.widget.Calendar.prototype={Config:null,parent:null,index:-1,cells:null,cellDates:null,id:null,oDomContainer:null,today:null,renderStack:null,_renderStack:null,_pageDate:null,_selectedDates:null,domEventMap:null};YAHOO.widget.Calendar.prototype.init=function(id,containerId,config){this.initEvents();this.today=new Date();YAHOO.widget.DateMath.clearTime(this.today);this.id=id;this.oDomContainer=document.getElementById(containerId);this.cfg=new YAHOO.util.Config(this);this.Options={};this.Locale={};this.initStyles();_PERF.addClass(this.oDomContainer,this.Style.CSS_CONTAINER);_PERF.addClass(this.oDomContainer,this.Style.CSS_SINGLE);this.cellDates=[];this.cells=[];this.renderStack=[];this._renderStack=[];this.setupConfig();if(config){this.cfg.applyConfig(config,true);}
this.cfg.fireQueue();};YAHOO.widget.Calendar.prototype.configIframe=function(type,args,obj){var useIframe=args[0];if(YAHOO.util.Dom.inDocument(this.oDomContainer)){if(useIframe){var pos=YAHOO.util.Dom.getStyle(this.oDomContainer,"position");if(this.browser=="ie"&&(pos=="absolute"||pos=="relative")){if(!YAHOO.util.Dom.inDocument(this.iframe)){this.iframe=document.createElement("iframe");this.iframe.src="javascript:false;";YAHOO.util.Dom.setStyle(this.iframe,"opacity","0");this.oDomContainer.insertBefore(this.iframe,this.oDomContainer.firstChild);}}}else{if(this.iframe){if(this.iframe.parentNode){this.iframe.parentNode.removeChild(this.iframe);}
this.iframe=null;}}}};YAHOO.widget.Calendar.prototype.configTitle=function(type,args,obj){var title=args[0];var close=this.cfg.getProperty("close");var titleDiv;if(title&&title!==""){titleDiv=YAHOO.util.Dom.getElementsByClassName(YAHOO.widget.CalendarGroup.CSS_2UPTITLE,"div",this.oDomContainer)[0]||document.createElement("div");titleDiv.className=YAHOO.widget.CalendarGroup.CSS_2UPTITLE;titleDiv.innerHTML=title;this.oDomContainer.insertBefore(titleDiv,this.oDomContainer.firstChild);_PERF.addClass(this.oDomContainer,"withtitle");}else{titleDiv=YAHOO.util.Dom.getElementsByClassName(YAHOO.widget.CalendarGroup.CSS_2UPTITLE,"div",this.oDomContainer)[0]||null;if(titleDiv){YAHOO.util.Event.purgeElement(titleDiv);this.oDomContainer.removeChild(titleDiv);}
if(!close){YAHOO.util.Dom.removeClass(this.oDomContainer,"withtitle");}}};YAHOO.widget.Calendar.prototype.configClose=function(type,args,obj){var close=args[0];var title=this.cfg.getProperty("title");var linkClose;if(close===true){linkClose=YAHOO.util.Dom.getElementsByClassName("link-close","a",this.oDomContainer)[0]||document.createElement("a");linkClose.href="javascript:void(null);";linkClose.className="link-close";YAHOO.util.Event.addListener(linkClose,"click",this.hide,this,true);var imgClose=document.createElement("img");imgClose.src=YAHOO.widget.Calendar.IMG_ROOT+"us/my/bn/x_d.gif";imgClose.className=YAHOO.widget.CalendarGroup.CSS_2UPCLOSE;linkClose.appendChild(imgClose);this.oDomContainer.appendChild(linkClose);_PERF.addClass(this.oDomContainer,"withtitle");}else{linkClose=YAHOO.util.Dom.getElementsByClassName("link-close","a",this.oDomContainer)[0]||null;if(linkClose){YAHOO.util.Event.purgeElement(linkClose);this.oDomContainer.removeChild(linkClose);}
if(!title||title===""){YAHOO.util.Dom.removeClass(this.oDomContainer,"withtitle");}}};YAHOO.widget.Calendar.prototype.initEvents=function(){this.beforeSelectEvent=new YAHOO.util.CustomEvent("beforeSelect");this.selectEvent=new YAHOO.util.CustomEvent("select");this.beforeDeselectEvent=new YAHOO.util.CustomEvent("beforeDeselect");this.deselectEvent=new YAHOO.util.CustomEvent("deselect");this.changePageEvent=new YAHOO.util.CustomEvent("changePage");this.beforeRenderEvent=new YAHOO.util.CustomEvent("beforeRender");this.renderEvent=new YAHOO.util.CustomEvent("render");this.resetEvent=new YAHOO.util.CustomEvent("reset");this.clearEvent=new YAHOO.util.CustomEvent("clear");this.beforeSelectEvent.subscribe(this.onBeforeSelect,this,true);this.selectEvent.subscribe(this.onSelect,this,true);this.beforeDeselectEvent.subscribe(this.onBeforeDeselect,this,true);this.deselectEvent.subscribe(this.onDeselect,this,true);this.changePageEvent.subscribe(this.onChangePage,this,true);this.renderEvent.subscribe(this.onRender,this,true);this.resetEvent.subscribe(this.onReset,this,true);this.clearEvent.subscribe(this.onClear,this,true);};YAHOO.widget.Calendar.prototype.doSelectCell=function(e,cal){var target=YAHOO.util.Event.getTarget(e);var cell,index,d,date;while(target.tagName.toLowerCase()!="td"&&!YAHOO.util.Dom.hasClass(target,cal.Style.CSS_CELL_SELECTABLE)){target=target.parentNode;if(target.tagName.toLowerCase()=="html"){return;}}
cell=target;if(YAHOO.util.Dom.hasClass(cell,cal.Style.CSS_CELL_SELECTABLE)){index=cell.id.split("cell")[1];d=cal.cellDates[index];date=new Date(d[0],d[1]-1,d[2]);var link;if(cal.Options.MULTI_SELECT){var cellDate=cal.cellDates[index];var cellDateIndex=cal._indexOfSelectedFieldArray(cellDate);if(cellDateIndex>-1){cal.deselectCell(index);}else{cal.selectCell(index);}}else{cal.selectCell(index);}}};YAHOO.widget.Calendar.prototype.doCellMouseOver=function(e,cal){var target;if(e){target=YAHOO.util.Event.getTarget(e);}else{target=this;}
while(target.tagName.toLowerCase()!="td"){target=target.parentNode;if(target.tagName.toLowerCase()=="html"){return;}}
if(YAHOO.util.Dom.hasClass(target,cal.Style.CSS_CELL_SELECTABLE)){_PERF.addClass(target,cal.Style.CSS_CELL_HOVER);}};YAHOO.widget.Calendar.prototype.doCellMouseOut=function(e,cal){var target;if(e){target=YAHOO.util.Event.getTarget(e);}else{target=this;}
while(target.tagName.toLowerCase()!="td"){target=target.parentNode;if(target.tagName.toLowerCase()=="html"){return;}}
if(YAHOO.util.Dom.hasClass(target,cal.Style.CSS_CELL_SELECTABLE)){YAHOO.util.Dom.removeClass(target,cal.Style.CSS_CELL_HOVER);}};YAHOO.widget.Calendar.prototype.setupConfig=function(){this.cfg.addProperty("pagedate",{value:new Date(),handler:this.configPageDate});this.cfg.addProperty("selected",{value:[],handler:this.configSelected});this.cfg.addProperty("title",{value:"",handler:this.configTitle});this.cfg.addProperty("close",{value:false,handler:this.configClose});this.cfg.addProperty("iframe",{value:true,handler:this.configIframe,validator:this.cfg.checkBoolean});this.cfg.addProperty("mindate",{value:null,handler:this.configMinDate});this.cfg.addProperty("maxdate",{value:null,handler:this.configMaxDate});this.cfg.addProperty("MULTI_SELECT",{value:false,handler:this.configOptions,validator:this.cfg.checkBoolean});this.cfg.addProperty("START_WEEKDAY",{value:0,handler:this.configOptions,validator:this.cfg.checkNumber});this.cfg.addProperty("SHOW_WEEKDAYS",{value:true,handler:this.configOptions,validator:this.cfg.checkBoolean});this.cfg.addProperty("SHOW_WEEK_HEADER",{value:false,handler:this.configOptions,validator:this.cfg.checkBoolean});this.cfg.addProperty("SHOW_WEEK_FOOTER",{value:false,handler:this.configOptions,validator:this.cfg.checkBoolean});this.cfg.addProperty("HIDE_BLANK_WEEKS",{value:false,handler:this.configOptions,validator:this.cfg.checkBoolean});this.cfg.addProperty("NAV_ARROW_LEFT",{value:YAHOO.widget.Calendar.IMG_ROOT+"us/tr/callt.gif",handler:this.configOptions});this.cfg.addProperty("NAV_ARROW_RIGHT",{value:YAHOO.widget.Calendar.IMG_ROOT+"us/tr/calrt.gif",handler:this.configOptions});this.cfg.addProperty("MONTHS_SHORT",{value:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],handler:this.configLocale});this.cfg.addProperty("MONTHS_LONG",{value:["January","February","March","April","May","June","July","August","September","October","November","December"],handler:this.configLocale});this.cfg.addProperty("WEEKDAYS_1CHAR",{value:["S","M","T","W","T","F","S"],handler:this.configLocale});this.cfg.addProperty("WEEKDAYS_SHORT",{value:["Su","Mo","Tu","We","Th","Fr","Sa"],handler:this.configLocale});this.cfg.addProperty("WEEKDAYS_MEDIUM",{value:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],handler:this.configLocale});this.cfg.addProperty("WEEKDAYS_LONG",{value:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],handler:this.configLocale});var refreshLocale=function(){this.cfg.refireEvent("LOCALE_MONTHS");this.cfg.refireEvent("LOCALE_WEEKDAYS");};this.cfg.subscribeToConfigEvent("START_WEEKDAY",refreshLocale,this,true);this.cfg.subscribeToConfigEvent("MONTHS_SHORT",refreshLocale,this,true);this.cfg.subscribeToConfigEvent("MONTHS_LONG",refreshLocale,this,true);this.cfg.subscribeToConfigEvent("WEEKDAYS_1CHAR",refreshLocale,this,true);this.cfg.subscribeToConfigEvent("WEEKDAYS_SHORT",refreshLocale,this,true);this.cfg.subscribeToConfigEvent("WEEKDAYS_MEDIUM",refreshLocale,this,true);this.cfg.subscribeToConfigEvent("WEEKDAYS_LONG",refreshLocale,this,true);this.cfg.addProperty("LOCALE_MONTHS",{value:"long",handler:this.configLocaleValues});this.cfg.addProperty("LOCALE_WEEKDAYS",{value:"short",handler:this.configLocaleValues});this.cfg.addProperty("DATE_DELIMITER",{value:",",handler:this.configLocale});this.cfg.addProperty("DATE_FIELD_DELIMITER",{value:"/",handler:this.configLocale});this.cfg.addProperty("DATE_RANGE_DELIMITER",{value:"-",handler:this.configLocale});this.cfg.addProperty("MY_MONTH_POSITION",{value:1,handler:this.configLocale,validator:this.cfg.checkNumber});this.cfg.addProperty("MY_YEAR_POSITION",{value:2,handler:this.configLocale,validator:this.cfg.checkNumber});this.cfg.addProperty("MD_MONTH_POSITION",{value:1,handler:this.configLocale,validator:this.cfg.checkNumber});this.cfg.addProperty("MD_DAY_POSITION",{value:2,handler:this.configLocale,validator:this.cfg.checkNumber});this.cfg.addProperty("MDY_MONTH_POSITION",{value:1,handler:this.configLocale,validator:this.cfg.checkNumber});this.cfg.addProperty("MDY_DAY_POSITION",{value:2,handler:this.configLocale,validator:this.cfg.checkNumber});this.cfg.addProperty("MDY_YEAR_POSITION",{value:3,handler:this.configLocale,validator:this.cfg.checkNumber});};YAHOO.widget.Calendar.prototype.configPageDate=function(type,args,obj){var val=args[0];var month,year,aMonthYear;if(val){if(val instanceof Date){val=YAHOO.widget.DateMath.findMonthStart(val);this.cfg.setProperty("pagedate",val,true);if(!this._pageDate){this._pageDate=this.cfg.getProperty("pagedate");}
return;}else{aMonthYear=val.split(this.cfg.getProperty("DATE_FIELD_DELIMITER"));month=parseInt(aMonthYear[this.cfg.getProperty("MY_MONTH_POSITION")-1],10)-1;year=parseInt(aMonthYear[this.cfg.getProperty("MY_YEAR_POSITION")-1],10);}}else{month=this.today.getMonth();year=this.today.getFullYear();}
this.cfg.setProperty("pagedate",new Date(year,month,1),true);if(!this._pageDate){this._pageDate=this.cfg.getProperty("pagedate");}};YAHOO.widget.Calendar.prototype.configMinDate=function(type,args,obj){var val=args[0];if(typeof val=='string'){val=this._parseDate(val);this.cfg.setProperty("mindate",new Date(val[0],(val[1]-1),val[2]));}};YAHOO.widget.Calendar.prototype.configMaxDate=function(type,args,obj){var val=args[0];if(typeof val=='string'){val=this._parseDate(val);this.cfg.setProperty("maxdate",new Date(val[0],(val[1]-1),val[2]));}};YAHOO.widget.Calendar.prototype.configSelected=function(type,args,obj){var selected=args[0];if(selected){if(typeof selected=='string'){this.cfg.setProperty("selected",this._parseDates(selected),true);}}
if(!this._selectedDates){this._selectedDates=this.cfg.getProperty("selected");}};YAHOO.widget.Calendar.prototype.configOptions=function(type,args,obj){type=type.toUpperCase();var val=args[0];this.Options[type]=val;};YAHOO.widget.Calendar.prototype.configLocale=function(type,args,obj){type=type.toUpperCase();var val=args[0];this.Locale[type]=val;this.cfg.refireEvent("LOCALE_MONTHS");this.cfg.refireEvent("LOCALE_WEEKDAYS");};YAHOO.widget.Calendar.prototype.configLocaleValues=function(type,args,obj){type=type.toUpperCase();var val=args[0];switch(type){case"LOCALE_MONTHS":switch(val){case"short":this.Locale.LOCALE_MONTHS=this.cfg.getProperty("MONTHS_SHORT").concat();break;case"long":this.Locale.LOCALE_MONTHS=this.cfg.getProperty("MONTHS_LONG").concat();break;}
break;case"LOCALE_WEEKDAYS":switch(val){case"1char":this.Locale.LOCALE_WEEKDAYS=this.cfg.getProperty("WEEKDAYS_1CHAR").concat();break;case"short":this.Locale.LOCALE_WEEKDAYS=this.cfg.getProperty("WEEKDAYS_SHORT").concat();break;case"medium":this.Locale.LOCALE_WEEKDAYS=this.cfg.getProperty("WEEKDAYS_MEDIUM").concat();break;case"long":this.Locale.LOCALE_WEEKDAYS=this.cfg.getProperty("WEEKDAYS_LONG").concat();break;}
var START_WEEKDAY=this.cfg.getProperty("START_WEEKDAY");if(START_WEEKDAY>0){for(var w=0;w<START_WEEKDAY;++w){this.Locale.LOCALE_WEEKDAYS.push(this.Locale.LOCALE_WEEKDAYS.shift());}}
break;}};YAHOO.widget.Calendar.prototype.initStyles=function(){this.Style={CSS_ROW_HEADER:"calrowhead",CSS_ROW_FOOTER:"calrowfoot",CSS_CELL:"calcell",CSS_CELL_SELECTED:"selected",CSS_CELL_SELECTABLE:"selectable",CSS_CELL_RESTRICTED:"restricted",CSS_CELL_TODAY:"today",CSS_CELL_OOM:"oom",CSS_CELL_OOB:"previous",CSS_HEADER:"calheader",CSS_HEADER_TEXT:"calhead",CSS_WEEKDAY_CELL:"calweekdaycell",CSS_WEEKDAY_ROW:"calweekdayrow",CSS_FOOTER:"calfoot",CSS_CALENDAR:"yui-calendar",CSS_SINGLE:"single",CSS_CONTAINER:"yui-calcontainer",CSS_NAV_LEFT:"calnavleft",CSS_NAV_RIGHT:"calnavright",CSS_CELL_TOP:"calcelltop",CSS_CELL_LEFT:"calcellleft",CSS_CELL_RIGHT:"calcellright",CSS_CELL_BOTTOM:"calcellbottom",CSS_CELL_HOVER:"calcellhover",CSS_CELL_HIGHLIGHT1:"highlight1",CSS_CELL_HIGHLIGHT2:"highlight2",CSS_CELL_HIGHLIGHT3:"highlight3",CSS_CELL_HIGHLIGHT4:"highlight4"};};YAHOO.widget.Calendar.prototype.buildMonthLabel=function(){var text=this.Locale.LOCALE_MONTHS[this.cfg.getProperty("pagedate").getMonth()]+" "+this.cfg.getProperty("pagedate").getFullYear();return text;};YAHOO.widget.Calendar.prototype.buildDayLabel=function(workingDate){var day=workingDate.getDate();return day;};YAHOO.widget.Calendar.prototype.renderHeader=function(html){var colSpan=7;if(this.cfg.getProperty("SHOW_WEEK_HEADER")){colSpan+=1;}
if(this.cfg.getProperty("SHOW_WEEK_FOOTER")){colSpan+=1;}
html[html.length]="<thead>";html[html.length]="<tr>";html[html.length]='<th colspan="'+colSpan+'" class="'+this.Style.CSS_HEADER_TEXT+'">';html[html.length]='<div align=center class="'+this.Style.CSS_HEADER+'">';var renderLeft,renderRight=false;if(this.parent){if(this.index===0){renderLeft=true;}
if(this.index==(this.parent.cfg.getProperty("pages")-1)){renderRight=true;}}else{renderLeft=true;renderRight=true;}
var cal=this.parent||this;html[html.length]="<table width='100%' cellspacing=0 cellpadding=0><tr><td>"
if(renderLeft){var nal=this.cfg.getProperty("NAV_ARROW_LEFT");if(nal.charAt('<'))
html[html.length]=nal;else
html[html.length]='<a class="'+this.Style.CSS_NAV_LEFT+'" style="background-image:url('+nal+')">&#160;</a>';}
html[html.length]="</td><td>";html[html.length]="<div class='"+this.Style.CSS_HEADER+"'>";html[html.length]=this.buildMonthLabel();html[html.length]="</div>"
html[html.length]="</td><td>"
if(renderRight){var nar=this.cfg.getProperty("NAV_ARROW_RIGHT");if(nar.charAt(0)=='<')
html[html.length]=nar;else
html[html.length]='<a class="'+this.Style.CSS_NAV_RIGHT+'" style="background-image:url('+nar+')">&#160;</a>';}
html[html.length]="</td></tr></table>"
html[html.length]='</div>';html[html.length]='</th>';html[html.length]='</tr>';if(this.cfg.getProperty("SHOW_WEEKDAYS")){html=this.buildWeekdays(html);}
html[html.length]='</thead>';return html;};YAHOO.widget.Calendar.prototype.buildWeekdays=function(html){html[html.length]='<tr class="'+this.Style.CSS_WEEKDAY_ROW+'">';if(this.cfg.getProperty("SHOW_WEEK_HEADER")){html[html.length]='<th>&#160;</th>';}
for(var i=0;i<this.Locale.LOCALE_WEEKDAYS.length;++i){html[html.length]='<th class="calweekdaycell">'+this.Locale.LOCALE_WEEKDAYS[i]+'</th>';}
if(this.cfg.getProperty("SHOW_WEEK_FOOTER")){html[html.length]='<th>&#160;</th>';}
html[html.length]='</tr>';return html;};YAHOO.widget.Calendar.prototype.renderBody=function(workingDate,html){var startDay=this.cfg.getProperty("START_WEEKDAY");this.preMonthDays=workingDate.getDay();if(startDay>0){this.preMonthDays-=startDay;}
if(this.preMonthDays<0){this.preMonthDays+=7;}
this.monthDays=YAHOO.widget.DateMath.findMonthEnd(workingDate).getDate();this.postMonthDays=YAHOO.widget.Calendar.DISPLAY_DAYS-this.preMonthDays-this.monthDays;workingDate=YAHOO.widget.DateMath.subtract(workingDate,YAHOO.widget.DateMath.DAY,this.preMonthDays);var useDate,weekNum,weekClass;useDate=this.cfg.getProperty("pagedate");html[html.length]='<tbody class="m'+(useDate.getMonth()+1)+'">';var i=0;var jan1=new Date(useDate.getFullYear(),0,1);var cal=this.parent||this;for(var r=0;r<6;r++){weekNum=YAHOO.widget.DateMath.getWeekNumber(workingDate,useDate.getFullYear(),startDay);weekClass="w"+weekNum;if(r!==0&&this.isDateOOM(workingDate)&&this.cfg.getProperty("HIDE_BLANK_WEEKS")===true){break;}else{html[html.length]='<tr class="'+weekClass+'">';if(this.cfg.getProperty("SHOW_WEEK_HEADER")){html=this.renderRowHeader(weekNum,html);}
for(var d=0;d<7;d++){var cellRenderers=[];var cell$$$$$$$$$$$={classes:[],innerHTML:"",id:null};cell$$$$$$$$$$$.classes.push("calcell");cell$$$$$$$$$$$.id=this.id+"_cell"+(r*7+d);var renderer=null;if(workingDate.getFullYear()==this.today.getFullYear()&&workingDate.getMonth()==this.today.getMonth()&&workingDate.getDate()==this.today.getDate()){cellRenderers[cellRenderers.length]=cal.renderCellStyleToday;}
this.cellDates[this.cellDates.length]=[workingDate.getFullYear(),workingDate.getMonth()+1,workingDate.getDate()];if(this.isDateOOM(workingDate)){cellRenderers[cellRenderers.length]=cal.renderCellNotThisMonth;}else{cell$$$$$$$$$$$.classes.push("wd"+workingDate.getDay());cell$$$$$$$$$$$.classes.push("d"+workingDate.getDate());for(var s=0;s<this.renderStack.length;++s){var rArray=this.renderStack[s];var type=rArray[0];var month;var day;var year;switch(type){case YAHOO.widget.Calendar.DATE:month=rArray[1][1];day=rArray[1][2];year=rArray[1][0];if(workingDate.getMonth()+1==month&&workingDate.getDate()==day&&workingDate.getFullYear()==year){renderer=rArray[2];this.renderStack.splice(s,1);}
break;case YAHOO.widget.Calendar.MONTH_DAY:month=rArray[1][0];day=rArray[1][1];if(workingDate.getMonth()+1==month&&workingDate.getDate()==day){renderer=rArray[2];this.renderStack.splice(s,1);}
break;case YAHOO.widget.Calendar.RANGE:var date1=rArray[1][0];var date2=rArray[1][1];var d1month=date1[1];var d1day=date1[2];var d1year=date1[0];var d1=new Date(d1year,d1month-1,d1day);var d2month=date2[1];var d2day=date2[2];var d2year=date2[0];var d2=new Date(d2year,d2month-1,d2day);if(workingDate.getTime()>=d1.getTime()&&workingDate.getTime()<=d2.getTime()){renderer=rArray[2];if(workingDate.getTime()==d2.getTime()){this.renderStack.splice(s,1);}}
break;case YAHOO.widget.Calendar.WEEKDAY:var weekday=rArray[1][0];if(workingDate.getDay()+1==weekday){renderer=rArray[2];}
break;case YAHOO.widget.Calendar.MONTH:month=rArray[1][0];if(workingDate.getMonth()+1==month){renderer=rArray[2];}
break;}
if(renderer){cellRenderers[cellRenderers.length]=renderer;}}}
if(this._indexOfSelectedFieldArray([workingDate.getFullYear(),workingDate.getMonth()+1,workingDate.getDate()])>-1){cellRenderers[cellRenderers.length]=cal.renderCellStyleSelected;}
var mindate=this.cfg.getProperty("mindate");var maxdate=this.cfg.getProperty("maxdate");if(mindate){mindate=YAHOO.widget.DateMath.clearTime(mindate);}
if(maxdate){maxdate=YAHOO.widget.DateMath.clearTime(maxdate);}
if((mindate&&(workingDate.getTime()<mindate.getTime()))||(maxdate&&(workingDate.getTime()>maxdate.getTime()))){cellRenderers[cellRenderers.length]=cal.renderOutOfBoundsDate;}else{cellRenderers[cellRenderers.length]=cal.styleCellDefault;cellRenderers[cellRenderers.length]=cal.renderCellDefault;}
for(var x=0;x<cellRenderers.length;++x){var ren=cellRenderers[x];if(ren.call((this.parent||this),workingDate,cell$$$$$$$$$$$)==YAHOO.widget.Calendar.STOP_RENDER){break;}}
workingDate.setTime(workingDate.getTime()+YAHOO.widget.DateMath.ONE_DAY_MS);if(i>=0&&i<=6){cell$$$$$$$$$$$.classes.push(this.Style.CSS_CELL_TOP);}
if((i%7)===0){cell$$$$$$$$$$$.classes.push(this.Style.CSS_CELL_LEFT);}
if(((i+1)%7)===0){cell$$$$$$$$$$$.classes.push(this.Style.CSS_CELL_RIGHT);}
var postDays=this.postMonthDays;if(postDays>=7&&this.cfg.getProperty("HIDE_BLANK_WEEKS")){var blankWeeks=Math.floor(postDays/7);for(var p=0;p<blankWeeks;++p){postDays-=7;}}
if(i>=((this.preMonthDays+postDays+this.monthDays)-7)){cell$$$$$$$$$$$.classes.push(this.Style.CSS_CELL_BOTTOM);;}
html[html.length]="<td id=\""+cell$$$$$$$$$$$.id+"\" class=\"";for(var i=cell$$$$$$$$$$$.classes.length-1;i>=0;i--)
html[html.length]=cell$$$$$$$$$$$.classes[i]+" ";html[html.length]="\">"+cell$$$$$$$$$$$.innerHTML+"</td>"
i++;}
if(this.cfg.getProperty("SHOW_WEEK_FOOTER")){html=this.renderRowFooter(weekNum,html);}
html[html.length]='</tr>';}}
html[html.length]='</tbody>';return html;};YAHOO.widget.Calendar.prototype.renderFooter=function(html){return html;};YAHOO.widget.Calendar.prototype.render=function(){var stamps=[];this.beforeRenderEvent.fire();var workingDate=YAHOO.widget.DateMath.findMonthStart(this.cfg.getProperty("pagedate"));this.resetRenderers();this.cellDates.length=0;YAHOO.util.Event.purgeElement(this.oDomContainer,false);var html=[];html[html.length]='<table cellSpacing="0" class="'+this.Style.CSS_CALENDAR+' y'+workingDate.getFullYear()+'" id="'+this.id+'">';html=this.renderHeader(html);html=this.renderBody(workingDate,html);html=this.renderFooter(html);html[html.length]='</table>';this.oDomContainer.innerHTML=html.join("\n");this.applyListeners_Header();this.applyListeners_Body();var tbodies=this.oDomContainer.getElementsByTagName("tbody");this.cells=tbodies[tbodies.length-1].getElementsByTagName("td");this.cfg.refireEvent("title");this.cfg.refireEvent("close");this.cfg.refireEvent("iframe");this.renderEvent.fire();};YAHOO.widget.Calendar.prototype.applyListeners_Header=function(){var root=this.oDomContainer;var cal=this.parent||this;var linkLeft,linkRight;linkLeft=YAHOO.util.Dom.getElementsByClassName(this.Style.CSS_NAV_LEFT,"a",root);linkRight=YAHOO.util.Dom.getElementsByClassName(this.Style.CSS_NAV_RIGHT,"a",root);if(linkLeft){this.linkLeft=linkLeft[0];YAHOO.util.Event.addListener(this.linkLeft,"mouseup",cal.previousMonth,cal,true);}
if(linkRight){this.linkRight=linkRight[0];YAHOO.util.Event.addListener(this.linkRight,"mouseup",cal.nextMonth,cal,true);}}
YAHOO.widget.Calendar.prototype.applyListeners_Body=function(){var root=this.oDomContainer;var cal=this.parent||this;if(this.domEventMap){var el,elements;for(var cls in this.domEventMap){if(this.domEventMap.hasOwnProperty(cls)){var items=this.domEventMap[cls];if(!(items instanceof Array)){items=[items];}
for(var i=0;i<items.length;i++){var item=items[i];elements=YAHOO.util.Dom.getElementsByClassName(cls,item.tag,this.oDomContainer);for(var c=0;c<elements.length;c++){el=elements[c];YAHOO.util.Event.addListener(el,item.event,item.handler,item.scope,item.correct);}}}}}
YAHOO.util.Event.addListener(this.oDomContainer,"mouseup",this.doSelectCell,this);YAHOO.util.Event.addListener(this.oDomContainer,"mouseover",this.doCellMouseOver,this);YAHOO.util.Event.addListener(this.oDomContainer,"mouseout",this.doCellMouseOut,this);};YAHOO.widget.Calendar.prototype.getDateByCellId=function(id){var date=this.getDateFieldsByCellId(id);return new Date(date[0],date[1]-1,date[2]);};YAHOO.widget.Calendar.prototype.getDateFieldsByCellId=function(id){id=id.toLowerCase().split("_cell")[1];id=parseInt(id,10);return this.cellDates[id];};YAHOO.widget.Calendar.prototype.renderOutOfBoundsDate=function(workingDate,cell){_PERF.addClass(cell,this.Style.CSS_CELL_OOB);cell.innerHTML=workingDate.getDate();return YAHOO.widget.Calendar.STOP_RENDER;};YAHOO.widget.Calendar.prototype.renderRowHeader=function(weekNum,html){html[html.length]='<th class="calrowhead">'+weekNum+'</th>';return html;};YAHOO.widget.Calendar.prototype.renderRowFooter=function(weekNum,html){html[html.length]='<th class="calrowfoot">'+weekNum+'</th>';return html;};YAHOO.widget.Calendar.prototype.renderCellDefault=function(workingDate,cell){cell.innerHTML='<a href="javascript:void(null);" >'+this.buildDayLabel(workingDate)+"</a>";};YAHOO.widget.Calendar.prototype.styleCellDefault=function(workingDate,cell){_PERF.addClass(cell,this.Style.CSS_CELL_SELECTABLE);};YAHOO.widget.Calendar.prototype.renderCellStyleHighlight1=function(workingDate,cell){_PERF.addClass(cell,this.Style.CSS_CELL_HIGHLIGHT1);};YAHOO.widget.Calendar.prototype.renderCellStyleHighlight2=function(workingDate,cell){_PERF.addClass(cell,this.Style.CSS_CELL_HIGHLIGHT2);};YAHOO.widget.Calendar.prototype.renderCellStyleHighlight3=function(workingDate,cell){_PERF.addClass(cell,this.Style.CSS_CELL_HIGHLIGHT3);};YAHOO.widget.Calendar.prototype.renderCellStyleHighlight4=function(workingDate,cell){_PERF.addClass(cell,this.Style.CSS_CELL_HIGHLIGHT4);};YAHOO.widget.Calendar.prototype.renderCellStyleToday=function(workingDate,cell){_PERF.addClass(cell,this.Style.CSS_CELL_TODAY);};YAHOO.widget.Calendar.prototype.renderCellStyleSelected=function(workingDate,cell){_PERF.addClass(cell,this.Style.CSS_CELL_SELECTED);};YAHOO.widget.Calendar.prototype.renderCellNotThisMonth=function(workingDate,cell){_PERF.addClass(cell,this.Style.CSS_CELL_OOM);cell.innerHTML=workingDate.getDate();return YAHOO.widget.Calendar.STOP_RENDER;};YAHOO.widget.Calendar.prototype.renderBodyCellRestricted=function(workingDate,cell){_PERF.addClass(cell,this.Style.CSS_CELL);_PERF.addClass(cell,this.Style.CSS_CELL_RESTRICTED);cell.innerHTML=workingDate.getDate();return YAHOO.widget.Calendar.STOP_RENDER;};YAHOO.widget.Calendar.prototype.addMonths=function(count){this.cfg.setProperty("pagedate",YAHOO.widget.DateMath.add(this.cfg.getProperty("pagedate"),YAHOO.widget.DateMath.MONTH,count));this.resetRenderers();this.changePageEvent.fire();};YAHOO.widget.Calendar.prototype.subtractMonths=function(count){this.cfg.setProperty("pagedate",YAHOO.widget.DateMath.subtract(this.cfg.getProperty("pagedate"),YAHOO.widget.DateMath.MONTH,count));this.resetRenderers();this.changePageEvent.fire();};YAHOO.widget.Calendar.prototype.addYears=function(count){this.cfg.setProperty("pagedate",YAHOO.widget.DateMath.add(this.cfg.getProperty("pagedate"),YAHOO.widget.DateMath.YEAR,count));this.resetRenderers();this.changePageEvent.fire();};YAHOO.widget.Calendar.prototype.subtractYears=function(count){this.cfg.setProperty("pagedate",YAHOO.widget.DateMath.subtract(this.cfg.getProperty("pagedate"),YAHOO.widget.DateMath.YEAR,count));this.resetRenderers();this.changePageEvent.fire();};YAHOO.widget.Calendar.prototype.nextMonth=function(){this.addMonths(1);};YAHOO.widget.Calendar.prototype.previousMonth=function(){this.subtractMonths(1);};YAHOO.widget.Calendar.prototype.nextYear=function(){this.addYears(1);};YAHOO.widget.Calendar.prototype.previousYear=function(){this.subtractYears(1);};YAHOO.widget.Calendar.prototype.reset=function(){this.cfg.resetProperty("selected");this.cfg.resetProperty("pagedate");this.resetEvent.fire();};YAHOO.widget.Calendar.prototype.clear=function(){this.cfg.setProperty("selected",[]);this.cfg.setProperty("pagedate",new Date(this.today.getTime()));this.clearEvent.fire();};YAHOO.widget.Calendar.prototype.selectLight=function(date){var toSelect=[date.getFullYear(),date.getMonth()+1,date.getDate()];var selected=[toSelect];(this.parent||this).cfg.setProperty("selected",selected);this.selectEvent.fire([toSelect]);};YAHOO.widget.Calendar.prototype.select=function(date){this.beforeSelectEvent.fire();var selected=this.cfg.getProperty("selected");var aToBeSelected=this._toFieldArray(date);for(var a=0;a<aToBeSelected.length;++a){var toSelect=aToBeSelected[a];if(this._indexOfSelectedFieldArray(toSelect)==-1){selected[selected.length]=toSelect;}}
if(this.parent){this.parent.cfg.setProperty("selected",selected);}else{this.cfg.setProperty("selected",selected);}
this.selectEvent.fire(aToBeSelected);return this.getSelectedDates();};YAHOO.widget.Calendar.prototype.selectCell=function(cellIndex){this.beforeSelectEvent.fire();var selected=this.cfg.getProperty("selected");var cell=this.cells[cellIndex];var cellDate=this.cellDates[cellIndex];var dCellDate=this._toDate(cellDate);var selectDate=cellDate.concat();selected[selected.length]=selectDate;if(this.parent){this.parent.cfg.setProperty("selected",selected);}else{this.cfg.setProperty("selected",selected);}
this.renderCellStyleSelected(dCellDate,cell);this.selectEvent.fire([selectDate]);this.doCellMouseOut.call(cell,null,this);return this.getSelectedDates();};YAHOO.widget.Calendar.prototype.deselect=function(date){this.beforeDeselectEvent.fire();var selected=this.cfg.getProperty("selected");var aToBeSelected=this._toFieldArray(date);for(var a=0;a<aToBeSelected.length;++a){var toSelect=aToBeSelected[a];var index=this._indexOfSelectedFieldArray(toSelect);if(index!=-1){selected.splice(index,1);}}
if(this.parent){this.parent.cfg.setProperty("selected",selected);}else{this.cfg.setProperty("selected",selected);}
this.deselectEvent.fire(aToBeSelected);return this.getSelectedDates();};YAHOO.widget.Calendar.prototype.deselectCell=function(i){this.beforeDeselectEvent.fire();var selected=this.cfg.getProperty("selected");var cell=this.cells[i];var cellDate=this.cellDates[i];var cellDateIndex=this._indexOfSelectedFieldArray(cellDate);var dCellDate=this._toDate(cellDate);var selectDate=cellDate.concat();if(cellDateIndex>-1){if(this.cfg.getProperty("pagedate").getMonth()==dCellDate.getMonth()&&this.cfg.getProperty("pagedate").getFullYear()==dCellDate.getFullYear()){YAHOO.util.Dom.removeClass(cell,this.Style.CSS_CELL_SELECTED);}
selected.splice(cellDateIndex,1);}
if(this.parent){this.parent.cfg.setProperty("selected",selected);}else{this.cfg.setProperty("selected",selected);}
this.deselectEvent.fire(selectDate);return this.getSelectedDates();};YAHOO.widget.Calendar.prototype.deselectAll=function(){this.beforeDeselectEvent.fire();var selected=this.cfg.getProperty("selected");var count=selected.length;var sel=selected.concat();if(this.parent){this.parent.cfg.setProperty("selected",[]);}else{this.cfg.setProperty("selected",[]);}
if(count>0){this.deselectEvent.fire(sel);}
return this.getSelectedDates();};YAHOO.widget.Calendar.prototype._toFieldArray=function(date){var returnDate=[];if(date instanceof Date){returnDate=[[date.getFullYear(),date.getMonth()+1,date.getDate()]];}else if(typeof date=='string'){returnDate=this._parseDates(date);}else if(date instanceof Array){for(var i=0;i<date.length;++i){var d=date[i];returnDate[returnDate.length]=[d.getFullYear(),d.getMonth()+1,d.getDate()];}}
return returnDate;};YAHOO.widget.Calendar.prototype._toDate=function(dateFieldArray){if(dateFieldArray instanceof Date){return dateFieldArray;}else{return new Date(dateFieldArray[0],dateFieldArray[1]-1,dateFieldArray[2]);}};YAHOO.widget.Calendar.prototype._fieldArraysAreEqual=function(array1,array2){var match=false;if(array1[0]==array2[0]&&array1[1]==array2[1]&&array1[2]==array2[2]){match=true;}
return match;};YAHOO.widget.Calendar.prototype._indexOfSelectedFieldArray=function(find){var selected=-1;var seldates=this.cfg.getProperty("selected");for(var s=0;s<seldates.length;++s){var sArray=seldates[s];if(find[0]==sArray[0]&&find[1]==sArray[1]&&find[2]==sArray[2]){selected=s;break;}}
return selected;};YAHOO.widget.Calendar.prototype.isDateOOM=function(date){var isOOM=false;if(date.getMonth()!=this.cfg.getProperty("pagedate").getMonth()){isOOM=true;}
return isOOM;};YAHOO.widget.Calendar.prototype.onBeforeSelect=function(){if(this.cfg.getProperty("MULTI_SELECT")===false){if(this.parent){this.parent.callChildFunction("clearAllBodyCellStyles",this.Style.CSS_CELL_SELECTED);this.parent.deselectAll();}else{this.clearAllBodyCellStyles(this.Style.CSS_CELL_SELECTED);this.deselectAll();}}};YAHOO.widget.Calendar.prototype.onSelect=function(selected){};YAHOO.widget.Calendar.prototype.onBeforeDeselect=function(){};YAHOO.widget.Calendar.prototype.onDeselect=function(deselected){};YAHOO.widget.Calendar.prototype.onChangePage=function(){this.render();};YAHOO.widget.Calendar.prototype.onRender=function(){};YAHOO.widget.Calendar.prototype.onReset=function(){this.render();};YAHOO.widget.Calendar.prototype.onClear=function(){this.render();};YAHOO.widget.Calendar.prototype.validate=function(){return true;};YAHOO.widget.Calendar.prototype._parseDate=function(sDate){var aDate=sDate.split(this.Locale.DATE_FIELD_DELIMITER);var rArray;if(aDate.length==2){rArray=[aDate[this.Locale.MD_MONTH_POSITION-1],aDate[this.Locale.MD_DAY_POSITION-1]];rArray.type=YAHOO.widget.Calendar.MONTH_DAY;}else{rArray=[aDate[this.Locale.MDY_YEAR_POSITION-1],aDate[this.Locale.MDY_MONTH_POSITION-1],aDate[this.Locale.MDY_DAY_POSITION-1]];rArray.type=YAHOO.widget.Calendar.DATE;}
for(var i=0;i<rArray.length;i++){rArray[i]=parseInt(rArray[i],10);}
return rArray;};YAHOO.widget.Calendar.prototype._parseDates=function(sDates){var aReturn=[];var aDates=sDates.split(this.Locale.DATE_DELIMITER);for(var d=0;d<aDates.length;++d){var sDate=aDates[d];if(sDate.indexOf(this.Locale.DATE_RANGE_DELIMITER)!=-1){var aRange=sDate.split(this.Locale.DATE_RANGE_DELIMITER);var dateStart=this._parseDate(aRange[0]);var dateEnd=this._parseDate(aRange[1]);var fullRange=this._parseRange(dateStart,dateEnd);aReturn=aReturn.concat(fullRange);}else{var aDate=this._parseDate(sDate);aReturn.push(aDate);}}
return aReturn;};YAHOO.widget.Calendar.prototype._parseRange=function(startDate,endDate){var dStart=new Date(startDate[0],startDate[1]-1,startDate[2]);var dCurrent=YAHOO.widget.DateMath.add(new Date(startDate[0],startDate[1]-1,startDate[2]),YAHOO.widget.DateMath.DAY,1);var dEnd=new Date(endDate[0],endDate[1]-1,endDate[2]);var results=[];results.push(startDate);while(dCurrent.getTime()<=dEnd.getTime()){results.push([dCurrent.getFullYear(),dCurrent.getMonth()+1,dCurrent.getDate()]);dCurrent=YAHOO.widget.DateMath.add(dCurrent,YAHOO.widget.DateMath.DAY,1);}
return results;};YAHOO.widget.Calendar.prototype.resetRenderers=function(){this.renderStack=this._renderStack.concat();};YAHOO.widget.Calendar.prototype.clearElement=function(cell){cell.innerHTML="&#160;";cell.className="";};YAHOO.widget.Calendar.prototype.addRenderer=function(sDates,fnRender){var aDates=this._parseDates(sDates);for(var i=0;i<aDates.length;++i){var aDate=aDates[i];if(aDate.length==2){if(aDate[0]instanceof Array){this._addRenderer(YAHOO.widget.Calendar.RANGE,aDate,fnRender);}else{this._addRenderer(YAHOO.widget.Calendar.MONTH_DAY,aDate,fnRender);}}else if(aDate.length==3){this._addRenderer(YAHOO.widget.Calendar.DATE,aDate,fnRender);}}};YAHOO.widget.Calendar.prototype._addRenderer=function(type,aDates,fnRender){var add=[type,aDates,fnRender];this.renderStack.unshift(add);this._renderStack=this.renderStack.concat();};YAHOO.widget.Calendar.prototype.addMonthRenderer=function(month,fnRender){this._addRenderer(YAHOO.widget.Calendar.MONTH,[month],fnRender);};YAHOO.widget.Calendar.prototype.addWeekdayRenderer=function(weekday,fnRender){this._addRenderer(YAHOO.widget.Calendar.WEEKDAY,[weekday],fnRender);};YAHOO.widget.Calendar.prototype.clearAllBodyCellStyles=function(style){for(var c=0;c<this.cells.length;++c){YAHOO.util.Dom.removeClass(this.cells[c],style);}};YAHOO.widget.Calendar.prototype.setMonth=function(month){var current=this.cfg.getProperty("pagedate");current.setMonth(month);this.cfg.setProperty("pagedate",current);};YAHOO.widget.Calendar.prototype.setYear=function(year){var current=this.cfg.getProperty("pagedate");current.setFullYear(year);this.cfg.setProperty("pagedate",current);};YAHOO.widget.Calendar.prototype.getSelectedDates=function(){var returnDates=[];var selected=this.cfg.getProperty("selected");for(var d=0;d<selected.length;++d){var dateArray=selected[d];var date=new Date(dateArray[0],dateArray[1]-1,dateArray[2]);returnDates.push(date);}
returnDates.sort(function(a,b){return a-b;});return returnDates;};YAHOO.widget.Calendar.prototype.hide=function(){this.oDomContainer.style.display="none";};YAHOO.widget.Calendar.prototype.show=function(){this.oDomContainer.style.display="block";};YAHOO.widget.Calendar.prototype.browser=function(){var ua=navigator.userAgent.toLowerCase();if(ua.indexOf('opera')!=-1){return'opera';}else if(ua.indexOf('msie 7')!=-1){return'ie7';}else if(ua.indexOf('msie')!=-1){return'ie';}else if(ua.indexOf('safari')!=-1){return'safari';}else if(ua.indexOf('gecko')!=-1){return'gecko';}else{return false;}}();YAHOO.widget.Calendar.prototype.toString=function(){return"Calendar "+this.id;};YAHOO.widget.Calendar_Core=YAHOO.widget.Calendar;YAHOO.widget.Cal_Core=YAHOO.widget.Calendar;YAHOO.widget.CalendarGroup=function(id,containerId,config){if(arguments.length>0){this.init(id,containerId,config);}};YAHOO.widget.CalendarGroup.prototype.init=function(id,containerId,config){this.initEvents();this.initStyles();this.pages=[];this.id=id;this.containerId=containerId;this.oDomContainer=document.getElementById(containerId);_PERF.addClass(this.oDomContainer,YAHOO.widget.CalendarGroup.CSS_CONTAINER);_PERF.addClass(this.oDomContainer,YAHOO.widget.CalendarGroup.CSS_MULTI_UP);this.cfg=new YAHOO.util.Config(this);this.Options={};this.Locale={};this.setupConfig();if(config){this.cfg.applyConfig(config,true);}
this.cfg.fireQueue();if(this.browser=="opera"){var fixWidth=function(){var startW=this.oDomContainer.offsetWidth;var w=0;for(var p=0;p<this.pages.length;++p){var cal=this.pages[p];w+=cal.oDomContainer.offsetWidth;}
if(w>0){this.oDomContainer.style.width=w+"px";}};this.renderEvent.subscribe(fixWidth,this,true);}};YAHOO.widget.CalendarGroup.prototype.setupConfig=function(){this.cfg.addProperty("pages",{value:2,validator:this.cfg.checkNumber,handler:this.configPages});this.cfg.addProperty("pagedate",{value:new Date(),handler:this.configPageDate});this.cfg.addProperty("selected",{value:[],handler:this.delegateConfig});this.cfg.addProperty("title",{value:"",handler:this.configTitle});this.cfg.addProperty("close",{value:false,handler:this.configClose});this.cfg.addProperty("iframe",{value:true,handler:this.delegateConfig,validator:this.cfg.checkBoolean});this.cfg.addProperty("mindate",{value:null,handler:this.delegateConfig});this.cfg.addProperty("maxdate",{value:null,handler:this.delegateConfig});this.cfg.addProperty("MULTI_SELECT",{value:false,handler:this.delegateConfig,validator:this.cfg.checkBoolean});this.cfg.addProperty("START_WEEKDAY",{value:0,handler:this.delegateConfig,validator:this.cfg.checkNumber});this.cfg.addProperty("SHOW_WEEKDAYS",{value:true,handler:this.delegateConfig,validator:this.cfg.checkBoolean});this.cfg.addProperty("SHOW_WEEK_HEADER",{value:false,handler:this.delegateConfig,validator:this.cfg.checkBoolean});this.cfg.addProperty("SHOW_WEEK_FOOTER",{value:false,handler:this.delegateConfig,validator:this.cfg.checkBoolean});this.cfg.addProperty("HIDE_BLANK_WEEKS",{value:false,handler:this.delegateConfig,validator:this.cfg.checkBoolean});this.cfg.addProperty("NAV_ARROW_LEFT",{value:YAHOO.widget.Calendar.IMG_ROOT+"us/tr/callt.gif",handler:this.delegateConfig});this.cfg.addProperty("NAV_ARROW_RIGHT",{value:YAHOO.widget.Calendar.IMG_ROOT+"us/tr/calrt.gif",handler:this.delegateConfig});this.cfg.addProperty("MONTHS_SHORT",{value:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],handler:this.delegateConfig});this.cfg.addProperty("MONTHS_LONG",{value:["January","February","March","April","May","June","July","August","September","October","November","December"],handler:this.delegateConfig});this.cfg.addProperty("WEEKDAYS_1CHAR",{value:["S","M","T","W","T","F","S"],handler:this.delegateConfig});this.cfg.addProperty("WEEKDAYS_SHORT",{value:["Su","Mo","Tu","We","Th","Fr","Sa"],handler:this.delegateConfig});this.cfg.addProperty("WEEKDAYS_MEDIUM",{value:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],handler:this.delegateConfig});this.cfg.addProperty("WEEKDAYS_LONG",{value:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],handler:this.delegateConfig});this.cfg.addProperty("LOCALE_MONTHS",{value:"long",handler:this.delegateConfig});this.cfg.addProperty("LOCALE_WEEKDAYS",{value:"short",handler:this.delegateConfig});this.cfg.addProperty("DATE_DELIMITER",{value:",",handler:this.delegateConfig});this.cfg.addProperty("DATE_FIELD_DELIMITER",{value:"/",handler:this.delegateConfig});this.cfg.addProperty("DATE_RANGE_DELIMITER",{value:"-",handler:this.delegateConfig});this.cfg.addProperty("MY_MONTH_POSITION",{value:1,handler:this.delegateConfig,validator:this.cfg.checkNumber});this.cfg.addProperty("MY_YEAR_POSITION",{value:2,handler:this.delegateConfig,validator:this.cfg.checkNumber});this.cfg.addProperty("MD_MONTH_POSITION",{value:1,handler:this.delegateConfig,validator:this.cfg.checkNumber});this.cfg.addProperty("MD_DAY_POSITION",{value:2,handler:this.delegateConfig,validator:this.cfg.checkNumber});this.cfg.addProperty("MDY_MONTH_POSITION",{value:1,handler:this.delegateConfig,validator:this.cfg.checkNumber});this.cfg.addProperty("MDY_DAY_POSITION",{value:2,handler:this.delegateConfig,validator:this.cfg.checkNumber});this.cfg.addProperty("MDY_YEAR_POSITION",{value:3,handler:this.delegateConfig,validator:this.cfg.checkNumber});};YAHOO.widget.CalendarGroup.prototype.initEvents=function(){var me=this;var sub=function(fn,obj,bOverride){for(var p=0;p<me.pages.length;++p){var cal=me.pages[p];cal[this.type+"Event"].subscribe(fn,obj,bOverride);}};var unsub=function(fn,obj){for(var p=0;p<me.pages.length;++p){var cal=me.pages[p];cal[this.type+"Event"].unsubscribe(fn,obj);}};this.beforeSelectEvent=new YAHOO.util.CustomEvent("beforeSelect");this.beforeSelectEvent.subscribe=sub;this.beforeSelectEvent.unsubscribe=unsub;this.selectEvent=new YAHOO.util.CustomEvent("select");this.selectEvent.subscribe=sub;this.selectEvent.unsubscribe=unsub;this.beforeDeselectEvent=new YAHOO.util.CustomEvent("beforeDeselect");this.beforeDeselectEvent.subscribe=sub;this.beforeDeselectEvent.unsubscribe=unsub;this.deselectEvent=new YAHOO.util.CustomEvent("deselect");this.deselectEvent.subscribe=sub;this.deselectEvent.unsubscribe=unsub;this.changePageEvent=new YAHOO.util.CustomEvent("changePage");this.changePageEvent.subscribe=sub;this.changePageEvent.unsubscribe=unsub;this.beforeRenderEvent=new YAHOO.util.CustomEvent("beforeRender");this.beforeRenderEvent.subscribe=sub;this.beforeRenderEvent.unsubscribe=unsub;this.renderEvent=new YAHOO.util.CustomEvent("render");this.renderEvent.subscribe=sub;this.renderEvent.unsubscribe=unsub;this.resetEvent=new YAHOO.util.CustomEvent("reset");this.resetEvent.subscribe=sub;this.resetEvent.unsubscribe=unsub;this.clearEvent=new YAHOO.util.CustomEvent("clear");this.clearEvent.subscribe=sub;this.clearEvent.unsubscribe=unsub;};YAHOO.widget.CalendarGroup.prototype.configPages=function(type,args,obj){var pageCount=args[0];for(var p=0;p<pageCount;++p){var calId=this.id+"_"+p;var calContainerId=this.containerId+"_"+p;var childConfig=this.cfg.getConfig();childConfig.close=false;childConfig.title=false;var cal=this.constructChild(calId,calContainerId,childConfig);var caldate=cal.cfg.getProperty("pagedate");caldate.setMonth(caldate.getMonth()+p);cal.cfg.setProperty("pagedate",caldate);YAHOO.util.Dom.removeClass(cal.oDomContainer,this.Style.CSS_SINGLE);_PERF.addClass(cal.oDomContainer,"groupcal");if(p===0){_PERF.addClass(cal.oDomContainer,"first");}
if(p==(pageCount-1)){_PERF.addClass(cal.oDomContainer,"last");}
cal.parent=this;cal.index=p;this.pages[this.pages.length]=cal;}};YAHOO.widget.CalendarGroup.prototype.configPageDate=function(type,args,obj){var val=args[0];for(var p=0;p<this.pages.length;++p){var cal=this.pages[p];cal.cfg.setProperty("pagedate",val);var calDate=cal.cfg.getProperty("pagedate");calDate.setMonth(calDate.getMonth()+p);}};YAHOO.widget.CalendarGroup.prototype.delegateConfig=function(type,args,obj){var val=args[0];var cal;for(var p=0;p<this.pages.length;p++){cal=this.pages[p];cal.cfg.setProperty(type,val);}};YAHOO.widget.CalendarGroup.prototype.setChildFunction=function(fnName,fn){var pageCount=this.cfg.getProperty("pages");for(var p=0;p<pageCount;++p){this.pages[p][fnName]=fn;}};YAHOO.widget.CalendarGroup.prototype.callChildFunction=function(fnName,args){var pageCount=this.cfg.getProperty("pages");for(var p=0;p<pageCount;++p){var page=this.pages[p];if(page[fnName]){var fn=page[fnName];fn.call(page,args);}}};YAHOO.widget.CalendarGroup.prototype.constructChild=function(id,containerId,config){var container=document.getElementById(containerId);if(!container){container=document.createElement("div");container.id=containerId;this.oDomContainer.appendChild(container);}
return new YAHOO.widget.Calendar(id,containerId,config);};YAHOO.widget.CalendarGroup.prototype.setMonth=function(month){for(var p=0;p<this.pages.length;++p){var cal=this.pages[p];cal.setMonth(month+p);}};YAHOO.widget.CalendarGroup.prototype.setYear=function(year){for(var p=0;p<this.pages.length;++p){var cal=this.pages[p];var pageDate=cal.cfg.getProperty("pageDate");if((pageDate.getMonth()+1)==1&&p>0){year+=1;}
cal.setYear(year);}};YAHOO.widget.CalendarGroup.prototype.render=function(){this.renderHeader();for(var p=0;p<this.pages.length;++p){var cal=this.pages[p];cal.render();}
this.renderFooter();};YAHOO.widget.CalendarGroup.prototype.select=function(date){for(var p=0;p<this.pages.length;++p){var cal=this.pages[p];cal.select(date);}
return this.getSelectedDates();};YAHOO.widget.CalendarGroup.prototype.selectCell=function(cellIndex){for(var p=0;p<this.pages.length;++p){var cal=this.pages[p];cal.selectCell(cellIndex);}
return this.getSelectedDates();};YAHOO.widget.CalendarGroup.prototype.deselect=function(date){for(var p=0;p<this.pages.length;++p){var cal=this.pages[p];cal.deselect(date);}
return this.getSelectedDates();};YAHOO.widget.CalendarGroup.prototype.deselectAll=function(){for(var p=0;p<this.pages.length;++p){var cal=this.pages[p];cal.deselectAll();}
return this.getSelectedDates();};YAHOO.widget.CalendarGroup.prototype.deselectCell=function(cellIndex){for(var p=0;p<this.pages.length;++p){var cal=this.pages[p];cal.deselectCell(cellIndex);}
return this.getSelectedDates();};YAHOO.widget.CalendarGroup.prototype.reset=function(){for(var p=0;p<this.pages.length;++p){var cal=this.pages[p];cal.reset();}};YAHOO.widget.CalendarGroup.prototype.clear=function(){for(var p=0;p<this.pages.length;++p){var cal=this.pages[p];cal.clear();}};YAHOO.widget.CalendarGroup.prototype.nextMonth=function(){for(var p=0;p<this.pages.length;++p){var cal=this.pages[p];cal.nextMonth();}};YAHOO.widget.CalendarGroup.prototype.previousMonth=function(){for(var p=this.pages.length-1;p>=0;--p){var cal=this.pages[p];cal.previousMonth();}};YAHOO.widget.CalendarGroup.prototype.nextYear=function(){for(var p=0;p<this.pages.length;++p){var cal=this.pages[p];cal.nextYear();}};YAHOO.widget.CalendarGroup.prototype.previousYear=function(){for(var p=0;p<this.pages.length;++p){var cal=this.pages[p];cal.previousYear();}};YAHOO.widget.CalendarGroup.prototype.getSelectedDates=function(){var returnDates=[];var selected=this.cfg.getProperty("selected");for(var d=0;d<selected.length;++d){var dateArray=selected[d];var date=new Date(dateArray[0],dateArray[1]-1,dateArray[2]);returnDates.push(date);}
returnDates.sort(function(a,b){return a-b;});return returnDates;};YAHOO.widget.CalendarGroup.prototype.addRenderer=function(sDates,fnRender){for(var p=0;p<this.pages.length;++p){var cal=this.pages[p];cal.addRenderer(sDates,fnRender);}};YAHOO.widget.CalendarGroup.prototype.addMonthRenderer=function(month,fnRender){for(var p=0;p<this.pages.length;++p){var cal=this.pages[p];cal.addMonthRenderer(month,fnRender);}};YAHOO.widget.CalendarGroup.prototype.addWeekdayRenderer=function(weekday,fnRender){for(var p=0;p<this.pages.length;++p){var cal=this.pages[p];cal.addWeekdayRenderer(weekday,fnRender);}};YAHOO.widget.CalendarGroup.prototype.renderHeader=function(){};YAHOO.widget.CalendarGroup.prototype.renderFooter=function(){};YAHOO.widget.CalendarGroup.prototype.addMonths=function(count){this.callChildFunction("addMonths",count);};YAHOO.widget.CalendarGroup.prototype.subtractMonths=function(count){this.callChildFunction("subtractMonths",count);};YAHOO.widget.CalendarGroup.prototype.addYears=function(count){this.callChildFunction("addYears",count);};YAHOO.widget.CalendarGroup.prototype.subtractYears=function(count){this.callChildFunction("subtractYears",count);};YAHOO.widget.CalendarGroup.CSS_CONTAINER="yui-calcontainer";YAHOO.widget.CalendarGroup.CSS_MULTI_UP="multi";YAHOO.widget.CalendarGroup.CSS_2UPTITLE="title";YAHOO.widget.CalendarGroup.CSS_2UPCLOSE="close-icon";YAHOO.augment(YAHOO.widget.CalendarGroup,YAHOO.widget.Calendar,"buildDayLabel","buildMonthLabel","renderOutOfBoundsDate","renderRowHeader","renderRowFooter","renderCellDefault","styleCellDefault","renderCellStyleHighlight1","renderCellStyleHighlight2","renderCellStyleHighlight3","renderCellStyleHighlight4","renderCellStyleToday","renderCellStyleSelected","renderCellNotThisMonth","renderBodyCellRestricted","initStyles","configTitle","configClose","hide","show","browser");YAHOO.widget.CalendarGroup.prototype.toString=function(){return"CalendarGroup "+this.id;};YAHOO.widget.CalGrp=YAHOO.widget.CalendarGroup;YAHOO.widget.Calendar2up=function(id,containerId,config){this.init(id,containerId,config);};YAHOO.extend(YAHOO.widget.Calendar2up,YAHOO.widget.CalendarGroup);YAHOO.widget.Cal2up=YAHOO.widget.Calendar2up;
/**/

function Event_preventDefault(e){
return YAHOO.util.Event.preventDefault(e);
}
function Event_stopPropagation(e){
return YAHOO.util.Event.stopPropagation(e);
}
function Event_getTarget(e){
return YAHOO.util.Event.getTarget(e);
}
var Event_simpleAddListener=function(){
if(window.addEventListener){
return function(el,sType,fn){
el.addEventListener(sType,fn,false);
};
}else if(window.attachEvent){
return function(el,sType,fn,capture){
el.attachEvent("on"+sType,fn);
};
}else{
return function(){};
}
}();
function Event_removeListener(obj,eventName,callback){
return YAHOO.util.Event.removeListener(obj,eventName,callback);
}
function Event_addListener(obj,eventName,callback,instance,replaceInstance){
return YAHOO.util.Event.addListener(obj,eventName,callback,instance,replaceInstance);
}
var Event_isIE=YAHOO.util.Event.isIE;
var Easing_easeNone=YAHOO.util.Easing.easeNone;
var Easing_easeOut=YAHOO.util.Easing.easeOut;
function new_DD(id){
return new YAHOO.util.DD(id);
}
function Dom_setStyle(obj,pro,value){
return YAHOO.util.Dom.setStyle(obj,pro,value);
}
function Dom_getXY(obj){
if(document.getBoxObjectFor){
var posRes=document.getBoxObjectFor(obj);
return [posRes.x,posRes.y];
}else
return YAHOO.util.Dom.getXY(obj);
}
function Dom_getRegion(obj){
if(document.getBoxObjectFor){
var posRes=document.getBoxObjectFor(obj);
return{
top:posRes.y,
left:posRes.x,
bottom:posRes.y+posRes.height,
right:posRes.x+posRes.width
};
}else
return YAHOO.util.Dom.getRegion(obj);
}
function Dom_AddClass(obj,className){
return YAHOO.util.Dom.addClass(obj,className)
}
function Dom_RemoveClass(obj,className){
return YAHOO.util.Dom.removeClass(obj,className)
}
function Dom_hasClass(obj,className){
return YAHOO.util.Dom.hasClass(obj,className)
}
function Region_getRegion(el){
if(document.getBoxObjectFor){
var posRes=document.getBoxObjectFor(el);
var l=posRes.x;
var t=posRes.y;
var dt=0,dl=0;
if(!ICOpen.Utils.isBorderBoxModel()){
dl=parseInt(el.style.borderLeftWidth,10);
if(isNaN(dl))
dl=2;
dt=parseInt(el.style.borderTopWidth,10);
if(isNaN(dt))
dt=2;
}
return new YAHOO.util.Region(posRes.y-dt,posRes.x-dl+posRes.width,posRes.y-dt+posRes.height,posRes.x-dl);
}
var p=Dom_getXY(el);
var t=p[1];
var r=p[0]+el.offsetWidth;
var b=p[1]+el.offsetHeight;
var l=p[0];
return new YAHOO.util.Region(t,r,b,l);
}
function new_Motion(componentToMove,attributes,time,easing){
return new YAHOO.util.Motion(componentToMove,attributes,time,easing);
}
var YAHOO_Calendar=YAHOO.widget["Calendar"];
var YAHOO_CalendarGroup=YAHOO.widget["CalendarGroup"];
if(!window.IC)
window.IC={};
window.ICOpen={Utils:{}};
ICOpen.Utils.startsWithIgnoreCase=function(str1,str2){
if(typeof str1=="undefined"||typeof str2=="undefined"||str1==null||str2==null)
return false;
return str1.length>=str2.length&&str1.toLowerCase().substring(0,str2.length)==str2.toLowerCase();
};
window.ICOpen_cleanupRefStore={};
window.ICOpen_cleanupRefStore.lastId=0;
ICOpen.$=function(id){
var res;
if(typeof id=='string'){
res=document.getElementById(id);
if(!res){
res=window.ICOpen_cleanupRefStore[id];
if(res==null){
var byName=document.getElementsByName(id);
if(byName.length>0)
res=byName[0];
}
}
}else
res=id;
return res;
};
ICOpen.getId=function(obj){
return obj.id?obj.id:obj.name?(window.ICOpen_cleanupRefStore[obj.name]=obj).name:ICOpen._(obj);
};
ICOpen._=function(object){
if(object==null)
return null;
if(typeof object=="string")
return object;
var idFieldName=(typeof object.attributes=="object")?"id":"IC.id";
if(typeof object[idFieldName]=="undefined"||object[idFieldName]==null||object[idFieldName]=="")
object[idFieldName]=ICOpen_getUniqueId();
if(ICOpen.$(object[idFieldName])==null){
window.ICOpen_cleanupRefStore[object[idFieldName]]=object;
}
return object[idFieldName];
};
function ICOpen_getUniqueId(){
return "$:"+(window.ICOpen_cleanupRefStore.lastId++);
}
;
function ICOpen_cleanupRefStore(){
for(var id in window.ICOpen_cleanupRefStore){
delete window.ICOpen_cleanupRefStore[id];
}
window["ICOpen_cleanupRefStore"]=null;
}
;
if(window.attachEvent)
Event_addListener(window,"unload",ICOpen_cleanupRefStore);
ICOpen.Utils.setSelectionRange=function(el,start,end){
try{
if(start>el.value.length){
start=el.value.length;
}
if(typeof end=="undefined"||end==null)
end=start;
if(el.setSelectionRange){
el.setSelectionRange(start,end);
}else if(el.createTextRange){
var range=el.createTextRange();
range.moveStart("character",start);
range.moveEnd("character",end-el.value.length);
range.select();
}
}catch(e){}
};
ICOpen.Utils.attachToDocument=function(el,append){
if(append)
document.body.appendChild(el);
else
document.body.insertBefore(el,document.body.firstChild);
};
ICOpen.Utils.setTimeout=function(_fn_,delay){
return setTimeout(function(){
try{
_fn_()
}catch(e){
}
},delay);
};
ICOpen.Utils.markAsProcessed=function(el){
el.wiseBlocksProcessed=true;
};
ICOpen.Utils.unmarkAsProcessed=function(el){
el.wiseBlocksProcessed=null;
};
ICOpen.Utils.isProcessed=function(el){
return el.wiseBlocksProcessed;
};
ICOpen.Utils.IE6_workaround_setSize=function(iframeId,tableId){
ICOpen.Utils.setTimeout(function(){
ICOpen.$(iframeId).style.height=ICOpen.$(tableId).offsetHeight+"px";
ICOpen.$(iframeId).style.width=ICOpen.$(tableId).offsetWidth+"px";
});
};
ICOpen.Utils.IE6_selectTag_workaround=function(table,borderWidth){
if(document.all){
var iframe=document.createElement("IFRAME");
iframe.src="javascript:void(null)";
iframe.scrolling="no";
iframe.frameborder="0";
iframe.style.position="absolute";
iframe.style.display="block";
iframe.style.marginTop=(0-borderWidth)+"px";
iframe.style.marginLeft=(0-borderWidth)+"px";
iframe.style.filter="alpha(opacity=0)";
iframe.style.zIndex="-32000";
if(table.childNodes.length==0)
table.appendChild(iframe);
else
table.insertBefore(iframe,table.firstChild);
ICOpen.Utils.IE6_workaround_setSize(ICOpen._(iframe),ICOpen._(table));
}
};
ICOpen.Utils.boxModel=null;
ICOpen.Utils.isBorderBoxModel=function(){
if(ICOpen.Utils.boxModel==null){
var _outer=document.createElement("div");
var s=_outer.style;
s.visibility="hidden";
s.styleFloat=s.cssFloat="left";
_outer.innerHTML="<div style='width:25px;height:25px;border:1px solid black;overflow:hidden'>&nbsp;</div>";
ICOpen.Utils.attachToDocument(_outer,true);
ICOpen.Utils.boxModel=_outer.offsetWidth==25?"b":"c";
_outer.parentNode.removeChild(_outer);
}
return ICOpen.Utils.boxModel=="b";
};
ICOpen.Utils.copyProperties=function(from,to){
for(var i in from){
if(typeof from[i]!="undefined"&&from[i]!=null){
if(from[i] instanceof Array)
ICOpen.Utils.copyProperties(from[i],to[i]=[]);
else
try{
to[i]=from[i];
}catch(e){
}
}
}
};
ICOpen.Log={
_showOnInfo:false,
_showOnDev:false,
_showOnWarn:false,
_showOnError:true,
messages:[],
setShowOnDev:function(value){
this._showOnDev=value;
},
setShowOnError:function(value){
this._showOnError=value;
},
setShowOnWarn:function(value){
this._showOnWarn=value;
},
setShowOnInfo:function(value){
this._showOnInfo=value;
},
error:function(text){
this.messages.push({level:"Error",date:new Date(),text:text});
if(this._showOnError)
this.show();
},
warn:function(text){
this.messages.push({level:"Warning",date:new Date(),text:text});
if(this._showOnWarn)
this.show();
},
info:function(text){
this.messages.push({level:"Information",date:new Date(),text:text});
if(this._showOnInfo)
this.show();
},
dev:function(text){
this.messages.push({level:"Development",date:new Date(),text:text});
if(this._showOnDev)
this.show();
},
clear:function(){
this.messages=[];
},
disablePopUpDisplayed:false,
show:function(){
var dw=window.open("","IC_debug_window","resizable=yes,height=500,width=800,scrollbars=yes,status=no,toolbar=no,titlebar=no,menubar=no,location=no,top=0,left=0,x=0,y=0");
if(dw==null&&!this.disablePopUpDisplayed ){
alert("Please disable pop-up window blocking.");
this.disablePopUpDisplayed=true;
return;
}
dw.document.open();
dw.document.write("<html>");
dw.document.write("<style>");
dw.document.write("body{margin:0px;padding:0px;font-family:Verdana;font-size:12px;margin-bottom:1px;background-color:#F1F5FA;color:#3E3E3E;}");
dw.document.write(".ICSmallHeader{font-size:13px;font-weight:bold;color:#00349A;text-decoration:none;text-align:left;font-family:Verdana;border-bottom:2px solid #00349A;padding-top:3px;padding-bottom:3px;}");
dw.document.write(".ICText{font-size:9px;color:#3E3E3E;font-style:normal;text-align:justify;text-decoration:none;font-family:Verdana;border-bottom: 1px solid #3E3E3E;padding-top:3px;padding-bottom:3px;}");
dw.document.write(".ICHeader{color:#00349A;font-size:18px;font-family:Verdana;border-bottom:0px;}");
dw.document.write("</style>");
dw.document.write("<body>");
dw.document.write(this._getBody());
dw.document.write("</body></html>");
dw.document.close();
},
_getBody:function(){
var res="<span class='ICHeader'>Input Components Suite Debugger</span>"+
"<br>"+
"<br>"+
"<table border=0 width=100% cellspacing=0>"+
"<tr>"+
"<th class='ICSmallHeader'>Time</th>"+
"<th class='ICSmallHeader'>Level</th>"+
"<th class='ICSmallHeader'>Message</th>"+
"</tr>";
for(var i=this.messages.length-1;i>=0;i--){
var msg=this.messages[i];
res+="<tr>"+
"<td align='left' valign='top' class='ICText'>"+msg.date+"</td>"+
"<td align='left' valign='top' class='ICText'>"+msg.level+"</td>"+
"<td align='left' valign='top' class='ICText'>"+msg.text+"</td>"+
"</tr>"+
"<tr>"+
"<th class='ICSmallHeader'>&nbsp;</th>"+
"<th class='ICSmallHeader'>&nbsp;</th>"+
"<th class='ICSmallHeader'>&nbsp;</th>"+
"</tr>";
}
res+="</table>"+
"<br>"+
"<input type=button value='Refresh' onclick='document.body.innerHTML = window.opener.ICOpen.Log._getBody()'/>"+
"<input type=button value='Close' onclick='window.close()'/>"+
"<input type=button value='Close and Clear' onclick='window.opener.ICOpen.Log.clear();window.close()'/>";
return res;
}
};
function OICInputComponent(el){
this.element=ICOpen._(el);
this.refiners=[];
this.attach();
this.justTyped=false;
}
OICInputComponent.prototype.onKeyPress=function(e){
if(e.keyCode==13)
return this.onEnterKey();
var c=(typeof e.charCode=="undefined")?e.keyCode:c=e.charCode;
if(e.keyCode>0&&e.charCode==0)
return;
this.onBeforeCharEntered(c,e);
};
OICInputComponent.prototype.onKeyDown=function(e){
for(var i=0;i<this.refiners.length;i++)
if(this.refiners[i].handleKeyDown)
this.refiners[i].handleKeyDown(null,e.keyCode,e);
};
OICInputComponent.prototype.getElement=function(){
return ICOpen.$(this.element);
};
OICInputComponent.prototype.attach=function(){
var el=this.getElement();
if(el){
Event_addListener(el,"keydown",this.onKeyDown,this,true);
Event_addListener(el,"keypress",this.onKeyPress,this,true);
Event_addListener(el,"blur",this.onBlur,this,true);
}
};
OICInputComponent.prototype.onBeforeCharEntered=function(c,e){
for(var i=0;i<this.refiners.length;i++)
this.refiners[i].handleCharEntered(null,c,e);
};
OICInputComponent.prototype.getValue=function(){
return this.getElement().value;
};
OICInputComponent.prototype.focus=function(){
this.getElement().focus();
};
OICInputComponent.prototype.getParsedValue=function(){
return parseFloat(this.getElement().value);
};
OICInputComponent.prototype.acceptChar=function(ch){
this.getElement().value+=ch;
this.focus();
};
OICInputComponent.prototype.acceptBackSpace=function(){
var el=this.getElement();
if(el.value.length>0)
el.value=el.value.substring(0,el.value.length-1);
this.focus();
};
OICInputComponent.prototype.acceptNewValue=function(val){
if(typeof val!="string")
val=""+val;
this.getElement().value=val;
ICOpen.Utils.setSelectionRange(this.getElement(),val.length,val.length);
this.focus();
};
OICInputComponent.prototype.onEnterKey=function(val){
return true;
};
var SQRT_SIGN="\u221A";
function Calc(_inputComponent){
this.inputComponent=_inputComponent;
this._currentRegister="X";
this.operator=null;
this.justRegistred=false;
this.valueChangedAfterRegistered=false;
this.memory=0;
};
Calc.prototype.setValueChangedAfterRegistered=function(arg){
this.valueChangedAfterRegistered=arg;
};
Calc.prototype.attach=function(_dropDownPanel){
this.dropDownPanel=_dropDownPanel;
var refiner={
handleKeyDown:function(value,c,e){
if(c==13&&_dropDownPanel.visible ){
_dropDownPanel.hide();
Event_preventDefault(e);
if(value!=null)
value.stopProcessing=true;
this.calc._handleEQButton();
}else if(c==27){
if(_dropDownPanel.visible){
_dropDownPanel.dropDownPanelCalled();
if(value!=null)
value.stopProcessing=true;
Event_preventDefault(e);
this.calc.setValueChangedAfterRegistered(false);
this.calc.setJustRegistred(true);
this.calc.X=this.calc.Y=null;
this.calc._currentRegister="X";
this.calc.operator=null;
}
}
},
handleCharEntered:function(value,c,e){
if(" ".charCodeAt(0)==c){
_dropDownPanel.dropDownPanelCalled();
if(value!=null)
value.stopProcessing=true;
Event_preventDefault(e);
}else if("+".charCodeAt(0)==c||("-".charCodeAt(0)==c&&(value==null||!value.isChangeSignCursorPos()) )||
"/".charCodeAt(0)==c||
"*".charCodeAt(0)==c){
if(!_dropDownPanel.visible)
_dropDownPanel.show();
Event_preventDefault(e);
if(value!=null)
value.stopProcessing=true;
this.calc._handleOperatorButton(String.fromCharCode(c));
}else if("=".charCodeAt(0)==c ){
if(!_dropDownPanel.visible)
_dropDownPanel.show();
Event_preventDefault(e);
if(value!=null)
value.stopProcessing=true;
this.calc._handleEQButton();
}else{
this.calc.setValueChangedAfterRegistered(true);
}
},
handleChange:function(){
this.calc.setValueChangedAfterRegistered(true);
},
calc:this
};
this.inputComponent.refiners.push(refiner);
if(this.inputComponent.maskMgr&&this.inputComponent.maskMgr.specialChars){
this.inputComponent.maskMgr.specialChars.push("+");
this.inputComponent.maskMgr.specialChars.push("-");
this.inputComponent.maskMgr.specialChars.push("*");
this.inputComponent.maskMgr.specialChars.push("/");
this.inputComponent.maskMgr.specialChars.push("=");
}
};
Calc.prototype.show=function(){
if(this.inputComponent.maskMgr){
this.inputComponent.maskMgr.setIgnoreFixedDecimalPart(true);
var val=this.inputComponent.getValue();
var valBackup=val;
while(val.length>0&&val.indexOf(this.getDecimalSeparator())!=-1){
var lastCh=val.charAt(val.length-1);
if(lastCh=="0"||lastCh==this.getDecimalSeparator())
val=val.substring(0,val.length-1);
else
break;
}
if(val!=valBackup){
this.inputComponent.acceptNewValue(val);
}
}
};
Calc.prototype.hide=function(){
if(this.inputComponent.maskMgr){
this.inputComponent.maskMgr.setIgnoreFixedDecimalPart(false);
this.inputComponent.maskMgr.init();
}
};
Calc.prototype.getMemoryFormatted=function(){
if(this.inputComponent.maskMgr){
var value=new Value();
value.entered=""+this.memory;
this.inputComponent.maskMgr.handleChange(value);
return value.masked;
}else{
return this.memory;
}
};
Calc.prototype.calculate=function(_y){
this._saveToRegister();
if(this.operator!=null){
if(this.Y==null||this.Y.length==0)
this.Y="0";
if(this.X==null||this.X.length==0)
this.X="0";
var newVal=eval(parseFloat(this.X)+" "+this.operator+" "+parseFloat(this.Y));
this.inputComponent.acceptNewValue(newVal);
this.setValueChangedAfterRegistered(false);
}
};
Calc.prototype._handleEQButton=function(){
this.calculate();
this._currentRegister="X";
this._saveToRegister();
this.setJustRegistred(true);
this.setValueChangedAfterRegistered(false);
};
Calc.prototype.setJustRegistred=function(value){
this.justRegistred=value;
if(value){
ICOpen.Utils.setSelectionRange(this.inputComponent.getElement(),0,65535);
}
};
Calc.prototype._saveToRegister=function(buttonValue){
if(!this.valueChangedAfterRegistered&&this._currentRegister=="Y")
return;
if(this._currentRegister=="X")
this.X=this.inputComponent.getParsedValue();
else
this.Y=this.inputComponent.getParsedValue();
};
Calc.prototype._handleOperatorButton=function(buttonValue){
if(this.valueChangedAfterRegistered)
this.calculate();
this._currentRegister="X";
this._saveToRegister();
this.setValueChangedAfterRegistered(false);
this.operator=buttonValue;
this.setJustRegistred(true);
this._currentRegister="Y";
};
Calc.prototype.getDecimalSeparator=function(buttonValue){
return this.inputComponent.maskMgr?this.inputComponent.maskMgr.decimalSeparator:".";
};
Calc.prototype.buttonClicked=function(buttonValue){
buttonValue=buttonValue!=null?buttonValue.toUpperCase():null;
if(buttonValue=="&LARR;"||buttonValue=="BS"){
this.inputComponent.acceptBackSpace();
}else if(buttonValue=="1/X"){
var x=this.inputComponent.getParsedValue();
var newVal=eval("1/" + x);
this.inputComponent.acceptNewValue(newVal);
}else if((buttonValue>="0"&&buttonValue<="9")||buttonValue=="."){
if(buttonValue==".")
buttonValue=this.getDecimalSeparator();
this.setValueChangedAfterRegistered(true);
if(this.justRegistred){
this.justRegistred=false;
this.inputComponent.acceptNewValue(buttonValue);
}else
this.inputComponent.acceptChar(buttonValue);
}else if(buttonValue=="CE"){
this.setValueChangedAfterRegistered(false);
this.setJustRegistred(true);
this.inputComponent.acceptNewValue(0);
}else if(buttonValue=="+/-"){
this.setValueChangedAfterRegistered(true);
var val=this.inputComponent.getParsedValue()+"";
if(val.length>0&&val.charAt(0)=="-")
val=val.substring(1);
else
val="-"+val;
this.inputComponent.acceptNewValue(val);
}else if(buttonValue=="C"){
this.setValueChangedAfterRegistered(false);
this.setJustRegistred(true);
this.inputComponent.acceptNewValue(0);
this.X=this.Y=null;
this._currentRegister="X";
this.operator=null;
}else if(buttonValue=="="){
this._handleEQButton();
}else if(buttonValue=="+"||buttonValue=="-"||buttonValue=="/"||buttonValue=="*"){
this._handleOperatorButton(buttonValue);
}else if(buttonValue=="M+"||buttonValue=="M-"){
if(this.valueChangedAfterRegistered)
this.calculate();
this._currentRegister="X";
this.setValueChangedAfterRegistered(false);
this.memory+=(buttonValue=="M+"?1:-1) * this.inputComponent.getParsedValue();
this.setJustRegistred(true);
}else if(buttonValue==SQRT_SIGN||buttonValue=="SQRT"){
this.setValueChangedAfterRegistered(false);
this.setJustRegistred(true);
var newValue=Math.sqrt(this.inputComponent.getParsedValue());
this.inputComponent.acceptNewValue(newValue);
}else if(buttonValue=="%"){
this.setValueChangedAfterRegistered(false);
this.setJustRegistred(true);
if(this.operator=="*"){
this.calculate(this.inputComponent.getParsedValue() / 100);
}else{
this.inputComponent.acceptNewValue(this.X / 100 * this.inputComponent.getParsedValue());
}
}else if(buttonValue=="MR"){
this.setValueChangedAfterRegistered(false);
this.setJustRegistred(true);
this.inputComponent.acceptNewValue(this.memory);
}else if(buttonValue=="MC"){
this.setValueChangedAfterRegistered(false);
this.setJustRegistred(true);
this.memory=0;
}else{
ICOpen.Log.warn("button "+buttonValue+" is not implemented");
}
if(window.CursorOnFocus)
CursorOnFocus.lastPopUpButtonPressTimestamp=new Date().getTime();
this.inputComponent.focus();
};
Calc.prototype.positionIconClicked=function(){
this.dropDownPanel.positionIconClicked();
};
Calc.prototype.closeIconClicked=function(){
this.dropDownPanel.closeIconClicked();
};
function CalcCSS(baseClassName){
this.className=baseClassName;
this.memoryToolTipBox=new ToolTipBox("CalcMemory");
this.fShow=function(){
this.template.memoryToolTipBox.showRight(this,"&nbsp;"+this.calc.getMemoryFormatted());
};
this.fHide=function(){
this.template.memoryToolTipBox.disappear(false);
};
this.fnRefreshToolTip=function(){
var calc=this.calc;
ICOpen.Utils.setTimeout(function(){
new ToolTipBox('CalcMemory').getBox().innerHTML="&nbsp;"+calc.getMemoryFormatted()
},1);
};
this.createDOM=function(calcObject,_def){
var table=document.createElement("div");
table.align="left";
table.style.MozBoxSizing="border-box";
this.instanceId=(CalcCSS.counter++)+"_calculator";
this.calcObject=ICOpen._(calcObject);
table.innerHTML=CalcCSS._html
.replace(/\$\{id\}/g,this.instanceId)
.replace(/\$\{baseClassName\}/g,this.className)
.replace(/\$\{decimalSeparator\}/g,calcObject.getDecimalSeparator())
.replace(/\$\{imgPath\}/g,IC.MasterDecorator.imagesPath+_def.skin.path);
ICOpen.Utils.IE6_selectTag_workaround(table,0);
return table;
};
this.attachListener=function(no,text,calcObject){
var el=ICOpen.$('bt_'+no+"_"+text);
Event_addListener(el.parentNode,"click",CalcCSS.buttonClickHandler,{listener:calcObject,text:text},true);
if(Event_isIE)
Event_addListener(el.parentNode,"dblclick",CalcCSS.buttonClickHandler,{listener:calcObject,text:text},true);
CalcCSS.attachButtonBehaviour(el.parentNode);
};
this.init=function(_def){
var calcObject=ICOpen.$(this.calcObject);
var labels=["bs","c","ce","0","1","2","3","4","5","6","7","8","9","mr","mc","m+","m-",".","sqrt","*","%","/","-","+","1/x","+/-","="];
for(var i=0;i<labels.length;i++)
this.attachListener(this.instanceId,labels[i],calcObject);
if(_def.customCalcHelpFunction)
Event_addListener(ICOpen.$("bt_"+this.instanceId+"_help").parentNode,"click",_def.customCalcHelpFunction);
else
ICOpen.$("bt_"+this.instanceId+"_help").style.display="none";
Event_addListener(ICOpen.$("bt_"+this.instanceId+"_position").parentNode,"click",calcObject.positionIconClicked,calcObject,true);
Event_addListener(ICOpen.$("bt_"+this.instanceId+"_position"),"mousemove",function(event){
YAHOO.util.Event.stopEvent(event);
});
Event_addListener(ICOpen.$("bt_"+this.instanceId+"_close").parentNode,"click",calcObject.closeIconClicked,calcObject,true);
CalcCSS.attachButtonBehaviour(ICOpen.$("bt_"+this.instanceId+"_close").parentNode);
CalcCSS.attachButtonBehaviour(ICOpen.$("bt_"+this.instanceId+"_position").parentNode);
CalcCSS.attachButtonBehaviour(ICOpen.$("bt_"+this.instanceId+"_help").parentNode);
var mButtons=[
ICOpen.$("bt_"+this.instanceId+"_mc"),
ICOpen.$("bt_"+this.instanceId+"_mr"),
ICOpen.$("bt_"+this.instanceId+"_m+"),
ICOpen.$("bt_"+this.instanceId+"_m-") ];
for(var i=0;i<mButtons.length;i++){
var mButton=mButtons[i];
mButton.calc=calcObject;
mButton.template=this;
Event_addListener(mButton,"mouseover",this.fShow);
Event_addListener(mButton,"click",this.fnRefreshToolTip);
if(Event_isIE)
Event_addListener(mButton,"dblclick",this.fnRefreshToolTip);
Event_addListener(mButton,"mouseout",this.fHide);
}
};
this.preload=function(){
};
};
CalcCSS.doMouseOver=function(){
Dom_AddClass(this,"IC_genericCalcButtonOver");
};
CalcCSS.doMouseDown=function(){
Dom_AddClass(this,"IC_genericCalcButtonDown");
};
CalcCSS.doMouseOut=function(){
Dom_RemoveClass(this,"IC_genericCalcButtonOver");
Dom_RemoveClass(this,"IC_genericCalcButtonDown");
};
CalcCSS.doMouseUp=function(){
Dom_RemoveClass(this,"IC_genericCalcButtonDown");
};
CalcCSS.buttonClickHandler=function(e){
Event_preventDefault(e);
this.listener.buttonClicked(this.text);
};
CalcCSS.attachButtonBehaviour=function(td){
Event_addListener(td,"mouseover",CalcCSS.doMouseOver);
Event_addListener(td,"mouseout",CalcCSS.doMouseOut);
Event_addListener(td,"mousedown",CalcCSS.doMouseDown);
Event_addListener(td,"mouseup",CalcCSS.doMouseUp);
};
CalcCSS.counter=0;
CalcCSS._html='<table class="${baseClassName}" cellpadding="0" cellspacing="0" border="0" onselectstart="return false">'+
'<tr>'+
'<td class=IC_genericCalcBody>'+
'<table cellpadding="0" cellspacing="1">'+
'<tr>'+
'<td class="IC_genericCalcButton IC_genericCalcBS"><div id="bt_${id}_bs">&lt;</div></td>'+
'<td class="IC_genericCalcButton IC_genericCalcC"><div id="bt_${id}_c">c</div></td>'+
'<td class="IC_genericCalcButton IC_genericCalcCE"><div id="bt_${id}_ce">ce</div></td>'+
'<td class="IC_genericCalcButton IC_genericCalcPanel" colspan=3 align="right" id="headerCell_${id}">'+
'<table align="right" cellpadding="0" cellspacing="0" border="0">'+
'<tr>'+
'<td class="IC_genericCalcSmallButton"><div id="bt_${id}_help"><img height="11px" width="12px" src="${imgPath}/helpIcon.gif"></div></td>'+
'<td class="IC_genericCalcSmallButton"><div id="bt_${id}_position"><img height="11px" width="12px" src="${imgPath}/positionIcon.gif"></div></td>'+
'<td class="IC_genericCalcSmallButton"><div id="bt_${id}_close"><img height="11px" width="12px" src="${imgPath}/closeIcon.gif"></div></td>'+
'</tr>'+
'</table>'+
'</td>'+
'</tr>'+
'<tr>'+
'<td class="IC_genericCalcButton IC_genericCalcMC"><div id="bt_${id}_mc">mc</div></td>'+
'<td class="IC_genericCalcButton IC_genericCalcDigit"><div id="bt_${id}_7">7</div></td>'+
'<td class="IC_genericCalcButton IC_genericCalcDigit"><div id="bt_${id}_8">8</div></td>'+
'<td class="IC_genericCalcButton IC_genericCalcDigit"><div id="bt_${id}_9">9</div></td>'+
'<td class="IC_genericCalcButton IC_genericCalcDiv"><div id="bt_${id}_/">/</div></td>'+
'<td class="IC_genericCalcButton IC_genericCalcSqrt"><div id="bt_${id}_sqrt" >&#x221A;</div></td>'+
'</tr>'+
'<tr>'+
'<td class="IC_genericCalcButton IC_genericCalcMR"><div id="bt_${id}_mr" >mr</div></td>'+
'<td class="IC_genericCalcButton IC_genericCalcDigit"><div id="bt_${id}_4" >4</div></td>'+
'<td class="IC_genericCalcButton IC_genericCalcDigit"><div id="bt_${id}_5" >5</div></td>'+
'<td class="IC_genericCalcButton IC_genericCalcDigit"><div id="bt_${id}_6" >6</div></td>'+
'<td class="IC_genericCalcButton IC_genericCalcMult"><div id="bt_${id}_*" >*</div></td>'+
'<td class="IC_genericCalcButton IC_genericCalcPercent"><div id="bt_${id}_%" >%</div></td>'+
'</tr>'+
'<tr>'+
'<td class="IC_genericCalcButton IC_genericCalcMM"><div id="bt_${id}_m-" >m-</div></td>'+
'<td class="IC_genericCalcButton IC_genericCalcDigit"><div id="bt_${id}_1" >1</div></td>'+
'<td class="IC_genericCalcButton IC_genericCalcDigit"><div id="bt_${id}_2" >2</div></td>'+
'<td class="IC_genericCalcButton IC_genericCalcDigit"><div id="bt_${id}_3" >3</div></td>'+
'<td class="IC_genericCalcButton IC_genericCalcMinus"><div id="bt_${id}_-" >-</div></td>'+
'<td class="IC_genericCalcButton IC_genericCalc1DivX"><div id="bt_${id}_1/x" >1/x</div></td>'+
'</tr>'+
'<tr>'+
'<td class="IC_genericCalcButton IC_genericCalcMP"><div id="bt_${id}_m+" >m+</div></td>'+
'<td class="IC_genericCalcButton IC_genericCalcDigit"><div id="bt_${id}_0" >0</div></td>'+
'<td class="IC_genericCalcButton IC_genericCalcSign"><div id="bt_${id}_+/-" >+/-</div></td>'+
'<td class="IC_genericCalcButton IC_genericCalcDot"><div id="bt_${id}_." >${decimalSeparator}</div></td>'+
'<td class="IC_genericCalcButton IC_genericCalcPlus"><div id="bt_${id}_+" >+</div></td>'+
'<td class="IC_genericCalcButton IC_genericCalcEQ"><div id="bt_${id}_=" >=</div></td>'+
'</tr>'+
'</table>'+
'</td>'+
'</tr>'+
''+
'</table>';
var DropDownFactory={
createTemplate:function(_def){
if(_def.type.indexOf("/calc")!=-1){
var name=_def.calcTemplate;
if(name.toLowerCase()=="windowsxplike"||name.toLowerCase()=="windows95like"||name.toLowerCase()=="windowsvistalike")
name=IC.MasterDecorator.CalcCSS_DefautClassName;
return new CalcCSS(name);
}else if(_def.type.indexOf("/calend")!=-1){
var name=_def.calendarTemplate;
return new CalenedarTemplate(name,_def);
}
}
};
function ToolTipBox(instanceName){
this.message="";
if(typeof instanceName=="undefined")
instanceName=ICOpen_getUniqueId();
this.instanceName=instanceName;
this.box=ICOpen.$(instanceName+"_ToolTipBox");
this.visible=false;
};
ToolTipBox.boxOnClick=function(){
this.style.display="none"
};
ToolTipBox.boxOnCompleteHide=function(){
this.getBox().style.display="none";
};
ToolTipBox.boxOnCompleteShow=function(){
this.getBox().style.display="block";
};
ToolTipBox.prototype.getBox=function(_message){
if(this.box==null){
var boxDiv=document.createElement("div");
boxDiv.id=this.instanceName+"_ToolTipBox";
boxDiv.className="toolTipBox";
boxDiv.ToolTipBox=ICOpen._(this);
boxDiv.onclick=ToolTipBox.boxOnClick;
ICOpen.Utils.attachToDocument(boxDiv);
this.box=ICOpen._(boxDiv);
}
return ICOpen.$(this.box);
};
ToolTipBox.prototype.appear=function(animate){
if(animate){
var attributes={
opacity:{from:0.1,to:0.8}
};
Dom_setStyle(this.getBox(),'opacity',0);
Dom_setStyle(this.getBox(),'display','block');
var anim=new_Motion(this.getBox(),attributes,0.5,Easing_easeNone);
anim.onComplete.subscribe(ToolTipBox.boxOnCompleteShow,this,true);
anim.animate();
}else{
Dom_setStyle(this.getBox(),'opacity',0.8);
Dom_setStyle(this.getBox(),'display','block');
}
this.visible=true;
};
ToolTipBox.prototype.disappear=function(animate){
if(!this.visible)
return;
if(animate){
var attributes={
opacity:{to:0}
};
var anim=new_Motion(this.getBox(),attributes,0.3,Easing_easeOut);
anim.onComplete.subscribe(ToolTipBox.boxOnCompleteHide,this,true);
anim.animate();
}else{
Dom_setStyle(this.getBox(),'opacity',0);
Dom_setStyle(this.getBox(),'display','none');
}
this.visible=false;
};
ToolTipBox.prototype.initialize=function(_message,color){
if(color)
this.getBox().style.color=color;
this.getBox().style.display="none";
this.message=_message;
this.getBox().innerHTML=this.message;
this.visible=false;
};
ToolTipBox.prototype.showUnder=function(component,message,color,animate){
this.initialize(message,color);
this.appear(animate);
ShowMaster.moveUnderRight(component,this.getBox());
};
ToolTipBox.prototype.showAbove=function(component,message,color,animate){
this.initialize(message,color);
this.appear(animate);
ShowMaster.moveAbove(component,this.getBox());
};
ToolTipBox.prototype.showRight=function(component,message,color,animate){
this.initialize(message,color);
this.appear(animate);
ShowMaster.moveRight(component,this.getBox());
};
var toolTipBox=new ToolTipBox("default");
function ShowMaster(){
}
ShowMaster.moveUnderRight=function(component,componentToMove,useAnimation){
var region=Region_getRegion(component);
var left=region.left+component.offsetWidth-componentToMove.offsetWidth;
if(left<0)
left=0;
if(useAnimation){
var endPoint=YAHOO.util.Dom.getXY(component);
var attributes={
points:{
to:new YAHOO.util.Point(left,region.bottom+1),
control:[ [left+10,region.bottom+10],[left,region.bottom+20],[left-10,region.bottom+10] ]
}
};
var anim=new_Motion(componentToMove,attributes,0.5,Easing_easeOut);
anim.animate();
}else{
componentToMove.style.left=left+"px";
componentToMove.style.top=region.bottom+1+"px";
}
};
ShowMaster.moveRight=function(component,componentToMove){
var region=Region_getRegion(component);
componentToMove.style.top=region.top+"px";
var left=region.right;
componentToMove.style.left=left+"px";
};
ShowMaster.moveAbove=function(component,componentToMove){
var region=Region_getRegion(component);
var left=region.left+component.offsetWidth-componentToMove.offsetWidth;
if(left<0)
left=0;
componentToMove.style.left=left+"px";
componentToMove.style.top=(region.top-componentToMove.offsetHeight)+"px";
};
ShowMaster.setTopMarginCenter=function(icon,iconHeight,input){
ShowMaster.planSetTopMarginCenter(ICOpen._(icon),ICOpen._(input));
};
ShowMaster.planSetTopMarginCenter=function(_icon,_input){
ICOpen.Utils.setTimeout(function(){
var icon=ICOpen.$(_icon);
var input=ICOpen.$(_input);
var icoR=YAHOO.util.Dom.getRegion(icon);
var inpR=YAHOO.util.Dom.getRegion(input);
var icoC=(icoR.top+icoR.bottom )/2;
var inpC=(inpR.top+inpR.bottom )/2;
icon.style.marginTop=Math.floor(inpC-icoC)+"px";
},1);
};
var SQRT_SIGN="\u221A";
function Calc(_inputComponent){
this.inputComponent=_inputComponent;
this._currentRegister="X";
this.operator=null;
this.justRegistred=false;
this.valueChangedAfterRegistered=false;
this.memory=0;
};
Calc.prototype.setValueChangedAfterRegistered=function(arg){
this.valueChangedAfterRegistered=arg;
};
Calc.prototype.attach=function(_dropDownPanel){
this.dropDownPanel=_dropDownPanel;
var refiner={
handleKeyDown:function(value,c,e){
if(c==13&&_dropDownPanel.visible ){
_dropDownPanel.hide();
Event_preventDefault(e);
if(value!=null)
value.stopProcessing=true;
this.calc._handleEQButton();
}else if(c==27){
if(_dropDownPanel.visible){
_dropDownPanel.dropDownPanelCalled();
if(value!=null)
value.stopProcessing=true;
Event_preventDefault(e);
this.calc.setValueChangedAfterRegistered(false);
this.calc.setJustRegistred(true);
this.calc.X=this.calc.Y=null;
this.calc._currentRegister="X";
this.calc.operator=null;
}
}
},
handleCharEntered:function(value,c,e){
if(" ".charCodeAt(0)==c){
_dropDownPanel.dropDownPanelCalled();
if(value!=null)
value.stopProcessing=true;
Event_preventDefault(e);
}else if("+".charCodeAt(0)==c||("-".charCodeAt(0)==c&&(value==null||!value.isChangeSignCursorPos()) )||
"/".charCodeAt(0)==c||
"*".charCodeAt(0)==c){
if(!_dropDownPanel.visible)
_dropDownPanel.show();
Event_preventDefault(e);
if(value!=null)
value.stopProcessing=true;
this.calc._handleOperatorButton(String.fromCharCode(c));
}else if("=".charCodeAt(0)==c ){
if(!_dropDownPanel.visible)
_dropDownPanel.show();
Event_preventDefault(e);
if(value!=null)
value.stopProcessing=true;
this.calc._handleEQButton();
}else{
this.calc.setValueChangedAfterRegistered(true);
}
},
handleChange:function(){
this.calc.setValueChangedAfterRegistered(true);
},
calc:this
};
this.inputComponent.refiners.push(refiner);
if(this.inputComponent.maskMgr&&this.inputComponent.maskMgr.specialChars){
this.inputComponent.maskMgr.specialChars.push("+");
this.inputComponent.maskMgr.specialChars.push("-");
this.inputComponent.maskMgr.specialChars.push("*");
this.inputComponent.maskMgr.specialChars.push("/");
this.inputComponent.maskMgr.specialChars.push("=");
}
};
Calc.prototype.show=function(){
if(this.inputComponent.maskMgr){
this.inputComponent.maskMgr.setIgnoreFixedDecimalPart(true);
var val=this.inputComponent.getValue();
var valBackup=val;
while(val.length>0&&val.indexOf(this.getDecimalSeparator())!=-1){
var lastCh=val.charAt(val.length-1);
if(lastCh=="0"||lastCh==this.getDecimalSeparator())
val=val.substring(0,val.length-1);
else
break;
}
if(val!=valBackup){
this.inputComponent.acceptNewValue(val);
}
}
};
Calc.prototype.hide=function(){
if(this.inputComponent.maskMgr){
this.inputComponent.maskMgr.setIgnoreFixedDecimalPart(false);
this.inputComponent.maskMgr.init();
}
};
Calc.prototype.getMemoryFormatted=function(){
if(this.inputComponent.maskMgr){
var value=new Value();
value.entered=""+this.memory;
this.inputComponent.maskMgr.handleChange(value);
return value.masked;
}else{
return this.memory;
}
};
Calc.prototype.calculate=function(_y){
this._saveToRegister();
if(this.operator!=null){
if(this.Y==null||this.Y.length==0)
this.Y="0";
if(this.X==null||this.X.length==0)
this.X="0";
var newVal=eval(parseFloat(this.X)+" "+this.operator+" "+parseFloat(this.Y));
this.inputComponent.acceptNewValue(newVal);
this.setValueChangedAfterRegistered(false);
}
};
Calc.prototype._handleEQButton=function(){
this.calculate();
this._currentRegister="X";
this._saveToRegister();
this.setJustRegistred(true);
this.setValueChangedAfterRegistered(false);
};
Calc.prototype.setJustRegistred=function(value){
this.justRegistred=value;
if(value){
ICOpen.Utils.setSelectionRange(this.inputComponent.getElement(),0,65535);
}
};
Calc.prototype._saveToRegister=function(buttonValue){
if(!this.valueChangedAfterRegistered&&this._currentRegister=="Y")
return;
if(this._currentRegister=="X")
this.X=this.inputComponent.getParsedValue();
else
this.Y=this.inputComponent.getParsedValue();
};
Calc.prototype._handleOperatorButton=function(buttonValue){
if(this.valueChangedAfterRegistered)
this.calculate();
this._currentRegister="X";
this._saveToRegister();
this.setValueChangedAfterRegistered(false);
this.operator=buttonValue;
this.setJustRegistred(true);
this._currentRegister="Y";
};
Calc.prototype.getDecimalSeparator=function(buttonValue){
return this.inputComponent.maskMgr?this.inputComponent.maskMgr.decimalSeparator:".";
};
Calc.prototype.buttonClicked=function(buttonValue){
buttonValue=buttonValue!=null?buttonValue.toUpperCase():null;
if(buttonValue=="&LARR;"||buttonValue=="BS"){
this.inputComponent.acceptBackSpace();
}else if(buttonValue=="1/X"){
var x=this.inputComponent.getParsedValue();
var newVal=eval("1/" + x);
this.inputComponent.acceptNewValue(newVal);
}else if((buttonValue>="0"&&buttonValue<="9")||buttonValue=="."){
if(buttonValue==".")
buttonValue=this.getDecimalSeparator();
this.setValueChangedAfterRegistered(true);
if(this.justRegistred){
this.justRegistred=false;
this.inputComponent.acceptNewValue(buttonValue);
}else
this.inputComponent.acceptChar(buttonValue);
}else if(buttonValue=="CE"){
this.setValueChangedAfterRegistered(false);
this.setJustRegistred(true);
this.inputComponent.acceptNewValue(0);
}else if(buttonValue=="+/-"){
this.setValueChangedAfterRegistered(true);
var val=this.inputComponent.getParsedValue()+"";
if(val.length>0&&val.charAt(0)=="-")
val=val.substring(1);
else
val="-"+val;
this.inputComponent.acceptNewValue(val);
}else if(buttonValue=="C"){
this.setValueChangedAfterRegistered(false);
this.setJustRegistred(true);
this.inputComponent.acceptNewValue(0);
this.X=this.Y=null;
this._currentRegister="X";
this.operator=null;
}else if(buttonValue=="="){
this._handleEQButton();
}else if(buttonValue=="+"||buttonValue=="-"||buttonValue=="/"||buttonValue=="*"){
this._handleOperatorButton(buttonValue);
}else if(buttonValue=="M+"||buttonValue=="M-"){
if(this.valueChangedAfterRegistered)
this.calculate();
this._currentRegister="X";
this.setValueChangedAfterRegistered(false);
this.memory+=(buttonValue=="M+"?1:-1) * this.inputComponent.getParsedValue();
this.setJustRegistred(true);
}else if(buttonValue==SQRT_SIGN||buttonValue=="SQRT"){
this.setValueChangedAfterRegistered(false);
this.setJustRegistred(true);
var newValue=Math.sqrt(this.inputComponent.getParsedValue());
this.inputComponent.acceptNewValue(newValue);
}else if(buttonValue=="%"){
this.setValueChangedAfterRegistered(false);
this.setJustRegistred(true);
if(this.operator=="*"){
this.calculate(this.inputComponent.getParsedValue() / 100);
}else{
this.inputComponent.acceptNewValue(this.X / 100 * this.inputComponent.getParsedValue());
}
}else if(buttonValue=="MR"){
this.setValueChangedAfterRegistered(false);
this.setJustRegistred(true);
this.inputComponent.acceptNewValue(this.memory);
}else if(buttonValue=="MC"){
this.setValueChangedAfterRegistered(false);
this.setJustRegistred(true);
this.memory=0;
}else{
ICOpen.Log.warn("button "+buttonValue+" is not implemented");
}
if(window.CursorOnFocus)
CursorOnFocus.lastPopUpButtonPressTimestamp=new Date().getTime();
this.inputComponent.focus();
};
Calc.prototype.positionIconClicked=function(){
this.dropDownPanel.positionIconClicked();
};
Calc.prototype.closeIconClicked=function(){
this.dropDownPanel.closeIconClicked();
};
function ImageButtonBG(){}
ImageButtonBG.createButton=function(name,precedingElement,def){
var hd=IC.IconSet.getHeightDescrition(def.skin,precedingElement);
var isrc=IC.MasterDecorator.imagesPath+def.skin.path+"/"+hd.imageName;
var i=ImageButtonBG.doCreateButton(isrc,
hd.size[name][0],hd.size[name][1],
-hd.offsetsY[name],
-hd.offsetsX["normal"],
-hd.offsetsX["over"],
-hd.offsetsX["down"]);
i.style.cursor=document.all?"hand":"pointer";
return i;
};
ImageButtonBG.createButtonHtml=function(id,cassName,name,precedingElement,def){
var hd=IC.IconSet.getHeightDescrition(def.skin,precedingElement);
var bg=IC.MasterDecorator.imagesPath+def.skin.path+"/"+hd.imageName;
var w=hd.size[name][0];
var h=hd.size[name][1];
var offsetY=-hd.offsetsY[name];
var offsetNormal=-hd.offsetsX["normal"];
var offsetOver=-hd.offsetsX["over"];
var offsetDown=-hd.offsetsX["down"];
return "<a id='"+id+"' class='"+cassName+"' style='cursor:pointer;height:"+h+
"px;width:"+w+"px;background-position:0px "+offsetY+"px;"+
"overflow:hidden;background-image:url("+
bg+")' offsetY='"+offsetY+"' offsetNormal='"+offsetNormal+"' offsetOver='"+offsetOver+"' offsetDown='"+offsetDown+"' "+
" onmouseout='ImageButtonBG.onmouseout(event,this)'"+
" onmouseover='ImageButtonBG.onmouseover(event,this)'"+
" onmouseup='ImageButtonBG.onmouseover(event,this)'"+
" onmousedown='ImageButtonBG.onmousedown(event,this)'"+
" ondblclick='Event_stopPropagation(event)'"+
"'></a>";
};
ImageButtonBG.onmouseover=function(event,obj){
if(!obj)
obj=this;
if(!obj.offsetOver&&obj.offsetOver!=0)
obj.offsetOver=obj.attributes.offsetOver.nodeValue;
if(!obj.offsetY&&obj.offsetY!=0)
obj.offsetY=obj.attributes.offsetY.nodeValue;
obj.style.backgroundPosition=obj.offsetOver+"px "+obj.offsetY+"px";
};
ImageButtonBG.onmousedown=function(event,obj){
if(!obj)
obj=this;
if(!obj.offsetDown&&obj.offsetDown!=0)
obj.offsetDown=obj.attributes.offsetDown.nodeValue;
if(!obj.offsetY&&obj.offsetY!=0)
obj.offsetY=obj.attributes.offsetY.nodeValue;
obj.style.backgroundPosition=obj.offsetDown+"px "+obj.offsetY+"px";
};
ImageButtonBG.onmouseout=function(event,obj){
if(!obj)
obj=this;
if(!obj.offsetNormal&&obj.offsetNormal!=0)
obj.offsetNormal=obj.attributes.offsetNormal.nodeValue;
if(!obj.offsetY&&obj.offsetY!=0)
obj.offsetY=obj.attributes.offsetY.nodeValue;
obj.style.backgroundPosition=obj.offsetNormal+"px "+obj.offsetY+"px";
};
ImageButtonBG.doCreateButton=function(bg,w,h,offsetY,offsetNormal,offsetOver,offsetDown){
var i=document.createElement("div");
var s=i.style;
s.height=h+"px";
s.width=w+"px";
s.overflow="hidden";
s.styleFloat=s.cssFloat="left";
s.backgroundImage="url("+bg+")";
i.offsetY=offsetY;
i.offsetNormal=offsetNormal;
i.offsetOver=offsetOver;
i.offsetDown=offsetDown;
i.onmouseout=ImageButtonBG.onmouseout;
i.onmouseover=i.onmouseup=ImageButtonBG.onmouseover;
i.onmousedown=ImageButtonBG.onmousedown;
i.onmouseout();
s.cursor=document.all?"hand":"pointer";
return i;
};
function ImageButton(){
}
ImageButtonBG.DELAY=250;
ImageButtonBG.CPS=30;























ImageButtonBG._holdTarget=null;
ImageButtonBG._timeoutId=null;
ImageButtonBG.rDown=function(event){
ImageButtonBG._holdTarget=this;
ImageButtonBG._timeoutId=ICOpen.Utils.setTimeout(ImageButtonBG._clicksOnHoldTimeout,ImageButtonBG.DELAY)
};
ImageButtonBG.rUp=function(event){
ImageButtonBG._holdTarget=null;
window.clearTimeout(ImageButtonBG._timeoutId)
};
ImageButtonBG._clicksOnHoldTimeout=function(){
if(ImageButtonBG._holdTarget!=null){
ImageButtonBG._holdTarget.onHold();
ImageButtonBG._timeoutId=ICOpen.Utils.setTimeout(ImageButtonBG._clicksOnHoldTimeout,1000/ImageButtonBG.CPS);
}
};
ImageButtonBG.clicksOnHold=function(element){
Event_addListener(element,"mouseup",ImageButtonBG.rUp);
Event_addListener(element,"mouseout",ImageButtonBG.rUp);
Event_addListener(element,"mousedown",ImageButtonBG.rDown);
};
IC.MasterDecorator=function(){
};
IC.MasterDecorator.CalcCSS_DefautClassName="IC_genericCalc";
IC.MasterDecorator.defsById={};
IC.MasterDecorator.defsByClassName={};
IC.MasterDecorator.processElement=function(input,def){
var finalDefinition={
skin:IC.MasterDecorator.SKIN_XP_BLUE,
className:null,
align:null,
id:null,
type:null,
calcTemplate:IC.MasterDecorator.CalcCSS_DefautClassName
};
ICOpen.Utils.copyProperties(IC.MasterDecorator.globals,finalDefinition);
for(var i in def){
finalDefinition[i]=def[i];
}
var type=finalDefinition.type;
if(ICOpen.Utils.startsWithIgnoreCase(type,"numeric")&&type.indexOf("/c")!=-1){
ICOpen.Utils.markAsProcessed(input);
var name=input.name;
input.style.textAlign=(finalDefinition.align==null)?"right":finalDefinition.align;
var inputComponent=new OICInputComponent(input);
var parent_=input.parentNode;
var nobr=document.createElement("nobr");
parent_.insertBefore(nobr,input);
parent_.removeChild(input);
nobr.appendChild(input);
input.style.verticalAlign="middle";
input.style.marginRight="2px";
var h=new DropDownHelper(finalDefinition,"calculator",Calc);
var helperButton=h.create(inputComponent,input,input);
nobr.appendChild(helperButton);
}
};
IC.MasterDecorator.setCustomCalcHelpFunction=function(_function){
if(_function)
IC.Log.warn("IC.MasterDecorator.setCustomCalcHelpFunction is depricated. Use IC.MasterDecorator.setGlobals({customCalcHelpFunction:...}) instead");
};

IC.MasterDecorator.imagesPath="WiseBlocks_resources/img";

IC.MasterDecorator.setImagesPath=function(_imagesPath){
IC.MasterDecorator.imagesPath=_imagesPath;
};
IC.MasterDecorator.process=function(definition){
if(definition instanceof Array){
for(var i=0;i<definition.length;i++){
var def=definition[i];
IC.MasterDecorator.saveDef(def);
}
}else if(typeof definition!="undefined"&&definition!=null){
IC.MasterDecorator.saveDef(definition);
}
if(IC.MasterDecorator.page_loaded)
IC.MasterDecorator.doProcess();
};
IC.MasterDecorator.saveDef=function(def){
if(def.className!=null){
IC.MasterDecorator.defsByClassName[def.className]=def;
}else if(def.id!=null){
IC.MasterDecorator.defsById [def.id]=def;
}else{
ICOpen.Log.error("className or id missing in the definition");
}
};
IC.MasterDecorator.page_loaded=false;
IC.MasterDecorator.doProcess=function(){
if(window["IC.MasterDecorator.planned"])
return;
IC.MasterDecorator.page_loaded=true;
var inputs=document.getElementsByTagName("input");
IC.MasterDecorator.elByClassName={};
for(var i=0;inputs!=null&&i<inputs.length;i++){
var inp=inputs[i];
if(typeof inp.className!="undefined"&&inp.className!=null&&inp.className.length>0){
var classes=inp.className.split(" ");
var def={};
var toProcess=false;
for(var j=0;j<classes.length;j++){
var c=classes[j];
if(IC.MasterDecorator.defsByClassName[c]){
toProcess=true;
ICOpen.Utils.copyProperties(IC.MasterDecorator.defsByClassName[c],def);
}
}
if(IC.MasterDecorator.defsById[inp.id]){
ICOpen.Utils.copyProperties(IC.MasterDecorator.defsById[inp.id],def);
toProcess=true;
}
if(toProcess)
IC.MasterDecorator.processElement(inp,def);
}
}
for(var i in IC.MasterDecorator.defsById){
if(ICOpen.$(i)!=null)
IC.MasterDecorator.processElement(ICOpen.$(i),IC.MasterDecorator.defsById[i]);
}
};
IC.MasterDecorator.checkCssPresence=function(){
try{
if(window["IC.MasterDecorator.planned"])
return;
for(var s=0;s<document.styleSheets.length;s++){
var ss=document.styleSheets[s];
var rules=ss.rules?ss.rules:ss.cssRules;
for(var j=0;j<rules.length;j++){
if(rules[j].selectorText==".toolTipBox")
return;
}
}
ICOpen.Log.error("Open Input Components CSS not included. Make sure you have included <link rel=stylesheet type=text/css href='YOUR_PATH/WiseBlocks_resources/css/ICOpenCalculator-[VERSION].css' />");
}catch(e){}
};
if(typeof window["ICOpen.MasterDecorator.planned"]=="undefined"){
Event_addListener(window,"load",IC.MasterDecorator.doProcess);
Event_addListener(window,"load",IC.MasterDecorator.checkCssPresence);
window["ICOpen.MasterDecorator.planned"]=true;
}
IC.MasterDecorator.process([{className:"IC_Calc",type:"numeric/calc"},
{className:"IC_Calc_WindowsXPLike",type:"numeric/calc"},
{className:"IC_Calc_Windows95Like",type:"numeric/calc"},
{className:"IC_Calc_WindowsVistaLike",type:"numeric/calc"}]);
IC.IconSet={};
IC.IconSet.getHeightDescrition=function(skin,precedingElement){
var h=precedingElement.offsetHeight;
var heights=skin.heights;
var descr;
outer:
{
for(var i=0;i<128;i++){
if(descr=heights[h-i]) break outer;
if(descr=heights[h+i]) break outer;
}
for(var i in heights){
descr=heights[i];
break;
}
}
return descr;
};
IC.MasterDecorator.SKIN_XP_BLUE={
heights:{
18:{
imageName:"18.gif",
size:{
calculator:[16,18],
calendar:[16,18],
spinUp:[16,6],
spinHandle:[16,6],
spinDown:[16,6],
arrowLeft:[9,15],
arrowRight:[9,15]
},
offsetsY:{
calculator:0,
spinUp:25,
spinHandle:36,
spinDown:47,
calendar:60,
arrowLeft:80,
arrowRight:100
},
offsetsX:{
normal:0,
over:25,
down:50
}
}
},
path:"/xp"
};
IC.MasterDecorator.SKIN_XP_SILVER={
heights:{
18:{
imageName:"18.gif",
size:{
calculator:[16,18],
calendar:[16,18],
spinUp:[16,6],
spinHandle:[16,6],
spinDown:[16,6],
arrowLeft:[9,15],
arrowRight:[9,15]
},
offsetsY:{
calculator:0,
spinUp:25,
spinHandle:36,
spinDown:47,
calendar:60,
arrowLeft:80,
arrowRight:100
},
offsetsX:{
normal:0,
over:25,
down:50
}
}
},
path:"/xp_silver"
};
function DropDownHelper(_def,_name,panelClass){
this.name=_name;
this.def=_def;
this.panelClass=panelClass;
this.create=function(inputComponent,formattedInput,input){
var icon=ImageButtonBG.createButton(this.name,formattedInput,this.def);
icon.valign="center";
icon.style.marginRight="2px";
icon.style.verticalAlign="middle";
icon.formattedInput=ICOpen._(formattedInput);
this.template=DropDownFactory.createTemplate(_def);
var panelContent=new(this.panelClass)(inputComponent);
new DropDownPanel(this.def,inputComponent,icon,this.template,panelContent);
this.preload();
var panel=document.createElement("div");
panel.className="spinnerBox";
var hd=IC.IconSet.getHeightDescrition(this.def.skin,formattedInput);
var panelHeight=hd.size[this.name][1];
var panelWidth=hd.size[this.name][0];
panel.style.height=panelHeight+"px";
panel.style.width=panelWidth+1+"px";
panel.style.paddingLeft="1px";
var prevMrg=(parseInt(formattedInput.style.marginRight,10)||0);
panel.style.marginLeft=-(prevMrg+panelWidth)+"px";
formattedInput.style.marginRight=prevMrg+panelWidth+1+"px";
ShowMaster.setTopMarginCenter(panel,panelHeight,formattedInput);
panel.appendChild(icon);
return panel;
};
this.preload=function(){
if(this.template&&this.template.preload)
this.template.preload();
};
}
function DropDownPanel(_def,_inputComponent,btn,_template,_panelContent ){
this.def=_def;
this.inputComponent=_inputComponent;
this.button=ICOpen._(ICOpen.$(btn));
this.visible=false;
this.calcDiv=null;
this.panelContent=_panelContent;
this.attach();
this.template=_template;
this.X=null;
this.Y=null;
this.autoHideAttached=false;
};
DropDownPanel.Z_INDEX=32001;
DropDownPanel.calcs=[];
DropDownPanel.prototype.getDropDownPanelDiv=function(){
return ICOpen.$(this.calcDiv);
};
DropDownPanel.prototype.getButton=function(){
return ICOpen.$(this.button);
};
DropDownPanel.fnClick=function(e){
Event_preventDefault(e);
this.dropDownPanelCalled();
};
DropDownPanel.prototype.attach=function(){
Event_addListener(this.getButton(),"click",DropDownPanel.fnClick,this,true);
if(Event_isIE)
Event_addListener(this.getButton(),"dblclick",DropDownPanel.fnClick,this,true);




if(this.panelContent)
this.panelContent.attach(this);
};
DropDownPanel.prototype.dropDownPanelCalled=function(){
if(!this.visible)
this.show();
else
this.hide();
};
DropDownPanel.prototype.show=function(){
this.prepareDOM();
this.getDropDownPanelDiv().style.display="";
if(window.CursorOnFocus)
CursorOnFocus.lastPopUpButtonPressTimestamp=new Date().getTime();
this.inputComponent.focus();
this.visible=true;
if(this.panelContent.show)
this.panelContent.show();
if(this.neverPositioned){
ShowMaster.moveUnderRight(this.inputComponent.getElement(),this.getDropDownPanelDiv());
this.neverPositioned=false;
}
};
DropDownPanel.prototype.hide=function(){
this.getDropDownPanelDiv().style.display="none";
this.visible=false;
if(this.panelContent.hide)
this.panelContent.hide();
};
DropDownPanel.prototype.prepareDOM=function(){
if(this.getDropDownPanelDiv()==null){
var table=this.template.createDOM(this.panelContent,this.def );
var newCalcDiv=document.createElement("DIV");
newCalcDiv.style.position="absolute";
newCalcDiv.style.zIndex=DropDownPanel.Z_INDEX;
newCalcDiv.appendChild(table);
ICOpen.Utils.attachToDocument(newCalcDiv);
if(this.def.compactDropDown){
ICOpen.$("headerCell_"+this.template.instanceId).style.display="none";
}
var dd=new_DD(ICOpen._(newCalcDiv));
dd.calc=this;
dd.endDrag=function(){
if(window.CursorOnFocus)
CursorOnFocus.lastPopUpButtonPressTimestamp=new Date().getTime();
this.calc.inputComponent.focus();
};
DropDownPanel.calcs.push(this);
this.calcDiv=ICOpen._(newCalcDiv);
this.template.init(this.def);
this.neverPositioned=true;
}
this.hideOthers();
};
DropDownPanel.prototype.positionIconClicked=function(){
ShowMaster.moveUnderRight(this.inputComponent.getElement(),this.getDropDownPanelDiv(),true);
};
DropDownPanel.prototype.closeIconClicked=function(){
this.hide();
};
DropDownPanel.prototype.hideOthers=function(){
var res=false;
for(var i=0;i<DropDownPanel.calcs.length;i++){
if(DropDownPanel.calcs[i]!=this&&DropDownPanel.calcs[i].visible){
DropDownPanel.calcs[i].hide();
res=true;
}
}
return res;
};
NegativeRed={
condition:function(value){
return value.length>0&&value.charAt(0)=='-';
},
style:{color:"red"}
};
function AbstractMaskManager(){
this.inputComponent=null;
};
AbstractMaskManager.prototype.init=function(){
if(this.inputComponent)
this.inputComponent.onValueChanged(false,true,true);
};
AbstractMaskManager.prototype.onBeforeSetInputComponent=function(_inputComponent){};
AbstractMaskManager.prototype.setInputComponent=function(_inputComponent){
this.onBeforeSetInputComponent(_inputComponent);
this.inputComponent=_inputComponent;
this.attachMaskChangedCallback(this.mask);
};
AbstractMaskManager.prototype.unmask4PostBack=function(){};
AbstractMaskManager.prototype.handleChange=function(){};
AbstractMaskManager.prototype.isValueValid=function(value,acceptPostBackFormat){
var v=new Value();
v.refined=v.entered=value;
this.handleChange(v);
return v.masked==value||(acceptPostBackFormat&&this.unmask4PostBack(v.masked)==value);
}
AbstractMaskManager.prototype.attachMaskChangedCallback=function(mask){
if(mask instanceof DependentValue){
var maskMgr=this;
mask.attachValueChangedCallback(function(depValue){
maskMgr.init();
});
}
};
function NullMaskMgr(_mask,_decimalSeparator,_thousandsSeparator,align){
this.mask=_mask;
this.decimalSeparator=(typeof _decimalSeparator!="undefined")?_decimalSeparator:".";
this.thousandsSeparator=(typeof _thousandsSeparator!="undefined")?_thousandsSeparator:",";
this.defaultAlign=align;
};
NullMaskMgr.prototype=new AbstractMaskManager();
NullMaskMgr.prototype.unmask=function(value){value.unmasked=value.entered;};
NullMaskMgr.prototype.format=function(value){value.masked=value.unmasked;};
NullMaskMgr.prototype.unmask4PostBack=function(entered){return entered};
NullMaskMgr.prototype.handleChange=function(value){
this.unmask(value);
this.format(value);
};
NullMaskMgr.prototype.handleDelKey=function(value,e){
if(value.cursorPos==value.cursorPosEnd){
Event_preventDefault(e);
if(value.cursorPos<value.entered.length){
if(value.masked==null)
value.masked=value.entered;
value.masked=value.masked.substring(0,value.cursorPos)+
value.masked.substring(value.cursorPos+1);
value.newCursorPos=value.cursorPos;
}
}else
value.masked=value.entered;
};
NullMaskMgr.prototype.handleBackspaceKey=function(value,e){
if(value.cursorPos==value.cursorPosEnd){
if(e==null&&value.cursorPos>=1){
if(value.masked==null)
value.masked=value.entered;
value.masked=(value.cursorPos>0?value.masked.substring(0,value.cursorPos-1):"")+
value.masked.substring(value.cursorPos);
value.newCursorPos=value.cursorPos-1;
}
}else
value.masked=value.entered;
};
NullMaskMgr.prototype.handleCharEntered=
NullMaskMgr.prototype.init=
NullMaskMgr.prototype.setIgnoreFixedDecimalPart=
function(){};
window.MaskFactory={
getMaskValueObject:function(mask){
if(mask!=null&&mask.dependsOn)
return new DependentValue(mask.dependsOn,mask);
else
return mask;
},
getMaskMgr:function(finalDefinition){
var mask=MaskFactory.getMaskValueObject(finalDefinition.mask);
var res;
if(ICOpen.Utils.startsWithIgnoreCase(finalDefinition.type,"numeric")){
if(finalDefinition.postBackUnmasked==null)
finalDefinition.postBackUnmasked=true;
if(mask!=null)
res=new NumberMaskMgr(mask,finalDefinition.decimalSeparator,finalDefinition.thousandsSeparator,finalDefinition.postBackUnmasked);
else
res=new NullMaskMgr(mask,finalDefinition.decimalSeparator,finalDefinition.thousandsSeparator,"right");
}else if(ICOpen.Utils.startsWithIgnoreCase(finalDefinition.type,"text")){
if(finalDefinition.postBackUnmasked==null)
finalDefinition.postBackUnmasked="ifEmpty";
if(mask!=null)
res=new TextMaskMgr(finalDefinition,mask);
else{
ICOpen.Log.error("mask is not specified for text mask");
res=new NullMaskMgr(mask,finalDefinition.decimalSeparator,finalDefinition.thousandsSeparator,"left")
}
}else if(ICOpen.Utils.startsWithIgnoreCase(finalDefinition.type,"date")){
if(finalDefinition.postBackUnmasked==null)
finalDefinition.postBackUnmasked="ifEmpty";
res=DateFactory.createMaskMgr(finalDefinition,mask);
}
return res;
}
};
IC.Utils={};
IC.Utils.copySpecifiedProperties=function(from,to,properties){
for(var i=0;i<properties.length;i++)
if(from[properties[i]]&&from[properties[i]]!="")
to[properties[i]]=from[properties[i]];
};
IC.Utils.isDigitCharCode=function(c){
return c>='0'.charCodeAt(0)&&c<='9'.charCodeAt(0);
};
IC.Utils.isDigit=function(c){
return c>='0'&&c<='9';
};
IC.Utils.isAlpha=function(c){
return(c>='A'&&c<='Z')||(c>='a'&&c<='z');
};
IC.Utils.substringByExample=function(_source,_example,_exampleSubstring){
var pos=_example.indexOf(_exampleSubstring);
if(pos==-1)
return "";
else
return _source.substring(pos,pos+_exampleSubstring.length);
};
IC.Utils.instringByExample=function(_source,value,_example,_exampleSubstring,fillIn){
var pos=_example.indexOf(_exampleSubstring);
if(pos>-1){
value=value+"";
while(value.length<_exampleSubstring.length&&fillIn){
value=fillIn+value;
}
return _source.substring(0,pos)+value+_source.substring(pos+_exampleSubstring.length);
}else
return _source;
};
IC.Utils.log=function(){
if(ICOpen.$("log")!=null){
var str="<br>";
for(var i=0;i<arguments.length;i++)
str+=arguments[i]+" , ";
ICOpen.$("log").innerHTML+=str;
}
};
IC.Utils.applyConditions=function(){
if(this.conditions){
var style={};
for(var i=0;i<this.conditions.length;i++){
var res;
var cDef=this.conditions[i];
var val=this.getValue();
try{
res=cDef.condition(val);
}catch(e){
ICOpen.Log.error("User defined 'condition' function generated "+e.name+" exception :"+e.message+" function:"+cDef.condition);
}
if(res){
ICOpen.Utils.copyProperties(cDef.style,style);
}
}
for(var prop in style)
if(typeof this.defaultStyle[prop]=="undefined"){
this.defaultStyle[prop]=this.getElement().style[prop];
}
for(var prop in this.defaultStyle)
if(typeof style[prop]=="undefined")
style[prop]=this.defaultStyle[prop];
for(var prop in style)
if(typeof this.defaultStyle[prop]=="undefined"){
this.defaultStyle[prop]=this.getElement().style[prop];
}
for(var prop in style){
if(this.getElement().style[prop]!=style[prop]){
this.getElement().style[prop]=style[prop];
}
}
}
};
IC.Utils.defultBodyBorder=null;
IC.Utils.getDefultBodyBorder=function(){
if(IC.Utils.defultBodyBorder!=null)
return IC.Utils.defultBodyBorder;
else{
IC.Utils.defultBodyBorder=2;
ie:
if(Event_isIE){
var parentFrames=window.parent.document.getElementsByTagName('iframe');
for(var i=0;i<parentFrames.length;i++){
var ifr=parentFrames[i];
if(ifr.contentWindow==window){
var ifrHTML=ifr.outerHTML.toUpperCase();
if(ifrHTML.indexOf("FRAMEBORDER")!=-1&&ifrHTML.indexOf("FRAMEBORDER=YES")==-1&&ifrHTML.indexOf("FRAMEBORDER=1")==-1){
IC.Utils.defultBodyBorder=0;
break ie;
}
}
}
if(window.parent.document.getElementsByTagName('frame').length!=0)
IC.Utils.defultBodyBorder=0;
}
return IC.Utils.defultBodyBorder;
}
};
IC.Utils.setBorderSizingTLWH=function(obj,t,l,w,h){
var dl=0,dt=0,dw=0,dh=0;
if(!ICOpen.Utils.isBorderBoxModel()){
dl=IC.Utils.getBorderWidth(obj,"Left");
dt=IC.Utils.getBorderWidth(obj,"Top");
dw=dl+IC.Utils.getBorderWidth(obj,"Right");
dh=dt+IC.Utils.getBorderWidth(obj,"Bottom");
if(obj.style.width=="0px")
dl=0;
if(obj.style.height=="0px")
dt=0;
if(Event_isIE&&window.parent!=window&&window.parent.document.getElementsByTagName('frame').length!=0){
dl=dt=2;
}
}else{
var style=document.body.currentStyle||document.body.style;
var leftBodyWidth=parseInt(style.borderLeftWidth,10);
if(isNaN(leftBodyWidth))
leftBodyWidth=IC.Utils.getDefultBodyBorder();
var topBodyWidth=parseInt(style.borderTopWidth,10);
if(isNaN(topBodyWidth))
topBodyWidth=IC.Utils.getDefultBodyBorder();
var leftDelta=leftBodyWidth-1;
var topDelta=topBodyWidth-1;
dl=IC.Utils.getBorderWidth(obj,"Left")-leftDelta;
dt=IC.Utils.getBorderWidth(obj,"Top")-topDelta;
}
IC.Utils.setStylePx(obj,"left",l+dl);
IC.Utils.setStylePx(obj,"top",t+dt);
IC.Utils.setStylePx(obj,"width",w-dw);
IC.Utils.setStylePx(obj,"height",h-dh);
};
IC.Utils.getBorderWidth=function(obj,direction){
var w=obj.style["border"+direction+"Width"];
return w.length==0?0:parseInt(w,10);
};
IC.Utils.AllEvents=[
"abort","activate","afterprint","afterupdate","beforeactivate","beforecopy",
"beforecut","beforedeactivate","beforeeditfocus","beforepaste","beforeprint","beforeunload",
"beforeupdate","blur","bounce","cellchange","change","click",
"ctextmenu","ctrolselect","copy","cut","dataavailable","datasetchange",
"datasetcomplete","dblclick","deactivate","drag","dragend","dragenter",
"dragleave","dragover","dragstart","drop","error","errorupdate",
"filterchange","finish","focus","focusin","focusout","help",
"keydown","keypress","keyup","layoutcomplete","load","losecapture",
"mousedown","mouseenter","mouseleave","mousemove","mouseout","mouseover",
"mouseup","mousewheel","move","moveend","movestart","paste",
"reset","resize","resizeend","resizestart",
"rowenter","rowexit","rowsdelete","rowsinserted","scroll","select",
"selectichange","selectstart","start","submit","timeerror","unload"
];
IC.Utils.EventTypes={
'HTMLEvents':['initEvent','abort','blur','change','error','focus','load','reset','resize','scroll','select','submit','unload'],
'KeyEvents':['initKeyEvent','keydown','keypress','keyup'],
'MouseEvents':['initMouseEvent','click','mousedown','mousemove','mouseout','mouseover','mouseup']
};
IC.Utils.attachOnChangeSimulation_onblur=function(event){
var e=Event_getTarget(event);
var res=true;
if(e['old.value']!=e.value){
IC.Utils.onChangeEventOk=true;
IC.Utils.delegateEvent(e,event,"change");
IC.Utils.onChangeEventOk=false;
res=event.IC_returnValue;
if(typeof res=="boolean"&&res)
e['old.value']=e.value;
else{
e.value=e['old.value'];
}
}
e['focused']=e;
return res;
};
IC.Utils.attachOnChangeSimulation_onfocus=function(event){
var e=Event_getTarget(event);
if(!e['focused'])
e['old.value']=e.value;
e['focused']=true;
}
IC.Utils.attachOnChangeSimulation=function(el,onChangeDelegate){
Event_simpleAddListener(el,"blur",IC.Utils.attachOnChangeSimulation_onblur);
Event_simpleAddListener(el,"focus",IC.Utils.attachOnChangeSimulation_onfocus);
};
IC.Utils.getEventDelegate=function(delegateTo){
return function(event){
return IC.Utils.delegateEvent(delegateTo,event,event.type);
}
};
IC.Utils.delegateEvent=function(target,event,type){
if(type=="unload")
return;
if(type=="change"&&!IC.Utils.onChangeEventOk){
return true;
}
if(Spinner.isDragging)
return;
var obj=ICOpen.$(target);
var evObj=event;
if(obj.dispatchEvent){
var et;
var method;
outer:
for(var t in IC.Utils.EventTypes){
for(var i=1;i<IC.Utils.EventTypes[t].length;i++){
if(type==IC.Utils.EventTypes[t][i]){
et=t;
method=IC.Utils.EventTypes[t][0];
break outer;
}
}
}
evObj=document.createEvent(et);
evObj.onChangeOk=event.onChangeOk;
if(method=="initKeyEvent"){
evObj[method](type,
event.bubbles,
event.cancelable,
event.windowObject,
event.ctrlKey,
event.altKey,
event.shiftKey,
event.metaKey,
event.keyCode,
event.charCode);
}else{
evObj[method](type,
event.bubbles,
event.cancelable,
event.windowObject,
event.detail,
event.screenX,
event.screenY,
event.clientX,
event.clientY,
event.ctrlKey,
event.altKey,
event.shiftKey,
event.metaKey,
event.button,
obj);
}
var res=obj.dispatchEvent(evObj);
}else{
var res=obj.fireEvent("on"+type,event);
}
if(type=="change")
res=event.IC_returnValue=((typeof evObj.IC_returnValue!="undefined")?evObj.IC_returnValue:res);
return res;
};
IC.Utils.setStylePx=function(obj,name,value){
value+='px';
if(obj.style[name]!=value)
obj.style[name]=value;
};
IC.Utils.attachOnMouseWheel=function(el,handler,instance){
el=ICOpen._(el);
var wheel=function(event){
var delta=0;
if(!event) 
event=window.event;
if(event.wheelDelta){
delta=event.wheelDelta / 120;
if(window.opera)
delta=-delta;
}else if(event.detail){

delta=-event.detail / 3;
}
if(delta)
handler.call(instance,delta);
if(event.preventDefault)
event.preventDefault();
event.returnValue=false;
};
if(window.addEventListener) 
ICOpen.$(el).addEventListener('DOMMouseScroll',wheel,false);
ICOpen.$(el).onmousewheel=wheel;
};
IC.Log=ICOpen.Log;
function DependentValue(_target,_options){
this.valueOptions=_options;
if(ICOpen.$(_target)!=null){
this.target=_target;
}else{
ICOpen.Log.error("DependentValue target not found:"+_target);
}
this.attachToTarget();
this.listeners=[];
this.toString=DependentValue.DependentValue_toString;
};
DependentValue.prototype.maskModifierFunction=function(rawMask){return rawMask};
DependentValue.prototype.getMaxSize=function(_function){
var max=0;
for(var key in this.valueOptions){
var option=this.maskModifierFunction(this.valueOptions[key]+"");
if(option.length>max){
max=(option).length;
}
}
return max;
};
DependentValue.prototype.attachValueChangedCallback=function(_function){
this.listeners.push(_function);
};
DependentValue.prototype.targetValueChanged=function(){
try{
for(var i=0;i<this.listeners.length;i++)
this.listeners[i](this);
}catch(e){}
};
DependentValue.prototype.attachToTarget=function(){
Event_addListener(ICOpen.$(this.target),"change",this.targetValueChanged,this,true);
};
DependentValue.DependentValue_toString=function(){
var el=ICOpen.$(this.target);
var key;
if(el.tagName.toUpperCase()=="SELECT"){
var o=el.options[el.selectedIndex];
key=o.value?o.value:o.text;
}else
key=ICOpen.$(this.target).value;
if(this.valueOptions[key])
return this.maskModifierFunction(this.valueOptions[key]);
else if(this.valueOptions['default'])
return this.maskModifierFunction(this.valueOptions['default']);
else
return this.maskModifierFunction(key);
};
function Value(){
this.cursorPos=0;
this.cursorPosEnd=0;
this.newCursorPos=null;
this.newCursorPosEnd=null;
this.entered=null;
this.refined=null;
this.masked=null;
this.unmasked=null;
this.formatted=null;
this.validated=false;
this.error=null;
this.warning=null;
this.stopProcessing=false;
};
Value.prototype.isChangeSignCursorPos=function(){
return this.cursorPos==this.cursorPosEnd
&&(this.cursorPos==0
||(this.cursorPos==1&&this.entered.charAt(0)=="-")
)
};
function FixedCharMask(_char){
this.letter=_char;
}
FixedCharMask.prototype.isEditable=function(){
return false
};
FixedCharMask.prototype.maskChar=FixedCharMask.prototype.maskEmptyChar=function(value,pos){
return this.letter;
};
function RegExpCharMask(_regexp,_blankChar,_modifier,_errorMessage){
this.regexp=_regexp;
this.blankChar=_blankChar;
this.modifier=_modifier;
this.errorMessage=_errorMessage
}
RegExpCharMask.prototype.isEditable=function(){
return true;
};
RegExpCharMask.prototype.maskChar=function(value,pos,ch,ignoreModifiers){
if(typeof ch=="undefined")
ch=value.unmasked.charAt(pos);
if(ch==this.blankChar||ch.match(this.regexp)!=null){
if(this.modifier&&!ignoreModifiers)
return this.modifier.modify(ch);
else
return ch;
}else{
value.error=this.errorMessage;
value.newCursorPos=pos;
return this.blankChar;
}
};
RegExpCharMask.prototype.maskEmptyChar=function(value,pos){
return this.blankChar;
};
function CharMaskFactory(){};
CharMaskFactory.parseDefinition=function(definition,mask ){
var res=[];
var regExps={
"@":/[a-zA-Z]/,
"#":/[0-9]/,
"*":/./,
"!":new RegExp("[!'#S%&\"\\(\\)\\*+,-\\.\\/\\:;<=>\\?@\\[\\/\\]\\^_\\{\\|\\}~]")
};
if(definition.maskDefinitions)
for(var i in definition.maskDefinitions)
regExps[i]=definition.maskDefinitions[i];
var errors={
"@":"alphaExpectedHere",
"#":"digitExpectedHere",
"!":"punctuationExpectedHere"
};
for(var i in definition.maskErrors)
errors[i]=definition.maskErrors[i];
mask=mask.toString();
var modifiers=definition.caseFormatters;
var i=0;
var escapedCharIndex=-1;
for(var j=0;j<mask.length;j++){
var ch=mask.charAt(j);
if(ch=="\\"){
escapedCharIndex=j+1;
}else{
var modifier=null;
if(modifiers&&i<modifiers.length){
if(modifiers.charAt(i)=="+")
modifier=CharMaskFactory.upperCaseModifier;
else if(modifiers.charAt(i)=="-")
modifier=CharMaskFactory.lowerCaseModifier;
}
var chMask;
if(regExps[ch]&&escapedCharIndex!=j){
var bc=definition.blankCharacter.charAt(Math.min(j,definition.blankCharacter.length-1));
chMask=new RegExpCharMask(regExps[ch],bc,modifier,errors[ch]);
}else{
chMask=new FixedCharMask(ch);
}
res.push(chMask);
i++;
}
}
return res;
};
CharMaskFactory.upperCaseModifier={
modify:function(ch){
return ch!=null?ch.toUpperCase():null;
}
};
CharMaskFactory.lowerCaseModifier={
modify:function(ch){
return ch!=null?ch.toLowerCase():null;
}
};
function TextMaskMgr(_definition,maskObject){
this.postBackUnmasked=_definition.postBackUnmasked;
this.definition=_definition;
this.mask=maskObject;
this.defaultAlign="left";
}
;
TextMaskMgr.prototype=new AbstractMaskManager();
TextMaskMgr.prototype.unmask4PostBack=function(entered){
if(typeof this.postBackUnmasked=="string"&&this.postBackUnmasked.toLowerCase()=="ifempty"){
var cms=this.charMasks;
var empty=true;
for(var i=0;empty&&i<entered.length&&i<cms.length;i++){
var ch=entered.substring(i,i+1);
var cm=cms[i];
if(cm.isEditable()&&ch!=cm.blankChar)
empty=false;
}
return empty?"":entered;
}else if(this.postBackUnmasked){
var cms=this.charMasks;
var res="";
for(var i=0;i<entered.length&&i<cms.length;i++){
var ch=entered.substring(i,i+1);
var cm=cms[i];
if(cm.isEditable()&&(ch!=cm.blankChar||(typeof this.postBackUnmasked=="string"&&this.postBackUnmasked.toLowerCase()=="withblankchars"))){
res+=ch;
}
}
return res;
}else
return entered;
};
TextMaskMgr.prototype.init_parent=AbstractMaskManager.prototype.init;
TextMaskMgr.prototype.init=function(){
this.charMasks=CharMaskFactory.parseDefinition(this.definition,this.mask);
this.init_parent();
};
TextMaskMgr.prototype.handleChange=function(value){
this.unmask(value);
this.format(value);
};
TextMaskMgr.prototype.unmask=function(value){
value.unmasked=value.entered;
};
TextMaskMgr.prototype.format=function(value){
value.masked="";
var pos=value.cursorPos;
for(var i=0,j=0;i<value.unmasked.length&&j<this.charMasks.length;i++&j++){
value.masked+=this.charMasks[j].maskChar(value,i);
if((!this.charMasks[j].isEditable())&&(value.unmasked.charAt(i)!=this.charMasks[j].maskChar(value,i)) ){
if(pos<=i+1) pos++;
i--;
value.newCursorPos=null;
}
}
for(var i=value.masked.length;i<this.charMasks.length;i++){
value.masked+=this.charMasks[i].maskEmptyChar();
}
if(value.newCursorPos==null){
while(pos<this.charMasks.length&&!this.charMasks[pos].isEditable())
pos++;
if(pos!=value.cursorPos)
value.newCursorPos=pos;
}
};
TextMaskMgr.prototype.handleCharEntered=function(value,c,e){
value.unmasked=value.entered;
if(value.cursorPos==value.cursorPosEnd){
var pos=value.cursorPos;
while(pos<this.charMasks.length&&!this.charMasks[pos].isEditable())
pos++;
if(pos<value.entered.length){
var ch=String.fromCharCode(c);
if(ch!=this.charMasks[pos].maskChar(value,pos,ch,true)){
Event_preventDefault(e);
}else{
value.masked=value.entered.substring(0,pos)+value.entered.substring(pos+1);
}
value.newCursorPos=pos;
}else if(pos=this.charMasks.length)
Event_preventDefault(e);
}
};
TextMaskMgr.prototype.isDigitCharCode=function(c){
return c>='0'.charCodeAt(0)&&c<='9'.charCodeAt(0);
};
TextMaskMgr.prototype.isDigit=function(c){
return c>='0'&&c<='9';
};
TextMaskMgr.prototype.handleBackspaceKey=function(value,e){
if(value.cursorPos==value.cursorPosEnd){
var pos=value.cursorPos;
while(pos>0&&!this.charMasks[pos-1].isEditable())
pos--;
if(pos>=1&&value.cursorPos>=1){
value.masked=value.entered.substring(0,pos-1)
+this.charMasks[pos-1].maskEmptyChar()
+value.entered.substring(pos);
value.newCursorPos=pos-1;
Event_preventDefault(e);
}
}else
value.masked=value.entered;
};
TextMaskMgr.prototype.handleDelKey=function(value,e){
var pos=value.cursorPos;
if(pos==value.cursorPosEnd){
if(pos<value.entered.length){
value.masked=value.entered.substring(0,pos)
+this.charMasks[pos].maskEmptyChar()
+value.entered.substring(pos+1);
value.newCursorPos=pos+1;
Event_preventDefault(e);
}
}else
value.masked=value.entered;
};
function NumberMaskMgr(_mask,_decimalSeparator,_thousandsSeparator,_postBackUnmasked){
this.postBackUnmasked=_postBackUnmasked;
this.mask=_mask;
this.decimalSeparator=(typeof _decimalSeparator!="undefined")?_decimalSeparator:".";
this.thousandsSeparator=(typeof _thousandsSeparator!="undefined")?_thousandsSeparator:",";
this.specialChars=[];
this.defaultAlign="right";
this.ignoreFixedDecimalPart=false;
this.positiveOnly=false;
};
NumberMaskMgr.applyToElement=function(id,mask,decSep,thouSep,cursorOnFocus){
var el=document.getElementById(id);
if(!el){
Event_addListener(window,"load",function(){
NumberMaskMgr.applyToElement(id,mask,decSep,thouSep,cursorOnFocus);
});
return;
}
var mm=new NumberMaskMgr(mask||"####,###,###,###,###.##",decSep||".",thouSep||",");
if(GracefulFallback.enabled){
var ic=new InputComponent(el);
ic.setMaskMgr(mm);
mm.positiveOnly=true;
mm.setInputComponent(ic);
mm.init();
new CursorOnFocus(ic,cursorOnFocus||"beforedecimal");
}
};
NumberMaskMgr.prototype=new AbstractMaskManager();
NumberMaskMgr.prototype.setIgnoreFixedDecimalPart=function(value){
if(this.ignoreFixedDecimalPart!=value&&this.getMask().indexOf("0")!=-1){
this.ignoreFixedDecimalPart=value;
}
};
NumberMaskMgr.prototype.handleChange=function(value){
if(this.thousandsSeparator!=".")
value.entered=value.entered.replace(".",this.decimalSeparator);
this.unmask(value);
this.format(value);
};
NumberMaskMgr.prototype.unmask=function(value){
value.unmasked=this.unmaskValue(value.entered,value);
};
NumberMaskMgr.prototype.unmaskValue=function(valueEntered,valueObject){
var tmp=valueEntered.split(this.decimalSeparator).join("|");
for(var i=0;i<tmp.length;i++){
if(!IC.Utils.isDigit(tmp.charAt(i))&&(tmp.charAt(i)!="-"||i>0)&&(tmp.charAt(i)!="|")){
if(valueObject&&valueObject.cursorPos>i)
valueObject.cursorPos--;
tmp=tmp.substring(0,i)+((i+1<tmp.length)?tmp.substring(i+1):"");
i--;
}
}
var isNegative=tmp.length>0&&tmp.charAt(0)=="-";
while((tmp.length>1||(tmp.length==1&&tmp.charAt(0)=="-"))&&(tmp.charAt(0)=="0"||tmp.charAt(0)=="-"))
tmp=tmp.substring(1);
tmp=(isNegative?"-":"")+tmp.split("|").join(".");
return tmp;
};
NumberMaskMgr.prototype.unmask4PostBack=function(entered){
if(this.postBackUnmasked){
return this.unmaskValue(entered);
}else
return entered;
};
NumberMaskMgr.prototype.getMask=function(){
return this.mask.toString();
};
NumberMaskMgr.prototype.format=function(value){
var elements=value.unmasked.split(".");
var masks=this.getMask().split(".");
var elInt=elements[0];
var isNegative=false;
if(elInt.length>1&&elInt.charAt(0)=="-"){
elInt=elInt.substring(1);
isNegative=true;
}
var maskInt=masks[0];
var formattedInt="";
var i=elInt.length-1,j=maskInt.length-1;
value.newCursorPos=0;
while(i>=0&&j>=0){
if(maskInt.charAt(j)=="#"||maskInt.charAt(j)=="0"){
formattedInt=elInt.charAt(i)+formattedInt;(i<value.cursorPos)?value.newCursorPos++:0;
}else if(maskInt.charAt(j)==","){
formattedInt=this.thousandsSeparator+formattedInt;(i<value.cursorPos)?value.newCursorPos++:0;
i++;
}else
ICOpen.Log.error("'"+maskInt.charAt(j)+"' character not recognised in "+this.getMask()+" numeric mask");
i--;
j--;
}
if(i>=0){
elements[0]=elements[0].substring(0,elements[0].length-i-1);
value.unmasked=elements.join(".");
this.format(value);
value.feedback=new Feedback();
return;
}
if(maskInt.charAt(maskInt.length-1)=="0"&&formattedInt.length==0)
formattedInt="0";
if(formattedInt.length>0&&formattedInt.charAt(0)==this.thousandsSeparator)
formattedInt=formattedInt.substring(1);
if(isNegative)
formattedInt="-"+formattedInt;
var elDec;
if(masks.length>1){
var maskDec=masks[1];
elDec=(elements.length>1)?elements[1]:"";
var zeros=0,sharps=0;
for(i=0;i<maskDec.length;i++){
zeros+=maskDec.charAt(i)=="0"?1:0;
sharps+=maskDec.charAt(i)=="#"?1:0;
}
if(this.ignoreFixedDecimalPart){
sharps+=zeros;
zeros=0;
}
if(elDec.length<zeros)
elDec+="0000000000000000000000000000".substring(0,zeros-elDec.length);
else if(elDec.length>zeros+sharps)
elDec=elDec.substring(0,zeros+sharps);
}else{
elDec=null;
}
if(elDec!=null){
if(elInt.length<=value.cursorPos){
value.newCursorPos+=value.cursorPos-elInt.length;
}
if(elDec.length!=0)
value.masked=formattedInt+this.decimalSeparator+elDec;
else
value.masked=formattedInt+(elements.length>1?this.decimalSeparator:"");
}else{
value.masked=formattedInt;
}
};
NumberMaskMgr.prototype.handleCharEntered=function(value,c,e){
if(c=="-".charCodeAt(0)&&value.isChangeSignCursorPos()){
Event_preventDefault(e);
if(this.positiveOnly)
return;
value.masked="-"+value.entered;
if(value.masked.length>1&&value.masked.charAt(1)=="-"){
value.masked=value.masked.substring(2);
value.newCursorPos=0;
}else
value.newCursorPos=1;
}else if(c==this.decimalSeparator.charCodeAt(0)){
var posDot=value.entered.indexOf(this.decimalSeparator);
if(posDot!=-1){
Event_preventDefault(e);
value.newCursorPos=posDot+1;
return;
}
}else if(!IC.Utils.isDigitCharCode(c)&&(!this.isSpecialCharCode(c))){
value.error="digitOrDotExpectedHere";
Event_preventDefault(e);
return;
}else{
if(value.entered.length>0&&value.cursorPos==0&&value.cursorPosEnd==0&&value.entered.charAt(0)=="-")
value.newCursorPos=1;
value.masked=null;
}
};
NumberMaskMgr.prototype.isSpecialCharCode=function(c){
for(var i=0;i<this.specialChars.length;i++){
var cc=this.specialChars[i].charCodeAt(0);
if(c==cc)
return true;
}
return false;
};
NumberMaskMgr.prototype.handleBackspaceKey=function(value,e){
if(value.cursorPos==value.cursorPosEnd){
if(value.cursorPos>=1){
var prevCh=value.entered.charAt(value.cursorPos-1);
if(prevCh=="-"||IC.Utils.isDigit(prevCh)||(prevCh==this.decimalSeparator&&value.cursorPos==value.entered.length)){
if(value.masked==null)
value.masked=value.entered;
value.newCursorPos=value.cursorPos;
if(e==null){
value.masked=(value.cursorPos>0?value.masked.substring(0,value.cursorPos-1):"")+
value.masked.substring(value.cursorPos);
value.newCursorPos=value.cursorPos-1;
}
}else{
value.cursorPos--;
value.cursorPosEnd--;
this.handleBackspaceKey(value,e);
}
}
}else
value.masked=value.entered;
};
NumberMaskMgr.prototype.handleDelKey=function(value,e){
if(value.cursorPos==value.cursorPosEnd){
if(value.cursorPos<value.entered.length){
var ch=value.entered.charAt(value.cursorPos);
if((!IC.Utils.isDigit(ch))&&(ch!="-")&&value.cursorPos+1<value.entered.length){
value.cursorPos++;
value.cursorPosEnd++;
this.handleDelKey(value,e);
}else{
if(value.masked==null)
value.masked=value.entered;
value.newCursorPos=value.cursorPos;
}
}
}else
value.masked=value.entered;
};
function InputComponent(el,elUnmasked){
this.element=ICOpen._(el);
if(elUnmasked){
this.elementUnmasked=ICOpen._(elUnmasked);
elUnmasked.facade=this.element;
elUnmasked.inputComponent=ICOpen._(this);
elUnmasked.getFacade=InputComponent_getFacace;
elUnmasked.focus_bak=elUnmasked.focus;
elUnmasked.focus=InputComponent_getFacaceFocus;
elUnmasked.setValue=InputComponent_setValue;
elUnmasked.valueUpdated=InputComponent_valueUpdated;
}
el.facade=this.element;
el.getFacade=InputComponent_getFacace;
el.inputComponent=ICOpen._(this);
el.setValue=InputComponent_setValue;
el.valueUpdated=InputComponent_valueUpdated;
this.refiners=[];
this.maskMgr=null;
this.conditions=null;
this.formatter=null;
this.validators=[];
this.defaultStyle={};
this.value=new Value();
this.attach();
this.toolTipBox=new ToolTipBox("InputComponent_"+el.name);
this.keepMessageTill=0;
this.justTyped=false;
InputComponent.all.push(this);
}
InputComponent.detach=function(el){
el.focus=el.focus_bak;
el.facade=el.getFacade=el.valueUpdated=el.setValue=undefined;
Event_removeListener(el,"keydown",InputComponent.prototype.onKeyDown);
Event_removeListener(el,"keypress",InputComponent.prototype.onKeyPress);
Event_removeListener(el,"blur",InputComponent.prototype.onBlur);
}
InputComponent.prototype=new OICInputComponent();
function InputComponent_getFacace(){
return ICOpen.$(this.facade);
}
function InputComponent_getFacaceFocus(){
return ICOpen.$(this.facade).focus();
}
function InputComponent_setValue(_value){
this.getFacade().value=_value;
this.valueUpdated();
}
function InputComponent_valueUpdated(){
ICOpen.$(this.inputComponent).onValueChanged(true,true,true);
}
InputComponent.all=[];
InputComponent.valueChangeCheck4All=function(){
for(var i=0;i<InputComponent.all.length;i++){
var ic=InputComponent.all[i];
ic._valueChangeCheck();
}
InputComponent.ScheduleValueChangeCheck4All();
};
InputComponent.ScheduleValueChangeCheck4All=function(){
ICOpen.Utils.setTimeout(InputComponent.valueChangeCheck4All, 500);
};
InputComponent.ScheduleValueChangeCheck4All();
InputComponent.prototype.setConditions=function(_conditions){
this.conditions=_conditions;
this.lastValue=null;
this.onValueChanged(false);
};
InputComponent.prototype.setMaskMgr=function(_maskMgr){
this.maskMgr=_maskMgr;
};
InputComponent.prototype.onKeyPress=function(e){
if(e.keyCode==13)
return this.onEnterKey();
this._scheduleCopyUnmasked();
var c=(typeof e.charCode=="undefined")?e.keyCode:c=e.charCode;
if(e.keyCode>0&&e.charCode==0)
return;
this.onBeforeCharEntered(c,e);
this._scheduleValueChangeCheck();
};
InputComponent.prototype.onKeyDown=function(e){
this._initValueObject();
var intercepted=false;
for(var i=0;i<this.refiners.length&&!this.value.stopProcessing&&!intercepted;i++)
if(this.refiners[i].handleKeyDown)
intercepted=this.refiners[i].handleKeyDown(this.value,e.keyCode,e);
if(!intercepted){
if(e.keyCode==46){
this.maskMgr.handleDelKey(this._initValueObject(),e);
intercepted=true;
}
else if(e.keyCode==8){
this.maskMgr.handleBackspaceKey(this._initValueObject(),e);
intercepted=true;
}
}
if(intercepted){
if(this.value.masked!=null){
this._applyMaskedValueChange();
this._applyConditions();
this._scheduleOnValueChange();
}
this._applyCursorPositionChange();
this._copyUnmasked();
}
this._applyErrorMessage(true);
if(e.keyCode==27){
Event_preventDefault(e);
return false;
}
};
InputComponent.prototype.getElement=function(){
return ICOpen.$(this.element);
};
InputComponent.prototype.attach=function(){
var el=this.getElement();
Event_addListener(el,"keydown",this.onKeyDown,this,true);
Event_addListener(el,"keypress",this.onKeyPress,this,true);
Event_addListener(el,"blur",this.onBlur,this,true);
IC.MasterDecorator.addReleaseAction(ICOpen.$(this.elementUnmasked)||el,InputComponent.detach);
};
InputComponent.prototype._valueChangeCheck=function(){
var vl=this.getElement().value;
if(vl!=this.lastValue){
this.onValueChanged();
this._copyUnmasked();
this.lastValue=this.getElement().value;
}
};
InputComponent.prototype._scheduleCopyUnmasked=function(){
var instance=this;
ICOpen.Utils.setTimeout(function(){
instance._copyUnmasked()
},100);
};
InputComponent.prototype._scheduleValueChangeCheck=function(){
var instance=this;
ICOpen.Utils.setTimeout(function(){
instance._valueChangeCheck()
},10);
};
InputComponent.prototype._scheduleOnValueChange=function(){
var instance=this;
ICOpen.Utils.setTimeout(function(){
instance.onValueChanged()
},10);
};
InputComponent.prototype._copyUnmasked=function(){
var value=this.getValue();
if(this.maskMgr!=null){
if(this.maskMgr.unmask4PostBack)
value=this.maskMgr.unmask4PostBack(value);
}
if(this.elementUnmasked&&ICOpen.$(this.elementUnmasked).value!=value){
ICOpen.$(this.elementUnmasked).value=value;
}
};
InputComponent.prototype._initCursorPos=function(){
try{
var el=this.getElement();
if(typeof el.selectionStart!="undefined"){
this.value.cursorPos=el.selectionStart;
this.value.cursorPosEnd=el.selectionEnd;
}else{
this.value.cursorPos=Math.abs(document.selection.createRange().duplicate().moveStart("character",-10000000));
this.value.cursorPosEnd=Math.abs(document.selection.createRange().duplicate().moveEnd("character",-10000000));
}
}catch(e){
this.value.cursorPos=this.value.cursorPosEnd=0;
}
};
InputComponent.prototype._initValueObject=function(){
this.value.entered=this.getElement().value;
this._initCursorPos();
this.value.newCursorPos=null;
this.value.newCursorPosEnd=null;
this.value.masked=null;
this.value.error=null;
this.value.feedback=null;
this.value.stopProcessing=false;
return this.value;
};
InputComponent.prototype.onBeforeCharEntered=function(c,e){
if(e.ctrlKey&&!e.altKey)
return;
this._initValueObject();
this.value.refined=this.value.entered;
for(var i=0;i<this.refiners.length&&!this.value.stopProcessing;i++)
this.refiners[i].handleCharEntered(this.value,c,e);
if(this.value.stopProcessing)
return;
if(this.maskMgr!=null){
if(this.value.refined==this.value.entered){
this.maskMgr.handleCharEntered(this.value,c,e);
}else
this.maskMgr.handleChange(this.value);
}
this._applyErrorMessage(true);
if(this.value.entered==this.value.masked)
return;
this.justTyped=true;
this._applyMaskedValueChange();
this._applyConditions();
this._applyCursorPositionChange();
};
InputComponent.prototype.onValueChanged=function(hideToolTipIfNoError,ignoreErrors,maskChanged){
if(this.lastValue==this.getElement().value&&(typeof maskChanged=="undefined"||!maskChanged)){
if(!ignoreErrors)
this._applyErrorMessage(hideToolTipIfNoError);
return;
}
this._initValueObject();
this.value.entered=this.getElement().value;
this.value.refined=this.value.entered;
for(var i=0;i<this.refiners.length&&!this.value.stopProcessing;i++)
this.refiners[i].handleChange(this.value);
if(this.value.stopProcessing)
return;
this.value.masked=this.value.refined;
this.value.unmasked=this.value.refined;
if(this.maskMgr!=null)
this.maskMgr.handleChange(this.value);
if(!ignoreErrors)
this._applyErrorMessage(hideToolTipIfNoError);
if(this.value.entered==this.value.masked){
if(this.justTyped){
this.justTyped=false;
if(this.value.newCursorPos!=null)
this._applyCursorPositionChange();
}
}else{
this._applyMaskedValueChange();
if(typeof maskChanged=="undefined"||!maskChanged)
this._applyCursorPositionChange();
this._copyUnmasked();
}
this._applyConditions();
};
InputComponent.prototype.onBlur=function(){
this.toolTipBox.disappear(true);
};
InputComponent.prototype.getValue=function(){
return this.getElement().value;
};
InputComponent.prototype._applyConditions=IC.Utils.applyConditions;
InputComponent.prototype._applyCursorPositionChange=function(){
if(Spinner.isDragging)
return;
this._initCursorPos();
if(this.value.newCursorPos!=null&&(this.value.cursorPos==this.value.cursorPosEnd)){
ICOpen.Utils.setSelectionRange(this.getElement(),this.value.newCursorPos,this.value.newCursorPosEnd);
}
};
InputComponent.prototype._applyMaskedValueChange=function(){
if(this.value.masked!=null&&this.getElement().value!=this.value.masked){
if(this.value.newCursorPos==null)
this.value.newCursorPos=this.value.cursorPos;
this.getElement().value=this.lastValue=this.value.masked;
}
};
InputComponent.prototype.showMessage=function(message,color){
this.toolTipBox.showUnder(this.getElement(),IC.Dictionary.translate(message),color,true);
this.keepMessageTill=new Date().getTime()+2000;
};
InputComponent.prototype._applyErrorMessage=function(hideToolTipIfNoError){
if(this.value.error!=null){
this.toolTipBox.showUnder(this.getElement(),IC.Dictionary.translate(this.value.error),"black",true);
this.keepMessageTill=new Date().getTime()+2000;
}else if(hideToolTipIfNoError){
if((this.keepMessageTill<new Date().getTime()))
this.toolTipBox.disappear(true);
}
if(this.value.feedback!=null){
this.value.feedback.run(this.element);
}
};
InputComponent.prototype.focus=function(){
if(!Spinner.isDragging){
this.getElement().focus();
}
};
InputComponent.prototype.getParsedValue=function(){
if(this.maskMgr.parseValue)
return this.maskMgr.parseValue(this.getValue());
else{
var value=new Value();
value.entered=this.getValue();
this.maskMgr.unmask(this.value);
return this.value.unmasked;
}
};
InputComponent.prototype.acceptChar=function(ch){
this.focus();
this.getElement().value+=ch;
this.onValueChanged(true);
ICOpen.Utils.setSelectionRange(this.getElement(),this.value.masked.length);
this._scheduleCopyUnmasked();
};
InputComponent.prototype.acceptBackSpace=function(){
this.focus();
this._initValueObject();
if(this.value.entered==null||this.value.entered.length==0)
return;
this.value.cursorPos=this.value.cursorPosEnd=this.value.entered.length;
this.maskMgr.handleBackspaceKey(this.value,null);
this.value.entered=this.value.masked;
this.maskMgr.handleChange(this.value);
this._applyErrorMessage(true);
this._applyMaskedValueChange();
this._applyConditions();
ICOpen.Utils.setSelectionRange(this.getElement(),this.value.entered.length);
this._scheduleCopyUnmasked();
};
InputComponent.prototype.acceptNewValue=function(val){
this.focus();
if(this.maskMgr.prepareAcceptNewValue)
val=this.maskMgr.prepareAcceptNewValue(val);
if(typeof val!="string")
val=""+val;
this._initValueObject();
this.value.entered=val;
this.maskMgr.handleChange(this.value);
this._applyErrorMessage(true);
this._applyMaskedValueChange();
this._applyConditions();
this._scheduleCopyUnmasked();
this.value.newCursorPos=this.getElement().value.length;
this._applyCursorPositionChange();
};
InputComponent.prototype.onEnterKey=function(val){
return true;
};
function InputDecorator(inp,definition,_maskMgr,_helpers){
this.def=definition;
this.maskMgr=_maskMgr;
this.helpers=_helpers;
this.decorateAll(inp);
}
;
InputDecorator.removeFacade=function(e){
if(typeof e.style_display_bak!="undefined")
e.style.display=e.style_display_bak;
if(e.classname_bak)
e.className=e.classname_bak;
var f=e.getFacade();
if(f){
f.style.display="none";
f.parentNode.removeChild(f);
document.body.appendChild(f);
}
};
InputDecorator.dropHelpers=function(e){
var nobr=e.previousSibling;
if(nobr&&nobr.tagName.toLowerCase()=="nobr"){
nobr.style.display="none";
nobr.parentNode.removeChild(nobr);
document.body.appendChild(nobr);
}
};
InputDecorator.prototype.decorateAll=function(unmaskedInput){
ICOpen.Utils.markAsProcessed(unmaskedInput);
var unmaskedInputName=unmaskedInput.name;
var formattedInput;
var formattedName=unmaskedInputName;
if(this.def.postBackUnmasked||this.def.postBackDateFormat){
formattedName=unmaskedInputName+"_formatted";
formattedInput=document.createElement("input");
ICOpen.Utils.markAsProcessed(formattedInput);
formattedInput.style.marginRight="2px";
var propertiesToCopy=["size","className","value","accessKey","disabled","tabIndex","title","width"];
IC.Utils.copySpecifiedProperties(unmaskedInput,formattedInput,propertiesToCopy);
var delegate=IC.Utils.getEventDelegate(ICOpen._(unmaskedInput));
for(var t=0;t<IC.Utils.AllEvents.length;t++){
var ev=IC.Utils.AllEvents[t];
Event_simpleAddListener(formattedInput,ev,delegate);
if(ev=="change"){
IC.Utils.attachOnChangeSimulation(formattedInput,delegate);
}
}
var from=unmaskedInput.style;
var to=formattedInput.style;
for(var i in from){
try{
var _from=from[i];
if(_from&&(_from!=""||!i.startsWithIgnoreCase("border"))){
to[i]=from[i];
}
}catch(e){
}
}
formattedInput.name=formattedName;
unmaskedInput.parentNode.insertBefore(formattedInput,unmaskedInput);
if(!window["IC.postBackFieldVisible"]){
unmaskedInput.style_display_bak=unmaskedInput.style.display;
unmaskedInput.style.display="none";
}
unmaskedInput.classname_bak=unmaskedInput.className;
unmaskedInput.className="";
IC.MasterDecorator.addReleaseAction(unmaskedInput,InputDecorator.removeFacade);
}else{
formattedInput=unmaskedInput;
unmaskedInput=null;
unmaskedInputName=null;
}
if(this.def.autoSize&&this.maskMgr.mask!=null){
formattedInput.size=(this.maskMgr.mask instanceof DependentValue)?(this.maskMgr.mask.getMaxSize()):this.maskMgr.mask.length;
}
formattedInput.style.textAlign=(this.def.align==null)?this.maskMgr.defaultAlign:this.def.align;
var inputComponent=new InputComponent(formattedInput,unmaskedInput);
inputComponent.setMaskMgr(this.maskMgr);
if(this.def.min!=null&&this.def.min>=0)
this.maskMgr.positiveOnly=true;
this.maskMgr.setInputComponent(inputComponent);
this.maskMgr.init();
inputComponent.setConditions(this.def.conditions);
HighlightBox.attachAutoHighlighting(formattedInput,this.def.highlight,this.def.borderStyle);
if(this.helpers!=null&&typeof this.helpers!="undefined"&&this.helpers.length>0){
var parent_=formattedInput.parentNode;
var nobr=document.createElement("nobr");
parent_.insertBefore(nobr,formattedInput);
parent_.removeChild(formattedInput);
nobr.appendChild(formattedInput);
formattedInput.style.verticalAlign="middle";
formattedInput.style.marginRight="2px";
for(var i=0;i<this.helpers.length;i++){
var h=this.helpers[i];
var helperButton=h.create(inputComponent,formattedInput,unmaskedInput);
nobr.appendChild(helperButton);
}
IC.MasterDecorator.addReleaseAction(unmaskedInput||formattedInput,InputDecorator.dropHelpers);
}
if(this.def.cursorOnFocus!=null)
new CursorOnFocus(inputComponent,this.def.cursorOnFocus);
};
IC.Dictionary=function(){
};
IC.Dictionary.getLanguage=function(){
if(IC.Dictionary._lang!=null)
return IC.Dictionary._lang;
var browserLang;
if(navigator.language){
browserLang=navigator.language.toUpperCase();
}else
browserLang=navigator.browserLanguage.toUpperCase();
if(browserLang.length>2)
browserLang=browserLang.substring(0,2);
return browserLang;
};
IC.Dictionary.setLanguage=function(_language){
IC.Dictionary._lang=_language.toUpperCase();
};
IC.Dictionary._lang=null;
IC.Dictionary.translate=function(key){
var _lang=IC.Dictionary.getLanguage();
var res;
if(IC.Dictionary[_lang+"_"+key])
res=IC.Dictionary[_lang+"_"+key];
else if(IC.Dictionary[key])
res=IC.Dictionary[key];
else
res=key;
return res;
};
IC.Dictionary.addTranslation=function(key,message){
IC.Dictionary[key]=message;
};
function HighlightBox(_highlight){
this.highlight=_highlight;
this.element=null;
this.visible=false;
}
HighlightBox.BLACK=["#000000","#AAAAAA","#DDDDDD"];
HighlightBox.BLUE=["#4455FF","#99AAFF","#DDEEFF"];
HighlightBox.BROWN=["#996600","#DD9944","#FFDD88"];
HighlightBox.GRAY=["#999999","#CCCCCC","#EEEEEE"];
HighlightBox.GREEN=["#22AA22","#66FF66","#CCFFCC"];
HighlightBox.PINK=["#FF00FF","#FF88FF","#FFDDFF"];
HighlightBox.PURPLE=["#9933FF","#CC88FF","#F8DDFF"];
HighlightBox.RED=["#FF0000","#FF9999","#FFEEEE"];
HighlightBox.WHITE=["#FFFFFF","#FFFFFF","#FFFFFF"];
HighlightBox.YELLOW=["#DDDD00","#FFFF88","#FFFFDD"];
HighlightBox.ORANGE=["#AA6622","#FF9966","#FFDDCC"];
HighlightBox.NONE=[false,false,false];
HighlightBox.active=null;
HighlightBox.borders=null;
HighlightBox.positionCheck=function(){
if(HighlightBox.active&&HighlightBox.active.visible)
HighlightBox.active._positionCheck();
HighlightBox.SchedulePositionChangeCheck();
};
HighlightBox.SchedulePositionChangeCheck=function(){
ICOpen.Utils.setTimeout(HighlightBox.positionCheck, 1000);
};
HighlightBox.SchedulePositionChangeCheck();
HighlightBox.prototype._positionCheck=function(){
if(this.visible&&this.element!=null){
this.showAround(ICOpen.$(this.element));
}
};
HighlightBox.prototype._newBorderDiv=function(position){
var _div=document.createElement("div");
_div.appendChild(document.createTextNode("\u00A0"));
_div.style.position="absolute";
_div.style.overflow="hidden";
switch(position){
case 0:
_div.style.borderLeft="1px solid "+this.highlight[2];
_div.style.borderRight="1px solid "+this.highlight[1];
_div.style.width="0px";
break;
case 1:
_div.style.borderTop="1px solid "+this.highlight[2];
_div.style.borderBottom="1px solid "+this.highlight[1];
_div.style.height="0px";
break;
case 2:
_div.style.borderLeft="1px solid "+this.highlight[1];
_div.style.borderRight="1px solid "+this.highlight[2];
_div.style.width="0px";
break;
case 3:
_div.style.borderTop="1px solid "+this.highlight[1];
_div.style.borderBottom="1px solid "+this.highlight[2];
_div.style.height="0px";
break;
}
ICOpen.Utils.attachToDocument(_div);
_div.style.visibility="hidden";
return _div;
};
HighlightBox["perf.optim"]=true;
HighlightBox.prototype.showAround=function(component){
HighlightBox.active=this;
this.visible=true;
this.element=ICOpen._(component);
var region=Region_getRegion(component);
var dx=Event_isIE?-3:-1;
var dy=Event_isIE?-3:-1;
if(!this.borders){
this.borders=[];
for(var i=0;i<4;i++)
this.borders.push(ICOpen._(this._newBorderDiv(i)));
}
for(var i=0;i<this.borders.length;i++){
var b=ICOpen.$(this.borders[i]);
b.style.visibility="visible";
b.style.zIndex="32000";
switch(i){
case 0:
IC.Utils.setBorderSizingTLWH(b,
region.top+dy+(ICOpen.Utils.isBorderBoxModel()?1:0),
region.left-1+dx,
2,
region.bottom-region.top+2);
break;
case 1:
IC.Utils.setBorderSizingTLWH(b,
region.top-1+dy
,region.left+dx+(ICOpen.Utils.isBorderBoxModel()?1:0)
,region.right-region.left+1
,2);
break;
case 2:
IC.Utils.setBorderSizingTLWH(b,
region.top+dy+(ICOpen.Utils.isBorderBoxModel()?1:0)
,region.right+dx+1
,2
,region.bottom-region.top+2);
break;
case 3:
IC.Utils.setBorderSizingTLWH(b,
region.bottom+dy+1
,region.left+dx+(ICOpen.Utils.isBorderBoxModel()?1:0)
,region.right-region.left+2
,2);
}
}
};
HighlightBox.prototype.backupBorderColors=function(el){
this.backupBorderColorLeft=el.style.borderLeftColor;
this.backupBorderColorTop=el.style.borderTopColor;
this.backupBorderColorRight=el.style.borderRightColor;
this.backupBorderColorBottom=el.style.borderBottomColor;
};
HighlightBox.prototype.applyBorderColors=function(el){
el.style.borderLeftColor=this.highlight[0];
el.style.borderTopColor=this.highlight[0];
el.style.borderRightColor=this.highlight[0];
el.style.borderBottomColor=this.highlight[0];
};
HighlightBox.prototype.restoreBorderColors=function(el){
el.style.borderLeftColor=this.backupBorderColorLeft;
el.style.borderTopColor=this.backupBorderColorTop;
el.style.borderRightColor=this.backupBorderColorRight;
el.style.borderBottomColor=this.backupBorderColorBottom;
};
HighlightBox.prototype.hide=function(){
if(HighlightBox.active==this)
HighlightBox.active=null;
this.visible=false;
for(var i=0;i<4;i++)
ICOpen.$(this.borders[i]).style.visibility="hidden";
};
HighlightBox.onfocus=function(){
var hBox=ICOpen.$(this.highlightBox);
hBox.backupBorderColors(this);
hBox.applyBorderColors(this);
hBox.showAround(this);
};
HighlightBox.onblur=function(){
var hBox=ICOpen.$(this.highlightBox);
hBox.restoreBorderColors(this);
hBox.hide();
};
HighlightBox.detachAutoHighlighting=function(control){
Event_removeListener(control,"focus",HighlightBox.onfocus);
Event_removeListener(control,"blur",HighlightBox.onblur);
};
HighlightBox.attachAutoHighlighting=function(control,highlight,borderStyle){
if(control.getFacade)
control=control.getFacade()
if(!highlight||(highlight[0]==HighlightBox.NONE[0]&&highlight[1]==HighlightBox.NONE[1]&&highlight[2]==HighlightBox.NONE[2] ))
return;
control.highlightBox=ICOpen._(new HighlightBox(highlight));
Event_addListener(control,"focus",HighlightBox.onfocus);
Event_addListener(control,"blur",HighlightBox.onblur);
if(!ICOpen.Utils.startsWithIgnoreCase(borderStyle,"css")){
var s=control.style;
if(!s.borderLeftWidth&&!s.borderTopWidth&&!s.borderRightWidth&&!s.borderBottomWidth&&!borderStyle){
borderStyle="1px solid #7F9DB9";
};
if(borderStyle!=null&&borderStyle.length!=0){
try{
s.border=borderStyle;
}catch(e){
ICOpen.Log.error("User defined 'borderStyle':"+borderStyle+" application failed with "+e.name+" exception :"+e.message);
}
}
}
IC.MasterDecorator.addReleaseAction(control,HighlightBox.detachAutoHighlighting);
};
function SpinnerHelper(_def){
this.def=_def;
this.create=function(inputComponent,formattedInput,input){
var spinner=new Spinner(inputComponent,formattedInput,input,this.def);
return ICOpen.$(spinner.panel);
};
}
;
function SpinnerRefiner(_spinner){
this.spinner=_spinner;
this.handleCharEntered=function(value,c,e){
if("+".charCodeAt(0)==c){
this.spinner._upClick();
Event_preventDefault(e);
}else if("-".charCodeAt(0)==c&&
value.cursorPos>=((value.entered.length>0&&value.entered.charAt(0)=='-')?2:1)){
this.spinner._downClick();
Event_preventDefault(e);
}
};
this.handleChange=function(){
};
this.handleKeyDown=function(value,c,e){
if(c==38){
this.spinner._upClick();
Event_preventDefault(e);
}else if(c==40){
this.spinner._downClick();
Event_preventDefault(e);
}
};
}
function Spinner(inputComponent,formattedInput,input,_def){
this.step=Spinner.nvl(_def.spinStep,_def.step,1);
this.scale=Spinner.nvl(_def.spinScale,_def.scale,1);
this.min=Spinner.nvl(_def.spinMin,_def.min,null);
this.max=Spinner.nvl(_def.spinMax,_def.max,null);
this.spinner=this;
this.inputComponent=inputComponent;
this.formattedInput=ICOpen._(formattedInput);
this.input=ICOpen._(input);
this._createPanel(_def);
this._attachMouseWheel();
if(this.inputComponent.maskMgr.specialChars){
this.inputComponent.maskMgr.specialChars.push("+");
this.inputComponent.maskMgr.specialChars.push("-");
}
this.inputComponent.refiners.push(new SpinnerRefiner(this));
}
;
Spinner.nvl=function(a,b,c){
return(a!=null?a:b!=null?b:c);
};
Spinner.prototype._handleMouseWheel=function(delta){
var baseValue=parseFloat(this.inputComponent.getParsedValue());
if(isNaN(baseValue)) baseValue=0;
this.inputComponent.acceptNewValue(this.rangeCheck(baseValue+this.step * delta));
};
Spinner.prototype._attachMouseWheel=function(value){
IC.Utils.attachOnMouseWheel(this.inputComponent.getElement(),this._handleMouseWheel,this);
IC.Utils.attachOnMouseWheel(ICOpen.$(this.panel),this._handleMouseWheel,this);
};
Spinner.prototype.rangeCheck=function(value){
return(this.min!=null&&value<this.min)?res=this.min:(this.max!=null&&value>this.max)?this.max:value;
};
Spinner.prototype._upClick=function(){
var ic=ICOpen.$(this.inputComponent);
var val=parseFloat(ic.getParsedValue());
if(isNaN(val)) val=0;
ic.acceptNewValue(this.spinner.rangeCheck(val+this.spinner.step));
};
Spinner.prototype._downClick=function(){
var ic=ICOpen.$(this.inputComponent);
var val=parseFloat(ic.getParsedValue());
if(isNaN(val)) val=0;
ic.acceptNewValue(this.spinner.rangeCheck(val-this.spinner.step));
};
Spinner.prototype._focus=function(){
var ic=ICOpen.$(this.inputComponent);
ic.focus();
};
Spinner.nullFunction=function(){
};
Spinner.isDragging=false;
Spinner.prototype._createPanel=function(_def){
var unmaskedInput=ICOpen.$(this.input);
var formattedInput=ICOpen.$(this.formattedInput);
var panel=document.createElement("div");
panel.className="spinnerBox";
var hd=IC.IconSet.getHeightDescrition(_def.skin,formattedInput);
var panelHeight=hd.size["spinDown"][1]+hd.size["spinUp"][1]+hd.size["spinHandle"][1];
panel.style.height=panelHeight+"px";
var width=hd.size["spinDown"][0];
panel.style.width=width+1+"px";
panel.style.paddingLeft="1px";
var prevMrg=(parseInt(formattedInput.style.marginRight,10)||0);
panel.style.marginLeft=-(prevMrg+width)+"px";
formattedInput.style.marginRight=prevMrg+width+1+"px";
ShowMaster.setTopMarginCenter(panel,panelHeight,formattedInput);
if(formattedInput.nextSibling!=null)
formattedInput.parentNode.insertBefore(panel,formattedInput.nextSibling);
else
formattedInput.parentNode.appendChild(panel);
var up=ImageButtonBG.createButton("spinUp",formattedInput,_def);
var handle=ImageButtonBG.createButton("spinHandle",formattedInput,_def);
handle.className="spinnerHandle";
handle.style.cursor="";
handle.style.display="block";
var down=ImageButtonBG.createButton("spinDown",formattedInput,_def);
panel.appendChild(up);
panel.appendChild(handle);
panel.appendChild(down);
up.inputComponent=down.inputComponent=handle.inputComponent=ICOpen._(this.inputComponent);
up.spinner=down.spinner=this;
Event_addListener(up,"click",this._upClick);
Event_addListener(down,"click",this._downClick);
Event_addListener(handle,"mouseup",this._focus);
if(Event_isIE){
Event_addListener(up,"dblclick",this._upClick);
Event_addListener(down,"dblclick",this._downClick);
}
up.onHold=this._upClick;
down.onHold=this._downClick;
ImageButtonBG.clicksOnHold(up);
ImageButtonBG.clicksOnHold(down);
this.ddInit=function(){
var dd=new_DD(ICOpen._(handle));
dd.spinner=this;
dd.inputComponent=this.inputComponent;
dd.handle=ImageButtonBG.createButton("spinHandle",formattedInput,_def);
dd.handle.onmouseover();
dd.handle.onmouseover=dd.handle.onmouseout=dd.onmousedown=dd.onmouseup=Spinner.nullFunction;
dd.handle.src=handle.src;
dd.handle.style.position="absolute";
dd.handle.style.display="none";
dd.handle.style.cursor="n-resize";
dd.handle.style.zIndex="32767";
dd.handle.style.border=handle.style.border;
ICOpen.Utils.attachToDocument(dd.handle);
dd.startDrag=function(){
this.inputComponent.focus();
Spinner.isDragging=true;
this.baseValue=parseFloat(this.inputComponent.getParsedValue());
if(isNaN(this.baseValue)) this.baseValue=0;
var el=this["getEl"]();
this.baseRegion=Dom_getXY(el);
dd.handle.style.display="block";
el.style.visibility="hidden";
};
dd.onDrag=function(){
var el=this["getEl"]();
var newXY=Dom_getXY(el);
this.inputComponent.acceptNewValue(this.spinner.rangeCheck(this.baseValue+this.spinner.step * Math.round((this.baseRegion[1]-newXY[1]) / this.spinner.scale)
),true);
dd.handle.style.left=newXY[0]+"px";
dd.handle.style.top=newXY[1]-1+"px";
};
dd.endDrag=function(){
Spinner.isDragging=false;
var el=this["getEl"]();
el.style.top=el.style.left="";
dd.handle.style.display="none";
el.style.visibility="visible";
};
dd.setXConstraint(0,0,0);
}
Event_addListener(handle,"mouseover",function(){
if(this.ddInit){
this.ddInit();
this.ddInit=null;
}
},this,true);
this.panel=ICOpen._(panel);
};
if(!IC['MasterDecorator'])
IC.MasterDecorator=function(){};
IC.MasterDecorator.DEFAULT_DECIMAL_SEPARATOR=".";
IC.MasterDecorator.DEFAULT_THOUSANDS_SEPARATOR=",";
IC.MasterDecorator.DEFAULT_BLANK_CHAR="_";
IC.MasterDecorator.DEFAULT_HIGHLIGHTING=["#22AA22","#66FF66","#CCFFCC"];
IC.MasterDecorator.CalcCSS_DefautClassName="IC_genericCalc";
IC.MasterDecorator.defsById={};
IC.MasterDecorator.defsByClassName={};
IC.MasterDecorator.getFilanDef=function(){
return{
clickToClose:false,
skin:IC.MasterDecorator.SKIN_XP_BLUE,
className:null,
align:null,
id:null,
type:null,
mask:null,
decimalSeparator:IC.MasterDecorator.DEFAULT_DECIMAL_SEPARATOR,
thousandsSeparator:IC.MasterDecorator.DEFAULT_THOUSANDS_SEPARATOR,
highlight:null,
blankCharacter:IC.MasterDecorator.DEFAULT_BLANK_CHAR,
formulaRefrehPeriod:1000,
calcTemplate:IC.MasterDecorator.CalcCSS_DefautClassName,
step:null,
scale:null,
max:null,
min:null,
spinStep:null,
spinScale:null,
spinMax:null,
spinMin:null,
autoSize:true,
cursorOnFocus:null,
postBackUnmasked:null,
postBackDateFormat:null,
conditions:null,
customCalcHelpFunction:null,
customCalendarHelpFunction:null,
compactDropDown:false
};
}
IC.MasterDecorator.processElement=function(inp,def){
var finalDefinition=IC.MasterDecorator.getFilanDef();
ICOpen.Utils.copyProperties(IC.MasterDecorator.globals,finalDefinition);
for(var i in def){
finalDefinition[i]=def[i];
}
var type=finalDefinition.type;
var maskMgr=MaskFactory.getMaskMgr(finalDefinition);
if(ICOpen.Utils.startsWithIgnoreCase(type,"numeric/formula")){
if(finalDefinition.id==null){
ICOpen.Log.error("id required for numeric/formula definition");
}else{
var ff=new FormulaField(finalDefinition.id,
finalDefinition.formulaRefrehPeriod,
finalDefinition.formula,
maskMgr
);
ff.setConditions(finalDefinition.conditions);
}
}else if(GracefulFallback.enabled){
if(ICOpen.Utils.startsWithIgnoreCase(type,"numeric")||ICOpen.Utils.startsWithIgnoreCase(type,"date")){
var helpers=[];
var typeLower=type.toLowerCase();
if(typeLower.indexOf("/calc")!=-1)
helpers.push(new DropDownHelper(finalDefinition,"calculator",Calc));
if(typeLower.indexOf("/calend")!=-1)
helpers.push(new DropDownHelper(finalDefinition,"calendar",Calendar));
if(typeLower.indexOf("/s")!=-1)
helpers.push(new SpinnerHelper(finalDefinition));
new InputDecorator(inp,finalDefinition,maskMgr,helpers);
}else if(ICOpen.Utils.startsWithIgnoreCase(type,"text/mask")){
new InputDecorator(inp,finalDefinition,maskMgr);
}else{
if(!ICOpen.Utils.isProcessed(inp)){
HighlightBox.attachAutoHighlighting(inp,finalDefinition.highlight,finalDefinition.borderStyle);
ICOpen.Utils.markAsProcessed(inp);
if(finalDefinition.cursorOnFocus!=null)
new CursorOnFocus(inp,finalDefinition.cursorOnFocus);
inp.getFacade=return_this;
inp.setValue=InputComponent_setValue;
inp.valueUpdated=return_this;
}
}
}
};
function return_this(){
return this;
};
IC.MasterDecorator.addReleaseAction=function(element,action){
if(!element.releaseActions)
element.releaseActions=[];
element.releaseActions.push(ICOpen._(action));
};
IC.MasterDecorator.releaseElement=function(element){
element=ICOpen.$(element);
if(!element)
return;
if(!ICOpen.Utils.isProcessed(element)&&element.childNodes){
var ch=element.childNodes;
for(var i=0;i<ch.length;i++){
IC.MasterDecorator.releaseElement(ch[i]);
}
}
if(element.releaseActions){
for(var i=0;i<element.releaseActions.length;i++){
ICOpen.$(element.releaseActions[i])(element);
}
element.releaseActions.length=0;
ICOpen.Utils.unmarkAsProcessed(element);
}
};
IC.MasterDecorator.setCustomCalcHelpFunction=function(_function){
if(_function)
IC.Log.warn("IC.MasterDecorator.setCustomCalcHelpFunction is depricated. Use IC.MasterDecorator.setGlobals({customCalcHelpFunction:...}) instead");
};
IC.MasterDecorator.imagesPath="WiseBlocks_resources/img";
IC.MasterDecorator.setImagesPath=function(_imagesPath){
IC.MasterDecorator.imagesPath=_imagesPath;
};
IC.MasterDecorator.getImagesPath=function(){
return IC.MasterDecorator.imagesPath;
};
IC.MasterDecorator.globals={
highlight:IC.MasterDecorator.DEFAULT_HIGHLIGHTING
};
IC.MasterDecorator.setGlobals=function(_def){
for(var i in _def){
IC.MasterDecorator.globals[i]=_def[i];
}
};
IC.MasterDecorator.process=function(definition){
if(definition instanceof Array){
for(var i=0;i<definition.length;i++){
var def=definition[i];
IC.MasterDecorator.saveDef(def);
}
}else if(typeof definition!="undefined"&&definition!=null){
IC.MasterDecorator.saveDef(definition);
}
if(IC.MasterDecorator.page_loaded)
IC.MasterDecorator.doProcess();
};
IC.MasterDecorator.isMaskRespected=function(value,_def,acceptPostBackFormat){
var def=(typeof _def=="string")?IC.MasterDecorator.defsByClassName[_def]:_def
if(!def)
def={mask:_def};
var deff=IC.MasterDecorator.getFilanDef();
for(var i in def)
deff[i]=def[i];
if(!deff.mask)
return true;
if(!deff.type)
deff.type="text";
var mm=MaskFactory.getMaskMgr(deff);
mm.init();
return mm.isValueValid(value,acceptPostBackFormat );
}
IC.MasterDecorator.saveDef=function(def){
if(def.className!=null){
IC.MasterDecorator.mergeDefs(IC.MasterDecorator.defsByClassName,def.className,def);
}else if(def.id!=null){
IC.MasterDecorator.mergeDefs(IC.MasterDecorator.defsById,def.id,def);
}else{
ICOpen.Log.error("className or id missing in the definition");
}
};
IC.MasterDecorator.mergeDefs=function(data,key,def){
if(data[key])
ICOpen.Utils.copyProperties(def,data[key]);
else
data[key]=def;
};
IC.MasterDecorator.page_loaded=false;
IC.MasterDecorator.doProcess=function(){
IC.MasterDecorator.page_loaded=true;
var inps=document.getElementsByTagName("input");
var tas=document.getElementsByTagName("textarea");
var selects=document.getElementsByTagName("select");
var inputs=[];
for(var i=0;tas!=null&&i<tas.length;i++)
inputs.push(tas[i]);
for(i=0;inps!=null&&i<inps.length;i++)
inputs.push(inps[i]);
for(i=0;selects!=null&&i<selects.length;i++)
inputs.push(selects[i]);
IC.MasterDecorator.elByClassName={};
var inp=null;
var toHighlight=[];
var curdef;
for(i=0;inputs!=null&&i<inputs.length;i++){
inp=inputs[i];
if(inp.tagName=="INPUT"&&inp.type!="text"&&inp.type!="password")
continue;
var toProcess=false;
var def={};
if(inp.className){
var classes=inp.className.split(" ");
for(var j=0;j<classes.length;j++){
var c=classes[j];
if(curdef=IC.MasterDecorator.defsByClassName[c]){
toProcess=true;
ICOpen.Utils.copyProperties(curdef,def);
}
}
if(IC.MasterDecorator.defsById[ICOpen.getId(inp)]){
ICOpen.Utils.copyProperties(IC.MasterDecorator.defsById[ICOpen.getId(inp)],def);
toProcess=true;
}
}
if(toProcess&&!ICOpen.Utils.isProcessed(inp))
IC.MasterDecorator.processElement(inp,def);
else if(IC.MasterDecorator.hightlightAll){
var t=inp.type.toLowerCase();
if(!ICOpen.Utils.isProcessed(inp)
&&IC.MasterDecorator.globals.highlight
&&t!="button"
&&t!="reset"
&&t!="submit"){
toHighlight.push(inp);
}
}
}
for(i in IC.MasterDecorator.defsById){
inp=ICOpen.$(i);
if(inp!=null&&!ICOpen.Utils.isProcessed(inp))
IC.MasterDecorator.processElement(inp,IC.MasterDecorator.defsById[i]);
}
for(i=0;i<toHighlight.length;i++){
inp=toHighlight[i];
if(ICOpen.Utils.isProcessed(inp))
continue;
HighlightBox.attachAutoHighlighting(inp,IC.MasterDecorator.globals.highlight,IC.MasterDecorator.globals.borderStyle);
inp.getFacade=return_this;
inp.setValue=InputComponent_setValue;
inp.valueUpdated=return_this;
}
if(GracefulFallback.BrowserDetect.browser=="Netscape"||
GracefulFallback.BrowserDetect.browser=="Mozilla"&&inp!=null){
var hd=new HighlightBox(HighlightBox.GRAY);
hd.showAround(inp);
setTimeout("ICOpen.$(\"" + ICOpen._(hd)+"\").hide()",1);
}
};

IC.MasterDecorator.hightlightAll=true;
IC.MasterDecorator.setHighlightAll=function(value){
IC.MasterDecorator.hightlightAll=value;
};
IC.MasterDecorator.checkCssPresence=function(){
for(var s=0;s<document.styleSheets.length;s++){
var ss=document.styleSheets[s];
try{
var rules=ss.rules?ss.rules:ss.cssRules;
for(var j=0;j<rules.length;j++){
if(rules[j]["selectorText"]==".toolTipBox")
return;
}
}catch(ex){
return;
}
}
ICOpen.Log.error("ICSuite CSS not included. Make sure you have included <link rel=stylesheet type=text/css href='YOUR_PATH/WiseBlocks_resources/css/ICSuite-[VERSION].css' />");
};
function addDOMLoadEvent(func){
if(!window.__load_events){
var init=function(){
if(arguments.callee.done) return;
arguments.callee.done=true;
if(window.__load_timer){
clearInterval(window.__load_timer);
window.__load_timer=null;
}
for(var i=0;i<window.__load_events.length;i++){
window.__load_events[i]();
}
window.__load_events=null;
};
if(document.addEventListener){
document.addEventListener("DOMContentLoaded",init,false);
}
if(document.attachEvent){
var fnID=ICOpen._(init);
ICOpen["$"]=ICOpen.$;
document.attachEvent("onreadystatechange",
new Function("if(document.readyState == 'complete'){window.DOMLoadEventCaller=true;(ICOpen.$('"+fnID+"'))(); }" ));
window.attachEvent("onload",
new Function("if(!window.DOMLoadEventCaller){window.DOMLoadEventCaller=true;(ICOpen.$('"+fnID+"'))(); }" ));
}


window.__load_events=[];
}
window.__load_events.push(func);
}
if(typeof window["IC.MasterDecorator.planned"]=="undefined"){
addDOMLoadEvent(IC.MasterDecorator.doProcess);
addDOMLoadEvent(IC.MasterDecorator.checkCssPresence);
window["IC.MasterDecorator.planned"]=true;
}else{
Event_addListener(window,"load",function(){
ICOpen.Log.warn("It looks like Input Components Suite library is included twice in this page.");
});
}
var ifEmpty="ifEmpty";



IC.MasterDecorator.SKIN_ICS_BLUE={
heights:{
18:{
imageName:"ics_blue.gif",
size:{
calculator:[16,20],
calendar:[16,20],
spinUp:[16,7],
spinHandle:[16,7],
spinDown:[16,6],
arrowLeft:[9,15],
arrowRight:[9,15]
},
offsetsY:{
calculator:0,
spinUp:22,
spinHandle:29,
spinDown:36,
calendar:44,
arrowLeft:65,
arrowRight:82
},
offsetsX:{
normal:0,
over:21,
down:42
}
},
16:{
imageName:"ics_blue.gif",
size:{
calculator:[12,15],
calendar:[12,15],
spinUp:[12,5],
spinHandle:[12,6],
spinDown:[12,4],
arrowLeft:[9,15],
arrowRight:[9,15]
},
offsetsY:{
calculator:98,
spinUp:115,
spinHandle:120,
spinDown:126,
calendar:132,
arrowLeft:65,
arrowRight:82
},
offsetsX:{
normal:0,
over:21,
down:42
}
}
},
path:"/ics_blue"
};
IC.MasterDecorator.SKIN_ICS_GRAY={
heights:{
18:{
imageName:"ics_gray.gif",
size:{
calculator:[16,20],
calendar:[16,20],
spinUp:[16,7],
spinHandle:[16,7],
spinDown:[16,6],
arrowLeft:[9,15],
arrowRight:[9,15]
},
offsetsY:{
calculator:0,
spinUp:22,
spinHandle:29,
spinDown:36,
calendar:44,
arrowLeft:65,
arrowRight:82
},
offsetsX:{
normal:0,
over:21,
down:42
}
},
16:{
imageName:"ics_gray.gif",
size:{
calculator:[12,15],
calendar:[12,15],
spinUp:[12,5],
spinHandle:[12,6],
spinDown:[12,4],
arrowLeft:[9,15],
arrowRight:[9,15]
},
offsetsY:{
calculator:98,
spinUp:115,
spinHandle:120,
spinDown:126,
calendar:132,
arrowLeft:65,
arrowRight:82
},
offsetsX:{
normal:0,
over:21,
down:42
}
}
},
path:"/ics_gray"
};
IC.MasterDecorator.SKIN_ICS_GREEN={
heights:{
18:{
imageName:"ics_green.gif",
size:{
calculator:[16,20],
calendar:[16,20],
spinUp:[16,7],
spinHandle:[16,7],
spinDown:[16,6],
arrowLeft:[9,15],
arrowRight:[9,15]
},
offsetsY:{
calculator:0,
spinUp:22,
spinHandle:29,
spinDown:36,
calendar:44,
arrowLeft:65,
arrowRight:82
},
offsetsX:{
normal:0,
over:21,
down:42
}
},
16:{
imageName:"ics_green.gif",
size:{
calculator:[12,15],
calendar:[12,15],
spinUp:[12,5],
spinHandle:[12,6],
spinDown:[12,4],
arrowLeft:[9,15],
arrowRight:[9,15]
},
offsetsY:{
calculator:98,
spinUp:115,
spinHandle:120,
spinDown:126,
calendar:132,
arrowLeft:65,
arrowRight:82
},
offsetsX:{
normal:0,
over:21,
down:42
}
}
},
path:"/ics_green"
};
IC.MasterDecorator.SKIN_ICS_RED={
heights:{
18:{
imageName:"ics_red.gif",
size:{
calculator:[16,20],
calendar:[16,20],
spinUp:[16,7],
spinHandle:[16,7],
spinDown:[16,6],
arrowLeft:[9,15],
arrowRight:[9,15]
},
offsetsY:{
calculator:0,
spinUp:22,
spinHandle:29,
spinDown:36,
calendar:44,
arrowLeft:65,
arrowRight:82
},
offsetsX:{
normal:0,
over:21,
down:42
}
},
16:{
imageName:"ics_red.gif",
size:{
calculator:[12,15],
calendar:[12,15],
spinUp:[12,5],
spinHandle:[12,6],
spinDown:[12,4],
arrowLeft:[9,15],
arrowRight:[9,15]
},
offsetsY:{
calculator:98,
spinUp:115,
spinHandle:120,
spinDown:126,
calendar:132,
arrowLeft:65,
arrowRight:82
},
offsetsX:{
normal:0,
over:21,
down:42
}
}
},
path:"/ics_red"
};
function FormulaField(_componentId,_formulaRefrehPeriod,_formula,_maskMgr ){
this.defaultStyle={};
this.componentId=_componentId;
this.formulaRefrehPeriod=_formulaRefrehPeriod;
this.formula=_formula;
this.maskMgr=_maskMgr;
this.setTimer();
this._update();
};
FormulaField.prototype._applyConditions=IC.Utils.applyConditions;
FormulaField.prototype.setConditions=function(_conditions){
this.conditions=_conditions;
this._applyConditions(false);
};
FormulaField.prototype.setTimer=function(){
var instanceId=ICOpen._(this);
ICOpen.Utils.setTimeout(function(){
var instance=ICOpen.$(instanceId);
instance._update();
instance.setTimer();
},this.formulaRefrehPeriod);
};
FormulaField.prototype._update=function(){
var value=new Value();
try{
value.unmasked=""+this.formula();
}catch(e){
ICOpen.Log.error("User defined 'formula' function generated "+e.name+" exception :"+e.message+" function:"+this.formula);
}
this.maskMgr.format(value);
this._setValue(ICOpen.$(this.componentId),value.masked);
this._applyConditions();
};
FormulaField.prototype.getValue=function(){
var obj=this.getElement();
if(obj.tagName.toLowerCase()=="input"||obj.tagName.toLowerCase()=="textarea"){
return obj.value;
}else{
return obj.innerHTML;
}
};
FormulaField.prototype.getElement=function(){
return ICOpen.$(this.componentId);
};
FormulaField.prototype._setValue=function(obj,value){
if(obj!=null&&typeof obj!="undefined")
if(obj.tagName.toLowerCase()=="input"||obj.tagName.toLowerCase()=="textarea"){
if(obj.value!=value)
obj.value=value;
}else{
if(obj.innerHTML!=value)
obj.innerHTML=value;
}
};
IC.stringValue=function(id){
if(ICOpen.$(id)==null){
ICOpen.Log.error("IC.stringValue() : Cannot find DOM Object with id:"+id);
return "";
}
return ICOpen.$(id).value;
};
IC.intValue=function(id){
if(ICOpen.$(id)==null){
ICOpen.Log.error("IC.intValue() : Cannot find DOM Object with id:"+id);
return 0;
}
var res=parseInt(ICOpen.$(id).value,10);
if(isNaN(res)){
return 0;
}
return res;
};
IC.floatValue=function(id){
var el=ICOpen.$(id);
if(ICOpen.$(id)==null){
ICOpen.Log.error("IC.intValue() : Cannot find DOM Object with id:"+id);
return 0;
}
if(el==null)
return null;
var res=parseFloat(el.value);
if(isNaN(res)){
return 0;
}
return res;
};
IC.getFloatValues=function(ids){
var res=[];
for(var i=0;i<ids.length;i++)
res.push(IC.floatValue(ids[i]));
return res;
};
IC.sum=function(){
var values=IC.getFloatValues(arguments);
var res=0;
for(var i=0;i<values.length;i++){
if(!isNaN(values[i])&&typeof values[i]!="undefined"&&values[i]!=null)
res+=values[i];
}
return res;
};
IC.avg=function(){
var values=IC.getFloatValues(arguments);
var res=0;
for(var i=0;i<values.length;i++){
if(!isNaN(values[i])&&typeof values[i]!="undefined"&&values[i]!=null)
res+=values[i];
}
return values.length!=0?res / values.length:0;
};
IC.min=function(){
var values=IC.getFloatValues(arguments);
if(values.length==0)
return 0;
var min=values[0];
for(var i=1;i<values.length;i++){
if(!isNaN(values[i])&&typeof values[i]!="undefined"&&values[i]!=null)
min=Math.min(min,values[i]);
}
return min;
};
IC.max=function(){
var values=IC.getFloatValues(arguments);
if(values.length==0)
return 0;
var max=values[0];
for(var i=1;i<values.length;i++){
if(!isNaN(values[i])&&typeof values[i]!="undefined"&&values[i]!=null)
max=Math.max(max,values[i]);
}
return max;
};
function Feedback(color){
this.color=color?color:Feedback.DEFAULT_COLOR;
};
Feedback.DEFAULT_COLOR="#FF8888";
Feedback.DEFAULT_PROPRETY="backgroundColor";
Feedback.TIMEOUT=250;
Feedback.prototype.run=function(elementId){
if(ICOpen.$(elementId).feedbackRunning)
return;
var backupColor=ICOpen.$(elementId).style[Feedback.DEFAULT_PROPRETY];
var color=this.color;
ICOpen.$(elementId).feedbackRunning=true;
ICOpen.$(elementId).style[Feedback.DEFAULT_PROPRETY]=color;
ICOpen.Utils.setTimeout(function(){
var el=ICOpen.$(elementId);
el.style[Feedback.DEFAULT_PROPRETY]=backupColor;
el.feedbackRunning=false;
},Feedback.TIMEOUT);
};
window.CursorOnFocus=function(_inputComponent,cursorOnFocus){
if(_inputComponent instanceof InputComponent){
this.formattedInput=ICOpen._(_inputComponent.getElement());
this.inputComponent=_inputComponent;
}else{
this.formattedInput=_inputComponent;
this.inputComponent=null;
}
this.cursorOnFocus=cursorOnFocus;
if(this.cursorOnFocus==null||this.cursorOnFocus==""
||this.cursorOnFocus.toLowerCase()=="default"
||this.cursorOnFocus.toLowerCase()=="none")
return;
if(this.cursorOnFocus.toLowerCase()=="firstempty"){
this.focusCallback=this.firstEmptyFocusCallback;
}else if(this.cursorOnFocus.toLowerCase()=="begin")
this.focusCallback=this.beginFocusCallback;
else if(this.cursorOnFocus.toLowerCase()=="end")
this.focusCallback=this.endFocusCallback;
else if(this.cursorOnFocus.toLowerCase()=="selectall")
this.focusCallback=this.selectAllFocusCallback;
else if(this.cursorOnFocus.toLowerCase()=="beforedecimal")
this.focusCallback=this.beforeDecimalFocusCallback;
else{
ICOpen.Log.error("cursorOnFocus value of:'"+this.cursorOnFocus+"' is not recognised. Allowed values are : default,begin,end,selectAll,firstEmpty,beforeDecimal");
return;
}
var fi=ICOpen.$(this.formattedInput);
Event_addListener(fi,"focus",this.focusCalled,this,true);
IC.MasterDecorator.addReleaseAction(fi,CursorOnFocus.detach);
};
CursorOnFocus.detach=function(e){
Event_removeListener(e,"focus",CursorOnFocus.prototype.focusCalled);
};
CursorOnFocus.lastPopUpButtonPressTimestamp=0;
CursorOnFocus.prototype.focusCalled=function(event){
if(new Date().getTime()-200>CursorOnFocus.lastPopUpButtonPressTimestamp )
this.focusCallback(event);
};
CursorOnFocus.prototype.beforeDecimalFocusCallback=function(event){
if(this.inputComponent!=null
&&this.inputComponent.maskMgr!=null
&&(this.inputComponent.maskMgr instanceof NumberMaskMgr))
{
var v=this.inputComponent.getValue();
for(var i=v.length;i>=0;i--){
if(v.charAt(i)==this.inputComponent.maskMgr.decimalSeparator){
CursorOnFocus.delayedSelectionRange(this.formattedInput,i,i);
return;
}
}
}
this.endFocusCallback(event);
};
CursorOnFocus.prototype.firstEmptyFocusCallback=function(event){
if(this.inputComponent!=null
&&this.inputComponent.maskMgr!=null
&&(this.inputComponent.maskMgr instanceof TextMaskMgr))
{
var cms=this.inputComponent.maskMgr.charMasks;
for(var i=0;i<cms.length;i++){
var cm=cms[i];
if(!cm.isEditable)
continue;
var v=this.inputComponent.getValue();
if(i>=v.length)
break;
if(v.substring(i,i+1)==cm.blankChar){
CursorOnFocus.delayedSelectionRange(this.formattedInput,i,i);
return;
}
}
}
};
CursorOnFocus.prototype.endFocusCallback=function(event){
CursorOnFocus.delayedSelectionRange(this.formattedInput,65535);
};
CursorOnFocus.prototype.beginFocusCallback=function(event){
CursorOnFocus.delayedSelectionRange(this.formattedInput,0);
};
CursorOnFocus.prototype.selectAllFocusCallback=function(){
CursorOnFocus.delayedSelectionRange(this.formattedInput,0,65535);
};
CursorOnFocus.delayedSelectionRange_intervalID=null;
CursorOnFocus.delayedSelectionRange=function(inputName,start,end){
ICOpen.Utils.setSelectionRange(ICOpen.$(inputName),start,end);
if(CursorOnFocus.delayedSelectionRange_intervalID==null)
CursorOnFocus.delayedSelectionRange_intervalID=ICOpen.Utils.setTimeout(function(){
CursorOnFocus.delayedSelectionRange_intervalID=null;
ICOpen.Utils.setSelectionRange(ICOpen.$(inputName),start,end);
},50);
};
function GracefulFallback(){}
GracefulFallback.BrowserDetect={
init:function(){
this.browser=this.searchString(this.dataBrowser)||"";
this.version=this.searchVersion(navigator.userAgent)
||this.searchVersion(navigator.appVersion)||"";
this.OS=this.searchString(this.dataOS)||"";
},
searchString:function(data){
for(var i=0;i<data.length;i++){
var dataString=data[i].string;
var dataProp=data[i].prop;
this.versionSearchString=data[i].versionSearch||data[i].identity;
if(dataString){
if(dataString.indexOf(data[i].subString)!=-1)
return data[i].identity;
}
else if(dataProp)
return data[i].identity;
}
},
searchVersion:function(dataString){
var index=dataString.indexOf(this.versionSearchString);
if(index==-1) return;
return parseFloat(dataString.substring(index+this.versionSearchString.length+1));
},
dataBrowser:[
{string:navigator.userAgent,
subString:"OmniWeb",
versionSearch:"OmniWeb/",
identity:"OmniWeb"
},
{
string:navigator.vendor,
subString:"Apple",
identity:"Safari"
},
{
prop:window.opera,
identity:"Opera"
},
{
string:navigator.vendor,
subString:"iCab",
identity:"iCab"
},
{
string:navigator.vendor,
subString:"KDE",
identity:"Konqueror"
},
{
string:navigator.userAgent,
subString:"Firefox",
identity:"Firefox"
},
{
string:navigator.vendor,
subString:"Camino",
identity:"Camino"
},
{
string:navigator.userAgent,
subString:"Netscape",
identity:"Netscape"
},
{
string:navigator.userAgent,
subString:"MSIE",
identity:"Explorer",
versionSearch:"MSIE"
},
{
string:navigator.userAgent,
subString:"Gecko",
identity:"Mozilla",
versionSearch:"rv"
},
{
string:navigator.userAgent,
subString:"Mozilla",
identity:"Netscape",
versionSearch:"Mozilla"
}
],
dataOS:[
{
string:navigator.platform,
subString:"Win",
identity:"Windows"
},
{
string:navigator.platform,
subString:"Mac",
identity:"Mac"
},
{
string:navigator.platform,
subString:"Linux",
identity:"Linux"
}
]
};
GracefulFallback.BrowserDetect.init();
GracefulFallback.enabled=false;
GracefulFallback.check=function(){
if(GracefulFallback.BrowserDetect.browser.OS=="Mac"&&GracefulFallback.BrowserDetect.browser=="Firefox")
GracefulFallback.enabled=true;
else if(GracefulFallback.BrowserDetect.browser=="Firefox" )
GracefulFallback.enabled=true;
else if(GracefulFallback.BrowserDetect.browser=="Explorer"
&&GracefulFallback.BrowserDetect.OS=="Windows"
&&GracefulFallback.BrowserDetect.version>="5.5")
GracefulFallback.enabled=true;
else if(GracefulFallback.BrowserDetect.browser=="Mozilla"
&&GracefulFallback.BrowserDetect.OS=="Windows"
&&GracefulFallback.BrowserDetect.version>="1.7")
GracefulFallback.enabled=true;
else if(GracefulFallback.BrowserDetect.browser=="Netscape"
&&GracefulFallback.BrowserDetect.OS=="Windows"
&&GracefulFallback.BrowserDetect.version>="8.1")
GracefulFallback.enabled=true;
else
ICOpen.Log.info(GracefulFallback.BrowserDetect.browser+" "+GracefulFallback.BrowserDetect.version+" "+GracefulFallback.BrowserDetect.OS)
};
GracefulFallback.check();
window.DateFactory={};








DateFactory.y="\u0010";
DateFactory.M="\u0011";
DateFactory.d="\u0012";
DateFactory.h="\u0013";
DateFactory.m="\u0014";
DateFactory.s="\u0015";
DateFactory.a="\u0016";
DateFactory.A="\u0017";
DateFactory.y2="\u0018";
DateFactory.mask_d=DateFactory.d+"#";
DateFactory.mask_M=DateFactory.M+"#";
DateFactory.mask_y="####";
DateFactory.mask_h=DateFactory.h+"#";
DateFactory.mask_m=DateFactory.m+"#";
DateFactory.mask_s=DateFactory.s+"#";
DateFactory.mask_a=DateFactory.a;
DateFactory.mask_A=DateFactory.A;
DateFactory.mask_y2=DateFactory.y2+DateFactory.y2;
DateFactory.reEscapedMask_d=new RegExp("\\\\"+DateFactory.mask_d,"g");
DateFactory.reEscapedMask_M=new RegExp("\\\\"+DateFactory.mask_M,"g");
DateFactory.reEscapedMask_y=new RegExp("\\\\"+DateFactory.mask_y,"g");
DateFactory.reEscapedMask_h=new RegExp("\\\\"+DateFactory.mask_h,"g");
DateFactory.reEscapedMask_m=new RegExp("\\\\"+DateFactory.mask_m,"g");
DateFactory.reEscapedMask_s=new RegExp("\\\\"+DateFactory.mask_s,"g");
DateFactory.reEscapedMask_a=new RegExp("\\\\"+DateFactory.mask_a,"g");
DateFactory.reEscapedMask_A=new RegExp("\\\\"+DateFactory.mask_A,"g");
DateFactory.maskParts=[
DateFactory.mask_y,
DateFactory.mask_M,
DateFactory.mask_d,
DateFactory.mask_h,
DateFactory.mask_m,
DateFactory.mask_s,
DateFactory.mask_a,
DateFactory.mask_A,
DateFactory.mask_y2];
DateFactory.transformMask=function(userMask){
for(var i=0;i<userMask.length;i++){
if(userMask.charAt(i)=='D'&&(i==0||userMask.charAt(i-1)!="\\"))
userMask=userMask.substring(0,i)+"d"+userMask.substring(i+1);
if(userMask.charAt(i)=='Y'&&(i==0||userMask.charAt(i-1)!="\\"))
userMask=userMask.substring(0,i)+"y"+userMask.substring(i+1);
}
var res=userMask
.replace(/d{1,2}/g,DateFactory.mask_d)
.replace(/M{1,2}/g,DateFactory.mask_M)
.replace(/yyyy/ig,DateFactory.mask_y)
.replace(/yy/ig,DateFactory.mask_y2)
.replace(/y/ig,DateFactory.mask_y)
.replace(/h{1,2}/g,DateFactory.mask_h)
.replace(/m{1,2}/g,DateFactory.mask_m)
.replace(/s{1,2}/g,DateFactory.mask_s)
.replace(/a/g,DateFactory.mask_a)
.replace(/A/g,DateFactory.mask_A)
.replace(DateFactory.reEscapedMask_d,"d") 
.replace(DateFactory.reEscapedMask_m,"m")
.replace(DateFactory.reEscapedMask_y,"y")
.replace(DateFactory.reEscapedMask_h,"h")
.replace(DateFactory.reEscapedMask_M,"M")
.replace(DateFactory.reEscapedMask_s,"s")
.replace(DateFactory.reEscapedMask_a,"a")
.replace(DateFactory.reEscapedMask_A,"A")
return res;
};
DateFactory.textMaskMgr_prepareAcceptNewValue=function(value){
var msk=this.mask.toString();
var res=DateFactory.dateToString(new Date(value * 1000),msk);
return res;
};
DateFactory.textMaskMgr_parseValue=function(value){
var msk=this.mask.toString();
return DateFactory.stringToDate(value,msk).getTime() / 1000;
};
DateFactory.textMaskMgr_unmask4PostBack=function(value){
var msk=this.mask.toString();
var d=DateFactory.stringToDate(value,msk,true);
return d==null?"":DateFactory.dateToString(d,this.definition.postBackDateFormat);
};
DateFactory.convertMask=function(value,oldMask,newMask ){
var res=newMask;
for(var i=0;i<DateFactory.maskParts.length;i++)
res=IC.Utils.instringByExample(res,
IC.Utils.substringByExample(value,oldMask,DateFactory.maskParts[i])
,newMask
,DateFactory.maskParts[i]
,"0");
return res;
};
DateFactory.textMaskMgr_init=function(){
var msk=this.mask.toString();
if(msk!=this.oldMask){
if(this.oldMask&&this.inputComponent){
var el=this.inputComponent.getElement();
el.value=DateFactory.convertMask(el.value,this.oldMask,msk);
}
this.oldMask=msk;
}
this.init_old();
var aPos=msk.indexOf(DateFactory.a);
if(aPos!=-1){
this.charMasks[aPos].blankChar="a";
this.charMasks[aPos].modifier=CharMaskFactory.lowerCaseModifier;
}
var aPosA=msk.indexOf(DateFactory.A);
if(aPosA!=-1){
this.charMasks[aPosA].blankChar="A";
this.charMasks[aPosA].modifier=CharMaskFactory.upperCaseModifier;
}
if(this.inputComponent)
this.inputComponent.onValueChanged(false,true,true);
};
DateFactory.createMaskMgr=function(def,msk){
var mskText=msk.toString();
if(!def.spinStep&&!def.step){
if(mskText.indexOf('M')!=-1) def.spinStep=30 * 24 * 60 * 60;
if(mskText.indexOf('d')!=-1) def.spinStep=24 * 60 * 60;
if(mskText.indexOf('h')!=-1) def.spinStep=60 * 60;
if(mskText.indexOf('m')!=-1) def.spinStep=60;
if(mskText.indexOf('s')!=-1) def.spinStep=1;
}
if(typeof msk=="string")
msk=DateFactory.transformMask(msk);
else
msk.maskModifierFunction=DateFactory.transformMask;
var maskMgr=new TextMaskMgr(def,msk);
if(def.postBackDateFormat){
def.postBackDateFormat=DateFactory.transformMask(def.postBackDateFormat);
maskMgr.onBeforeSetInputComponent=function(_inputComponent){
var el=_inputComponent.getElement();
var d=DateFactory.stringToDate(el.value,this.definition.postBackDateFormat,true);
el.value=d==null?"":DateFactory.dateToString(d,this.mask.toString());
}
}
maskMgr.init_old=maskMgr.init;
maskMgr.init=DateFactory.textMaskMgr_init;
maskMgr.prepareAcceptNewValue=DateFactory.textMaskMgr_prepareAcceptNewValue;
maskMgr.parseValue=DateFactory.textMaskMgr_parseValue;
if(def.postBackDateFormat)
maskMgr.unmask4PostBack=DateFactory.textMaskMgr_unmask4PostBack;
var mskTransformed=DateFactory.transformMask(mskText)
var isAMPM=mskTransformed.indexOf(DateFactory.mask_a)!=-1||mskTransformed.indexOf(DateFactory.mask_A)!=-1;
def.maskDefinitions={};
def.maskDefinitions[DateFactory.d]=/[\s0-3]/;
def.maskDefinitions[DateFactory.M]=/[0-1]/;
def.maskDefinitions[DateFactory.a]=/[apAP]/;
def.maskDefinitions[DateFactory.A]=/[apAP]/;
def.maskDefinitions[DateFactory.h]=isAMPM?/[0-1]/:/[0-2]/;
def.maskDefinitions[DateFactory.m]=/[0-5]/;
def.maskDefinitions[DateFactory.s]=/[0-5]/;
def.maskDefinitions[DateFactory.y2]=/[0-9]/;
def.maskErrors={};
def.maskErrors[DateFactory.d]="dateValueExpectedHere";
def.maskErrors[DateFactory.M]="monthValueExpectedHere";
def.maskErrors[DateFactory.h]=isAMPM?"hour12ValueExpectedHere":"hourValueExpectedHere";
def.maskErrors[DateFactory.m]="minuteValueExpectedHere";
def.maskErrors[DateFactory.s]="secondValueExpectedHere";
def.maskErrors[DateFactory.A]=def.maskErrors[DateFactory.a]="AMPMValueExpectedHere";
def.maskErrors[DateFactory.y2]="digitExpectedhere";
if(def.conditions==null)
def.conditions=[];
var isDateInvalid=function(value){
var mask=msk.toString();
return DateFactory.stringToDate(value,mask,true)==null;
};
var isIncomplete=function(value){
var mask=msk.toString();
var allZeros=true;
for(var i=0;i<DateFactory.maskParts.length;i++){
var part=DateFactory.maskParts[i];
if(mask.toString().indexOf(part)==-1)
continue;
if(part==DateFactory.mask_a||part==DateFactory.mask_A){
allZeros=false;
continue;
}
var partValue=IC.Utils.substringByExample(value,mask,part);
if(partValue.charAt(0)==def.blankCharacter.charAt(0))
partValue=partValue.substring(1);
var partIntValue=parseInt(partValue,10);
if(isNaN(partIntValue))
return true;
allZeros&=partIntValue==0;
}
return allZeros;
}
def.conditions.push({
condition:isDateInvalid,
style:{color:"red"}
});
def.conditions.push({
condition:isIncomplete,
style:{color:"#888888"}
});
maskMgr.isValueValid_super=maskMgr.isValueValid;
maskMgr.isValueValid=function(v,acceptPostBackFormat ){
return maskMgr.isValueValid_super(v,acceptPostBackFormat )&&(isIncomplete(v)||!isDateInvalid(v) );
}
return maskMgr;
};
DateFactory.getUTCAMPM=function(d,isAMPM){
return isAMPM?d.getUTCHours()>11?1:0:-1;
};
DateFactory.getUTCHours=function(d,isAMPM){
return isAMPM?d.getUTCHours():DateFactory.getClockHours(d.getUTCHours());
};
DateFactory.getClockHours=function(h){
if(h>12)
return h-12;
if(h==0)
return 12;
return h;
};
DateFactory.stringToDate=function(value,mask,nullIfIncorrect){
var res=[];
var d=new Date();
var d0=new Date(0);
mask=mask.toString();
var isAMPM=mask.indexOf(DateFactory.mask_a)!=-1||mask.indexOf(DateFactory.mask_A)!=-1;
DateFactory.defaultPartValues=[(mask.indexOf(DateFactory.mask_y)==-1?d0:d).getUTCFullYear(),(mask.indexOf(DateFactory.mask_M)==-1?d0:d).getUTCMonth()+1,(mask.indexOf(DateFactory.mask_d)==-1?d0:d).getUTCDate(),
DateFactory.getUTCHours(mask.indexOf(DateFactory.mask_h)==-1?d0:d,isAMPM),(mask.indexOf(DateFactory.mask_m)==-1?d0:d).getUTCMinutes(),(mask.indexOf(DateFactory.mask_s)==-1?d0:d).getUTCSeconds(),
DateFactory.getUTCAMPM(mask.indexOf(DateFactory.mask_a)==-1?d0:d,isAMPM),
DateFactory.getUTCAMPM(mask.indexOf(DateFactory.mask_A)==-1?d0:d,isAMPM),(""+(mask.indexOf(DateFactory.mask_y2)==-1?d0:d).getUTCFullYear()).substring(2,4)
];
for(var i=0;i<DateFactory.maskParts.length;i++){
var maskPart=DateFactory.maskParts[i];
var v=IC.Utils.substringByExample(value,mask,maskPart);
if(maskPart==DateFactory.mask_a||maskPart==DateFactory.mask_A){
res[i]=(v=="p"||v=="P")?1:0;
}else{
res[i]=parseInt(v,10);
if(isNaN(res[i])){
if(v.length>1)
res[i]=parseInt(v.substring(1),10);
}
if(isNaN(res[i])||(maskPart==DateFactory.mask_h&&isAMPM&&(res[i]<1||res[i]>12))){
if(nullIfIncorrect&&mask.indexOf(maskPart)!=-1){
return null;
}else
res[i]=DateFactory.defaultPartValues[i];
}
}
}
res[8]=""+res[8];
while(res[8].length<2)
res[8]="0"+res[8];
if(mask.indexOf(DateFactory.mask_y2)!=-1)
res[0]="20"+res[8];
d.setUTCFullYear(res[0]);
d.setUTCMonth(res[1]-1);
d.setUTCMonth(res[1]-1);
d.setUTCDate(res[2]);
d.setUTCDate(res[2]);
var h=res[3];
if(isAMPM){
if(res[6]&&h!=12) 
h+=12
else if((!res[6])&&h==12)
h=0;
}
d.setUTCHours(h);
d.setUTCMinutes(res[4]);
d.setUTCSeconds(res[5]);
var ret;
if(d.getUTCFullYear()==res[0]&&d.getUTCMonth()==res[1]-1&&d.getUTCDate()==res[2]
&&d.getUTCHours()==h&&d.getUTCMinutes()==res[4]&&d.getUTCSeconds()==res[5])
ret=d;
else
if(nullIfIncorrect)
ret=null;
else{
ret=new Date();
}
return ret;
};
DateFactory.dateToString=function(_date,mask){
var res=mask;
var isAMPM=mask.indexOf(DateFactory.mask_a)!=-1||mask.indexOf(DateFactory.mask_A)!=-1;
var values=[_date.getUTCFullYear(),
_date.getUTCMonth()+1,
_date.getUTCDate(),
_date.getUTCHours(),
_date.getUTCMinutes(),
_date.getUTCSeconds(),
0,
0,(""+_date.getUTCFullYear()).substring(2)];
if(isAMPM)
values[3]=DateFactory.getClockHours(values[3]);
values[6]=DateFactory.getUTCAMPM(_date,true)?"p":"a";
values[7]=DateFactory.getUTCAMPM(_date,true)?"P":"A";
for(var i=0;i<DateFactory.maskParts.length;i++)
res=IC.Utils.instringByExample(res,values[i],mask,DateFactory.maskParts[i],"0");
return res;
};
DateFactory.isDateMask=function(def){
return ICOpen.Utils.startsWithIgnoreCase(def.type,"date");
};
function Calendar(_inputComponent){
this.inputComponent=_inputComponent;
this.cal=null;
this.selecteEventAttached=false;
}
;
Calendar.prototype.attach=function(_dropDownPanel){
this.dropDownPanel=_dropDownPanel;
var refiner={
handleKeyDown:function(value,c,e){
if(c==13&&_dropDownPanel.visible){
_dropDownPanel.hide();
Event_preventDefault(e);
if(value!=null)
value.stopProcessing=true;
}else if(c==27){
if(_dropDownPanel.visible){
_dropDownPanel.dropDownPanelCalled();
if(value!=null)
value.stopProcessing=true;
Event_preventDefault(e);
}
}
},
handleCharEntered:function(value,c,e){
if(" ".charCodeAt(0)==c){
_dropDownPanel.dropDownPanelCalled();
if(value!=null)
value.stopProcessing=true;
Event_preventDefault(e);
}
},
handleChange:function(){
},
calendar:this
};
this.inputComponent.refiners.push(refiner);
};
Calendar.prototype.show=function(){
if(!this.selecteEventAttached){
var inputComponent=this.inputComponent;
this.selecteEventAttached=true;
this.cal.selectEvent.subscribe(function(type,args,obj){
var dates=args[0];
var date=dates[0];
var year=date[0],month=date[1],day=date[2];
var msk=inputComponent.maskMgr.mask.toString();
var val=DateFactory.stringToDate(inputComponent.getValue(),msk);
val.setUTCFullYear(year);
val.setUTCMonth(month-1);
val.setUTCDate(day);
inputComponent.acceptNewValue(val.getTime()/1000);
},
this.cal,true);
}
var msk=this.inputComponent.maskMgr.mask.toString();
var val=DateFactory.stringToDate(this.inputComponent.getValue(),msk);
outer:
if(val){
if(this.cal.getSelectedDates().length!=0){
var oldVal=this.cal.getSelectedDates()[0];
if(oldVal.toDateString()==val.toDateString()){
break outer;
}
}else{
if(val.toDateString()==new Date().toDateString())
break outer;
}
this.cal.select(val);
this.cal.cfg.setProperty("pagedate",(val.getMonth()+1)+"/"+val.getFullYear());
this.cal.render();
this.cal["neverRendered"]=false;
}
if(this.cal["neverRendered"]){
this.cal["neverRendered"]=false;
this.cal.render();
}











};
Calendar.prototype.hide=function(){
};
Calendar.prototype.buttonClicked=function(buttonValue){
buttonValue=buttonValue!=null?buttonValue.toUpperCase():null;
if(window.CursorOnFocus)
CursorOnFocus.lastPopUpButtonPressTimestamp=new Date().getTime();
this.inputComponent.focus();
};
Calendar.prototype.positionIconClicked=function(){
this.dropDownPanel.positionIconClicked();
};
Calendar.prototype.closeIconClicked=function(){
this.dropDownPanel.closeIconClicked();
};
function CalenedarTemplate(baseClassName,_definiton){
this.def=_definiton;
this.className=baseClassName||"IC_calcontainer";
this.workaround=false;
this.instanceId=ICOpen._(this);
this.createDOM=function(calendarObject,_def){
var tableOuter=document.createElement("div");
tableOuter.onselectstart="return false";
tableOuter.className=this.className;
this.tableOuterID=ICOpen._(tableOuter);
this.calendarObject=calendarObject;
var panel=document.createElement("div");
panel.style.overhlow="hidden";
panel.align="left";
var str=
'<table cellpadding="0" cellspacing="0" border="0">'+
'<tr><td id="headerCell_${id}" align="right" style="padding:3px;">'+
'<table align="right" cellpadding="0" cellspacing="0" border="0"><tr>'+
'<td class="IC_genericCalcSmallButton"><div id="bt_${id}_help"><img height="11px" width="12px" src="${imgPath}/helpIcon.gif"></div></td>'+
'<td class="IC_genericCalcSmallButton"><div id="bt_${id}_position"><img height="11px" width="12px" src="${imgPath}/positionIcon.gif"></div></td>'+
'<td class="IC_genericCalcSmallButton"><div id="bt_${id}_close"><img height="11px" width="12px" src="${imgPath}/closeIcon.gif"></div></td></tr>'+
'</table>'+
'</td></tr>'+
'<tr><td><div id="calcContainer_${id}">&nbsp;</div></td></tr>'+
'<table>';
str=str.replace(/\$\{id\}/g,this.instanceId).replace(/\$\{imgPath\}/g,IC.MasterDecorator.imagesPath+_def.skin.path);
panel.innerHTML=str;
tableOuter.appendChild(panel);
this.tableID="calcContainer_"+this.instanceId;
return tableOuter;
};
this.init=function(_def){
Event_addListener(ICOpen.$("bt_"+this.instanceId+"_position").parentNode,"click",this.calendarObject.positionIconClicked,this.calendarObject,true);
Event_addListener(ICOpen.$("bt_"+this.instanceId+"_position"),"mousemove",function(event){
YAHOO.util.Event.stopEvent(event);
});
Event_addListener(ICOpen.$("bt_"+this.instanceId+"_close").parentNode,"mouseup",this.calendarObject.closeIconClicked,this.calendarObject,true);
CalcCSS.attachButtonBehaviour(ICOpen.$("bt_"+this.instanceId+"_close").parentNode);
CalcCSS.attachButtonBehaviour(ICOpen.$("bt_"+this.instanceId+"_position").parentNode);
if(_def.customCalendarHelpFunction){
Event_addListener(ICOpen.$("bt_"+this.instanceId+"_help").parentNode,"click",_def.customCalendarHelpFunction);
CalcCSS.attachButtonBehaviour(ICOpen.$("bt_"+this.instanceId+"_help").parentNode);
}else
ICOpen.$("bt_"+this.instanceId+"_help").style.display="none";
var pages=this.def.calendarOptions&&this.def.calendarOptions["pages"];
var multi=pages&&pages>1;
var baseOptions=IC.Dictionary.translate("calendarOptions");
if(baseOptions!="calendarOptions"){
ICOpen.Utils.copyProperties(this.def.calendarOptions,this.def.calendarOptions=[]);
for(var i in baseOptions)
if(!this.def.calendarOptions[i])
this.def.calendarOptions[i]=baseOptions[i];
}
this.calendarObject.cal=multi?
new YAHOO_CalendarGroup((CalenedarTemplate.counter++)+"_cal",this.tableID,this.def.calendarOptions):
new YAHOO_Calendar((CalenedarTemplate.counter++)+"_cal",this.tableID,this.def.calendarOptions);
if(multi){
var ps=this.calendarObject.cal.pages;
for(var i in ps)
ps[i].Style.CSS_CALENDAR="IC_calendar";
}
this.calendarObject.cal.Style.CSS_CALENDAR="IC_calendar";
this.calendarObject.cal.Style.CSS_CONTAINER=this.className;
this.calendarObject.cal.cfg.setProperty("NAV_ARROW_RIGHT",
ImageButtonBG.createButtonHtml('calrt'+this.instanceId,"calnavright","arrowRight",this.calendarObject.inputComponent.getElement(),_def));
this.calendarObject.cal.cfg.setProperty("NAV_ARROW_LEFT",
ImageButtonBG.createButtonHtml('callt'+this.instanceId,"calnavleft","arrowLeft",this.calendarObject.inputComponent.getElement(),_def));
this.calendarObject.cal.templateInstanceId=this.instanceId;
this.calendarObject.cal.cfg.setProperty("iframe",false);
this.calendarObject.cal["neverRendered"]=true;
var tableID=this.tableID;
if(!this.workaround){
this.workaround=true;
ICOpen.Utils.IE6_selectTag_workaround(ICOpen.$(this.tableOuterID),1);
}
Event_addListener(ICOpen.$(this.tableID).parentNode,(_def.clickToClose?"":"dbl")+"click",this.calendarObject.closeIconClicked,this.calendarObject,true);
};
this.preload=function(){
};
}
;
CalenedarTemplate.counter=0;
//**************************************//
//***********   ENGLISH    *************//
//**************************************//
IC.Dictionary.digitExpectedHere = "Digit is expected here.";
IC.Dictionary.alphaExpectedHere = "Alphabetic character is expected here.";
IC.Dictionary.digitOrDotExpectedHere = "Digit or decimal separator is expected here.";
IC.Dictionary.punctuationExpectedHere = "Punctuation sign is expected here.";
IC.Dictionary.hourValueExpectedHere = "The first hour (0-24) digit must be 0,1,2 or stay empty.";
IC.Dictionary.hour12ValueExpectedHere = "The first hour (1-12) digit must be 0,1 or stay empty.";
IC.Dictionary.AMPMValueExpectedHere = "You must type an A (AM) or a P (PM).";
IC.Dictionary.monthValueExpectedHere = "The first digit for the month must be either 0 or 1.";
IC.Dictionary.dateValueExpectedHere = "The first digit for the date must be between 0 and 3.";
IC.Dictionary.minuteValueExpectedHere = "The first minutes digit must be between 0 and 5.";
IC.Dictionary.secondValueExpectedHere = "The first seconds digit must be between 0 and 5.";

IC.Dictionary.calendarOptions = {
	START_WEEKDAY : 0,
	LOCALE_WEEKDAYS:"medium",
	MONTHS_SHORT:["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"],
	MONTHS_LONG:["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"],
	WEEKDAYS_1CHAR:["S", "M", "T", "W", "T", "F", "S"],
	WEEKDAYS_SHORT:["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"],
	WEEKDAYS_MEDIUM:["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
	WEEKDAYS_LONG:["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"] 
};

