function scroll()
    {
    self.scroll(0,130);
 
 	}
	
function isEmpty(input)
	{
	if(input <= "          ")
		return true;
	else
		return false;
	}
	
function isNumber(input)
	{
	oneDecimal = false;
		for(var i=0; i<input.length; i++)
		{
			var oneChar = input.charAt(i);
		//allow negative sign as first char
			if(i == 0 && oneChar == "-")
				continue;
		//allow one decimal point
			if(oneChar == "." && !oneDecimal)
			{
				oneDecimal = true;
				continue;
			}
		//digit is between 0 and 9
			if(oneChar < "0" || oneChar > "9")
				return false;
		}
	return true;
	}

function digitOK(input, numDigit)
	{
	if(input.length == numDigit)
		return true;
	else
		return false;
	}
	
function checkform(formObj)
	{
	//------------------------------------------------------------
	//check Region
	//------------------------------------------------------------
	if(formObj.Region)
	{
		if(formObj.Region.selectedIndex == -1)
		{
			alert("Please select one Region.");
			return false;
		}
	}
	//------------------------------------------------------------
	//check examType
	//------------------------------------------------------------
	if(formObj.examType)
	{
		radioChecked = 0;
		for(i=0; i<formObj.examType.length; i++)
		{
			if(formObj.examType[i].checked)
				radioChecked = 1;
		}
		
		if(radioChecked == 0)
		{
			var c = getCookieData("ReportName=");
			var rep = c.charAt(0);
			if(c == "H9") 
			{
				alert("Please choose an Exam Type.");
				return false;
			}
			else
			{
				alert("Please choose a Report Type.");
				return false;
			}
		}
	}
	//---------------------------------------------------------------
	//check report specific input fields
	//(repInputOK() loaded with each report specific include file
	//---------------------------------------------------------------
	return repInputOK(formObj)
}

function getCookieData(label)
{
	var labelLen = label.length;
	var cLen = document.cookie.length;
	var i = 0;
	var cEnd;
	while(i < cLen)
	{
		var j = i + labelLen;
		if(document.cookie.substring(i,j) == label)
		{
			cEnd = document.cookie.indexOf(";", j);
			if(cEnd == -1)
				cEnd = document.cookie.length;
			return unescape(document.cookie.substring(j,cEnd));
		}
		i++;
	}
	return " "
}

function WarnUserTimeout()
    {
	
	var MINUTE = 60 * 1000

	var WarnTime = new Date();
    	if (confirm('It is now ' + showtime() + ' Your session will expire in 10 minutes.\n\nDo you want to continue working?\n\n(Press <OK> to continue, press <CANCEL> to log out now.)'))
    	{
    		
			var AcceptTime = new Date();
			var Diff = Math.round((AcceptTime - WarnTime) / MINUTE);
			if (Diff > 9)
			{
			window.open('index.asp?Denied=6','WarningWindow');
			}
			else
			{
			if ((document.forms.length > 0))
				document.forms[0].submit();
			else
				window.location.reload(true);
			}
    	}
		else
		{
			window.location = "index.asp?Denied=5";
		}
		return true;
		
    }


function showtime () 
{
	var now = new Date();
	var hours = now.getHours();
	var minutes = now.getMinutes();
	var seconds = now.getSeconds();
	var timeValue = "" + ((hours >12) ? hours -12 :hours);
	if (timeValue == "0") timeValue = 12;
	timeValue += ((minutes < 10) ? ":0" : ":") + minutes;
	timeValue += ((seconds < 10) ? ":0" : ":") + seconds;
	timeValue += (hours >= 12) ? " P.M." : " A.M.";
	return timeValue;
}

