jindo.Component=jindo.$Class({_htEventHandler:null,_htOption:null,$init:function(){var a=this.constructor.getInstance();a.push(this);this._htEventHandler={};this._htOption={};this._htOption._htSetter={}},option:function(c,b){switch(typeof c){case"undefined":return this._htOption;case"string":if(typeof b!="undefined"){if(c=="htCustomEventHandler"){if(typeof this._htOption[c]=="undefined"){this.attach(b)}else{return this}}this._htOption[c]=b;if(typeof this._htOption._htSetter[c]=="function"){this._htOption._htSetter[c](b)}}else{return this._htOption[c]}break;case"object":for(var a in c){if(a=="htCustomEventHandler"){if(typeof this._htOption[a]=="undefined"){this.attach(c[a])}else{continue}}this._htOption[a]=c[a];if(typeof this._htOption._htSetter[a]=="function"){this._htOption._htSetter[a](c[a])}}break}return this},optionSetter:function(c,a){switch(typeof c){case"undefined":return this._htOption._htSetter;case"string":if(typeof a!="undefined"){this._htOption._htSetter[c]=jindo.$Fn(a,this).bind()}else{return this._htOption._htSetter[c]}break;case"object":for(var b in c){this._htOption._htSetter[b]=jindo.$Fn(c[b],this).bind()}break}return this},fireEvent:function(b,k){k=k||{};var d=this["on"+b],c=this._htEventHandler[b]||[],h=typeof d=="function",g=c.length>0;if(!h&&!g){return true}c=c.concat();k.sType=b;if(typeof k._aExtend=="undefined"){k._aExtend=[];k.stop=function(){if(k._aExtend.length>0){k._aExtend[k._aExtend.length-1].bCanceled=true}}}k._aExtend.push({sType:b,bCanceled:false});var f=[k],e,j;for(e=2,j=arguments.length;e0){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(a,b){this.option({sClassName:"rollover",sClassPrefix:"rollover-",bCheckMouseDown:true,bActivateOnload:true,htStatus:{sOver:"over",sDown:"down"}});this.option(b||{});this._elArea=jindo.$(a);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(a){this._aOveredElements.push(a)},_removeOvered:function(a){this._aOveredElements.splice(jindo.$A(this._aOveredElements).indexOf(a),1)},_addStatus:function(b,a){jindo.$Element(b).addClass(this.option("sClassPrefix")+a)},_removeStatus:function(b,a){jindo.$Element(b).removeClass(this.option("sClassPrefix")+a)},_isInnerElement:function(a,b){return a===b?true:jindo.$Element(a).isParentOf(b)},_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(b){var a=this.option("sClassName");return jindo.$$.test(b,"."+a)?b:jindo.$$.getSingle("! ."+a,b)},_onMouseOver:function(a){var c=a.element,b=a.relatedElement,d;for(;c=this._findRollover(c);c=c.parentNode){if(b&&this._isInnerElement(c,b)){continue}this._addOvered(c);d={element:c,htStatus:this.option("htStatus"),weEvent:a};if(this.fireEvent("over",d)){this._addStatus(d.element,d.htStatus.sOver)}}},_onMouseOut:function(a){var c=a.element,b=a.relatedElement,d;for(;c=this._findRollover(c);c=c.parentNode){if(b&&this._isInnerElement(c,b)){continue}this._removeOvered(c);d={element:c,htStatus:this.option("htStatus"),weEvent:a};if(this.fireEvent("out",d)){this._removeStatus(d.element,d.htStatus.sOver)}}},_onMouseDown:function(a){var b=a.element,c;while(b=this._findRollover(b)){c={element:b,htStatus:this.option("htStatus"),weEvent:a};this._aDownedElements.push(b);if(this.fireEvent("down",c)){this._addStatus(c.element,c.htStatus.sDown)}b=b.parentNode}},_onMouseUp:function(c){var e=c.element,f=[],a=this._aDownedElements,g,d,b;for(b=0;d=a[b];b++){f.push({element:d,htStatus:this.option("htStatus"),weEvent:c})}for(;e=this._findRollover(e);e=e.parentNode){if(jindo.$A(a).indexOf(e)>-1){continue}f.push({element:e,htStatus:this.option("htStatus"),weEvent:c})}for(b=0;g=f[b];b++){if(this.fireEvent("up",g)){this._removeStatus(g.element,g.htStatus.sDown)}}this._aDownedElements=[]}}).extend(jindo.UIComponent);jindo.Calendar=jindo.$Class({$init:function(a,b){this._htToday=this.constructor.getDateHashTable(new Date());this._elLayer=jindo.$(a);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(b||{});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(b){var a=jindo.$A(this._aDateContainerElement).indexOf(b);if(a>-1){return this._aMetaData[a]}return null},getToday:function(){return this._htToday},setDate:function(b,c,a){this._htDate={nYear:b,nMonth:(c*1),nDate:(a*1)}},getShownDate:function(){return this._getShownDate()},_getShownDate:function(){return this.htShownDate||this.getDate()},_setShownDate:function(a,b){this.htShownDate={nYear:a,nMonth:(b*1),nDate:1}},_assignHTMLElements:function(){var c=this.option("sClassPrefix"),b=this.getBaseElement();if((this.elBtnPrevYear=jindo.$$.getSingle(("."+c+"btn-prev-year"),b))){this.wfPrevYear=jindo.$Fn(function(d){d.stop(jindo.$Event.CANCEL_DEFAULT);this.draw(-1,0,true)},this)}if((this.elBtnPrevMonth=jindo.$$.getSingle(("."+c+"btn-prev-mon"),b))){this.wfPrevMonth=jindo.$Fn(function(d){d.stop(jindo.$Event.CANCEL_DEFAULT);this.draw(0,-1,true)},this)}if((this.elBtnNextMonth=jindo.$$.getSingle(("."+c+"btn-next-mon"),b))){this.wfNextMonth=jindo.$Fn(function(d){d.stop(jindo.$Event.CANCEL_DEFAULT);this.draw(0,1,true)},this)}if((this.elBtnNextYear=jindo.$$.getSingle(("."+c+"btn-next-year"),b))){this.wfNextYear=jindo.$Fn(function(d){d.stop(jindo.$Event.CANCEL_DEFAULT);this.draw(1,0,true)},this)}this.elTitle=jindo.$$.getSingle(("."+c+"title"),b);this.elTitleYear=jindo.$$.getSingle(("."+c+"title-year"),b);this.elTitleMonth=jindo.$$.getSingle(("."+c+"title-month"),b);var a=jindo.$$.getSingle("."+c+"week",b);this.elWeekTemplate=a.cloneNode(true);this.elWeekAppendTarget=a.parentNode},_setCalendarTitle:function(b,c,f){if(c<10){c=("0"+(c*1)).toString()}var d=this.elTitle,e=this.option("sTitleFormat"),a;if(typeof f!="undefined"){switch(f){case"year":d=this.elTitleYear;e=this.option("sYearTitleFormat");a=e.replace(/yyyy/g,b).replace(/y/g,(b).toString().substr(2,2));break;case"month":d=this.elTitleMonth;e=this.option("sMonthTitleFormat");a=e.replace(/mm/g,c).replace(/m/g,(c*1)).replace(/M/g,this.option("aMonthTitle")[c-1]);break}}else{a=e.replace(/yyyy/g,b).replace(/y/g,(b).toString().substr(2,2)).replace(/mm/g,c).replace(/m/g,(c*1)).replace(/M/g,this.option("aMonthTitle")[c-1])}jindo.$Element(d).text(a)},draw:function(p,s,a){var n=this.option("sClassPrefix"),l=this.getDate(),j=this._getShownDate();if(j&&typeof a!="undefined"&&a){var w=this.constructor.getRelativeDate(p,s,0,j);p=w.nYear;s=w.nMonth}else{if(typeof p=="undefined"&&typeof s=="undefined"&&typeof a=="undefined"){p=l.nYear;s=l.nMonth}else{p=p||j.nYear;s=s||j.nMonth}}if(this.fireEvent("beforeDraw",{nYear:p,nMonth:s})){if(this.elTitle){this._setCalendarTitle(p,s)}if(this.elTitleYear){this._setCalendarTitle(p,s,"year")}if(this.elTitleMonth){this._setCalendarTitle(p,s,"month")}this._clear(jindo.Calendar.getWeeks(p,s));this._setShownDate(p,s);var e=this.getToday(),k=this.constructor.getFirstDay(p,s),q=this.constructor.getLastDay(p,s),z=this.constructor.getLastDate(p,s),m=0,d=this.constructor.getRelativeDate(0,-1,0,{nYear:p,nMonth:s,nDate:1}),g=this.constructor.getRelativeDate(0,1,0,{nYear:p,nMonth:s,nDate:1}),v=this.constructor.getLastDate(d.nYear,d.nMonth),A=[],r,t,y,b,h,f,o,x,u;var c=this.constructor.getWeeks(p,s);for(u=0;u *",this.elWeekAppendTarget);if(k>0){for(u=v-k;uo){t=true;y.addClass(n+"next-mon");b=g.nYear;h=g.nMonth}else{b=p;h=s}}if(m===0){y.addClass(n+"sun")}if(m==6){y.addClass(n+"sat")}if(b==e.nYear&&(h*1)==e.nMonth&&A[u]==e.nDate){y.addClass(n+"today")}f={elDate:this._aDateElement[u],elDateContainer:y.$value(),nYear:b,nMonth:h,nDate:A[u],bPrevMonth:r,bNextMonth:t,sHTML:A[u]};jindo.$Element(f.elDate).html(f.sHTML.toString());this._aMetaData.push({nYear:b,nMonth:h,nDate:A[u]});m=(m+1)%7;this.fireEvent("draw",f)}this.fireEvent("afterDraw",{nYear:p,nMonth:s})}},_clear:function(a){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(a){if(arguments.length==3){return new Date(arguments[0],arguments[1]-1,arguments[2])}return new Date(a.nYear,a.nMonth-1,a.nDate)};jindo.Calendar.getDateHashTable=function(a){if(arguments.length==3){return{nYear:arguments[0],nMonth:arguments[1],nDate:arguments[2]}}if(arguments.length<=1){a=a||new Date()}return{nYear:a.getFullYear(),nMonth:a.getMonth()+1,nDate:a.getDate()}};jindo.Calendar.getTime=function(a){return this.getDateObject(a).getTime()};jindo.Calendar.getFirstDay=function(a,b){return new Date(a,b-1,1).getDay()};jindo.Calendar.getLastDay=function(a,b){return new Date(a,b,0).getDay()};jindo.Calendar.getLastDate=function(a,b){return new Date(a,b,0).getDate()};jindo.Calendar.getWeeks=function(a,c){var d=this.getFirstDay(a,c),b=this.getLastDate(a,c);return Math.ceil((d+b)/7)};jindo.Calendar.getRelativeDate=function(c,d,b,a){return this.getDateHashTable(new Date(a.nYear+c,a.nMonth+d-1,a.nDate+b))};jindo.Calendar.isPast=function(a,b){if(this.getTime(a)this.getTime(b)){return true}return false};jindo.Calendar.isSameDate=function(a,b){if(this.getTime(a)==this.getTime(b)){return true}return false};jindo.Calendar.isBetween=function(a,c,b){if(this.isFuture(a,b)||this.isPast(a,c)){return false}else{return true}};jindo.LayerManager=jindo.$Class({_bIsActivating:false,_bIsLayerVisible:false,_bIsHiding:false,_bIsShowing:false,_aLink:null,$init:function(a,b){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(b||{});this.setLayer(a);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(d){var b=jindo.$Element(d);for(var c=0,a;a=this._aLink[c];c++){a=jindo.$Element(a).$value();if(a&&(d==a||b.isChildOf(a))){return true}}return false},_find:function(c){for(var b=0,a;(a=this._aLink[b]);b++){if(a==c){return b}}return -1},getLayer:function(){return this._el},setLayer:function(b){this._el=jindo.$(b);this._wel=jindo.$Element(b);var c=this._el.cloneNode(true);var a=jindo.$Element(c);a.css({position:"absolute",left:"-5000px"}).appendTo(this._el.parentNode);a.show();this._nLayerHeight=a.height();a.height(this._nLayerHeight);this._sLayerCSSHeight=a.css("height");this._sLayerCSSOverflowX=this._wel.css("overflowX");this._sLayerCSSOverflowY=this._wel.css("overflowY");a.css("overflow","hidden").height(0);this._nSlideMinHeight=a.height()+1;a.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(b){this._aLink=jindo.$A(b).unique().$value();return this},link:function(b){if(arguments.length>1){for(var c=0,a=arguments.length;c1){for(var d=0,b=arguments.length;d-1){this._aLink.splice(a,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(b,a){this._oEventTimer.abort();this._bIsShowing=true;this._bIsHiding=false;if(a>0){this._oShowTimer.start(b,a)}else{this._oHideTimer.abort();b()}},_hide:function(b,a){this._bIsShowing=false;this._bIsHiding=true;if(a>0){this._oHideTimer.start(b,a)}else{this._oShowTimer.abort();b()}},_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(a){if(typeof a=="undefined"){a=this.option("nShowDelay")}this[this._getShowMethod()](a);return this},hide:function(a){if(typeof a=="undefined"){a=this.option("nHideDelay")}this[this._getHideMethod()](a);return this},showIn:function(a){if(typeof a=="undefined"){a=this.option("nShowDelay")}var b=this;this._show(function(){b._sAppliedMethod="show";if(!b.getVisible()){if(b._fireEventBeforeShow()){b._wel.show();b._fireEventAppear();b._fireEventShow()}}},a);return this},hideOut:function(a){if(typeof a=="undefined"){a=this.option("nHideDelay")}var b=this;this._hide(function(){b._sAppliedMethod="show";if(b.getVisible()){if(b._fireEventBeforeHide()){b._wel.hide();b._fireEventHide()}}},a);return this},_getTransition:function(){if(this._oTransition){return this._oTransition}else{return(this._oTransition=new jindo.Transition().fps(30))}},fadeIn:function(b){var a=this._getTransition();a.detachAll().abort();if(typeof b=="undefined"){b=this.option("nShowDelay")}var d=this.option("nDuration");var c=this;this._show(function(){c._sAppliedMethod="fade";var e=c.getLayer();if(!c._wel.visible()||c._wel.opacity()!=1){if(c._fireEventBeforeShow()){if(!c._wel.visible()){c._wel.opacity(0);c._wel.show()}d*=(1-c._wel.opacity());a.attach({playing:function(f){if(f.nStep===1){this.detach("playing",arguments.callee);c._fireEventAppear()}},end:function(f){this.detach("end",arguments.callee);c._fireEventShow()}}).start(d,e,{"@opacity":c.option("Transition").fFadeIn.apply(null,[1])})}}},b);return this},fadeOut:function(b){var a=this._getTransition();a.detachAll().abort();if(typeof b=="undefined"){b=this.option("nHideDelay")}var d=this.option("nDuration");var c=this;this._hide(function(){c._sAppliedMethod="fade";if(c.getVisible()){var e=c.getLayer();if(c._fireEventBeforeHide()){d*=c._wel.opacity();a.attach({end:function(f){this.detach("end",arguments.callee);c._wel.hide();c._wel.opacity(1);c._fireEventHide()}}).start(d,e,{"@opacity":c.option("Transition").fFadeOut.apply(null,[0])})}}},b);return this},slideDown:function(b){var a=this._getTransition();a.detachAll().abort();if(typeof b=="undefined"){b=this.option("nShowDelay")}var d=this.option("nDuration");var c=this;this._show(function(){c._sAppliedMethod="slide";var e=c.getLayer();if(Math.ceil(c._wel.height())-1){return true}return false},_setLeftRight:function(i,b){var c=this.getElement(),e=this.getLayer(),g=c.offsetWidth,d=e.offsetWidth;if(c==document.body){g=jindo.$Document().clientSize().width}var a=this._isPosition(i,"left"),h=this._isPosition(i,"right"),f=this._isPosition(i,"inside");if(a){if(f){b.nLeft+=i.nLeft}else{b.nLeft-=d;b.nLeft-=i.nLeft}}else{if(h){b.nLeft+=g;if(f){b.nLeft-=d;b.nLeft-=i.nLeft}else{b.nLeft+=i.nLeft}}else{if(i.sAlign=="left"){b.nLeft+=i.nLeft}if(i.sAlign=="center"){b.nLeft+=(g-d)/2}if(i.sAlign=="right"){b.nLeft+=g-d;b.nLeft-=i.nLeft}}}return b},_setVerticalAlign:function(e,f){var c=this.getElement(),b=this.getLayer(),a=c.offsetHeight,d=b.offsetHeight;if(c==document.body){a=jindo.$Document().clientSize().height}switch(e.sValign){case"top":f.nTop+=e.nTop;break;case"middle":f.nTop+=(a-d)/2;break;case"bottom":f.nTop+=a-d-e.nTop;break}return f},_adjustScrollPosition:function(a){if(this.getElement()==document.body){var b=jindo.$Document().scrollPosition();a.nTop+=b.top;a.nLeft+=b.left}return a},getPosition:function(m){if(typeof m!="object"){m=this.option()}if(typeof m.nTop=="undefined"){m.nTop=0}if(typeof m.nLeft=="undefined"){m.nLeft=0}var a,j=this._isPosition(m,"center"),h=this._isPosition(m,"inside"),i=this._isPosition(m,"top"),s=this._isPosition(m,"bottom"),n=this._isPosition(m,"left"),c=this._isPosition(m,"right");if(n){a="left"}if(c){a="right"}if(i){a="top"}if(s){a="bottom"}if(j){a="center"}var b=this.getElement(),o=jindo.$Element(b),q=this.getLayer(),l=jindo.$Element(q),f=o.offset(),g=b.offsetWidth,p=b.offsetHeight,r,d=q.offsetWidth,e=q.offsetHeight,k={nTop:f.top,nLeft:f.left};if(b==document.body){r=jindo.$Document().clientSize();g=r.width;p=r.height}d+=parseInt(l.css("marginLeft"))+parseInt(l.css("marginRight"))||0;e+=parseInt(l.css("marginTop"))+parseInt(l.css("marginBottom"))||0;switch(a){case"center":k.nTop+=(p-e)/2;k.nTop+=m.nTop;k.nLeft+=(g-d)/2;k.nLeft+=m.nLeft;break;case"top":if(h){k.nTop+=m.nTop}else{k.nTop-=m.nTop+e}k=this._setLeftRight(m,k);break;case"bottom":k.nTop+=p;if(h){k.nTop-=m.nTop+e}else{k.nTop+=m.nTop}k=this._setLeftRight(m,k);break;case"left":if(h){k.nLeft+=m.nLeft}else{k.nLeft-=m.nLeft+d}k=this._setVerticalAlign(m,k);break;case"right":k.nLeft+=g;if(h){k.nLeft-=m.nLeft+d}else{k.nLeft+=m.nLeft}k=this._setVerticalAlign(m,k);break}k=this._adjustScrollPosition(k);return k},setPosition:function(b){var a=jindo.$Element(this.getLayer());a.css("left","-9999px").css("top","0px");if(typeof b=="undefined"){b=this.getPosition()}if(this.option("bAuto")){b=this._adjustPosition(b)}a.css("left",b.nLeft+"px").css("top",b.nTop+"px");return this},getCurrentPosition:function(){var a=jindo.$Element(this.getLayer());return{nTop:parseInt(a.css("top")),nLeft:parseInt(a.css("left"))}},_isFullyVisible:function(c){var e=this.getLayer(),i=jindo.$Element(e),g=jindo.$Document().scrollPosition(),h=g.top,b=g.left,a=jindo.$Document().clientSize(),d=e.offsetWidth+(parseInt(i.css("marginLeft"))+parseInt(i.css("marginRight"))||0),f=e.offsetHeight+(parseInt(i.css("marginTop"))+parseInt(i.css("marginBottom"))||0);if(c.nLeft>=0&&c.nTop>=0&&a.width>=c.nLeft-b+d&&a.height>=c.nTop-h+f){return true}return false},_mirrorHorizontal:function(c){if(c.sAlign=="center"||c.sPosition=="inside-center"){return c}var a={};for(var b in c){a[b]=c[b]}if(this._isPosition(a,"right")){a.sPosition=a.sPosition.replace(/right/,"left")}else{if(this._isPosition(a,"left")){a.sPosition=a.sPosition.replace(/left/,"right")}else{if(a.sAlign=="right"){a.sAlign="left"}else{if(a.sAlign=="left"){a.sAlign="right"}}}}return a},_mirrorVertical:function(c){if(c.sValign=="middle"||c.sPosition=="inside-center"){return c}var a={};for(var b in c){a[b]=c[b]}if(this._isPosition(a,"top")){a.sPosition=a.sPosition.replace(/top/,"bottom")}else{if(this._isPosition(a,"bottom")){a.sPosition=a.sPosition.replace(/bottom/,"top")}else{if(a.sValign=="top"){a.sValign="bottom"}else{if(a.sValign=="bottom"){a.sValign="top"}}}}return a},_adjustPosition:function(d){var c=this.option(),a=[];a.push(d);a.push(this.getPosition(this._mirrorHorizontal(c)));a.push(this.getPosition(this._mirrorVertical(c)));a.push(this.getPosition(this._mirrorVertical(this._mirrorHorizontal(c))));for(var b=0,e;e=a[b];b++){if(this._isFullyVisible(e)){d=e;break}}return d}}).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(b,a){this.abort();this._nRemained=0;this._nDelay=a;this._fRun=b;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 a=false;if(this._nTimer){clearInterval(this._nTimer);this._bIsRunning=false;a=true}this._nTimer=null;return a},abort:function(){var a=this._clearTimer();if(a){this.fireEvent("abort");this._fRun=null}return a},pause:function(){var a=this._getTime()-this._nLatest;this._nRemained=Math.max(this._nDelay-a,0);return this._clearTimer()},_excute:function(b,a){var c=this;this._clearTimer();this._bIsRunning=true;this._nTimer=setInterval(function(){if(c._nTimer){c.fireEvent("run");var d=c._fRun();c._nLatest=c._getTime();if(!d){clearInterval(c._nTimer);c._nTimer=null;c._bIsRunning=false;c.fireEvent("end");return}c.fireEvent("wait");if(a){c._excute(c._nDelay,false)}}},b)},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(a){this._aTaskQueue=[];this._oTimer=new jindo.Timer();this.option({fEffect:jindo.Effect.linear,bCorrection:false});this.option(a||{})},fps:function(a){if(arguments.length>0){this._nFPS=a;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(c,b,a){if(arguments.length>0){this.queue.apply(this,arguments)}this._prepareNextTask();return this},queue:function(g,f){var b;if(typeof arguments[0]=="function"){b={sType:"function",fTask:arguments[0]}}else{var k=[];var m=arguments.length;if(arguments[1] instanceof Array){k=arguments[1]}else{var h=[];jindo.$A(arguments).forEach(function(a,n){if(n>0){h.push(a);if(n%2==0){k.push(h.concat());h=[]}}})}b={sType:"task",nDuration:g,aList:[]};for(var e=0;e1){i=a(i);j=a(j);g=j.sUnit}else{j=a(i);i=null;g=j.sUnit}if(i&&j&&i.sUnit!=j.sUnit){throw new Error("unit error")}i=i&&i.nValue;j=j&&j.nValue;var h=function(n){var l=e(n);var o=function(p,q){return(q-p)*l+p+g};if(g=="color"){var m=parseInt(o(i[0],j[0]),10)<<16;m|=parseInt(o(i[1],j[1]),10)<<8;m|=parseInt(o(i[2],j[2]),10);m=m.toString(16).toUpperCase();for(var k=0;6-m.length;k++){m="0"+m}return"#"+m}return o(i,j)};if(i===null){h.setStart=function(k){k=a(k);if(k.sUnit!=g){throw new Error("unit eror")}i=k.nValue}}return h}};jindo.Effect.linear=jindo.Effect(function(a){return a});jindo.Effect.easeIn=jindo.Effect(function(a){return(1-Math.sqrt(1-(a*a)))});jindo.Effect.easeOut=jindo.Effect(function(a){return Math.sqrt((2-a)*a)});jindo.Effect.bounce=jindo.Effect(function(a){if(a<(1/2.75)){return(7.5625*a*a)}else{if(a<(2/2.75)){return(7.5625*(a-=(1.5/2.75))*a+0.75)}else{if(a<(2.5/2.75)){return(7.5625*(a-=(2.25/2.75))*a+0.9375)}else{return(7.5625*(a-=(2.625/2.75))*a+0.984375)}}}});jindo.Effect._cubicBezier=function(b,d,a,c){return function(n){var j=3*b,l=3*(a-b)-j,e=1-j-l,i=3*d,k=3*(c-d)-i,m=1-i-k;function h(o){return((e*o+l)*o+j)*o}function g(o){return((m*o+k)*o+i)*o}function f(o,v){var u=0,t=1,r=o,p,s;for(var q=0;q<8;q++){p=h(r)-o;if(Math.abs(p)t){return t}while(up){u=r}else{t=r}r=(t-u)*0.5+u}return r}return g(f(n,(1/1000)))}};jindo.Effect.cubicBezier=function(b,d,a,c){return jindo.Effect(jindo.Effect._cubicBezier(b,d,a,c))};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(a){return jindo.Effect(function(b){return(-Math.cos((b*(a-0.5)*2)*Math.PI)/2)+0.5})};jindo.FileUploader=jindo.$Class({_bIsActivating:false,_aHiddenInput:[],$init:function(a,b){var c={sUrl:"",sCallback:"",htData:{},sFiletype:"*",sMsgNotAllowedExt:"업로드가 허용되지 않는 파일형식입니다",bAutoUpload:false,bAutoReset:true,bActivateOnload:true};this.option(c);this.option(b||{});this._el=jindo.$(a);this._wel=jindo.$Element(this._el);this._elForm=this._el.form;this._aHiddenInput=[];this.constructor._oCallback={};this._wfChange=jindo.$Fn(this._onFileSelectChange,this);this._sFunctionName=null;if(this.option("bActivateOnload")){this.activate()}},_appendIframe:function(){var a="tmpFrame_"+this._makeUniqueId();this._welIframe=jindo.$Element(jindo.$('