/*****************************************************************/
/* This script function determines the browser used by the       */
/* visitor                                                       */
/*****************************************************************/

var agt = navigator.userAgent.toLowerCase();
var is_major = parseInt(navigator.appVersion);
var is_minor = parseFloat(navigator.appVersion);
var is_nav = ((agt.indexOf('mozilla') != -1) && (agt.indexOf('spoofer') == -1) && (agt.indexOf('compatible') == -1) && (agt.indexOf('opera') == -1) && (agt.indexOf('webtv') == -1));
var is_ie = (agt.indexOf('msie') != -1);


if (is_ie)
{
var agt_ie = agt.substring(agt.indexOf('msie') + 5);

  is_major = parseInt(agt_ie);
  is_minor = parseFloat(agt_ie);
}

var is_dom2 = (document.getElementById);
var is_http = (window.location.protocol.indexOf('http') == 0);


function ShowWarehouseMap(blnShow)
{
var imgWarehouseMap = document.getElementById("WarehouseMap");
var spanShowMap = document.getElementById("ShowWarehouseMap");
var spanHideMap = document.getElementById("HideWarehouseMap");

  imgWarehouseMap.style.display = blnShow ? "block" : "none";
  spanShowMap.style.display = blnShow ? "none" : "inline";
  spanHideMap.style.display = blnShow ? "inline" : "none";
}

/*****************************************************************/
/* This script function captures the right click and displays a  */
/* message box instead of the default context menu               */
/*****************************************************************/

function CaptureRightClick(e)
{
  if (navigator.appName == 'Netscape' && (e.which == 3 || e.which == 2)) return false;
  else if (navigator.appName == 'Microsoft Internet Explorer' && (event.button == 2 || event.button == 3))
  {
    alert("Welcome to mfa/erongs, Inc.\n\nLocation: http://www.mfaeronga.com\nContact: srosenthal@mfa-eronga.com");
    return false;
  }
  return true;
}


/*****************************************************************/
/* This script function positions item ItemID at the specified   */
/* x and y coordinates XPos and YPos                             */
/*****************************************************************/

function PositionItem(ItemID, XPos, YPos)
{
  if (is_dom2 && document.getElementById(ItemID))
  {
  var e = document.getElementById(ItemID);

    e.style.left = XPos + "px";
    e.style.top = YPos + "px";
  }
  else if (is_ie && is_major >= 4 && eval("document.all." + ItemID))
  {
  var e = eval("document.all." + ItemID);

    e.style.left = XPos + "px";
    e.style.top = YPos + "px";
  }
  else if (is_nav && is_major >= 4 && eval("document." + ItemID))
  {
  var e = eval("document." + ItemID);

    e.left = XPos;
    e.top = YPos;
  }
}


/*****************************************************************/
/* This script function opens a window at the specified position */
/*****************************************************************/

function OpenWindow(WindowName, XPos, YPos, WindowWidth, WindowHeight)
{
var strWindowStyle;

  strWindowStyle = "toolbar = no";
  strWindowStyle = strWindowStyle + ", location = no";
  strWindowStyle = strWindowStyle + ", directories = no";
  strWindowStyle = strWindowStyle + ", status = no";
  strWindowStyle = strWindowStyle + ", scrollbars = no";
  strWindowStyle = strWindowStyle + ", left = " + XPos;
  strWindowStyle = strWindowStyle + ", top = " + YPos;
  strWindowStyle = strWindowStyle + ", width = " + WindowWidth;
  strWindowStyle = strWindowStyle + ", height = " + WindowHeight;

  window.open(WindowName, "", strWindowStyle);
}


