
window.history.forward(1);
var browser_type;

if (document.all)
	browser_type = "IE";
else
	browser_type = "Netscape";


function changeHelpText(iQuestionID) 
{ 

	if (!(document.all))
		document.all = document.getElementsByTagName("*");
	
	if(!(window.document.all.spanHelp))
		return;
	if ((iQuestionID > 0) && (iQuestionID <= sHelpStrings.length)) 
		window.document.all.spanHelp.innerHTML = sHelpStrings[iQuestionID - 1];

	/*
	if(window.document.all("spanHelp") == null)
		return;
	if ((iQuestionID > 0) && (iQuestionID <= sHelpStrings.length)) 
		window.document.all("spanHelp").innerText = sHelpStrings[iQuestionID - 1]; 
	*/

} 
				
function changeSectionColor(iActiveFlag, sSectionId)
{
	
	if (!(document.all))
		document.all = document.getElementsByTagName("*");
		
	if (iActiveFlag == 1)
		window.document.all[sSectionId].className = "ActiveSectionStyle + normaltext";
	else
		window.document.all[sSectionId].className = "CellWithNoborder + normaltext";

	/*
	if (iActiveFlag == 1)
		window.document.all(sSectionId).className = "ActiveSectionStyle + normaltext";
	else
		window.document.all(sSectionId).className = "CellWithNoborder + normaltext";
		*/
}
				
									
function checkNumeric(checkDecimal, textControl)
{
	
	if (!(event.keyCode))
		return;
	if ((event.keyCode < 48) || (event.keyCode > 57))
	{
		if ((checkDecimal == 1) && (event.keyCode == 46))
		{	
			if (textControl.indexOf(".") >=0)
				event.keyCode = 0;
			return;
			}
		event.keyCode = 0;
	}
	return;
}


function AllowNumericComma(checkDecimal, textControl)
{
	
	if (!(event.keyCode))
		return;
	if (((event.keyCode < 48) || (event.keyCode > 57)) && (!(event.keyCode==44)))
	{
		if ((checkDecimal == 1) && (event.keyCode == 46))
		{	
			if (textControl.indexOf(".") >=0)
				event.keyCode = 0;
			return;
			}
		event.keyCode = 0;
	}
	return;
}


function toUpperCase()
{
	if (!(event.keyCode))
		return;
		
	if ((event.keyCode >= 97) && (event.keyCode <=122))
		event.keyCode = event.keyCode - 32;
	
	return 

}

function maxCharacters(oControl, iLength)
{
	//alert("In the function");
	if (oControl == null)
		alert("Control passed to function maxCharacters was null");
	var sString = oControl.value;
	if (sString.length > iLength -1 )	
	{
		if (browser_type == "IE")	
			event.keyCode = 0;
		else
			alert("Maximum allowed character length for this field is " + iLength + ".Any exceeding characters will be ignored.");
	}
	return;

}

function handleMaxCharacters(oControl, iLength)
{
	if (oControl == null)
		alert("Control passed to function maxCharacters was null");
	var sString = oControl.value;
	if (sString.length > iLength)
		oControl.value = oControl.value.substring(0, iLength);
	return;
}
