jindo.Component=jindo.$Class({_htEventHandler:null,_htOption:null,$init:function(){var aInstance=this.constructor.getInstance();aInstance.push(this);this._htEventHandler={};this._htOption={};this._htOption._htSetter={};},option:function(sName,vValue){switch(typeof sName){case"undefined":return this._htOption;case"string":if(typeof vValue!="undefined"){if(sName=="htCustomEventHandler"){if(typeof this._htOption[sName]=="undefined"){this.attach(vValue);}else{return this;}}this._htOption[sName]=vValue;if(typeof this._htOption._htSetter[sName]=="function"){this._htOption._htSetter[sName](vValue);}}else{return this._htOption[sName];}break;case"object":for(var sKey in sName){if(sKey=="htCustomEventHandler"){if(typeof this._htOption[sKey]=="undefined"){this.attach(sName[sKey]);}else{continue;}}this._htOption[sKey]=sName[sKey];if(typeof this._htOption._htSetter[sKey]=="function"){this._htOption._htSetter[sKey](sName[sKey]);}}break;}return this;},optionSetter:function(sName,fSetter){switch(typeof sName){case"undefined":return this._htOption._htSetter;case"string":if(typeof fSetter!="undefined"){this._htOption._htSetter[sName]=jindo.$Fn(fSetter,this).bind();}else{return this._htOption._htSetter[sName];}break;case"object":for(var sKey in sName){this._htOption._htSetter[sKey]=jindo.$Fn(sName[sKey],this).bind();}break;}return this;},fireEvent:function(sEvent,oEvent){oEvent=oEvent||{};var fInlineHandler=this["on"+sEvent],aHandlerList=this._htEventHandler[sEvent]||[],bHasInlineHandler=typeof fInlineHandler=="function",bHasHandlerList=aHandlerList.length>0;if(!bHasInlineHandler&&!bHasHandlerList){return true;}aHandlerList=aHandlerList.concat();oEvent.sType=sEvent;if(typeof oEvent._aExtend=="undefined"){oEvent._aExtend=[];oEvent.stop=function(){if(oEvent._aExtend.length>0){oEvent._aExtend[oEvent._aExtend.length-1].bCanceled=true;}};}oEvent._aExtend.push({sType:sEvent,bCanceled:false});var aArg=[oEvent],i,nLen;for(i=2,nLen=arguments.length;i0){this._onActivate.apply(this,arguments);}else{this._onActivate();}return this;},deactivate:function(){if(!this.isActivating()){return this;}this._bIsActivating=false;if(arguments.length>0){this._onDeactivate.apply(this,arguments);}else{this._onDeactivate();}return this;}}).extend(jindo.Component);jindo.RolloverArea=jindo.$Class({$init:function(el,htOption){this.option({sClassName:"rollover",sClassPrefix:"rollover-",bCheckMouseDown:true,bActivateOnload:true,htStatus:{sOver:"over",sDown:"down"}});this.option(htOption||{});this._elArea=jindo.$(el);this._aOveredElements=[];this._aDownedElements=[];this._wfMouseOver=jindo.$Fn(this._onMouseOver,this);this._wfMouseOut=jindo.$Fn(this._onMouseOut,this);this._wfMouseDown=jindo.$Fn(this._onMouseDown,this);this._wfMouseUp=jindo.$Fn(this._onMouseUp,this);if(this.option("bActivateOnload")){this.activate();}},_addOvered:function(el){this._aOveredElements.push(el);},_removeOvered:function(el){this._aOveredElements.splice(jindo.$A(this._aOveredElements).indexOf(el),1);},_addStatus:function(el,sStatus){jindo.$Element(el).addClass(this.option("sClassPrefix")+sStatus);},_removeStatus:function(el,sStatus){jindo.$Element(el).removeClass(this.option("sClassPrefix")+sStatus);},_isInnerElement:function(elParent,elChild){return elParent===elChild?true:jindo.$Element(elParent).isParentOf(elChild);},_onActivate:function(){this._wfMouseOver.attach(this._elArea,"mouseover");this._wfMouseOut.attach(this._elArea,"mouseout");if(this.option("bCheckMouseDown")){this._wfMouseDown.attach(this._elArea,"mousedown");this._wfMouseUp.attach(document,"mouseup");}},_onDeactivate:function(){this._wfMouseOver.detach(this._elArea,"mouseover");this._wfMouseOut.detach(this._elArea,"mouseout");this._wfMouseDown.detach(this._elArea,"mousedown");this._wfMouseUp.detach(document,"mouseup");this._aOveredElements.length=0;this._aDownedElements.length=0;},_findRollover:function(el){var sClassName=this.option("sClassName");return jindo.$$.test(el,"."+sClassName)?el:jindo.$$.getSingle("! ."+sClassName,el);},_onMouseOver:function(we){var el=we.element,elRelated=we.relatedElement,htParam;for(;el=this._findRollover(el);el=el.parentNode){if(elRelated&&this._isInnerElement(el,elRelated)){continue;}this._addOvered(el);htParam={element:el,htStatus:this.option("htStatus"),weEvent:we};if(this.fireEvent("over",htParam)){this._addStatus(htParam.element,htParam.htStatus.sOver);}}},_onMouseOut:function(we){var el=we.element,elRelated=we.relatedElement,htParam;for(;el=this._findRollover(el);el=el.parentNode){if(elRelated&&this._isInnerElement(el,elRelated)){continue;}this._removeOvered(el);htParam={element:el,htStatus:this.option("htStatus"),weEvent:we};if(this.fireEvent("out",htParam)){this._removeStatus(htParam.element,htParam.htStatus.sOver);}}},_onMouseDown:function(we){var el=we.element,htParam;while(el=this._findRollover(el)){htParam={element:el,htStatus:this.option("htStatus"),weEvent:we};this._aDownedElements.push(el);if(this.fireEvent("down",htParam)){this._addStatus(htParam.element,htParam.htStatus.sDown);}el=el.parentNode;}},_onMouseUp:function(we){var el=we.element,aTargetElementDatas=[],aDownedElements=this._aDownedElements,htParam,elMouseDown,i;for(i=0;elMouseDown=aDownedElements[i];i++){aTargetElementDatas.push({element:elMouseDown,htStatus:this.option("htStatus"),weEvent:we});}for(;el=this._findRollover(el);el=el.parentNode){if(jindo.$A(aDownedElements).indexOf(el)>-1){continue;}aTargetElementDatas.push({element:el,htStatus:this.option("htStatus"),weEvent:we});}for(i=0;htParam=aTargetElementDatas[i];i++){if(this.fireEvent("up",htParam)){this._removeStatus(htParam.element,htParam.htStatus.sDown);}}this._aDownedElements=[];}}).extend(jindo.UIComponent);jindo.Calendar=jindo.$Class({$init:function(sLayerId,htOption){this._htToday=this.constructor.getDateHashTable(new Date());this._elLayer=jindo.$(sLayerId);this.htDefaultOption={sClassPrefix:"calendar-",nYear:this._htToday.nYear,nMonth:this._htToday.nMonth,nDate:this._htToday.nDate,sTitleFormat:"yyyy-mm",sYearTitleFormat:"yyyy",sMonthTitleFormat:"m",aMonthTitle:["JAN","FEB","MAR","APR","MAY","JUN","JUL","AUG","SEP","OCT","NOV","DEC"],bDrawOnload:true};this.option(this.htDefaultOption);this.option(htOption||{});this._assignHTMLElements();this.activate();this.setDate(this.option("nYear"),this.option("nMonth"),this.option("nDate"));if(this.option("bDrawOnload")){this.draw();}},getBaseElement:function(){return this._elLayer;},getDate:function(){return this._htDate;},getDateOfElement:function(el){var nDateIndex=jindo.$A(this._aDateContainerElement).indexOf(el);if(nDateIndex>-1){return this._aMetaData[nDateIndex];}return null;},getToday:function(){return this._htToday;},setDate:function(nYear,nMonth,nDate){this._htDate={nYear:nYear,nMonth:(nMonth*1),nDate:(nDate*1)};},getShownDate:function(){return this._getShownDate();},_getShownDate:function(){return this.htShownDate||this.getDate();},_setShownDate:function(nYear,nMonth){this.htShownDate={nYear:nYear,nMonth:(nMonth*1),nDate:1};},_assignHTMLElements:function(){var sClassPrefix=this.option("sClassPrefix"),elLayer=this.getBaseElement();if((this.elBtnPrevYear=jindo.$$.getSingle(("."+sClassPrefix+"btn-prev-year"),elLayer))){this.wfPrevYear=jindo.$Fn(function(oEvent){oEvent.stop(jindo.$Event.CANCEL_DEFAULT);this.draw(-1,0,true);},this);}if((this.elBtnPrevMonth=jindo.$$.getSingle(("."+sClassPrefix+"btn-prev-mon"),elLayer))){this.wfPrevMonth=jindo.$Fn(function(oEvent){oEvent.stop(jindo.$Event.CANCEL_DEFAULT);this.draw(0,-1,true);},this);}if((this.elBtnNextMonth=jindo.$$.getSingle(("."+sClassPrefix+"btn-next-mon"),elLayer))){this.wfNextMonth=jindo.$Fn(function(oEvent){oEvent.stop(jindo.$Event.CANCEL_DEFAULT);this.draw(0,1,true);},this);}if((this.elBtnNextYear=jindo.$$.getSingle(("."+sClassPrefix+"btn-next-year"),elLayer))){this.wfNextYear=jindo.$Fn(function(oEvent){oEvent.stop(jindo.$Event.CANCEL_DEFAULT);this.draw(1,0,true);},this);}this.elTitle=jindo.$$.getSingle(("."+sClassPrefix+"title"),elLayer);this.elTitleYear=jindo.$$.getSingle(("."+sClassPrefix+"title-year"),elLayer);this.elTitleMonth=jindo.$$.getSingle(("."+sClassPrefix+"title-month"),elLayer);var elWeekTemplate=jindo.$$.getSingle("."+sClassPrefix+"week",elLayer);this.elWeekTemplate=elWeekTemplate.cloneNode(true);this.elWeekAppendTarget=elWeekTemplate.parentNode;},_setCalendarTitle:function(nYear,nMonth,sType){if(nMonth<10){nMonth=("0"+(nMonth*1)).toString();}var elTitle=this.elTitle,sTitleFormat=this.option("sTitleFormat"),sTitle;if(typeof sType!="undefined"){switch(sType){case"year":elTitle=this.elTitleYear;sTitleFormat=this.option("sYearTitleFormat");sTitle=sTitleFormat.replace(/yyyy/g,nYear).replace(/y/g,(nYear).toString().substr(2,2));break;case"month":elTitle=this.elTitleMonth;sTitleFormat=this.option("sMonthTitleFormat");sTitle=sTitleFormat.replace(/mm/g,nMonth).replace(/m/g,(nMonth*1)).replace(/M/g,this.option("aMonthTitle")[nMonth-1]);break;}}else{sTitle=sTitleFormat.replace(/yyyy/g,nYear).replace(/y/g,(nYear).toString().substr(2,2)).replace(/mm/g,nMonth).replace(/m/g,(nMonth*1)).replace(/M/g,this.option("aMonthTitle")[nMonth-1]);}jindo.$Element(elTitle).text(sTitle);},draw:function(nYear,nMonth,bRelative){var sClassPrefix=this.option("sClassPrefix"),htDate=this.getDate(),oShownDate=this._getShownDate();if(oShownDate&&typeof bRelative!="undefined"&&bRelative){var htRelativeDate=this.constructor.getRelativeDate(nYear,nMonth,0,oShownDate);nYear=htRelativeDate.nYear;nMonth=htRelativeDate.nMonth;}else{if(typeof nYear=="undefined"&&typeof nMonth=="undefined"&&typeof bRelative=="undefined"){nYear=htDate.nYear;nMonth=htDate.nMonth;}else{nYear=nYear||oShownDate.nYear;nMonth=nMonth||oShownDate.nMonth;}}if(this.fireEvent("beforeDraw",{nYear:nYear,nMonth:nMonth})){if(this.elTitle){this._setCalendarTitle(nYear,nMonth);}if(this.elTitleYear){this._setCalendarTitle(nYear,nMonth,"year");}if(this.elTitleMonth){this._setCalendarTitle(nYear,nMonth,"month");}this._clear(jindo.Calendar.getWeeks(nYear,nMonth));this._setShownDate(nYear,nMonth);var htToday=this.getToday(),nFirstDay=this.constructor.getFirstDay(nYear,nMonth),nLastDay=this.constructor.getLastDay(nYear,nMonth),nLastDate=this.constructor.getLastDate(nYear,nMonth),nDay=0,htDatePrevMonth=this.constructor.getRelativeDate(0,-1,0,{nYear:nYear,nMonth:nMonth,nDate:1}),htDateNextMonth=this.constructor.getRelativeDate(0,1,0,{nYear:nYear,nMonth:nMonth,nDate:1}),nPrevMonthLastDate=this.constructor.getLastDate(htDatePrevMonth.nYear,htDatePrevMonth.nMonth),aDate=[],bPrevMonth,bNextMonth,welDateContainer,nTempYear,nTempMonth,oParam,nIndexOfLastDate,elWeek,i;var nWeeks=this.constructor.getWeeks(nYear,nMonth);for(i=0;i *",this.elWeekAppendTarget);if(nFirstDay>0){for(i=nPrevMonthLastDate-nFirstDay;inIndexOfLastDate){bNextMonth=true;welDateContainer.addClass(sClassPrefix+"next-mon");nTempYear=htDateNextMonth.nYear;nTempMonth=htDateNextMonth.nMonth;}else{nTempYear=nYear;nTempMonth=nMonth;}}if(nDay===0){welDateContainer.addClass(sClassPrefix+"sun");}if(nDay==6){welDateContainer.addClass(sClassPrefix+"sat");}if(nTempYear==htToday.nYear&&(nTempMonth*1)==htToday.nMonth&&aDate[i]==htToday.nDate){welDateContainer.addClass(sClassPrefix+"today");}oParam={elDate:this._aDateElement[i],elDateContainer:welDateContainer.$value(),nYear:nTempYear,nMonth:nTempMonth,nDate:aDate[i],bPrevMonth:bPrevMonth,bNextMonth:bNextMonth,sHTML:aDate[i]};jindo.$Element(oParam.elDate).html(oParam.sHTML.toString());this._aMetaData.push({nYear:nTempYear,nMonth:nTempMonth,nDate:aDate[i]});nDay=(nDay+1)%7;this.fireEvent("draw",oParam);}this.fireEvent("afterDraw",{nYear:nYear,nMonth:nMonth});}},_clear:function(nWeek){this._aMetaData=[];this._aWeekElement=[];jindo.$Element(this.elWeekAppendTarget).empty();},attachEvent:function(){this.activate();},detachEvent:function(){this.deactivate();},_onActivate:function(){if(this.elBtnPrevYear){this.wfPrevYear.attach(this.elBtnPrevYear,"click");}if(this.elBtnPrevMonth){this.wfPrevMonth.attach(this.elBtnPrevMonth,"click");}if(this.elBtnNextMonth){this.wfNextMonth.attach(this.elBtnNextMonth,"click");}if(this.elBtnNextYear){this.wfNextYear.attach(this.elBtnNextYear,"click");}},_onDeactivate:function(){if(this.elBtnPrevYear){this.wfPrevYear.detach(this.elBtnPrevYear,"click");}if(this.elBtnPrevMonth){this.wfPrevMonth.detach(this.elBtnPrevMonth,"click");}if(this.elBtnNextMonth){this.wfNextMonth.detach(this.elBtnNextMonth,"click");}if(this.elBtnNextYear){this.wfNextYear.detach(this.elBtnNextYear,"click");}}}).extend(jindo.UIComponent);jindo.Calendar.getDateObject=function(htDate){if(arguments.length==3){return new Date(arguments[0],arguments[1]-1,arguments[2]);}return new Date(htDate.nYear,htDate.nMonth-1,htDate.nDate);};jindo.Calendar.getDateHashTable=function(oDate){if(arguments.length==3){return{nYear:arguments[0],nMonth:arguments[1],nDate:arguments[2]};}if(arguments.length<=1){oDate=oDate||new Date();}return{nYear:oDate.getFullYear(),nMonth:oDate.getMonth()+1,nDate:oDate.getDate()};};jindo.Calendar.getTime=function(htDate){return this.getDateObject(htDate).getTime();};jindo.Calendar.getFirstDay=function(nYear,nMonth){return new Date(nYear,nMonth-1,1).getDay();};jindo.Calendar.getLastDay=function(nYear,nMonth){return new Date(nYear,nMonth,0).getDay();};jindo.Calendar.getLastDate=function(nYear,nMonth){return new Date(nYear,nMonth,0).getDate();};jindo.Calendar.getWeeks=function(nYear,nMonth){var nFirstDay=this.getFirstDay(nYear,nMonth),nLastDate=this.getLastDate(nYear,nMonth);return Math.ceil((nFirstDay+nLastDate)/7);};jindo.Calendar.getRelativeDate=function(nYear,nMonth,nDate,htDate){return this.getDateHashTable(new Date(htDate.nYear+nYear,htDate.nMonth+nMonth-1,htDate.nDate+nDate));};jindo.Calendar.isPast=function(htDate,htComparisonDate){if(this.getTime(htDate)this.getTime(htComparisonDate)){return true;}return false;};jindo.Calendar.isSameDate=function(htDate,htComparisonDate){if(this.getTime(htDate)==this.getTime(htComparisonDate)){return true;}return false;};jindo.Calendar.isBetween=function(htDate,htFrom,htTo){if(this.isFuture(htDate,htTo)||this.isPast(htDate,htFrom)){return false;}else{return true;}};jindo.LayerManager=jindo.$Class({_bIsActivating:false,_bIsLayerVisible:false,_bIsHiding:false,_bIsShowing:false,_aLink:null,$init:function(el,htOption){this.option({sCheckEvent:"click",nCheckDelay:100,nShowDelay:0,nHideDelay:100,sMethod:"show",nDuration:200,Transition:{fFadeIn:jindo.Effect.cubicEaseOut,fFadeOut:jindo.Effect.cubicEaseIn,fSlideDown:jindo.Effect.cubicEaseOut,fSlideUp:jindo.Effect.cubicEaseIn}});this.option(htOption||{});this.setLayer(el);this._aLink=[];this._oShowTimer=new jindo.Timer();this._oHideTimer=new jindo.Timer();this._oEventTimer=new jindo.Timer();this._wfOnEvent=jindo.$Fn(this._onEvent,this);this.getVisible();this.activate();},_onActivate:function(){this._wfOnEvent.attach(document,this.option("sCheckEvent"));},_onDeactivate:function(){this._wfOnEvent.detach(document,this.option("sCheckEvent"));},getVisible:function(){return this._bIsLayerVisible=(this._wel.visible()&&this._wel.opacity()>0);},_check:function(el){var wel=jindo.$Element(el);for(var i=0,elLink;elLink=this._aLink[i];i++){elLink=jindo.$Element(elLink).$value();if(elLink&&(el==elLink||wel.isChildOf(elLink))){return true;}}return false;},_find:function(el){for(var i=0,elLink;(elLink=this._aLink[i]);i++){if(elLink==el){return i;}}return -1;},getLayer:function(){return this._el;},setLayer:function(el){this._el=jindo.$(el);this._wel=jindo.$Element(el);var elToMeasure=this._el.cloneNode(true);var welToMeasure=jindo.$Element(elToMeasure);welToMeasure.css({position:"absolute",left:"-5000px"}).appendTo(this._el.parentNode);welToMeasure.show();this._nLayerHeight=welToMeasure.height();welToMeasure.height(this._nLayerHeight);this._sLayerCSSHeight=welToMeasure.css("height");this._sLayerCSSOverflowX=this._wel.css("overflowX");this._sLayerCSSOverflowY=this._wel.css("overflowY");welToMeasure.css("overflow","hidden").height(0);this._nSlideMinHeight=welToMeasure.height()+1;welToMeasure.leave();return this;},_transform:function(){this._wel.css({overflowX:"hidden",overflowY:"hidden"});},_restore:function(){this._wel.css({overflowX:this._sLayerCSSOverflowX,overflowY:this._sLayerCSSOverflowY});},getLinks:function(){return this._aLink;},setLinks:function(a){this._aLink=jindo.$A(a).unique().$value();return this;},link:function(vElement){if(arguments.length>1){for(var i=0,len=arguments.length;i1){for(var i=0,len=arguments.length;i-1){this._aLink.splice(nIndex,1);}return this;},_fireEventBeforeShow:function(){this._transform();return this.fireEvent("beforeShow",{elLayer:this.getLayer(),aLinkedElement:this.getLinks(),sMethod:this.option("sMethod")});},_fireEventAppear:function(){this.fireEvent("appear",{elLayer:this.getLayer(),aLinkedElement:this.getLinks(),sMethod:this.option("sMethod")});},_fireEventShow:function(){this._bIsShowing=false;this._restore();this.fireEvent("show",{elLayer:this.getLayer(),aLinkedElement:this.getLinks(),sMethod:this.option("sMethod")});},_fireEventBeforeHide:function(){this._transform();return this.fireEvent("beforeHide",{elLayer:this.getLayer(),aLinkedElement:this.getLinks(),sMethod:this.option("sMethod")});},_fireEventHide:function(){this._bIsHiding=false;this._restore();this.fireEvent("hide",{elLayer:this.getLayer(),aLinkedElement:this.getLinks(),sMethod:this.option("sMethod")});},_show:function(fShow,nDelay){this._oEventTimer.abort();this._bIsShowing=true;this._bIsHiding=false;if(nDelay>0){this._oShowTimer.start(fShow,nDelay);}else{this._oHideTimer.abort();fShow();}},_hide:function(fHide,nDelay){this._bIsShowing=false;this._bIsHiding=true;if(nDelay>0){this._oHideTimer.start(fHide,nDelay);}else{this._oShowTimer.abort();fHide();}},_getShowMethod:function(){switch(this.option("sMethod")){case"show":return"showIn";case"fade":return"fadeIn";case"slide":return"slideDown";}},_getHideMethod:function(){switch(this.option("sMethod")){case"show":return"hideOut";case"fade":return"fadeOut";case"slide":return"slideUp";}},show:function(nDelay){if(typeof nDelay=="undefined"){nDelay=this.option("nShowDelay");}this[this._getShowMethod()](nDelay);return this;},hide:function(nDelay){if(typeof nDelay=="undefined"){nDelay=this.option("nHideDelay");}this[this._getHideMethod()](nDelay);return this;},showIn:function(nDelay){if(typeof nDelay=="undefined"){nDelay=this.option("nShowDelay");}var self=this;this._show(function(){self._sAppliedMethod="show";if(!self.getVisible()){if(self._fireEventBeforeShow()){self._wel.show();self._fireEventAppear();self._fireEventShow();}}},nDelay);return this;},hideOut:function(nDelay){if(typeof nDelay=="undefined"){nDelay=this.option("nHideDelay");}var self=this;this._hide(function(){self._sAppliedMethod="show";if(self.getVisible()){if(self._fireEventBeforeHide()){self._wel.hide();self._fireEventHide();}}},nDelay);return this;},_getTransition:function(){if(this._oTransition){return this._oTransition;}else{return(this._oTransition=new jindo.Transition().fps(30));}},fadeIn:function(nDelay){var oTransition=this._getTransition();oTransition.detachAll().abort();if(typeof nDelay=="undefined"){nDelay=this.option("nShowDelay");}var nDuration=this.option("nDuration");var self=this;this._show(function(){self._sAppliedMethod="fade";var elLayer=self.getLayer();if(!self._wel.visible()||self._wel.opacity()!=1){if(self._fireEventBeforeShow()){if(!self._wel.visible()){self._wel.opacity(0);self._wel.show();}nDuration*=(1-self._wel.opacity());oTransition.attach({playing:function(oCustomEvent){if(oCustomEvent.nStep===1){this.detach("playing",arguments.callee);self._fireEventAppear();}},end:function(oCustomEvent){this.detach("end",arguments.callee);self._fireEventShow();}}).start(nDuration,elLayer,{"@opacity":self.option("Transition").fFadeIn.apply(null,[1])});}}},nDelay);return this;},fadeOut:function(nDelay){var oTransition=this._getTransition();oTransition.detachAll().abort();if(typeof nDelay=="undefined"){nDelay=this.option("nHideDelay");}var nDuration=this.option("nDuration");var self=this;this._hide(function(){self._sAppliedMethod="fade";if(self.getVisible()){var elLayer=self.getLayer();if(self._fireEventBeforeHide()){nDuration*=self._wel.opacity();oTransition.attach({end:function(e){this.detach("end",arguments.callee);self._wel.hide();self._wel.opacity(1);self._fireEventHide();}}).start(nDuration,elLayer,{"@opacity":self.option("Transition").fFadeOut.apply(null,[0])});}}},nDelay);return this;},slideDown:function(nDelay){var oTransition=this._getTransition();oTransition.detachAll().abort();if(typeof nDelay=="undefined"){nDelay=this.option("nShowDelay");}var nDuration=this.option("nDuration");var self=this;this._show(function(){self._sAppliedMethod="slide";var elLayer=self.getLayer();if(Math.ceil(self._wel.height())-1){return true;}return false;},_setLeftRight:function(htOption,htPosition){var el=this.getElement(),elLayer=this.getLayer(),nWidth=el.offsetWidth,nLayerWidth=elLayer.offsetWidth;if(el==document.body){nWidth=jindo.$Document().clientSize().width;}var bLeft=this._isPosition(htOption,"left"),bRight=this._isPosition(htOption,"right"),bInside=this._isPosition(htOption,"inside");if(bLeft){if(bInside){htPosition.nLeft+=htOption.nLeft;}else{htPosition.nLeft-=nLayerWidth;htPosition.nLeft-=htOption.nLeft;}}else{if(bRight){htPosition.nLeft+=nWidth;if(bInside){htPosition.nLeft-=nLayerWidth;htPosition.nLeft-=htOption.nLeft;}else{htPosition.nLeft+=htOption.nLeft;}}else{if(htOption.sAlign=="left"){htPosition.nLeft+=htOption.nLeft;}if(htOption.sAlign=="center"){htPosition.nLeft+=(nWidth-nLayerWidth)/2;}if(htOption.sAlign=="right"){htPosition.nLeft+=nWidth-nLayerWidth;htPosition.nLeft-=htOption.nLeft;}}}return htPosition;},_setVerticalAlign:function(htOption,htPosition){var el=this.getElement(),elLayer=this.getLayer(),nHeight=el.offsetHeight,nLayerHeight=elLayer.offsetHeight;if(el==document.body){nHeight=jindo.$Document().clientSize().height;}switch(htOption.sValign){case"top":htPosition.nTop+=htOption.nTop;break;case"middle":htPosition.nTop+=(nHeight-nLayerHeight)/2;break;case"bottom":htPosition.nTop+=nHeight-nLayerHeight-htOption.nTop;break;}return htPosition;},_adjustScrollPosition:function(htPosition){if(this.getElement()==document.body){var htScrollPosition=jindo.$Document().scrollPosition();htPosition.nTop+=htScrollPosition.top;htPosition.nLeft+=htScrollPosition.left;}return htPosition;},getPosition:function(htOption){if(typeof htOption!="object"){htOption=this.option();}if(typeof htOption.nTop=="undefined"){htOption.nTop=0;}if(typeof htOption.nLeft=="undefined"){htOption.nLeft=0;}var sArea,bCenter=this._isPosition(htOption,"center"),bInside=this._isPosition(htOption,"inside"),bTop=this._isPosition(htOption,"top"),bBottom=this._isPosition(htOption,"bottom"),bLeft=this._isPosition(htOption,"left"),bRight=this._isPosition(htOption,"right");if(bLeft){sArea="left";}if(bRight){sArea="right";}if(bTop){sArea="top";}if(bBottom){sArea="bottom";}if(bCenter){sArea="center";}var el=this.getElement(),wel=jindo.$Element(el),elLayer=this.getLayer(),welLayer=jindo.$Element(elLayer),htElementPosition=wel.offset(),nWidth=el.offsetWidth,nHeight=el.offsetHeight,oClientSize,nLayerWidth=elLayer.offsetWidth,nLayerHeight=elLayer.offsetHeight,htPosition={nTop:htElementPosition.top,nLeft:htElementPosition.left};if(el==document.body){oClientSize=jindo.$Document().clientSize();nWidth=oClientSize.width;nHeight=oClientSize.height;}nLayerWidth+=parseInt(welLayer.css("marginLeft"))+parseInt(welLayer.css("marginRight"))||0;nLayerHeight+=parseInt(welLayer.css("marginTop"))+parseInt(welLayer.css("marginBottom"))||0;switch(sArea){case"center":htPosition.nTop+=(nHeight-nLayerHeight)/2;htPosition.nTop+=htOption.nTop;htPosition.nLeft+=(nWidth-nLayerWidth)/2;htPosition.nLeft+=htOption.nLeft;break;case"top":if(bInside){htPosition.nTop+=htOption.nTop;}else{htPosition.nTop-=htOption.nTop+nLayerHeight;}htPosition=this._setLeftRight(htOption,htPosition);break;case"bottom":htPosition.nTop+=nHeight;if(bInside){htPosition.nTop-=htOption.nTop+nLayerHeight;}else{htPosition.nTop+=htOption.nTop;}htPosition=this._setLeftRight(htOption,htPosition);break;case"left":if(bInside){htPosition.nLeft+=htOption.nLeft;}else{htPosition.nLeft-=htOption.nLeft+nLayerWidth;}htPosition=this._setVerticalAlign(htOption,htPosition);break;case"right":htPosition.nLeft+=nWidth;if(bInside){htPosition.nLeft-=htOption.nLeft+nLayerWidth;}else{htPosition.nLeft+=htOption.nLeft;}htPosition=this._setVerticalAlign(htOption,htPosition);break;}htPosition=this._adjustScrollPosition(htPosition);return htPosition;},setPosition:function(htPosition){var welLayer=jindo.$Element(this.getLayer());welLayer.css("left","-9999px").css("top","0px");if(typeof htPosition=="undefined"){htPosition=this.getPosition();}if(this.option("bAuto")){htPosition=this._adjustPosition(htPosition);}welLayer.css("left",htPosition.nLeft+"px").css("top",htPosition.nTop+"px");return this;},getCurrentPosition:function(){var welLayer=jindo.$Element(this.getLayer());return{nTop:parseInt(welLayer.css("top")),nLeft:parseInt(welLayer.css("left"))};},_isFullyVisible:function(htPosition){var elLayer=this.getLayer(),welLayer=jindo.$Element(elLayer),oScrollPosition=jindo.$Document().scrollPosition(),nScrollTop=oScrollPosition.top,nScrollLeft=oScrollPosition.left,oClientSize=jindo.$Document().clientSize(),nLayerWidth=elLayer.offsetWidth+(parseInt(welLayer.css("marginLeft"))+parseInt(welLayer.css("marginRight"))||0),nLayerHeight=elLayer.offsetHeight+(parseInt(welLayer.css("marginTop"))+parseInt(welLayer.css("marginBottom"))||0);if(htPosition.nLeft>=0&&htPosition.nTop>=0&&oClientSize.width>=htPosition.nLeft-nScrollLeft+nLayerWidth&&oClientSize.height>=htPosition.nTop-nScrollTop+nLayerHeight){return true;}return false;},_mirrorHorizontal:function(htOption){if(htOption.sAlign=="center"||htOption.sPosition=="inside-center"){return htOption;}var htConvertedOption={};for(var i in htOption){htConvertedOption[i]=htOption[i];}if(this._isPosition(htConvertedOption,"right")){htConvertedOption.sPosition=htConvertedOption.sPosition.replace(/right/,"left");}else{if(this._isPosition(htConvertedOption,"left")){htConvertedOption.sPosition=htConvertedOption.sPosition.replace(/left/,"right");}else{if(htConvertedOption.sAlign=="right"){htConvertedOption.sAlign="left";}else{if(htConvertedOption.sAlign=="left"){htConvertedOption.sAlign="right";}}}}return htConvertedOption;},_mirrorVertical:function(htOption){if(htOption.sValign=="middle"||htOption.sPosition=="inside-center"){return htOption;}var htConvertedOption={};for(var i in htOption){htConvertedOption[i]=htOption[i];}if(this._isPosition(htConvertedOption,"top")){htConvertedOption.sPosition=htConvertedOption.sPosition.replace(/top/,"bottom");}else{if(this._isPosition(htConvertedOption,"bottom")){htConvertedOption.sPosition=htConvertedOption.sPosition.replace(/bottom/,"top");}else{if(htConvertedOption.sValign=="top"){htConvertedOption.sValign="bottom";}else{if(htConvertedOption.sValign=="bottom"){htConvertedOption.sValign="top";}}}}return htConvertedOption;},_adjustPosition:function(htPosition){var htOption=this.option(),aCandidatePosition=[];aCandidatePosition.push(htPosition);aCandidatePosition.push(this.getPosition(this._mirrorHorizontal(htOption)));aCandidatePosition.push(this.getPosition(this._mirrorVertical(htOption)));aCandidatePosition.push(this.getPosition(this._mirrorVertical(this._mirrorHorizontal(htOption))));for(var i=0,htCandidatePosition;htCandidatePosition=aCandidatePosition[i];i++){if(this._isFullyVisible(htCandidatePosition)){htPosition=htCandidatePosition;break;}}return htPosition;}}).extend(jindo.Component);jindo.Timer=jindo.$Class({$init:function(){this._nTimer=null;this._nLatest=null;this._nRemained=0;this._nDelay=null;this._fRun=null;this._bIsRunning=false;},start:function(fRun,nDelay){this.abort();this._nRemained=0;this._nDelay=nDelay;this._fRun=fRun;this._bIsRunning=true;this._nLatest=this._getTime();this.fireEvent("wait");this._excute(this._nDelay,false);return true;},isRunning:function(){return this._bIsRunning;},_getTime:function(){return new Date().getTime();},_clearTimer:function(){var bFlag=false;if(this._nTimer){clearInterval(this._nTimer);this._bIsRunning=false;bFlag=true;}this._nTimer=null;return bFlag;},abort:function(){var bReturn=this._clearTimer();if(bReturn){this.fireEvent("abort");this._fRun=null;}return bReturn;},pause:function(){var nPassed=this._getTime()-this._nLatest;this._nRemained=Math.max(this._nDelay-nPassed,0);return this._clearTimer();},_excute:function(nDelay,bResetDelay){var self=this;this._clearTimer();this._bIsRunning=true;this._nTimer=setInterval(function(){if(self._nTimer){self.fireEvent("run");var r=self._fRun();self._nLatest=self._getTime();if(!r){clearInterval(self._nTimer);self._nTimer=null;self._bIsRunning=false;self.fireEvent("end");return;}self.fireEvent("wait");if(bResetDelay){self._excute(self._nDelay,false);}}},nDelay);},resume:function(){if(!this._fRun||this.isRunning()){return false;}this._bIsRunning=true;this.fireEvent("wait");this._excute(this._nRemained,true);this._nRemained=0;return true;}}).extend(jindo.Component);jindo.Transition=jindo.$Class({_nFPS:30,_aTaskQueue:null,_oTimer:null,_bIsWaiting:true,_bIsPlaying:false,$init:function(htOption){this._aTaskQueue=[];this._oTimer=new jindo.Timer();this.option({fEffect:jindo.Effect.linear,bCorrection:false});this.option(htOption||{});},fps:function(nFPS){if(arguments.length>0){this._nFPS=nFPS;return this;}return this._nFPS;},isPlaying:function(){return this._bIsPlaying;},abort:function(){this._aTaskQueue=[];this._oTimer.abort();if(this._bIsPlaying){this.fireEvent("abort");}this._bIsWaiting=true;this._bIsPlaying=false;this._htTaskToDo=null;return this;},start:function(nDuration,elTarget,htInfo){if(arguments.length>0){this.queue.apply(this,arguments);}this._prepareNextTask();return this;},queue:function(nDuration,aCommand){var htTask;if(typeof arguments[0]=="function"){htTask={sType:"function",fTask:arguments[0]};}else{var a=[];var nLength=arguments.length;if(arguments[1] instanceof Array){a=arguments[1];}else{var aInner=[];jindo.$A(arguments).forEach(function(v,i){if(i>0){aInner.push(v);if(i%2==0){a.push(aInner.concat());aInner=[];}}});}htTask={sType:"task",nDuration:nDuration,aList:[]};for(var i=0;i1){nStart=getUnitAndValue(nStart);nEnd=getUnitAndValue(nEnd);sUnit=nEnd.sUnit;}else{nEnd=getUnitAndValue(nStart);nStart=null;sUnit=nEnd.sUnit;}if(nStart&&nEnd&&nStart.sUnit!=nEnd.sUnit){throw new Error("unit error");}nStart=nStart&&nStart.nValue;nEnd=nEnd&&nEnd.nValue;var fReturn=function(p){var nValue=fEffect(p);var getResult=function(s,d){return(d-s)*nValue+s+sUnit;};if(sUnit=="color"){var r=parseInt(getResult(nStart[0],nEnd[0]),10)<<16;r|=parseInt(getResult(nStart[1],nEnd[1]),10)<<8;r|=parseInt(getResult(nStart[2],nEnd[2]),10);r=r.toString(16).toUpperCase();for(var i=0;6-r.length;i++){r="0"+r;}return"#"+r;}return getResult(nStart,nEnd);};if(nStart===null){fReturn.setStart=function(s){s=getUnitAndValue(s);if(s.sUnit!=sUnit){throw new Error("unit eror");}nStart=s.nValue;};}return fReturn;};};jindo.Effect.linear=jindo.Effect(function(s){return s;});jindo.Effect.easeIn=jindo.Effect(function(s){return(1-Math.sqrt(1-(s*s)));});jindo.Effect.easeOut=jindo.Effect(function(s){return Math.sqrt((2-s)*s);});jindo.Effect.bounce=jindo.Effect(function(s){if(s<(1/2.75)){return(7.5625*s*s);}else{if(s<(2/2.75)){return(7.5625*(s-=(1.5/2.75))*s+0.75);}else{if(s<(2.5/2.75)){return(7.5625*(s-=(2.25/2.75))*s+0.9375);}else{return(7.5625*(s-=(2.625/2.75))*s+0.984375);}}}});jindo.Effect._cubicBezier=function(x1,y1,x2,y2){return function(s){var cx=3*x1,bx=3*(x2-x1)-cx,ax=1-cx-bx,cy=3*y1,by=3*(y2-y1)-cy,ay=1-cy-by;function sampleCurveX(s){return((ax*s+bx)*s+cx)*s;}function sampleCurveY(s){return((ay*s+by)*s+cy)*s;}function solveCurveX(x,epsilon){var t0=0,t1=1,t2=x,x2,d2;for(var i=0;i<8;i++){x2=sampleCurveX(t2)-x;if(Math.abs(x2)t1){return t1;}while(t0x2){t0=t2;}else{t1=t2;}t2=(t1-t0)*0.5+t0;}return t2;}return sampleCurveY(solveCurveX(s,(1/1000)));};};jindo.Effect.cubicBezier=function(x1,y1,x2,y2){return jindo.Effect(jindo.Effect._cubicBezier(x1,y1,x2,y2));};jindo.Effect.overphase=jindo.Effect.cubicBezier(0.25,0.75,0.8,1.3);jindo.Effect.easeInOut=jindo.Effect.cubicBezier(0.75,0,0.25,1);jindo.Effect.easeOutIn=jindo.Effect.cubicBezier(0.25,0.75,0.75,0.25);jindo.Effect.cubicEase=jindo.Effect.cubicBezier(0.25,0.1,0.25,1);jindo.Effect.cubicEaseIn=jindo.Effect.cubicBezier(0.42,0,1,1);jindo.Effect.cubicEaseOut=jindo.Effect.cubicBezier(0,0,0.58,1);jindo.Effect.cubicEaseInOut=jindo.Effect.cubicBezier(0.42,0,0.58,1);jindo.Effect.cubicEaseOutIn=jindo.Effect.cubicBezier(0,0.42,1,0.58);jindo.Effect.pulse=function(nPulse){return jindo.Effect(function(s){return(-Math.cos((s*(nPulse-0.5)*2)*Math.PI)/2)+0.5;});};jindo.FileUploader=jindo.$Class({_bIsActivating:false,_aHiddenInput:[],$init:function(elFileSelect,htOption){var htDefaultOption={sUrl:"",sCallback:"",htData:{},sFiletype:"*",sMsgNotAllowedExt:"업로드가 허용되지 않는 파일형식입니다",bAutoUpload:false,bActivateOnload:true};this.option(htDefaultOption);this.option(htOption||{});this._el=jindo.$(elFileSelect);this._wel=jindo.$Element(this._el);this._assignHTMLElements();this._aHiddenInput=[];this.constructor._oCallback={};this._wfChange=jindo.$Fn(this._onFileSelectChange,this);if(this.option("bActivateOnload")){this.activate();}},_assignHTMLElements:function(){this._elForm=this._el.form;var sIframeName="tmpFrame_"+this._makeUniqueId();this._elIframe=jindo.$('