/*
function errorHandler(message, url, line)
{
	
   // message == text-based error description
   // url     == url which exhibited the script error
   // line    == the line number being executed when the error occurred
	var sce;
	sce = 'An error has occurred.\r\rPlease send us an email to inform us of this error. Select the Support link at the bottom of this page to open a pre-addressed email. Include the information below. Thank you.';
	window.alert(sce + '\r\rURL:  ' + url + '\rLine#:  ' + line + '\rError:  ' +  message);
	
 // handle the error here

 // stop the event from bubbling up to the default window.onerror handler
 // (see the "For More Info" section for an article on event bubbling)
   return true;
}
*/

// install the global error-handler
//window.onerror = errorHandler;

function FindElement( elementID, tagType )
{
	var Tags;
	var element;
	var Cnt;

	try	
	{	
		// IE
		Tags = document.all.tags(tagType);
				
		for( Cnt=0; Cnt<Tags.length; Cnt++)
		{
			element = Tags.item(Cnt);
			
			if( element.name != null )
			{
				if( element.id.indexOf(elementID) != -1 )
				{
					return element;
				}
			}
		}
	}
	catch( exception )
	{
		// other browsers
		element = FindElement2( document.body, elementID );
		return element;
	}

}

function FindElement2( parent, elementID )
{
	var Tags;
	var element;
	var Cnt;
	var result;
	
	Tags = parent.childNodes;
	
	for( Cnt=0; Cnt<Tags.length; Cnt++)
	{
		element = Tags.item(Cnt);
			
		if( element.name != null )
		{
			if( element.id.indexOf(elementID) != -1 )
			{
				return element;
			}
		}
		
		result = FindElement2(element, elementID);
		if( result != null )
			return result;
	}
}

function textboxFocus( elementName )
{
	var element;
		
	element=FindElement(elementName, 'input');
		
	if( element != null )
	{
		element.focus();
		element.select();
	}
}

function inputFocus( elementName )
{
	var element;
		
	element=FindElement(elementName, 'input');
		
	if( element != null )
	{
		element.focus();
		element.select();
	}
}

/*
function scriptingCheck()
{		
	var element;

	element = FindElement('tbScriptingCheck', 'input');
	if( element != null )
		element.value = 'true';
}
*/