function runAlert(hasAlert,alertMessage)
{
	if (hasAlert == "True")
		alert(alertMessage);

	//if (hasAlert == "True" || hasAlert == "False")
	//	alert("test" + alertMessage);
}
		
function Trim(inputString) 
{
	// Removes leading and trailing spaces from the passed string. If something besides
	// a string is passed in (null, custom object, etc.) then return the input.
	if (typeof inputString != "string") 
	{ 
		return inputString; 
	}
	
	var retValue = inputString;
	var ch = retValue.substring(0, 1);
	
	while (ch == " ") 
	{ 
		// Check for spaces at the beginning of the string
		retValue = retValue.substring(1, retValue.length);
		ch = retValue.substring(0, 1);
	}
  
	ch = retValue.substring(retValue.length-1, retValue.length);
	while (ch == " ") 
	{ 
		// Check for spaces at the end of the string
		retValue = retValue.substring(0, retValue.length-1);
		ch = retValue.substring(retValue.length-1, retValue.length);
	}
  
	return retValue; // Return the trimmed string back to the user
}
	
function FixHTML(inputString)
{
	// Eliminates possible HTML tags by inserting spaces
	if (typeof inputString != "string") 
	{ 
		return inputString; 
	}
	
	if((inputString.indexOf("&")!=-1)||(inputString.indexOf("<")!=-1))
	{
		exp1 = new RegExp("&");
		exp2 = new RegExp("&  ");
		exp3 = new RegExp("<");
		exp4 = new RegExp("<  ");
		
		inputString = inputString.replace(exp1,"& ");
		inputString = inputString.replace(exp2,"& ");
		inputString = inputString.replace(exp3,"< ");
		inputString = inputString.replace(exp4,"< ");
	}
	
	return inputString;
}

