
//>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>  Client Validation Functions  >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
var Timer;
var focusComponent;

//>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
function ValidString(txtBoxID)
{
	var txtBox = document.getElementById(txtBoxID);
	focusComponent = txtBox;
	//if txtBox = null, it is not displayed (like txtNetworkInfo is not displayed for paper Docs)
	if (txtBox == null) return true;
	var tx = txtBox.value;
	if((tx.indexOf("<")>=0) || (tx.indexOf(">")>=0))
	{ 
		ShowValidStringMessage();
		return false;
	}
	else return true;
}
//>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
function ValidEmpty(txtBoxID)
{
	var txtBox = document.getElementById(txtBoxID);
	focusComponent = txtBox;
	//if txtBox = null, it is not displayed (like txtNetworkInfo is not displayed for paper Docs)
	if (txtBox == null) return true;
	var tx = txtBox.value.toString();
	tx = trimString(tx);
	if((tx == "") || (tx == null))
	{		
		return false;
	}
	else return true;
}
//>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
function ShowValidStringMessage()
{
	var Msg = "Characters: &nbsp;&nbsp;<b>&lt;&nbsp;&nbsp;&gt;</b>&nbsp;&nbsp;" 
		+ "are not allowed as input,<br>(No HTML tags allowed).";
		popMsg(Msg, 300, 60, 100, 100);
}
//###############################################################################
// funct focusTextbox is called in GenMsgHtm.cs right after the message box is closed
function focusTextbox()
{
    Timer = setTimeout("foCus()", 500);
}
//>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
function foCus()
{
if(Timer) clearTimeout(Timer);
try {focusComponent.focus()}
    catch (exceptionObj) { }
try {focusComponent.select()}
    catch (exceptionObj) { }
}
//#############################################################################################
function trimString (str) //JS does not have a 'trim()' method and this is the function to trim strings
{
  str = this != window? this : str;
  return str.replace(/^\s+/g, '').replace(/\s+$/g, '');
}
//#############################################################################################

