function SetFocus()
// puts focus on first form element in page
{		
	//Added by Jeff Taylor 7-11-2002 to allow this to turned off
	if(typeof(m_initDoFocus)!="undefined"){
		if(m_initDoFocus == false) return;
	}
	var AttribFound = false, j = 0, FormElementType = "";
			
		while (( j < this.document.forms.length) && (! AttribFound))
		{
			var i = 0;
			while (( i < this.document.forms[j].elements.length) && (! AttribFound))
			{
				FormElementType = this.document.forms[j].elements[i].type;
				if ((FormElementType != "hidden") && (FormElementType != "reset") && (FormElementType != "submit"))
				{
					AttribFound = true;
					this.document.forms[j].elements[i].focus();
				}	
			i++;
			}
			j++;
		}
};

function DownloadPage() 
{
	document.forms[0].target = '_blank';
	document.forms[0].submit();
	document.forms[0].target = '_self';
}

function CheckTextArea(obj)
{
	var maxChars = 255;
	if(obj.value.length > maxChars) 
	{
		alert('Please limit the amount of text to 255 characters or less.');
		obj.focus();
		return false; 
	}
	else
	{
		return true; 
	}
}

function CheckTextSize(obj, maxChars)
{
	if(obj.value.length > maxChars) 
	{
		alert('Please limit the amount of text to ' + maxChars + ' characters or less.');
		obj.focus();
		return false; 
	}
	else
	{
		return true; 
	}
}
