<!--
// Webs Unlimited's J-BOTS FrontPage 2002 JavaScript Generator version 4.0
// Copyright Webs Unlimited 1998, 1999, 2000, 2001 All rights reserved - http://WebsUnlimited.com
// make an array of length n Needed for older javascript browsers
function makearray(n) {
	this.length = n
	for (var i = 1; i <= n; i++) {
		this[i] = null;
}
return this;
}
function IsIn(value,search) {
	if(search.indexOf(value) != -1) {
	  return 1;
 } else {
		return 0;
   }
}

function LeadZero(value) {
	if ( value < 10) 
	  document.write('0');
}
 function UntilFormat(format,twoplace,year,month,day) {
var operators = 'sSmMdDwWnNY%';
var value = '';
// get the numbers 
var today = new Date;
var when = new Date(year,month-1,day);
var todayyear = today.getYear();
var whenyear = when.getYear();
if(todayyear > 99) { todayyear -= 1900; }
if(whenyear > 99) { whenyear -= 1900; }
var seconds = Math.floor((when.getTime() - today.getTime()) / 1000); // %s
if(seconds < 0) {
	document.write('The date must be in the future!');
	return;
}
var leaptoday = today.getYear() / 4 - Math.floor(today.getYear()/4);
if(leaptoday == 0 && today.getMonth() > 1) {
leaptoday = 1; 
} else { 
  leaptoday = 0;
}
var leapwhen =  when.getYear() / 4 - Math.floor(when.getYear()/4);
if(leapwhen == 0 && when.getMonth() > 1) {
  leapwhen = 1; 
} else { 
  leapwhen = 0;
}
var leapyears = leaptoday + leapwhen;
leapyears += Math.floor(((--whenyear - todayyear) / 4 - 1));
//check for Daylight savings time
var TestDate = new Date;
TestDate.setMonth(3);
TestDate.setDate(1);
TestDay = TestDate.getDay();
var SatFirst = 7 - TestDay;
TestDate.setMonth(9);
TestDate.setDate(31);
var SatLast = 31 - (TestDate.getDay()+1);
if((((month == 4) && (day > SatFirst)) || month > 4) && (month < 11 || ((month ==10) && day < SatLast))) {seconds += 60 *60;}
var minutes = Math.floor(seconds / 60); //%m
var hours = Math.floor(minutes / 60); // %h
var days = Math.floor(hours / 24); // %d
var weeks = Math.floor(days / 7); // %w
var yearsleft = Math.floor(days / 365); // %Y
if(when.getYear() == today.getYear()) { // %N
  var monthsleft = when.getMonth() - (today.getMonth());
  if(monthsleft >= 1 && (when.getDate() < today.getDate())) --monthsleft;
} else {
  if(yearsleft == 0) {
    monthsleft = when.getMonth() + (11 - today.getMonth());
    if(when.getDate() > today.getDate()) ++monthsleft;
  } else {
    monthsleft = when.getMonth() + (11 - today.getMonth());
    if(when.getMonth() > today.getMonth()) { 
      monthsleft = when.getMonth() - (today.getMonth());
      if(monthsleft >= 1 && (when.getDate() < today.getDate())) --monthsleft;
    } else {
      monthsleft = when.getMonth() + (11 - today.getMonth());
      if(when.getDate() > today.getDate()) ++monthsleft;
    }
  }
} // %N
var months = (yearsleft * 12) + monthsleft; // %n
var hoursleft = hours - (days * 24) - 1; // %H
if(hoursleft <= 0) hoursleft = 23;
var minutesleft = minutes - hours * 60; // %M
var todaymonth = today.getMonth() + 1;
if( todaymonth == 02) {
	 var daysleft = 28 + leapyears - today.getDate();
}else {
	if(todaymonth ==  04 || todaymonth == 06 || todaymonth == 09 || todaymonth == 11) {
		daysleft = 30 - today.getDate();
	} else {
	    daysleft = 31 - today.getDate();
	}
}
if(when.getDate() < today.getDate()) {
 daysleft += when.getDate()  - 1;
} else {
 daysleft = day - today.getDate() - 1;
 if(daysleft < 0) {++daysleft; }
}
var weeksleft = Math.floor(daysleft / 7); // %W
var secondsleft = seconds - minutes * 60; // %S
var pos = 0;
while (pos < format.length) {
	if( format.substring(pos,pos+1) != '%') 
	{
		document.write(format.substring(pos,pos+1));
		pos++;
		continue;
	} else {
		if (!IsIn(format.substring(pos,pos+1), operators))		{
			document.write(format.substring(pos,pos+1));
			pos++;
			continue;
		} else {
			if ( format.substring(pos,pos+1) == '%') 			{
				pos++; // look ahead
				if (format.substring(pos,pos+1) == '%') 
				{
					document.write('%');
					pos++;
					continue;
				} else {
				if (format.substring(pos,pos+1) == 'd') 
				{
					if(twoplace) LeadZero(days);
					document.write(days);
					pos++;
					continue;
				} else {
				if (format.substring(pos,pos+1) == 'D') 
				{
				   if(twoplace) LeadZero(daysleft);
				   document.write(daysleft);
				   if( todaymonth == 02) { // reset daysleft if weeks was used.
						daysleft = 28 + leapyears - today.getDate();
					}else {
						if(todaymonth ==  04 || todaymonth == 06 || todaymonth == 09 || todaymonth == 11) {
							daysleft = 30 - today.getDate();
						} else {
							daysleft = 31 - today.getDate();
						}
					}
					pos++;
					continue;
				} else {
				if (format.substring(pos,pos+1) == 's') 
				{
				   if(twoplace) LeadZero(seconds);
				   	document.write(seconds);
					pos++;
					continue;
				} else {
				if (format.substring(pos,pos+1) == 'S') 
				{
					if(twoplace) LeadZero(secondsleft);
					document.write(secondsleft);
					pos++;
					continue;
				} else {
				if (format.substring(pos,pos+1) == 'h') 
				{
				   if(twoplace) LeadZero(hours);
				   	document.write(hours);
					pos++;
					continue;
				} else {
				if (format.substring(pos,pos+1) == 'H') 
				{
				   if(twoplace) LeadZero(hoursleft);
				   document.write(hoursleft);
					pos++;
					continue;
				} else {
				if (format.substring(pos,pos+1) == 'm') 
				{
				   if(twoplace) LeadZero(minutes);
				   	document.write(minutes);
					pos++;
					continue;
				} else {
				if (format.substring(pos,pos+1) == 'M') 
				{
				   if(twoplace) LeadZero(minutesleft);
				   	document.write(minutesleft);
					pos++;
					continue;
				} else {
				if (format.substring(pos,pos+1) == 'w') 
				{
				   daysleft = Math.ceil((days / 7 - Math.floor(days / 7)) * 7);
				   if(twoplace) LeadZero(weeks);
				   	document.write(weeks );
					pos++;
					continue;
				} else {
				if (format.substring(pos,pos+1) == 'W') 
				{
				   daysleft = Math.ceil((daysleft - weeksleft * 7));
				   if(twoplace) LeadZero(weeksleft);
				   	document.write(weeksleft);
					pos++;
					continue;
				} else {
				if (format.substring(pos,pos+1) == 'n') 
				{
				   if(twoplace) LeadZero(months);
				   	document.write(months);
					pos++;
					continue;
				} else {
				if (format.substring(pos,pos+1) == 'N') 
				{
				   if(twoplace) LeadZero(monthsleft);
				   	document.write(monthsleft);
					pos++;
					continue;
				} else {
				if (format.substring(pos,pos+1) == 'Y') 
				{
				   if(twoplace) LeadZero(yearsleft);
				   	document.write(yearsleft);
					pos++;
					continue;
				}				
       pos++; // ignore the char 
		}
} } } } } } } } } } } } } } } } }
//-->