
//---------------- FORM PROCESSING

//--------------- Validates Email
	function validEmail(email) {
		invalidChars = " /:,;"
			
		if (email == "") {		// cannot be empty
		return false
		}
		for (i=0; i<invalidChars.length; i++) {	
			// does it contain any invalid characters?
		badChar = invalidChars.charAt(i)
		if (email.indexOf(badChar,0) > -1) {
		return false
		}
		}
		atPos = email.indexOf("@",1)	// must be one "@" symbol
		if (atPos == -1) {
		return false
		}
		if (email.indexOf("@",atPos+1) != -1) {	
			// only 1 "@" symbol
		return false
		}
		periodPos = email.indexOf(".",atPos)
		if (periodPos == -1) {	// at least one "." after the "@"
		return false
		}
		if (periodPos+3 > email.length)	{	
			// must be at least 2 characters after the "."
		return false
		}
		return true
		}
		
		
function submitIt(form) 
{
					
	//--- runs email validation and requires fields

	if (!validEmail(form.email.value)) 
	{
	alert("Invalid or empty email address")
	form.email.focus()
	form.email.select()
	return false
	}

	if (form.name.value == "")
	{
	alert ("The name field is required")
	form.name.focus()
	form.name.select()
	return false
	}

   // If we made it to here, everything's valid, so return true
 
return true
}

//------- Print Page
function printWindow() {
bV = parseInt(navigator.appVersion);
if (bV >= 4) window.print();
}

//------- Close Window
function closeWindow() 
{
window.close(this)
}

//--------------Preloads nav frame pics so they roll over faster
function preLoad()
{
var images = new Array('path/image.jpg','path/image.gif'); /****/
preloadImages(images);
}

//--------------Defines process for preload
function preloadImages(images)
{
for(loop = 0; loop < images.length; loop++)
	{
	var image = new Image();
	image.src = images[loop];
	}
}

//----------- 
	if (document.images) 
	{
		bg = new Image
		impb = new Image

		bg.src = "graphics/Top.jpg"			
		impb.src = "graphics/InspirationsMPB.gif"
	}
	else 
	{
		bg = ""
		document.bg = ""
		impb = ""
		document.impb = ""
	}
