<!--
//
//
function checkPassword(pw,pw2,req)
	{
	pw = getObj(pw);
	pw2 = getObj(pw2);
	if ((pw.value.length == 0 && pw2.value.length == 0 && req == true)
			||
		((pw.value.length > 0 || pw2.value.length > 0) && (pw.value != pw2.value)))
		{
		alert ("Invalid Password");
		return false;
		}
	return true;
	}
//
//
function checkCount()
	{
	if (manuscript.coAuthorCount.value >= 0 && manuscript.coAuthorCount.value <= 10)
		{
		for (x=1; x<=10; x++)
			{
			if (x <= manuscript.coAuthorCount.value)
				document.getElementById("coAuthor"+x).style.visibility = 'visible';
			else
				document.getElementById("coAuthor"+x).style.visibility = 'hidden';
			}
		if (manuscript.coAuthorCount.value > 0)
			manuscript.coAuthor_firstName1.focus();
		else
			manuscript.primaryEmail.focus();
		return true;
		}
	manuscript.coAuthorCount.value = 0;
	return false;
	}
//
//
//
function changeSite(siteID,qString)
{
//alert(siteID+" "+qString);
	if (siteID > 1000000)
	{
			window.location = "?seriesID="+siteID+"&"+qString;
	}
	else
	{
			window.location = "?siteID="+siteID+"&"+qString;
	}
}
//
// Check that data has been entered for this field
//		if cnt is set then - length >= cnt
//
function checkReq(ip, cnt)
	{
	if (cnt)
		{
		if (cnt<0)
			{
			if (ip.value.length < (-cnt)) return false;
			}
		else if (ip.value.length != cnt) return false;
		}
	if (ip.value.length == 0)
		return false;
	else
		return true;
	}
//
// Check that the key is alpha numeric
//
// onkeypress="return checkAlphaNumeric(event);"
//
function checkAlphaNumeric(e)
	{
	if (navigator.appName == "Netscape")
	{
		key = e.which;
	}
	else
	{
		key = e.keyCode;
	}
//alert(key);
	if ((key >= 48 && key <= 58)
			||
		(key >= 65 && key <= 90)
			||
		(key >= 97 && key <= 122)
			||
		(key >= 45 && key <= 47)
			||
		 key == 95
		 	||
		 key == 124 || key == 0 || key == 8 || key == 13 )
	{
		return true;
	}

	return false;
	}
//
// Check that the key is alowed for names in DB
//     no ' or "
//
function checkName(e)
	{
	if (navigator.appName == "Netscape")
	{
		key = e.which;
	}
	else
	{
		key = e.keyCode;
	}

	if ((key >= 48 && key <= 57)
			||
		(key >= 65 && key <= 90)
			||
		(key >= 97 && key <= 122)
			||
		key == 32
			||
		key == 0 || key == 8 || key == 13 )
	{
		return true;
	}
	return false;
	}
//
// Check that the key is part of a phone #
//		[0-9] or '-'
//
// onkeypress="return checkPhone(event)"
//
function checkPhone(e)
	{
	if (navigator.appName == "Netscape")
	{
		key = e.which;
	}
	else
	{
		key = e.keyCode;
	}
	if (key == 45
			||
		(key >= 48 && key <= 57)
			||
		key == 0 || key == 8 || key == 13 )
	{
		return true;
	}

	return false;
	}
//
// Check that the key is part of a zip code
//		[0-9]
//
// onkeypress="return checkZip(event)"
//
function checkZip(e)
	{
	if (navigator.appName == "Netscape")
	{
		key = e.which;
	}
	else
	{
		key = e.keyCode;
	}

	if ( (key >= 48 && key <= 57) || key == 0 || key == 8 || key == 13 )
	{
		return true;
	}

	return false;
	}
//
// onkeyPress="return checkNumericKey(event);"
//
function checkNumericKey(e)
{
//alert(e);
	if (navigator.appName == "Netscape")
	{
		key = e.which;
	}
	else
	{
		key = e.keyCode;
	}
//alert(key);
	if ( (key >= 48 && key <= 57) || key == 0 || key == 8 || key == 13 )
	{
		return true;
	}

	return false;
}
//
//
var decimalFlag = false;
var decimalCnt = 10;
function checkMoney(e)
	{
	if (navigator.appName == "Netscape")
	{
		key = e.which;
	}
	else
	{
		key = e.keyCode;
	}

	if (key >= 48 && key <= 57 && (--decimalCnt) >= 0) return true;
	else if (key == 46 && decimalFlag == false)
		{
		decimalFlag = true;
		decimalCnt = 2;
		return true;
		}

	return false;
	}
//
//
//-->