var $ = function(id, win) 
{
	var w=window;
	if(win&&win.document){w=win;};
	return w.document.getElementById(id) || null;
}

function popUp(strURL,strType,strHeight,strWidth) 
{
var strOptions="";
if (strType=="console") strOptions="menubar,scrollbars,resizable,height="+strHeight+",width="+strWidth;
if (strType=="fixed") strOptions="menubar,status,height="+strHeight+",width="+strWidth;
if (strType=="elastic") strOptions="menubar,scrollbars,resizable,location,height="+strHeight+",width="+strWidth;
window.open(strURL, 'newWin', strOptions);
}

function validation() {
		
	if (document.SEND_FORM.NAME.value == "") {
		alert("Please enter your name!");
		document.SEND_FORM.NAME.focus();
		return false;
	}
	if (document.SEND_FORM.PHONE.value == "") {
		alert("Please enter your phone number!");
		document.SEND_FORM.PHONE.focus();
		return false;
	}
	if (document.SEND_FORM.EMAIL.value == "") {
		alert("Please enter your EMAIL address!");
		document.SEND_FORM.EMAIL.focus();
		return false;
	}
	
	// check if email field is blank
	if (document.SEND_FORM.EMAIL.value == "")
	{
	alert("Please enter a value for the \"Email\" field.");
	document.SEND_FORM.EMAIL.focus();
	return (false);
	}
	
	// test if valid email address, must have @ and .
	var checkEmail = "@.";
	var checkStr = document.SEND_FORM.EMAIL.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\" field must contain an \"@\" and a \".\".");
	document.SEND_FORM.EMAIL.focus();
	return (false);
	}

	return true

}