<!-- Original Code by:  Kal Chung (kalc.chung@gmail.com) -->
<!-- Version 1.0 June 1, 2004 -->
/* IsEmpty
 *  - Will checked if item is empty or not
 */
function IsEmpty(pItem, pFieldname)
{
   if((pItem.value.length==0)||(pItem.value==null)) 
   { 
      if (pFieldname != '') {
	      alert('The field ' + pFieldname + ' is blank, please enter a valid value');
   	 	  pItem.focus(); 
      }
      return true; 
   } 
	return false;
} 

/* HasSelection
 *  - Will checked if an item was selected
 */
function HasSelection(pItem, pFieldname)
{
   if(pItem.value == 0) 
   { 
      if (pFieldname != '') {
	      alert('Please select a ' + pFieldname + ' from the list');
     	  pItem.focus(); 
      }
      return false; 
   } 
	return true;
} 

/* CheckSize
 *  - Will checked the size of the item
 */
function CheckSize(pItem, pFieldname, pLength)
{
   if(pItem.value.length > pLength) 
   { 
      if (pFieldname != '') {
 	     alert('The field ' + pFieldname + ' has a maximum length of ' + String(pLength));
  	     pItem.focus(); 
  	  }
      return false; 
   } 
	return true;
} 

/* IsNumeric
 *  - Will checked if item is numeric or not
 */
function IsNumeric(pItem, pAlertMsg)
{
   if(isNaN(pItem.value)) 
   { 
      alert(pAlertMsg);
      form.account_number.focus(); 
      return false; 
   } 
	return true;
}
