tagged.namespace("util.dateHandler");tagged.util.dateHandler={dateObjects:[],findAndBind:function(b,c){if(b){var d=D.getElementsByClassName("tag_ts","span",b)}else{var d=D.getElementsByClassName("tag_ts","span")}for(var a in d){var e=d[a];if(e._inited){continue}YAHOO.lang.augmentObject(e,this.dateBinderClass,true);e.init(c);this.dateObjects.push(e)}},updateAll:function(){for(var a in this.dateObjects){this.dateObjects[a].update()}},getRelativeDate:function(b,c,e){var f=new Date();if(isNaN(c)){c=31557600}var a=(f.getTime()-b.getTime())/1000;if(c==0){return this.getLocalDate(b)}if(c<0){return this.computeRelative(a)}if(e&&a>e){a=e}if(c&&(a<c)){return this.computeRelative(a)}else{return this.getLocalDate(b)}},computeRelative:function(c){if(c<5){return this.stringMoments}else{if(c<30){return this.stringHalfMinute}else{if(c<60){return this.stringLessMinute}else{if(c<3600){var f=Math.round(c/60);if(f<=1){return this.stringMinute}else{return sprintf(this.stringMinutes,f)}}else{if(c<86400){var e=Math.round(c/3600);if(e<=1){return this.stringHour}else{return sprintf(this.stringHours,e)}}else{if(c<2629800){var b=Math.round(c/86400);if(b<=1){return this.stringDay}else{return sprintf(this.stringDays,b)}}else{if(c<31557600){var d=Math.round(c/2629800);if(d<=1){return this.stringMonth}else{return sprintf(this.stringMonths,d)}}else{var a=Math.round(c/3155760);if(a<=1){return this.stringYear}else{return sprintf(this.stringYears,a)}}}}}}}}},getLocalDate:function(a){return a.toLocaleString()},dateBinderClass:{init:function(a){if(this._inited){return}if(this.getAttribute("utc")){this._selfDate=new Date;this._selfDate.setTime(this.getAttribute("utc")*1000)}else{this._selfDate=new Date(this.innerHTML)}this.maxRelativeDate=0;if(this.getAttribute("max_relative_date")){this.maxRelativeDate=this.getAttribute("max_relative_date")}this.relativeDateCutoff="relative";if(this.getAttribute("relative_date_cutoff")){this.relativeDateCutoff=this.getAttribute("relative_date_cutoff")}if(this.getAttribute("relative")){switch(this.getAttribute("relative")){case"true":case"1":case"on":case"relative":this._isRelative=true;break;default:this._isRelative=false}}else{this._isRelative=true}this._inited=false;if(a){this.update()}},update:function(){if(!this._inited){this.init()}var a=tagged.util.dateHandler.getLocalDate(this._selfDate);if(this._isRelative){this.innerHTML=tagged.util.dateHandler.getRelativeDate(this._selfDate,this.relativeDateCutoff,this.maxRelativeDate)}else{this.innerHTML=a}if(!this.getAttribute("no_title")){this.setAttribute("title",a)}D.removeClass(this,"hidden")}}};TAGGED.namespace("util.notification");TAGGED.util.notification={showNotification:function(d,g,c,a,e){if(D.get(g+"_feedback")){this.hideNotification(g+"_feedback")}var f=D.get(g)||D.get("inner_container");var b=document.createElement("div");b.className="feedback "+c;b.id=g+"_feedback";b.innerHTML=d;if(a=="bottom"||f.childNodes.length==0){f.appendChild(b)}else{if(a=="top"){f.insertBefore(b,f.childNodes[0])}}if(e>0){if(e>300){setTimeout(function(){var h=new YAHOO.util.Anim(b,{opacity:{from:1,to:0}},0.3,YAHOO.util.Easing.easeOut);h.onComplete.subscribe(function(){f.removeChild(b)});h.animate()},e-300)}else{setTimeout(function(){f.removeChild(b)},e)}}},hideNotification:function(b){var a=D.get(b);if(a){a.parentNode.removeChild(a)}}};tagged.util.notificationClass=function(d,c){this._initEvents();this.cfg=new YAHOO.util.Config(this);this._initDefaultConfig();if(c){this.cfg.applyConfig(c,true)}if(YAHOO.lang.isString(d)){var b=d;d=D.get(d);if(d==null){d=(this._createTemplate()).cloneNode(false);d.id=b;var a=D.get(this.cfg.config.container.value);if(this.cfg.config.position.value=="bottom"||a.childNodes.length==0){a.appendChild(d)}else{if(this.cfg.config.position.value=="top"){a.insertBefore(d,a.childNodes[0])}}}}this.el=d;this.onInit.fire()};tagged.util.notificationClass.prototype={DEFAULT_CONFIG:{POSITION:{key:"position",value:"top"},CONTAINER:{key:"container",value:document.body}},CSS_NOTIFICATION:"feedback",_template:null,_createTemplate:function(){if(!this._template){this._template=document.createElement("div");D.addClass(this._template,this.CSS_NOTIFICATION+" hide_me")}return this._template},fadeTimeout:300,_initEvents:function(){this.onInit=new YAHOO.util.CustomEvent("init");this.onShow=new YAHOO.util.CustomEvent("show");this.onHide=new YAHOO.util.CustomEvent("hide")},_initDefaultConfig:function(){this.cfg.addProperty(this.DEFAULT_CONFIG.POSITION.key,{value:this.DEFAULT_CONFIG.POSITION.value});this.cfg.addProperty(this.DEFAULT_CONFIG.CONTAINER.key,{value:this.DEFAULT_CONFIG.CONTAINER.value})},previous_notification_timer:null,show:function(b,a,c){if(isNaN(c)){c=this.fadeTimeout}if(this.previous_notification_timer!=null){this.previous_notification_timer.cancel();this.previous_notification_timer=null}a=a||this.cfg.config.css.value;this.el.className=this.CSS_NOTIFICATION+" "+a;this.el.innerHTML=b;D.removeClass(this.el,"hide_me");if(c>300){this.previous_notification_timer=YAHOO.util.Lang.later(c-300,this,function(){var d=new YAHOO.util.Anim(this.el,{opacity:{from:1,to:0}},0.3,YAHOO.util.Easing.easeOut);d.onComplete.subscribe(this.hide,null,this);d.animate()})}else{if(c){this.previous_notification_timer=YAHOO.util.Lang.later(c,this,this.hide)}}this.onShow.fire()},hide:function(){D.addClass(this.el,"hide_me");D.setStyle(this.el,"opacity",1);this.onHide.fire()}};