// JavaScript Document

function hilite(fl)
{
	var fld = fl.id;
	document.getElementById(fld).style.backgroundImage = "url('images/buttonOn.jpg')";
	document.getElementById(fld).style.cursor = "pointer";
	//document.getElementById(fld).style.color = "black";
	
}

function unhilite(fl)
{
	var fld = fl.id;
	document.getElementById(fld).style.backgroundImage = "url('images/button.jpg')";
	document.getElementById(fld).style.color = "white";
}

function hand(fl) {
    var fld = fl.id;
    document.getElementById(fld).style.cursor = "pointer";
}

function validateEmail()
{
	var mess="";
	var array = new Array();
	var name = document.mainform.name.value;
	var email = document.mainform.email.value;
	var problem = document.mainform.problem.value;
	
	if(name=="")
		array.push("Name");
	if(email=="")
		array.push("Email");
	if(problem=="")
		array.push("Explanation");
	
	if(array.length==0)
		document.mainform.submit();
	else
	{
		mess="Please fill out the following fields:\n";
		for(var i = 0; i<array.length; i++)
		{
			mess += ' -'+array[i]+"\n";
		}
		alert(mess);
	}
}
