/*
********************************************************************
JavaScript functions common to most web pages

Author: Wayne Tooze

Date: 25/05/2005

Further Details:

Change History
--------------

Date:     Who:  Change Description:
--------  ----  ----------------------------------------------------

********************************************************************
*/
/* ----------------------------------------------------------------------------------
   Function Name: openBrWindow
   
   Details: Opens a new browser window
   
   In Parameters: strURL - URL
                  winName - Window name
                  features - Window features
   ---------------------------------------------------------------------------------- */

function openBrWindow(strURL,winName,features) {
  var win = window.open(strURL,winName,features);
  
  // Open the browser window and give it focus
  win.self.focus();
}


/* ----------------------------------------------------------------------------------
   Function Name: UserConfirm
   
   Details: Common function which asks the operator to confirm his navigational
            choice! If a page that updates data is chosen this can be used to get the
            user to confirm the choice
   
   In Parameters: msg - Message to be displayed
                  HRef - Hyperlink to be called
   ---------------------------------------------------------------------------------- */

function UserConfirm(msg, Href){
  if (confirm(msg)) 
    location.href = Href;

}


/* ----------------------------------------------------------------------------------
   Function Name: goLocation
   
   Details: Go to the URL passed in (within the current window)
   
   In Parameters: strURL - The full URL
   ---------------------------------------------------------------------------------- */

function goLocation(strURL) {
    location.href = strURL;  
}


/* ----------------------------------------------------------------------------------
   Function Name: giveFieldFocus

   Details: Gives a form element (like a text box) focus. The perfect solution if you
            want to place a cursor inside the first field on the page 
            
   In Parameters: strForm - Form name
                  strField - Field name
      ---------------------------------------------------------------------------------- */

function giveFieldFocus(strForm,strField) {
  eval('document.' + strForm + '.' + strField + '.focus()');
}