function initFocus()
{
	document.forms[document.forms.length-1].elements[0].focus();
}

function isDate(strdt)
{
	// replace hyphens with slashes (Netscape 4 does not accept hyphens)
	strdt = strdt.replace(/-/g, "/");

	var elem = strdt.match(/^\s*(\d+)\/(\d+)\/(\d+)\s*$/) ;
	if(elem == null) return false;

	var dt = new Date(strdt);

	// 2/29/00 means leap day 2000, not 1900 as JavaScript may think
	if(0 == elem[3] && 2 == elem[1] && 29 == elem[2] && dt.getDate() > 0) return true;

	// if the date parser and the text parser get the same month, it's all good.
	// otherwise we'll get NaN or the wrong month (e.g. 2/29/99 -> 3/1/1999)
	return dt.getMonth()+1 == elem[1];
}

function isSSN(s)
{
	return s.match(/^\d\d\d\d\d\d\d\d\d$/) || s.match(/^\d\d\d-\d\d-\d\d\d\d$/);
}

function isPasswordComplex(p)
{
	return p.length > 7 && p.match(/[a-z]/) && p.match(/[A-Z]/) && p.match(/[0-9]/) && p.match(/[^A-Za-z0-9]/);
}


