Мое предложение - шаблоны:
<html>
<head>
<script type="text/javascript" src="calend.js"></script>
</head>
<body>
<div id="test_div"></div>
<script type="text/javascript">
drawT(new Date(2008, 06, 21));
</script>
</body>
</html>
var STR = '<table cellspacing="0" cellpadding="0" border="1" onselectstart="return false;" class="HWCalendar" id="Calendar"><thead><tr><td colspan="8"></td></tr></thead><tbody><tr class="head"><td> </td><td>#mon#</td><td>#tue#</td><td>#wen#</td><td>#thu#</td><td>#fri#</td><td>#sat#</td><td>#sun#</td></tr><tr><td class="day-time">12:00 AM</td><td/><td/><td/><td/><td/><td/><td/></tr><tr><td class="day-time">12:30 AM</td><td/><td/><td/><td/><td/><td/><td/></tr><tr><td class="day-time">01:00 AM</td><td/><td/><td/><td/><td/><td/><td/></tr><tr><td class="day-time">01:30 AM</td><td/><td/><td/><td/><td/><td/><td/></tr><tr><td class="day-time">02:00 AM</td><td/><td class="click"/><td/><td/><td/><td/><td/></tr><tr><td class="day-time">02:30 AM</td><td/><td/><td class="click"/><td/><td/><td/><td/></tr><tr><td class="day-time">03:00 AM</td><td/><td/><td/><td/><td/><td/><td/></tr><tr><td class="day-time">03:30 AM</td><td/><td/><td/><td/><td/><td/><td/></tr><tr><td class="day-time">04:00 AM</td><td/><td/><td/><td/><td/><td/><td/></tr><tr><td class="day-time">04:30 AM</td><td/><td/><td/><td/><td/><td/><td/></tr><tr><td class="day-time">05:00 AM</td><td/><td/><td/><td/><td/><td/><td/></tr><tr><td class="day-time">05:30 AM</td><td/><td/><td/><td/><td/><td/><td/></tr><tr><td class="day-time">06:00 AM</td><td class="click"/><td/><td/><td/><td/><td/><td/></tr><tr><td class="day-time">06:30 AM</td><td/><td/><td/><td/><td/><td/><td/></tr><tr><td class="day-time">07:00 AM</td><td/><td/><td/><td/><td/><td/><td/></tr><tr><td class="day-time">07:30 AM</td><td/><td/><td/><td/><td/><td/><td/></tr><tr><td class="day-time">08:00 AM</td><td/><td/><td/><td/><td/><td/><td/></tr><tr><td class="day-time">08:30 AM</td><td/><td/><td/><td/><td/><td/><td/></tr><tr><td class="day-time">09:00 AM</td><td/><td/><td/><td/><td/><td/><td/></tr><tr><td class="day-time">09:30 AM</td><td/><td/><td/><td/><td/><td/><td/></tr><tr><td class="day-time">10:00 AM</td><td/><td/><td/><td/><td/><td/><td/></tr><tr><td class="day-time">10:30 AM</td><td/><td/><td/><td/><td/><td/><td/></tr><tr><td class="day-time">11:00 AM</td><td/><td/><td/><td/><td/><td/><td/></tr><tr><td class="day-time">11:30 AM</td><td/><td/><td/><td/><td/><td/><td/></tr><tr><td class="day-time">12:00 PM</td><td/><td/><td/><td/><td/><td/><td/></tr><tr><td class="day-time">12:30 PM</td><td/><td/><td/><td/><td/><td/><td/></tr><tr><td class="day-time">01:00 PM</td><td/><td/><td/><td/><td/><td/><td/></tr><tr><td class="day-time">01:30 PM</td><td/><td/><td/><td/><td/><td/><td/></tr><tr><td class="day-time">02:00 PM</td><td/><td/><td/><td/><td/><td/><td/></tr><tr><td class="day-time">02:30 PM</td><td/><td/><td/><td/><td/><td/><td/></tr><tr><td class="day-time">03:00 PM</td><td/><td/><td/><td/><td/><td/><td/></tr><tr><td class="day-time">03:30 PM</td><td/><td/><td/><td/><td/><td/><td/></tr><tr><td class="day-time">04:00 PM</td><td/><td/><td/><td/><td/><td/><td/></tr><tr><td class="day-time">04:30 PM</td><td/><td/><td/><td/><td/><td/><td/></tr><tr><td class="day-time">05:00 PM</td><td/><td/><td/><td/><td/><td/><td/></tr><tr><td class="day-time">05:30 PM</td><td/><td/><td/><td/><td/><td/><td/></tr><tr><td class="day-time">06:00 PM</td><td/><td/><td/><td/><td/><td/><td/></tr><tr><td class="day-time">06:30 PM</td><td/><td/><td/><td/><td/><td/><td/></tr><tr><td class="day-time">07:00 PM</td><td/><td/><td/><td/><td/><td/><td/></tr><tr><td class="day-time">07:30 PM</td><td/><td/><td/><td/><td/><td/><td/></tr><tr><td class="day-time">08:00 PM</td><td/><td/><td/><td/><td/><td/><td/></tr><tr><td class="day-time">08:30 PM</td><td/><td/><td/><td/><td/><td/><td/></tr><tr><td class="day-time">09:00 PM</td><td/><td/><td/><td/><td/><td/><td/></tr><tr><td class="day-time">09:30 PM</td><td/><td/><td/><td/><td/><td/><td/></tr><tr><td class="day-time">10:00 PM</td><td/><td/><td/><td/><td/><td/><td/></tr><tr><td class="day-time">10:30 PM</td><td/><td/><td/><td/><td/><td/><td/></tr><tr><td class="day-time">11:00 PM</td><td/><td/><td/><td/><td/><td/><td/></tr><tr><td class="day-time">11:30 PM</td><td/><td/><td/><td/><td/><td/><td/></tr></tbody></table>';
var DAY = 1000*60*60*24;
/* #mon#, #tue#, #wen#, #thu#, #fri#, #sat#, #sun#*/
function getD(_date) {
_date.setTime(Date.parse(_date) + DAY);
return _date;
}
function drawT(mondayDate) {
var startT = new Date();
document.getElementById('test_div').innerHTML = STR.replace('#mon#', mondayDate).replace('#tue#', getD(mondayDate)).replace('#wen#', getD(mondayDate)).replace('#thu#', getD(mondayDate)).replace('#fri#', getD(mondayDate)).replace('#sat#', getD(mondayDate)).replace('#sun#', getD(mondayDate));
alert(new Date() - startT);
}
Набросал совсем коротко, строго не судите - времени нет %)
Собственно наглый довольно метод, но зато очень простой и наглядный (люблю простоту). По времени не сравнивал, но мне кажется должно быть быстро.
Кстати, мне тоже интересны мнения.