function GetList()
{
	var a=["January","February","March","April","May","June","July","August","September","October","November","December"];
	for(i=1;i<=12;i++)
		document.writeln("<option value=\""+i+"\">"+a[i-1]+"</option>");
}
function GetYear()
{
	var a=["2004","2005","2006","2007","2008","2009","2010"];
	for(i=0;i<a.length;i++)
		document.writeln("<option value=\""+a[i]+"\">"+a[i]+"</option>");
}
function GetDay()
{
	var ae = [31,29,31,30,31,30,31,31,30,31,30,31];
	var today=new Date();
	tm=today.getMonth();
	td=today.getDate();
	ty=today.getYear();
	utc=Date.UTC(ty,tm,td);
	var od=new Date(utc);
	om=od.getMonth();
	oy = od.getYear();

	var m = ae[om];
	if ( (om == 1) && (oy != 2004 || oy != 2008) )
		m = 28;
	for(i=1;i<=m;i++) 
		document.writeln("<option value=\""+i+"\">"+i+"</option>");
	for(i=m;i<31;i++) 
		document.writeln("<option value=\""+(i+1)+"\"></option>");
	
}

function CurDay(f, ys,ms, ds)
{
	var today=new Date();
	m=today.getMonth();
	d=today.getDate();
	y=today.getYear();
	utc=Date.UTC(y,m,d);
	var od=new Date(utc);
	om=od.getMonth()+1;
	oy = od.getYear();
	oday = od.getDate();

	if(ms && ys && ds)
	{
		if(ms!=om || ys!=oy || ds!=oday)
			return;
	}
	if(f.Month.value!=om || f.Year.value!=oy || f.Year.value!=oday){
		f.Days.value=oday;
		f.Month.value=om;
		f.Year.value=oy;
	}	
}

function dd(f) {
	var ae = [31,29,31,30,31,30,31,31,30,31,30,31];
	m = f.Month.value;
	y = f.Year.value;
	if  (m == 2) {
		if (y == 2004 || y == 2008)  
			f.Days.options[28].text = 29;
		else	
			f.Days.options[28].text = '';
		f.Days.options[29].text = '';
		f.Days.options[30].text = '';	
		return;
	} 
	if (ae[m-1] == 31) {
		f.Days.options[28].text = 29;
		f.Days.options[29].text = 30;
		f.Days.options[30].text = 31;	
	} else {		
		f.Days.options[28].text = 29;
		f.Days.options[29].text = 30;
		f.Days.options[30].text = '';	
	}
}

function checkavail(f) {
	if (f.Days[f.Days.value-1].text == '') {
		document.all["avail_ok"].style.display="none";
		document.all["avail_ok"].style.visibility="hidden";
		document.all["avail_not"].style.display="none";
		document.all["avail_not"].style.visibility="hidden";
		return ;
	}
	var data = (f.Year.value - 2000)*1000 + f.Month.value*100 + f.Days.value*1;
	var find = false;
	
	for(i=0;i<booked.length; i++) {
		if (booked[i] == data) {
			find = true;
			break;
		}
	}
	if (find) {
		document.all["avail_ok"].style.display="none";
		document.all["avail_ok"].style.visibility="hidden";
		document.all["avail_not"].style.display="block";
		document.all["avail_not"].style.visibility="visible";
	} else {
		document.all["avail_not"].style.display="none";
		document.all["avail_not"].style.visibility="hidden";
		document.all["avail_ok"].style.display="block";
		document.all["avail_ok"].style.visibility="visible";
	}			
}
