//###################################################
//		Global JScript Vars Are Held Here
	//  Default Form Name
	var gFrm = 'thisForm'

//###################################################
function FocusTextBox(txtObject)
	{
		// Set Focus and Select text to the object passed in
		if(txtObject != null)
			{
				var n = txtObject.name;
				if(ExistsTextBox(n) == true)
					{
						txtObject.focus();
						txtObject.select();
					}
			}
	}

//###################################################
function ExistsTextBox(elementName)
	{
		if(elementName != null)
			{
				// if the Element Type is Text Box
				if(document.forms[gFrm].elements[elementName].type == "text")
					return true;
				else
					return false;
			}
		else
			return false;
	}
//###################################################
function FocusFirstTextBox()
	{	// Loop througth the forms elemnets
		for (var i = 0; i < document.forms[gFrm].elements.length; i++)
			{	// Check Element type to text type
				if(document.forms[gFrm].elements[i].type == "text")
					{	// Text Element Found So Call set focus and select text
						document.forms[gFrm].elements[i].focus();
						document.forms[gFrm].elements[i].select();
						return;
					}
			}
	}
	
	
//###################################################
function SubmitForm(ActionValue)
	{
		if(ActionValue != null)
			document.forms[gFrm].submit(ActionValue);
		else
			document.forms[gFrm].submit();
	}
	
//###################################################
function SubmitOnEnter(ActionValue)
	{
		if(event.keyCode==13)
			{
				if(ActionValue != null)
					document.forms[gFrm].submit(ActionValue);
				else
					document.forms[gFrm].submit();
			}
	}
	