<!--
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
//-->


function locality_change(theForm){

    if(theForm.district.value=="PlainesWilhems"){
        theForm.locality.disabled=false;
        
    }
    else{
		theForm.locality.disabled=true;
     
    }
}





function form_val_contact(theForm)
{
	// check to see if the last name field is blank
	if (theForm.first_name.value == "")
	{
		alert("Please enter your first name!");
		theForm.first_name.focus();
		return (false);
	}
	
	// allow ONLY alphanumeric keys, no symbols or punctuation
	var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz ";
	var checkStr = theForm.first_name.value;
	var allValid = true;
	for (i = 0;  i < checkStr.length;  i++)
	{
		ch = checkStr.charAt(i);
		for (j = 0;  j < checkOK.length;  j++)
		if (ch == checkOK.charAt(j))
		break;
		if (j == checkOK.length)
		{
			allValid = false;
			break;
		}
	}
	if (!allValid)
	{
		alert("Please enter only alphabets in the First Name field!");
		theForm.first_name.focus();
		return (false);
	}
	
	
	// check to see if the last name field is blank
	if (theForm.last_name.value == "")
	{
		alert("Please enter your last name!");
		theForm.last_name.focus();
		return (false);
	}
	
	// allow ONLY alphanumeric keys, no symbols or punctuation
	var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz ";
	var checkStr = theForm.last_name.value;
	var allValid = true;
	for (i = 0;  i < checkStr.length;  i++)
	{
		ch = checkStr.charAt(i);
		for (j = 0;  j < checkOK.length;  j++)
		if (ch == checkOK.charAt(j))
		break;
		if (j == checkOK.length)
		{
			allValid = false;
			break;
		}
	}
	if (!allValid)
	{
		alert("Please enter only alphabets in the Last Name field!");
		theForm.last_name.focus();
		return (false);
	}
	
	
	// check if email field is blank
	if (theForm.email_address.value == "")
	{
		alert("Please enter an email address.");
		theForm.email_address.focus();
		return (false);
	}
	
	
	// test if valid email address, must have @ and .
	var checkEmail = "@.";
	var checkStr = theForm.email_address.value;
	var EmailValid = false;
	var EmailAt = false;
	var EmailPeriod = false;
	for (i = 0;  i < checkStr.length;  i++)
	{
	ch = checkStr.charAt(i);
	for (j = 0;  j < checkEmail.length;  j++)
	{
	if (ch == checkEmail.charAt(j) && ch == "@")
	EmailAt = true;
	if (ch == checkEmail.charAt(j) && ch == ".")
	EmailPeriod = true;
		  if (EmailAt && EmailPeriod)
			break;
		  if (j == checkEmail.length)
			break;
		}
		// if both the @ and . were in the string
	if (EmailAt && EmailPeriod)
	{
			EmailValid = true
			break;
		}
	}
	if (!EmailValid)
	{
	alert("The \"Email\" provided is invalid!");
	theForm.email_address.focus();
	return (false);
	}
	
	//phone validation
	// check to see if the tel no field is blank
	if (theForm.phone_no.value != "")
	{
		// allow ONLY numeric keys, one symbol -
		var checkOK = "0123456789- ";
		var checkStr = theForm.phone_no.value;
		var allValid = true;
		for (i = 0;  i < checkStr.length;  i++)
		{
		ch = checkStr.charAt(i);
		for (j = 0;  j < checkOK.length;  j++)
		if (ch == checkOK.charAt(j))
		break;
		if (j == checkOK.length)
		{
		allValid = false;
		break;
		}
		}
		if (!allValid)
		{
		alert("Please enter only numbers in the Phone No field.");
		theForm.phone_no.focus();
		return (false);
		}
	}

	// check to see if the first name field is blank
	if (theForm.subject.value == "")
	{
	alert("Please enter a subject!");
	theForm.subject.focus();
	return (false);
	}

	// check to see if the first name field is blank
	if (theForm.message.value == "")
	{
	alert("Please enter a message!");
	theForm.message.focus();
	return (false);
	}

}//end function


<!-- Original:  Jenny Blewitt (webmaster@webdesignsdirect.com) -->
<!-- Web Site:  http://www.webdesignsdirect.com -->

<!-- This script and many more are available free online at -->
<!-- The JavaScript Source!! http://javascript.internet.com -->

<!-- Begin
browserName = navigator.appName;
browserVer = parseInt(navigator.appVersion);

ns3up = (browserName == "Netscape" && browserVer >= 3);
ie4up = (browserName.indexOf("Microsoft") >= 0 && browserVer >= 4);

function doPic(imgName) {
if (ns3up || ie4up) {
imgOn = ("" + imgName);
document.mainpic.src = imgOn;
   }
}
//  End -->


