//alert('custom functions: Present.');
//
//Clear the window status bar messgae.
function ClearStatusBar()
{
	window.status = "";
}
//
//Set the window status bar message.
function SetStatusBar(pMessage)
{
	window.status = pMessage;
	return true;
}
//
//re-direct the current window content to load from a new URL.
function re_direct(sURL)
{
  window.location.href = sURL
}
//
//Determine if the vallue passed is empty.
function IsValueEmpty(pValue)
{
  //var trimmedValue = Trim(pValue);
  return ((pValue == null) || (pValue.length < 1));
}
//
//Get a more browser-friendly elment id.
function cmz_GetElementByID(pID){ 
  var element = null; 

  //Relevant, but not as effective.
  //if (isMozilla || isIE5) 
  //  element = document.getElementById(pID) 
  //else if (isNetscape4) 
  //  element = document.layers[pID] 
  //else if (isIE4) 
  //  element = document.all[pID]; 
  if (document.getElementById)
	{
		element = document.getElementById(pID);
	}
	else if (document.layers)
	{
		element = document.layers[pID]; 
	}
	else
	{
		element = document.all[pID];
	}
  return element; 
}
//
//Pause the web page execution with the amount of seconds specified.
function pause_page(pSeconds) 
{
  var date = new Date();
  var curDate = null;
	
  do 
	{ 
	  var curDate = new Date(); 
	} while((curDate-date) < (pSeconds*1000));
}
//
//Determine if the given value is present in the array provided.
function ValueInArray(pArray, pValue)
{
  var bResult = false;
  for (var iLoop = 0; iLoop < pArray.length; iLoop++)
	{
	  if (pArray[iLoop].Code == pValue) 
		{
		  bResult = true;
			break;
		}
	}
	return bResult;
}
//
//Replace leading, ending and double spaces
function trim(inputString) {
  return inputString.replace (/\s/g, "");
}
//
//Verify that the passed value is valid to use as an organization ID.
function IsValidOrganizationID(pValue)
{
  var reValidChar = /\d/;
  var upperValue = trim(pValue.toUpperCase());
  if ((upperValue.indexOf(";") > -1) ||	(upperValue.indexOf("DELETE ") > -1) ||	(upperValue.indexOf("UPDATE ") > -1) ||
	(upperValue.indexOf("INSERT ") > -1) || (upperValue.indexOf("ALTER ") > -1) || (upperValue.indexOf("CREATE ") > -1) ||
	(upperValue.indexOf("GRANT ") > -1) ||	(upperValue.indexOf("TRUNCATE ") > -1) || (upperValue.indexOf("REVOKE ") > -1) ||
	(upperValue.indexOf("@@") > -1) || (upperValue.indexOf("SELECT ") > -1) ||	(upperValue.indexOf("DBCC ") > -1) ||
	(upperValue.indexOf("=") > -1) || (upperValue.indexOf("%") > -1)  || (upperValue.indexOf("'") > -1) ||
	(!reValidChar.test(upperValue)))
  {
	alert("Invalid organization ID entered: "+pValue);
	return false;
  }
  else
  {
	return true;
  }
}
//END