/**
* nlscalendar_picker.js v1.0
* Copyright 2005-2007, addobject.com. All Rights Reserved
* Author Jack Hermanto, www.addobject.com
*/
AOCAL.posAdj=function(){return[0,0]};AOCAL.showXY=function(x,y){ao$show(this,"dts");var oC=$aoGE(this.cId).style;if(x)oC.left=x+"px";if(y)oC.top=y+"px";oC.visibility="visible";oC.display=""};AOCAL.show=function(dir,elm,ctl,f,dl){if(this.onShow(elm,ctl)==false)return;this.bindControl(ctl,f,(dl?dl:"\n"));var o=elm?elm:$aoGE(ctl);var l=0,t=0,w=o.offsetWidth,h=o.offsetHeight,tmp=o,x=0,y=0;while(tmp){l+=tmp.offsetLeft;t+=tmp.offsetTop;tmp=tmp.offsetParent}switch(dir){case"UNE":x=-w;y=-h;case"NE":x+=(l+w);y+=(t-this.rt.cH+h);break;case"UNW":x=w;y=-h;case"NW":x+=(l-this.rt.cW);y+=(t-this.rt.cH+h);break;case"USW":x=w;y=h;case"SW":x+=(l-this.rt.cW);y+=t;break;case"USE":x=-w;y=h;case"SE":x+=l+w;y+=t;break}var a=this.posAdj();this.showXY(x+a[0],y+a[1]);};AOCAL.bindControl=function(ctl,f,dl){var c=this,o=c.opt;if(ctl){var dtCtl=$aoGE(ctl),fmt=(f?f:o.dtFormat);c.rt.dtCtl=dtCtl;var fn=function(){c.rt.dtCtl.value=AOCalendar.formatSelDates(c,dl,fmt);};if(!o.autoClose&&o.autoUpdate)c.$onChange=fn;else c.$onPickDate=fn;if(dtCtl.value!=""){if(this.opt.multiSel){this.clearSelections();var dv=dtCtl.value.split(dl);for(var i=0;i<dv.length;i++){dt=AOCalendar.parseDate(dv[i],fmt);c.addSelection(dt);}}else{c.setDate(AOCalendar.parseDate(dtCtl.value,fmt));}}}};AOCAL.hide=function(){$aoGE(this.cId).style.display="none";this.onHide();};