function favit(heading,address)	{
	if(window.external)window.external.AddFavorite(address,heading);
	else if(window.sidebar)window.sidebar.addPanel(heading,address,"");
	}

function printWindow(){
   bV = parseInt(navigator.appVersion)
   if (bV >= 4) window.print()
	}

function MM_jumpMenu(targ,selObj,restore){ //v3.0
	eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
	if (restore) selObj.selectedIndex=0;
	}

function MM_jumpMenuGo(selName,targ,restore){ //v3.0
	var selObj = MM_findObj(selName); if (selObj) MM_jumpMenu(targ,selObj,restore);
	}

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 check_contact_form()	 {

	var email_pat = /[\w\-]+\@[\w\-]+\.\w{2,3}/;

	if (trim(document.getElementById('fname').value).length == 0)	{
		alert("Please enter your first name");
		document.getElementById('fname').focus();
		document.getElementById('fname').style.backgroundColor = '#FBF780';
		return false;
		}
	else	{
		document.getElementById('fname').style.backgroundColor = '#FFFFFF';
		}

	if (trim(document.getElementById('lname').value).length == 0)	{
		alert("Please enter your last name");
		document.getElementById('lname').focus();
		document.getElementById('lname').style.backgroundColor = '#FBF780';
		return false;
		}
	else	{
		document.getElementById('lname').style.backgroundColor = '#FFFFFF';
		}

	if (trim(document.getElementById('state').value).length == 0)	{
		alert("Please enter the state you currently live in");
		document.getElementById('state').focus();
		document.getElementById('state').style.backgroundColor = '#FBF780';
		return false;
		}
	else	{
		document.getElementById('state').style.backgroundColor = '#FFFFFF';
		}

	if (!email_pat.test(document.getElementById('email').value))	{
		alert("Email address is either missing or not properly formatted, please check it and resubmit the form");
		document.getElementById('email').focus();
		document.getElementById('email').style.backgroundColor = '#FBF780';
		return false;
		}
	else	{
		document.getElementById('email').style.backgroundColor = '#FFFFFF';
		}
		
	if (trim(document.getElementById('comments').value).length == 0)	{
		alert("Please enter your comments or questions in the comment text area provided");
		document.getElementById('comments').focus();
		document.getElementById('comments').style.backgroundColor = '#FBF780';
		return false;
		}
	else	{
		document.getElementById('comments').style.backgroundColor = '#FFFFFF';
		}

	}

function trim(str)	{  
	while(str.charAt(0) == " ")	{  
		str = str.substring(1);
		}
	while(str.charAt(str.length-1) == " " )	{  
		str = str.substring(0,str.length-1);
		}
  return str;
}
