/*
PROGRAM ID: routine.js
DESCRIPTION: Javascript routine functions.
AUTHOR: Simon Chan
DATE: 20/07/2001
VERSION NO: 1.0 
PARAMETERS: NA
RETURN: NA
COMMENTS: 
  1. Perform generic functions like populating country, business, profession, number of accounts select boxes, opening a popup window and maximizing a window.

Author: Dale Goh
DATE : 08/05/2004
VERSION NO: 1.1
CHANGES: Added new generic function for populating SourceOfInfo
*/

<!--
function populateCountry(usertype, countryValue){
  for (var idx=0; idx<document.frmSubDetails.Country.length; idx++){
    if (document.frmSubDetails.Country.options[idx].value == countryValue){
      document.frmSubDetails.Country.options[idx].selected = true;
      return true;     
    }
  }
  return false;     
}

function populateSourceOfInfo(usertype, SourceOfInfoValue){
  for (var idx=0; idx<document.frmSubDetails.SourceOfInfo.length; idx++){
    if (document.frmSubDetails.SourceOfInfo.options[idx].value == SourceOfInfoValue){
      document.frmSubDetails.SourceOfInfo.options[idx].selected = true;
      return true;     
    }
  }
  return false;     
}

function populateBusiness(usertype, businessValue){
  for (var idx=0; idx<document.frmSubDetails.Business.length; idx++){
    if (document.frmSubDetails.Business.options[idx].value == businessValue){
      document.frmSubDetails.Business.options[idx].selected = true;
      return true;     
    }
  }
  return false;
}
function populateProfession(usertype, professionValue){
  for (var idx=0; idx<document.frmSubDetails.Profession.length; idx++){
    if (document.frmSubDetails.Profession.options[idx].value == professionValue){
      document.frmSubDetails.Profession.options[idx].selected = true;
      return true;     
    }
  }
  return false;
}
function populateNumberofAcct(numAcctValue){
  for (var idx=0; idx<document.frmSubDetails.NumberOfAcct.length; idx++){
    if (document.frmSubDetails.NumberOfAcct.options[idx].value == numAcctValue){
      document.frmSubDetails.NumberOfAcct.options[idx].selected = true;
      return true;     
    }
  }
  return false;
}
function displaywindow(url, target) {
  window.open(url,target,"menubar=0,scrollbars=1,resizable=1,toolbar=0,location=0,directories=0,status=0,height=600,width=800");
  return false;
}
function maximiseWindow(){
  window.moveTo(0,0); 
  var isIE = document.all?true:false;
  var isNS = document.layers?true:false;
  if (isIE) { window.resizeTo(screen.availWidth,screen.availHeight); } 
  if (isNS) { window.outerHeight = screen.availHeight; window.outerWidth = screen.availWidth; } 
}
//-->
