//Form highlighting script
function doHighlight(elementName)
{
var defaultBGcolor="#fff";
var defaultFGcolor="#000";
var hoverBGcolor="yellow";
var hoverFGcolor="#006";
for (var i=0;i<whatTag(elementName).length;i++)
	{
	var currentEl=whatTag(elementName)[i];
//	if (!((currentEl.type=="button")||(currentEl.type=="submit")))
//		{
		currentEl.onfocus=function(){this.style.backgroundColor=hoverBGcolor;this.style.color=hoverFGcolor;};
		currentEl.onblur=function(){this.style.backgroundColor=defaultBGcolor;this.style.color=defaultFGcolor;};
//		}
	}
}
function highlightFormInput()
{
//need to find the default value from the style sheet
//alert(document.styleSheets[1].cssText);
//var strRule ="";
//for (r=0;r<document.styleSheets[1].cssText.length;r++)
//	{
//	strRule+=document.styleSheets[1].cssText[r].value;
//	}
//	alert(strRule);
doHighlight("INPUT");
doHighlight("TEXTAREA");
doHighlight("SELECT");
}
function whatTag(tagName)
{
var value=document.getElementByTagName?document.getElementByTagName(tagName):document.all.tags(tagName);
	return value;
}
if (document.all)
	{
	window.onload = highlightFormInput;
	}

//Regular expressions
var notAlpha 	= /[^a-z \-\.\,']/gi;
var isEmail		= /^\w(\.?[\w-])*@\w(\.?[\w-])*\.[a-z]{2,6}(\.[a-z]{2})?$/i;
var isDecimal	= /^\d+(\.\d+)?$/;
