if(typeof SODON=="undefined"||!SODON){var SODON={};SODON.util={};SODON.widget={};SODON.example={}}(function(){var Dom=YAHOO.util.Dom;var Event=YAHOO.util.Event;var Element=YAHOO.util.Element;var DDM=YAHOO.util.DragDropMgr;SODON.util.Math={mod:function(too,sub){return(too-Math.floor(too/sub)*sub)},fixNumber:function(too){if(too>=0&&too<=9){return"0"+too}return too}};SODON.util.DateMath={YEAR:"Y",MONTH:"M",DAY:"D",WEEK:"W",add:function(date,field,amount){var d=new Date(date.getTime());switch(field){case this.YEAR:d.setFullYear(d.getFullYear()+amount);break;case this.MONTH:d.setMonth(d.getMonth()+amount);break;case this.DAY:d.setDate(d.getDate()+amount);break;case this.WEEK:d.setDate(d.getDate()+7*amount);break}return d},subtract:function(date,field,amount){return this.add(date,field,(-1)*amount)},before:function(date,compareTo){return date.getTime()<compareTo.getTime()},after:function(date,compareTo){return date.getTime()>compareTo.getTime()},between:function(date,dateBegin,dateEnd){return this.after(date,dateBegin)&&this.before(date,dateEnd)},equals:function(date,compareTo){date=this.clearTime(date);compareTo=this.clearTime(compareTo);return date.getTime()==compareTo.getTime()},findMonthStart:function(date){date.setDate(1);return date},findMonthEnd:function(date){var start=this.findMonthStart(date);var nextMonth=this.add(start,this.MONTH,1);return this.subtract(nextMonth,this.DAY,1)},clearTime:function(date){date.setHours(0,0,0,0);return date}};SODON.util.Config=function(owner){this.init.apply(this,arguments)};SODON.util.Config.prototype={owner:null,_DEFAULT_CONFIG:null,init:function(owner){this.owner=owner},setupConfig:function(){var key;for(key in this._DEFAULT_CONFIG){this.owner.Config[key]=this._DEFAULT_CONFIG[key]}},setConfig:function(config){var key;for(key in config){this.owner.Config[key]=config[key]}},getConfigProperty:function(key){return this.owner.Config[key]},setConfigProperty:function(key,value){this.owner.Config[key]=value},get:function(key){return this.getConfigProperty(key)},set:function(key,value){this.setConfigProperty(key,value)}};SODON.util.Ajax=function(container,method,url,config,params){this.init.apply(this,arguments)};SODON.util.Ajax.cfg=function(owner){SODON.util.Ajax.cfg.superclass.constructor.apply(this,arguments)};YAHOO.extend(SODON.util.Ajax.cfg,SODON.util.Config,{_DEFAULT_CONFIG:{ENABLE_JAVASCRIPT:true,TIMEOUT:30000,FORM_ID:null,FILE_UPLOAD:false,START:null,COMPLETE:null,SUCCESS:null,FAILURE:null,UPLOAD:null,ABORT:null,RENDER_BEFORE:null,RENDER_AFTER:null}});SODON.util.Ajax.prototype={oContainer:null,Connect:null,Config:null,cfg:null,request:null,init:function(container,method,url,config,params){var self=this;this.oContainer=Dom.get(container);if(this.oContainer!=null){method=method.toUpperCase();this.Config={};this.cfg=new SODON.util.Ajax.cfg(this);this.cfg.setupConfig();if(config!=null){this.cfg.setConfig(config)}var Connect=YAHOO.util.Connect;if(method=="POST"&&this.cfg.getConfigProperty("FORM_ID")!=null){Connect.setForm(this.cfg.getConfigProperty("FORM_ID"),this.cfg.getConfigProperty("FILE_UPLOAD"))}var callback={customevents:{onStart:function(type,args){},onComplete:function(type,args){},onSuccess:function(type,args){if(self.cfg.getConfigProperty("RENDER_BEFORE")!=null&&YAHOO.lang.isFunction(self.cfg.getConfigProperty("RENDER_BEFORE"))){self.cfg.getConfigProperty("RENDER_BEFORE")(type,args)}args[0].argument[0].innerHTML=args[0].responseText;if(self.cfg.getConfigProperty("RENDER_AFTER")!=null&&YAHOO.lang.isFunction(self.cfg.getConfigProperty("RENDER_AFTER"))){self.cfg.getConfigProperty("RENDER_AFTER")(type,args)}self.evalJavascript(args[0].argument[0])},onFailure:function(type,args){args[0].argument[0].innerHTML+="Transaction "+args[0].tId+", type: "+type+" fired, status: "+args[0].status+", statusText: "+args[0].statusText},onAbort:function(type,args){args[0].argument[0].innerHTML+="Transaction "+args[0].tId+", "+type+" fired."}},argument:[self.oContainer],timeout:self.cfg.getConfigProperty("TIMEOUT")};Connect.asyncRequest(method,url,callback,params)}},evalJavascript:function(htmlElement){var javascriptElements=htmlElement.getElementsByTagName("script");var i=0;while(i<javascriptElements.length){eval(javascriptElements[i].innerHTML);i++}}};SODON.util.ImageInfo=function(attr){SODON.util.ImageInfo.superclass.constructor.call(this,document.createElement("img"),attr)};YAHOO.extend(SODON.util.ImageInfo,Element,{init:function(el,attr){SODON.util.ImageInfo.superclass.init.call(this,el,attr)},initAttributes:function(attr){SODON.util.ImageInfo.superclass.initAttributes.call(this,attr);this.set("src",attr.src);var method=null;if(attr.imgload!=null){method=attr.imgload}else{method=function(){}}if(attr.data!=null){Event.on(this.get("element"),"load",method,attr.data)}else{Event.on(this.get("element"),"load",method)}},getWidth:function(){return this.get("width")},getHeight:function(){return this.get("height")}});SODON.widget.DDList=function(id,sGroup,config){SODON.widget.DDList.superclass.constructor.call(this,id,sGroup,config);var el=this.getDragEl();Dom.setStyle(el,"opacity",0.7);this.goingUp=false;this.lastX=0;this.lastY=0};YAHOO.extend(SODON.widget.DDList,YAHOO.util.DDProxy,{endDrag:function(e){var srcEl=this.getEl();var proxyEl=this.getDragEl();Dom.setStyle(proxyEl,"visibility","");var a=new YAHOO.util.Motion(proxyEl,{points:{to:Dom.getXY(srcEl)}},0.2,YAHOO.util.Easing.easeOut);var proxyId=proxyEl.id;var srcId=srcEl.id;a.onComplete.subscribe(function(){Dom.setStyle(proxyId,"visibility","hidden");Dom.setStyle(srcId,"visibility","")});a.animate()},onDrag:function(e){var y=Event.getPageY(e);if(y<this.lastY){this.goingUp=true}else{if(y>this.lastY){this.goingUp=false}}this.lastY=y}})})();