<!--  crw 1.16.2008 standard function for retrieving object in any browser, for now -->

function getObjectAnyBrowser(strObjectID)
{
  if( document.getElementById ) // this is the way the standards work
    return document.getElementById( strObjectID );
  else if( document.all ) // this is the way old msie versions work
    return document.all[strObjectID];
  else if( document.layers ) // this is the way nn4 works
    return document.layers[strObjectID];
  else
		return null;
}

// Function to toggle SHOW/HIDE display and hide or display info 
function ToggleInfoDisplay(divName_Show, divName_Hide, divName_Info)
{
//divName_Show is the name of the object that contains the "Show Something" button or text or whatever
//divName_Hide is the name of the object that contains the "Hide Something" button or text or whatever
//divName_Info is the name of the <div> that contains the info to show or hide
    var showit = getObjectAnyBrowser(divName_Show);
    var hideit = getObjectAnyBrowser(divName_Hide);
    var divAbout = getObjectAnyBrowser(divName_Info);
    if (showit.style.display === 'inline')
    {
        showit.style.display = 'none';
        hideit.style.display = 'inline';
        divAbout.style.display = 'block';
    }
    else
    {
        showit.style.display = 'inline';
        hideit.style.display = 'none';
        divAbout.style.display = 'none';
    }
}
/*
Note: I would say that on undefined, null ID string, or control not found the
function should return null, but then you cannot use the function 
in onblur, which needs true or false, apparently, before returning control to the page.
Could be my misunderstanding.  crw 2/20/2008
*/
//crw 2/20/2008
//function to determine whether control exists
//with optional warnings, purposes obvious from text
function objectExists(strObjectID, warningson)
{
	if (typeof strObjectID==="undefined") 	{
		alert ("objectExists: UNDEFINED.  No control ID parameter was supplied.");
		return false;
	}
	if (typeof warningson==="undefined") 	{
		alert ("objectExists: UNDEFINED.  No warningson parameter was supplied.");
		return false;
	}
	if (warningson!==true && warningson!==false) 	{
		alert("objectExists: 'warningson' parameter must receive either true or false.");
		return false;
	}
	if (strObjectID===null || strObjectID.length===0) {
		alert ("objectExists: Control ID parameter is null or empty string.");
		return false;
	}
	//alert("received: '" + strObjectID + "'");
	var c = getObjectAnyBrowser(strObjectID);
	if (c===undefined || c===null) {
		alert("objectExists: No control found with ID='" + strObjectID + "'");
		return false;
	}
	return true;
}

//crw 2/20/2008
//function to determine whether control contains null or empty string
//with optional warnings, purposes obvious from text
function controlContainsNull(strControlID, warningson)
{
	if (warningson!==true && warningson!==false) 	{
		alert("controlContainsNull: 'warningson' parameter must receive either true or false.");
		return false;
	}
	if (objectExists(strControlID, warningson))	{
		var targetControl = getObjectAnyBrowser(strControlID);
		if (targetControl.value===null) 	{
			return true;		
		}
		else {
			return false;
		}
	}
}

//crw 2/20/2008
//function to determine whether control contains empty string
function controlContainsEmptyString(strControlID, warningson)
{
	if (warningson!==true && warningson!==false) 	{
		alert("controlContainsEmptyString: 'warningson' parameter must receive either true or false.");
		return false;
	}
	if (objectExists(strControlID, warningson))	{
		var targetControl = getObjectAnyBrowser(strControlID);
		if (targetControl.value.length===0 || targetControl==="")	{  //is there any possible difference?
			return true;		
		}
		else {
			return false;
		}
	}
}

//crw 2/20/2008
//function to determine whether control contains null or empty string
//with optional warnings, purposes obvious from text
function controlContainsNullOrEmptyString(strControlID, warningson)
{
	if (warningson!==true && warningson!==false) 	{
		alert("controlContainsNullOrEmptyString: 'warningson' parameter must receive either true or false.");
		return false;
	}
	if (objectExists(strControlID, warningson))	{
		var targetControl = getObjectAnyBrowser(strControlID);
		if (targetControl.value===null || targetControl.value.length===0 || targetControl==="")	{
			return true;		
		}
		else {
			return false;
		}
	}
}

