// JavaScript Document

//this function moves focus to first form field on page
function focusForm() {			
	// If there is a form in the doc...
	if (document.forms[0]) {			
		theElems = document.forms[0].elements			
		// loop over the elements until finding a non-hidden one
		for (i = 0; i < theElems.length; i++) {
			theElem = theElems[i];
			if (theElem.type && theElem.type == "hidden" ) {
				continue;
			}
			// focus on the first non-hidden element
			theElem.focus();
			break;
		}
	}
}


function isEmail(string) 
{
	if (string.search(/^\w+(('\w+)|(-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/) != -1) return true;
	else return false;
}