<!--
self.onerror = function() {return true;}

function checker(selector) {
	selector.options.selectedIndex = selector.options.selectedIndex;
}


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 getWidth() {
if (screen.width == 800) 
		document.writeln("<LINK HREF='GRGSm.css' REL='stylesheet' TYPE='text/css'>");
	else
		document.writeln("<LINK HREF='GRGLg.css' REL='stylesheet' TYPE='text/css'>");
	
}
// Initializes layers and methods
ns4 = (document.layers)? true:false
ie4 = (document.all)? true:false
ns6 = (document.getElementById)? true:false


// Visibility toggling for NS4/6 and IE
function show(id) {
        if (ns4) document.layers[id].visibility = "show"
			else if (ie4) document.all[id].style.visibility = "visible"
				else if (ns6) document.getElementById(id).style.visibility = "visible"		}
function hide(id) {
        if (ns4) document.layers[id].visibility = "hide"
			else if (ie4) document.all[id].style.visibility = "hidden"
				else if (ns6) document.getElementById(id).style.visibility = "hidden"	}
				
// DOM Recognition for visibility
	if (document.layers) {
		visible = 'show';
		hidden = 'hide';
	} else if (document.all) {
		visible = 'visible';
		hidden = 'hidden';
	} else if (document.getElementById) {
		visible = 'visible';
		hidden = 'hidden';
	}

function test(src){
     var emailReg = "^[\\w-_\.]*[\\w-_\.]\@[\\w]\.+[\\w]+[\\w]$";
     var regex = new RegExp(emailReg);
     return regex.test(src);
}

function checkFields() {
	missinginfo = "";
	fieldForFocus = null;
	if (document.form1.firstname.value == "") {
		missinginfo += "    <li>First Name<br>";
		fieldForFocus = document.form1.firstname;
	}
	if (document.form1.lastname.value == "") {
		missinginfo += "    <li>Last Name<br>";
		if (fieldForFocus == null)
		fieldForFocus = document.form1.lastname;
	}
	if (!(test(document.form1.email.value))) {
		missinginfo += "     <li>Valid Email address<br>";
		if (fieldForFocus == null)
		fieldForFocus = document.form1.email;
	}
	if (document.form1.msg.value == "") {
		missinginfo += "     <li>Message Text<br>";
		if (fieldForFocus == null)
		fieldForFocus = document.form1.msg;
	}



	if (missinginfo != "") {

		text = '<!-- header area - begin -->';
		text += '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">';
		text += '<html>';
		text += '<head>';
		text += '<title>Green Resource Group Contact Form</title>';
		text += '<LINK HREF="GRG.css" REL="stylesheet" TYPE="text/css">';
		text += '<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">';
		text += '<BODY TOPMARGIN="0" LEFTMARGIN="0" MARGINWIDTH="7" MARGINHEIGHT="0">';
		text += '<table width="100%" border="0" cellspacing="0" cellpadding="0">';
		text += '<TR><TD><IMG SRC="images/GRGErrorBar.gif"></td></TR>';
		text += '<TR><TD><BR><BR><p class="subs"><B>Error Information</B><BR><BR>';
		text += 'Your data was not submitted because the following fields were missing:</p><UL>';
		text += missinginfo;
		text += '</UL><p class="subs"><B>Please return to the email form and provide required information.</B></P><BR></p></TD></TR>';
		text += '</table>';
		text += '</body><html>';

		preview = window.open("", "preview", "left=0,top=0,toolbar=yes,width=419,height=430,status=no,scrollbars=no,resizable,menubar=no");
		preview.document.open();
		preview.document.write(text);
		preview.document.close();

	return false;
	}
	else return true;
}


//-->

