//Browser detection
var browser = navigator.appName;
var version = parseFloat(navigator.appVersion);

var today = new Date();
var day = today.getDate();
var month = today.getMonth();
var year = today.getYear();

// Adjustment to "year" due to Netscape


function loadDates() {

}

function isLeapYear(year) {

}

// This function constructs the options for the year select box called
// lstYear
function buildYearSelect() {



}

// This function constructs the options for the day select box called
// lstDay
function buildDaySelect() {

}

function fnFrmSubmit(){

}

// Code  for  key pressed

function fnPressEnterPart()
{


}


//Checks Month and truncates select box as necessary
function checkNumDays() {

}

//This function valids that the user has not picked a date that
//has passed using the option select
function checkDate_select(dateVal,mon,yr) {

}
//This function valids that the user has not picked a date that
//has passed using the calendar
function checkDate(dateVal,mon,yr) {


}

function setFormValues() {



}

function setDateValue(dateVal,mon,yr)
{

}


// Begin form 1 validation
function validateForm(form)	{
	if ((document.getElementById) || (document.all)) {
		for (var loop=0; loop < bgColorArray.length; loop++) {
			var path = eval("document.frmVisitor." + bgColorArray[loop] + ".style");
			path.backgroundColor = '#FFFFFF';
		}
		for (var loop=0; loop < bgColorArray.length; loop++) {
			bgColorArray[loop] = "";
		}
	}


		var output = "";
	var email = form.email.value;
	if (email != null)
		form.email.value = email.toLowerCase();
		if (!valEmail(form.email.value)) {
			output += "* E-mail Address\n";
			setFocus(form.email);
			if ((document.getElementById) || (document.all)) {
				bgColorArray[arrayCounter] = "email";
				arrayCounter += 1;
			}
		}

		//final validation error message
		if (output != "")
			{
				alert("The following information was missing or incorrect:\n\n"+output);
				focusItem.focus();
				focusItem = "";
				if ((document.getElementById) || (document.all)) {
					bgColorArray.length = arrayCounter;
					arrayCounter = 0;

					//loop through to change background color of incorrect items
					for (var loop=0; loop < bgColorArray.length; loop++) {
						var path = eval("document.frmVisitor." + bgColorArray[loop] + ".style");
						path.backgroundColor = '#FFFFCC';
					}
				}
				return false;
			}

		return true;
	}
//  End form 1 validation
// setting focus on the first item that was invalid on form 2
var focusItem2 = "";
var bgColorArray2 = new Array(); // array for changing background color of invalid items
var arrayCounter2 = 0;

function setFocus2(item) {
	if (focusItem2 == "") focusItem2 = item;
}

// Begin form 2 validation
function validateForm2(form)	{
	if ((document.getElementById) || (document.all)) {
		for (var loop=0; loop < bgColorArray2.length; loop++) {
			var path = eval("document.frmMember." + bgColorArray2[loop] + ".style");
			path.backgroundColor = '#FFFFFF';
		}
		for (var loop=0; loop < bgColorArray2.length; loop++) {
			bgColorArray2[loop] = "";
		}
	}
		var output = "";

		if (!form.specialOfferSub.checked) {
			output += "* Please click the check box next to 'Subscribe Me to Wyndham Weekly Escape'\n";
			setFocus2(form.specialOfferSub);
			if ((document.getElementById) || (document.all)) {
				bgColorArray2[arrayCounter2] = "specialOfferSub";
				arrayCounter2 += 1;
			}
		}

		if (output != "")
			{
				alert("The following information was missing or incorrect:\n\n"+output);
				focusItem2.focus();
				focusItem2 = "";
				if ((document.getElementById) || (document.all)) {
					bgColorArray2.length = arrayCounter2;
					arrayCounter2 = 0;

					//loop through to change background color of incorrect items
					for (var loop=0; loop < bgColorArray2.length; loop++) {
						var path = eval("document.frmMember." + bgColorArray2[loop] + ".style");
						path.backgroundColor = '#FFFFCC';
					}
				}
				return false;
			}
			else {

			return true;
			}
	}
//  End form 2 validation
// Begin form 4 validation
// setting focus on the first item that was invalid on the form


// Begin form 4 validation
function validateForm4(form)	{

		var selIndex = form.lstHotel.selectedIndex;
		//alert(form.lstHotel.options[selIndex].text);
		var isis = form.lstHotel.options[selIndex].value;
		//alert(isis);
		if(isis == null || isis == "") {
			validateHotel(isis);
			form.lstHotel.style.backgroundColor = '#FFFFCC';
			form.lstHotel.focus();
			return false;
		} else {
			form.action = '/hotels/' + isis + '/specialoffers/main.wnt';
			return true;
		}

	}
//  End form4 validation
function convertCityToLower() {

}

function isInteger(val) {

}

function isDigit(num) {

}


