function createDatesTree()
{ var today = new Date(); var year = today.getFullYear();
treeDates = new LiknoTreeRoot("treeDates", "example", 0, 0, 176, 600, 16, true, "border:0; padding:4px; background-color:#FFFFFF; border:1px solid #003366;", "png"); treeDates.setHorzScroll(false); treeDates.setImagesDir("images/ldmt/16x16/winvista/"); treeDates.addClass("de", "font-family:Tahoma, Arial, sans-serif; font-size:11px; color:black; background-color:transparent; text-decoration:none; font-weight:normal; padding:2px 4px;"); treeDates.addClass("mo", "font-family:Tahoma Arial, sans-serif; font-size:11px; text-decoration:underline; color:blue; padding:2px 4px;"); treeDates.addClass("se", "font-family:Tahoma, Arial, sans-serif; font-size:11px; color:black; background-color:#EBF2FA; padding:2px 4px; border:1px solid #DFDFE1;"); var months = new Array("January","February","March","April","May","June","July","August","September","October","November","December"); var dayspermonth = new Array(31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31); var days = new Array("Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"); var day = 0; var week = -1; var month = today.getMonth(); var t5w = new Array(6); t5d = new Array(31); var t5m = treeDates.addLeafWithParams("<b>"+months[month]+"</b>", "", "", true, ""); var dayofmonth = 1; 22: var nodedate = new Date(year, month, dayofmonth); while(dayofmonth <= dayspermonth[month]) { if(nodedate.getDay() == 1 || week == -1) { week++; t5w[week] = t5m.addLeafWithParams("<span style='color:#004f8f;'><b>week "+getWeek(nodedate)+"</b></span>", "", "", true, ""); } if(dayofmonth == today.getDate()) t5d[day] = t5w[week].addLeafWithParams("<span style='color:#308f00;'><b>"+dayofmonth+", "+days[nodedate.getDay()]+" <span style='font-family:arial; font-size:13px;'>◄</span></b></span>", "", "", true, ""); else if(days[nodedate.getDay()] == "Sunday")
t5d[day] = t5w[week].addLeafWithParams("<span style='color:#ff6600;'>"+dayofmonth+", "+days[nodedate.getDay()]+"</span>", "", "", true, ""); else t5d[day] = t5w[week].addLeafWithParams(dayofmonth+", "+days[nodedate.getDay()], "", "", true, ""); dayofmonth++; day++; nodedate = new Date(year, month, dayofmonth); } treeDates.drawTree(); } |