//-- Rushden Golf Club

function DisplayYear()
{
	today = new Date();
	document.write( today.getFullYear() );	
}

		
function clearText(thefield)
{
	if (thefield.defaultValue==thefield.value)
		thefield.value = ""
} 

function onQuickLogonSubmit()
{
	// This is cross browser safe code
	var	objEmail = document.getElementById( 'QuickLogon_emailAddress' );
	var objPassword = document.getElementById( 'QuickLogon_Password' );
	
	if ( objEmail.value.length == 0 )
	{
		alert( 'Please enter your Email address before continuing' );
		objEmail.focus();
		return false;
	}

	if ( objPassword.value.length == 0 ) 
	{
		alert( 'Please enter your Password before continuing' );
		objPassword.focus();
		return false;
	}

	return true;
}


function getGreeting( tagtouse, url ) 
{
	var req = false;
	// For Safari, Firefox, and other non-MS browsers
	if (window.XMLHttpRequest) {
		try {
		req = new XMLHttpRequest();
		} catch (e) {
		req = false;
		}
	} else if (window.ActiveXObject) {
		// For Internet Explorer on Windows
		try {
		req = new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e) {
		try {
			req = new ActiveXObject("Microsoft.XMLHTTP");
		} catch (e) {
			req = false;
		}
		}
	}
	if (req) {
		// Synchronous request, wait till we have it all
		req.open('GET', url + '/ard/getgreeting.asp', false);
		req.send(null);
		if ( req.responseText != '' )
			document.write( '<' + tagtouse + '>' + req.responseText + '</' + tagtouse + '>' );
	} 
}
