function popupMoreDetail(urlPopup){
	window.open(urlPopup,'WEBANK','resizable=no, location=no, width=600, height=500, menubar=no, status=no, scrollbars=yes, menubar=no');
}
function openServerInfo () {
	new Ajax.Updater('infoServerId',url,{onComplete:function(){initselectedEntity();}});
}

function writeErrorMessage(id,message){
	document.getElementById(id).innerHTML = "<ul style='color:#FF0000; margin-bottom:4px; font-size:12px;'><li>" + message + "</li></ul>";
}

function writeMessage(id,message){
	if( ' ' == message )
		message = "&nbsp;";
	document.getElementById(id).innerHTML =  message ;
}

function setVisible(elementId) {
	document.getElementById(elementId).className='visible';
}

function hide(elementId) {
	document.getElementById(elementId).className='cache';
}

function trim(str, chars) {
	return ltrim(rtrim(str, chars), chars);
}
 
function ltrim(str, chars) {
	chars = chars || "\\s";
	return str.replace(new RegExp("^[" + chars + "]+", "g"), "");
}
 
function rtrim(str, chars) {
	chars = chars || "\\s";
	return str.replace(new RegExp("[" + chars + "]+$", "g"), "");
}

function isCharDigit( ch )
{
    if ( (ch >= '0') && (ch <= '9') )
      return true;
    else
      return false;
}

 function isCharAlpha( ch )
{
    if ( ((ch >= 'a') && (ch <= 'z')) || ((ch >= 'A') && (ch <= 'Z')) )
      return true;
    else
      return false;
}

function isCharAlphaDigit( ch )
{
    if ( isCharAlpha( ch ) || isCharDigit( ch ) )
      return true;
    else
      return false;
}

function toUpperCase(element) {
	var temp = element.value;
	element.value = temp.toUpperCase();
}

function isStringAlphaDigit( strString )
{
	for (i = 0; i < strString.length ; i++)
	{
    	if ( isCharAlphaDigit(strString.charAt(i)) == false ) 
      		return false;
    }
      return true;
}

function isStringAlpha( strString )
{
	for (i = 0; i < strString.length ; i++)
	{
    	if ( isCharAlpha(strString.charAt(i)) == false ) 
      		return false;
    }
      return true;
}

function isNumeric(strString)
{
   var strChar;
   var blnResult = true;
   var strVChars;
   strVChars = "0123456789";

   if (strString.length == 0) return false;
   for (i = 0; i < strString.length && blnResult == true; i++)
   {
      strChar = strString.charAt(i);
      if (strVChars.indexOf(strChar) == -1)
      {
         blnResult = false;
      }
   }
   return blnResult;
}
