<!--
  //NOTICE: Remember to Load strings.js before using any functions in this script!
  function retChk(objName, iChkType, bChkEmpty) {
    var strValidString;
    var iTemp;
    var bValid = true;
    var bEmpty;

    //Check for valid characters
    if (iChkType > 0) {
      strValidString = retType(iChkType);
      if (objName.value.length > 0) {
        if (Trim(objName.value) != "") {      
          for (var i=0; i<objName.value.length; i++) {
            iTemp = "" + objName.value.substring(i, i+1);
            if (strValidString.indexOf(iTemp) == "-1") {
              bValid = false;
              break;
            }  
          }
      
          if (!bValid) {
            switch (iChkType) {
            case 1:
              alert ("Please key in only characters [A-Z].");
              break;
            case 2:
              alert ("Please key in only characters [a-z].");
              break;
            case 3:
              alert ("Please key in only characters [A-Z] and numbers [0-9].");
              break;
            case 4:
              alert ("Please key in only characters [a-z] and numbers [0-9].");
              break;
            case 5:
              alert ("Please key in only characters [A-Z] & [a-z].");
              break;
            case 6:
              alert ("Please key in only characters [A-Z] & [a-z] and space.");
              break;
            case 7:
              alert ("Please key in only characters [A-Z] & [a-z] and numbers [0-9].");
              break;
            case 8:
              alert ("Please key in only characters [A-Z] & [a-z], numbers [0-9] and space.");
              break;
            case 9:
              alert ("Please key in only characters [A-Z] & [a-z], numbers [0-9], space and typical symbols.");
              break;
            case 10:
              alert ("| are not allowed");
              break;
            case 50:
              alert ("Please key in only numbers [0-9].");
              break;
            case 51:
              alert ("Please key in only numbers [0-9] and full stop.");
              break;
            case 52:
              alert ("Please key in only numbers [0-9], space, -, (, ).");
              break;
            case 53:
              alert ("Please key in valid email address.");
              break;
            }  
          }
        }  
        else {
          bEmpty = true;
        }  
      }
      else {
        bEmpty = true;
      }
    }  

    //Check for empty    
    if (bValid) {
      if (bChkEmpty) {
        bValid = bEmpty?false:true;
        if (!bValid) {
          alert ("Please do not leave this field empty.");
        }  
      }  
    }

    if (bValid)
      return (true);
    else {
      objName.focus();
      objName.select();
      return (false);
    }
  }

  function retType(type) {
    switch (type) {
    case 1:
      //A to Z
      return ("ABCDEFGHIJKLMNOPQRSTUVWXYZ");
    case 2:
      //a to z
      return ("abcdefghijklmnopqrstuvwxyz");
    case 3:
      //A to Z, 0 to 9
      return ("ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789");
    case 4:
      //a to z, 0 to 9
      return ("abcdefghijklmnopqrstuvwxyz0123456789");
    case 5:
      //A to Z, a to z
      return ("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz");
    case 6:
      //A to Z, a to z and space
      return ("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz ");
    case 7:
      //A to Z, a to z and 0 to 9
      return ("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789");
    case 8:
      //A to Z, a to z, 0 to 9 and space
      return ("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789 ");
    case 9:
      //All the visible characters
      return ("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789 `~!@#$%^&*()-=_+|[]{}:;<>?,.+-/'");
    case 10:
      //All the visible characters except comma
      return ("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789 `~!@#$%^&*()-=_+[]{}:;<>,?.+-/'");
    case 50:
      //integer
      return ("0123456789");
    case 51:
      //decimal
      return ("0123456789.");
    case 52:
      //phone number
      return ("0123456789-() ");
    case 53:
      //email characters
      return ("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789@-_.");
    }  
  }
  
  function chkFileExtension(objName, extenstionType)
  {
  	var boolCorrectExt = false;
	myString = new String(Trim(objName.value));	
	splitString = myString.split(".");
	splitExtType = extenstionType.split(",");
	
	for (i=0; i<splitExtType.length; i++){
		if (splitString[splitString.length-1].toLowerCase() == splitExtType[i]) {			
			boolCorrectExt = true;			
		}
	}
	
	if (!boolCorrectExt){
		alert("File not allowed.");
	}
	
	return boolCorrectExt;				
  }
 
  function openWindow(link)
  {
    window.open(link, "popup", "directory=no,menubar=no,toolbar=no,width=620,height=400,resizable=yes,scrollbars=yes");
  }  
//-->