// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
//
// api_Common.js
//
// These are CLIENTSIDE JavaScript functions that help us on a "common" basis. For example
// opening new windows, setting focus to windows, cookie stuff...
//
// sections : 
//   SECTION I   = Window Functions
//   SECTION II  = Date / Time Functions
//   SECTION III = Cookie
//   SECTION IV  = Misc Functions
//
// created  : 02.14.00
// updated  : 02.14.00
//
// notes    : 2/14/00 JMB - Today i started the commenting standard...
//            2/14/00 JMB - Split the file up into III sections...
//            7/12/00 JMB - Added Misc Functions
//
//
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++


//
//
// SECTION I 
//
//
// //////////////////////////////////////////////////////////////////////////////////////////////
//
// Window Functions
//
// These functions operate, and manipulate popup windows or any browser window you specify..
//
//
//
// //////////////////////////////////////////////////////////////////////////////////////////////


// JS PROPERTY ***********************************************************************************
//
// window.focus()
//
// This IF-BLOCK takes care of focusing the Popup windows. if there is an opener (parent), then
// set the focus()....
//
// input  : none
//
// output : none
//
// **********************************************************************************************
if(window.opener)
{
 window.focus();
}


// JS PROPERTY ***********************************************************************************
//
// onunload=??
//
// This will set the onunload to call refresh list. common on popups that maintain lists below..
//
// input  : none
//
// output : none
//
// **********************************************************************************************
//if(opener){ if(opener.RefreshList){ window.onunload = window.opener.RefreshList; }}


// FUNCTION *************************************************************************************
//
// PopupWindow
//
// This function pops-up a window of size w and h...
//
// input  : url [string], width [number], height [number], windowName [string], 
//          allowScrolling [boolean]
//
// output : funcWindow [object]
//
// **********************************************************************************************
function PopupWindow(page, width, height, windowName, allowScrolling, useModal) 
{ 
 scrollFlag     = (allowScrolling) ? "yes" : "no";
 openParameters = "width="+width+",height="+height+",resizable=yes,scrollbars="+scrollFlag+",menubars=no,toolbar=no,directories=no";

 funcWindow = window.open(page, windowName, openParameters);
 
 funcWindow.focus();

 //return funcWindow;
} 



// FUNCTION *************************************************************************************
//
// Redirect
//
// This function redirects to a url specified using the location.href object...
//
// input  : URL [string]
//
// output : none
//
// **********************************************************************************************
function Redirect(URL)
{ 
 if(URL != "")
 {
   window.location.href=URL;
 }
}



//
//
// SECTION III
//
//



//
//
// SECTION IV
// ----------
//
//
// //////////////////////////////////////////////////////////////////////////////////////////////
//
// Misc Functions
// 
// This section holds all general things...
// 
// //////////////////////////////////////////////////////////////////////////////////////////////



// -- IE ONLY
// onkeypress, returns the item if it is a digit! :)
//
function IsDigit()
{ 
  return ( (event.keyCode >= 48) && (event.keyCode <= 57) || (event.keyCode ==46)); 
}


