var ddlDate;

function the_date(){
	var arrivalDate = "-- Arrival Date --";
	var shortDayName = new Array("Sun","Mon","Tue","Wed","Thu","Fri","Sat");
	var shortMonthName = new Array("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec");
	
	var date = new Date();
	var select = ddlDate;
	
	var firstDay = date.getDate();
	if(parseInt(firstDay) < 10) firstDay = "0" + firstDay;
	var firstMonth = date.getMonth() + 1;
	if(parseInt(firstMonth) < 10) firstMonth = "0" + firstMonth;
		
	var firstOption = new Option(arrivalDate);
	firstOption.value = date.getFullYear() + firstMonth + firstDay;
	
	document.writeln("<SELECT name=\"d\">");
	
	for(var d=0;d<90;d++)
	{
		var day = date.getDate();
	    if(parseInt(day) < 10) day = "0" + day;
		var month = date.getMonth() + 1;
		if(parseInt(month) < 10) month = "0" + month;
		var option = new Option(shortDayName[date.getDay()] + " " + date.getDate() + " " + shortMonthName[date.getMonth()] + " " + date.getFullYear());
		option.value = date.getFullYear() + "" + month +  "" +  day;
		document.writeln("<OPTION value=" + option.value + ">" + shortDayName[date.getDay()] + " " + date.getDate() + " " + shortMonthName[date.getMonth()] + " " + date.getFullYear() + "</option>");
		date.setDate(date.getDate() + 1);
	}
	
	document.writeln("</SELECT>");
	}


function launchPad(filename) {
        var newWindow=window.open(filename,"launchpad",'status=yes,toolbar=no,width=560,height=320,left=30,top=30,directories=no,menubar=yes,location=no,copyhistory=no,scrollbars=yes')
        newWindow.focus();
}

function changeCase() {
        var field = document.basic.Postcode;
        field.value = field.value.toUpperCase()
}

function goTown(url) {
        if (url == "-----") { return; } else {
           tourl = "../places/" + url + ".htm";
           top.location = tourl;
        }
}

function pressOnce() {
        if (submitted == 'false') {
           submitted = 'true';
           alert('Thank-you... now processing, this could take at least a minute. Please do not click confirm again, you will receive a confirmation page and email.');
           document.confirm.submit();
        }
}
