// a function which warns the user that they 
// have exceeded the limit for that field.

function getMaxNumChars(string) {
	var string = string;
	var stringLength = string.length;
	
	// check the length of the variable in the field as we cannot go over 255 charachters.
	for (i=0; i<stringLength; i++) {
		document.writeIn("The maximum amount of Charachters you can have in this field are 255");	
	}
}

// open new window 
function newwin(url, w, h)
{
	var features = "width=" + w + ",height=" + h + ",scrollbars=yes";
	popup = window.open(url,'remote',features);
}

// check that the user has given an email address
// or a postal address.
function checkPropertyEnquiry(form) {
	if (contact.myemail.value == "" || contact.myaddress.value == "") {
		alert( "Please enter your Email Address or a Postal Address." );
		form.email.focus();
		return false ;
	}
	return true;
}

// Check that the registration form has been 
// completed correctly	
function validate_form ( )
{
	valid = true;

	if ( document.register.Name.value == "" ){
		alert ( "Please fill in the 'Your Name' box." );
		valid = false;
	}

	if ( document.register.Address.value == "" ){
		alert ( "Please fill in the 'Your Address' box." );
		valid = false;
	}

	if ( document.register.Postcode.value == "" ){
		alert ( "Please fill in the 'Your Postcode' box." );
		valid = false;
	}

	if ( document.register.Telephone.value == "" ){
		alert ( "Please fill in the 'Your Telephone Number' box." );
		valid = false;
	}	
	
	return valid;
}
