/*
* @(#)globalEvents.js $Revision: 1.9 $ $Date: 2006/12/04 04:55:01 $
*
* Copyright Navis Corporation 2003
* All Rights Reserved
*
* Confidential Information of Navis Corporation
* Unauthorized use is strictly prohibited
*
* This work contains valuable confidential proprietary trade secret
* information of Navis Corporation and is protected by specific
* agreements and federal copyright. This work or any part thereof
* may not be disclosed, transmitted, copied, or reproduced in any
* form or medium without prior written authorization from Navis
* Corporation.
*/

/************************************************************************/
/**** The following script is used to contain page-level event       ****/
/**** bindings.                                                      ****/
/****                                                                ****/
/************************************************************************/
/****                                                                ****/
/**** This file depends upon the following JavaScript files:         ****/
/****   -none                                                        ****/
/****                                                                ****/
/************************************************************************/

var doc = document;

doc.onmouseover = docOver;
doc.onmouseout = docOut;
doc.onclick = docClick;
doc.onmousedown = docDown;
doc.onmouseup = docUp;
doc.oncontextmenu = docContextMenu;
window.onload = winOnload;

function docOver()
{
  //var el = window.event.srcElement;
  //if (el && el.tagName == "IMG") swapImgOver();
}

function docOut()
{
  //var el = window.event.srcElement;
  //if (el && el.tagName == "IMG") swapImgOut();
}

function docClick(e)
{
  var e = getEvent(e);
  if (top.window.resetButton) top.window.resetButton(); //close all menus in menubar
  if (window.LovsArray && window.LovsArray.length > 0 && LovPageClick) LovPageClick(e);  //hide LOVS using autocomplete
  //if (top.window.frames.length > 0 && top.window.frames('contentFrame').hideContextMenu) top.window.frames('contentFrame').hideContextMenu();
  if(window.calendarDocumentClick) calendarDocumentClick();
  if(window.closeLayer) closeLayer(); //popuplayer
  if(window.handleDocumentClick) handleDocumentClick(e); //og calendar
}

function docDown()
{
  //var el = window.event.srcElement;
  //if (el && el.tagName == "IMG") swapImgDown();
}

function docUp()
{
  //var el = window.event.srcElement;
  //if (el && el.tagName == "IMG") swapImgUp();
}

function docContextMenu()
{
  //if (top.window.frames.length > 0 && top.window.frames('contentFrame').hideContextMenu) top.window.frames('contentFrame').hideContextMenu()  
}

function winOnload()
{
  //initialize objects
  if(window.verifyCompliance) verifyCompliance();    //test for browser compliance
  if(window.initModal) initModal();                  // modal dialog
  if(window.initToolTip) initToolTip();              //tooltip
  if(window.initMenu) initMenu();                    //menu
  if(window.initCalendar) initCalendar();            //calendar widget
  if(window.doCalendar) doCalendar();            		 // OG calendar widget
  if(window.initHandlers) initHandlers();            //status message watcher
  if(window.initLovs) initLovs();                    //initialize dynamic lovs
  if(window.focusFieldId) focusField(window.focusFieldId);
  if(window.initPage) initPage();                    //any page can include a proprietary initPage() function
  if(window.initIt) initIt();												 // WebAccess onload init
  if(window.setPagingButtons) setPagingButtons();      //enable/disable paging buttons if the fuction exists.
}

