if(null==window.tlCommon){var tlCommon={}}(function(){var b=["January","February","March","April","May","June","July","August","September","October","November","December"];var a=["S","M","T","W","T","F","S"];tlCommon.zeroPad=function(c){return(c<10)?"0"+c:c.toString()};Date.createDate=function(f,e){var c;var d;if("xml"==e){c=[f.substr(8,2),f.substr(5,2),f.substr(0,4)]}else{if("id"==e){c=[f.substr(1,2),f.substr(3,2),f.substr(5,4)]}else{if("mm/dd/yy"==e||"mm/dd/yyyy"==e){c=f.split("/");c=[c[1],c[0],c[2]]}else{if(null==e){c=f.split("/")}}}}if("num_day"==e){d=f*86400000}else{if("num"==e){d=f*1000}else{c[2]=parseInt(parseFloat(c[2]));if(c[2]<70){c[2]=2000+c[2]}else{if(c[2]<100){c[2]=1900+c[2]}}if(c[2]<1000){return false}d=Date.UTC(c[2],c[1]-1,c[0])}}if(isNaN(d)){return false}return new Date(d)};Date.shortMonth=function(c){return b[c-1].substr(0,3)};Date.prototype.format=function(c){if("dd mmm yy"==c){return tlCommon.zeroPad(this.getUTCDate())+" "+b[this.getUTCMonth()].substr(0,3)+" "+this.getUTCFullYear()}else{if("full"==c){return this.getUTCDate()+" "+b[this.getUTCMonth()]+" "+this.getUTCFullYear()}else{if("ddmmyy"==c){return tlCommon.zeroPad(this.getUTCDate())+""+tlCommon.zeroPad(this.getUTCMonth()+1)+""+this.getUTCFullYear()}else{if("mmyy"==c){return tlCommon.zeroPad(this.getUTCMonth()+1)+""+this.getUTCFullYear()}else{if("id"==c){return"d"+tlCommon.zeroPad(this.getUTCDate())+""+tlCommon.zeroPad(this.getUTCMonth()+1)+""+this.getUTCFullYear()}else{if("xml"==c){return this.getUTCFullYear()+"-"+tlCommon.zeroPad(this.getUTCMonth()+1)+"-"+tlCommon.zeroPad(this.getUTCDate())+"T00:00:00+00:00"}else{if("time"==c){return tlCommon.zeroPad(this.getUTCHours())+":"+tlCommon.zeroPad(this.getUTCMinutes())+":"+tlCommon.zeroPad(this.getUTCSeconds())+"."+String(this.getTime()).substr(String(this.getTime()).length-3)}else{if("hour"==c){return tlCommon.zeroPad(this.getUTCHours())+":"+tlCommon.zeroPad(this.getUTCMinutes())}else{if("arr"==c){return{day:this.getUTCDate(),month:this.getUTCMonth()+1,year:this.getUTCFullYear()}}else{if("num_day"==c){return parseInt(this.getTime()/86400000)}else{if("num"==c){return parseInt(this.getTime()/1000)}else{return tlCommon.zeroPad(this.getUTCDate())+"/"+tlCommon.zeroPad(this.getUTCMonth()+1)+"/"+this.getUTCFullYear()}}}}}}}}}}}};Date.prototype.decDay=function(){return new Date(this.getTime()-86400000)};Date.prototype.incDay=function(){return new Date(this.getTime()+86400000)};tlCommon.drawMonth=function(g,h,p){var f="";var d=32-new Date(Date.UTC(h,g-1,32)).getUTCDate();var o=Date.createDate("1/"+g+"/"+h).getUTCDay();var l="";var j="";var m="";var k="";var n="";if(null!=p){if(null!=p.table_id){l=' id="'+p.table_id+'"'}if(null!=p.table_class){j=' class="'+p.table_class+'"'}if(null!=p.click){m=' onclick="'+p.click+'"'}if(null!=p.mouseover){k=' onmouseover="'+p.mouseover+'"'}if(null!=p.mouseovernothing){n=' onmouseover="'+p.mouseovernothing+'"'}}var c=0;if(o>0){c++;f+='<tr><td colspan="'+o+'" class="nothing"'+n+"/>"}for(var e=1;e<=d;e++){if(o==0){c++;f+="<tr>"}day_id="d"+tlCommon.zeroPad(e)+tlCommon.zeroPad(g)+h;f+='<td id="'+day_id+'"'+m+k+">"+e+"</td>";if(o==6){f+="</tr>"}o=(o+1)%7}if(o>0){f+='<td colspan="'+(7-o)+'" class="nothing"'+n+"/></tr>"}while(c<6){f+='<tr><td colspan="7" class="nothing"'+n+">&nbsp;</td></tr>";c++}f="<table "+j+l+'><tr><th colspan="7"'+n+">"+Date.shortMonth(g)+" "+h+"</th></tr><tr><th"+n+">Su</th><th"+n+">Mo</th><th"+n+">Tu</th><th"+n+">We</th><th"+n+">Th</th><th"+n+">Fr</th><th"+n+">Sa</th></tr>"+f+"</table>";return f};tlCommon.month2num=function(d,c){return d-1+12*c};tlCommon.num2month=function(e){var d=e%12+1;var c=parseInt(e/12);return{month:d,year:c}};tlCommon.drawLineMonth=function(u,l,d){var p="";var h="";var j="";var m=32-new Date(Date.UTC(l,u-1,32)).getUTCDate();var o=Date.createDate("1/"+u+"/"+l).getUTCDay();var k="";var c="";var g="";var n="";var v="";var t="";if(null!=d){if(null!=d.table_id){k=' id="'+d.table_id+'"'}if(null!=d.table_class){c=' class="'+d.table_class+'"'}if(null!=d.day_class){g=' class="'+d.day_class+'"'}if(null!=d.click){n=' onclick="'+d.click+'"'}if(null!=d.mouseover){v=' onmouseover="'+d.mouseover+'"'}if(null!=d.mouseovernothing){t=' onmouseover="'+d.mouseovernothing+'"'}}for(var r=1;r<=m;r++){day_id="d"+tlCommon.zeroPad(r)+tlCommon.zeroPad(u)+l;p+="<td>"+a[o]+"</td>";h+='<td id="'+day_id+'"'+n+v+g+">"+r+"</td>";o=(o+1)%7}var f=b[u-1];var e=Math.floor(m/3);var q=m-2*e;var s='<td colspan="'+e+'" class="tlLeftMonthName">'+f+'</td><td colspan="'+q+'" class="tlMiddleMonthName">'+f+'</td><td colspan="'+e+'" class="tlRightMonthName">'+f+"</td>";j="<table "+c+k+"><tr>"+p+"</tr><tr>"+h+"</tr><tr>"+s+"</tr></table>";return j}})();