//---------------------------------------------------------------
// Copyright (c) 2000-2003 Asset Web Design. All rights reserved.
// Pearland, Texas 77581
// 281-412-3539
// www.asset-web.com
//
// 10-11-2003
//---------------------------------------------------------------


// check for frame ----------------------------------------------
//---------------------------------------------------------------

if (top.location.href != window.location.href)
  {
  top.location.href = window.location.href;
  }


// disable mouse select -----------------------------------------
//---------------------------------------------------------------

function SelectDisable (e)
  {
  // disable
  return false;
  }


function SelectEnable ()
  {
  // enable
  return true;
  }


//if IE4+
document.onselectstart = new Function ("return false")

//if NS6
if (window.sidebar)
  {
  document.onmousedown = SelectDisable;
  document.onclick = SelectEnable;
  }


// disable right mouse click ------------------------------------
//---------------------------------------------------------------

var message = "Bad!";
document.oncontextmenu = new Function ("return false");

if (isIE)
  {
  document.onmousedown = IEMouseDown;
  }

if (isNS)
  {
  document.captureEvents (Event.MOUSEDOWN);
  document.onmousedown = NSMouseDown;
  }


function IEMouseDown ()
  {
  if (event.button == 2 || event.button == 3)
    {
    // alert (message);
    return false;
    }
  }


function NSMouseDown (e)
  {
  if (e.which == 2 || e.which == 3)
    {
    // alert (message);
    return false;
    }
  }


// disable control keys -----------------------------------------
//---------------------------------------------------------------

var sMessage2 = "Control keys functions are not available on this page.";

if (isIE)
  {
  document.onkeydown = IEKeyDown;
  }

if (isNS)
  {
  if (isNS4) 
    {
    document.captureEvents (Event.KEYPRESS);
    document.onkeypress = NS4KeyDown;
    }

  if (isNS6up) 
    {
    document.captureEvents (Event.KEYPRESS);
    document.onkeypress = NS6KeyDown;
    }
  }


function IEKeyDown (DnEvents)
  {
  var iKey;
  var bOK = true;

  // read
  iKey = window.event.keyCode;

  // test
  if (window.event.altKey)
    {
    }

  if (window.event.ctrlKey)
    {
    // ctrl-a
    if (iKey == 65)
      {
      // alert (sMessage2);
      bOK = false;
      }

    // ctrl-c
    if (iKey == 67)
      {
      // alert (sMessage2);
      bOK = false;
      }
    }

  if (window.event.shiftKey)
    {
    }

  return bOK;
  }


function NS4KeyDown (e)
  {
  var iKey;
  var bOK = true;

  // read
  iKey = e.which;

  if (e.modifiers & Event.ALT_MASK)
    {
    }

  if (e.modifiers & Event.CONTROL_MASK)
    {
    // no control keys
    alert (sMessage2);
    bOK = false;
    }

  if (e.modifiers & Event.SHIFT_MASK)
    {
    }

  if (e.modifiers & Event.META_MASK)
    {
    }

  return bOK;
  }


function NS6KeyDown (e)
  {
  var iKey;
  var bOK = true;

  // read
  iKey = e.which;

  // test
  if (e.altKey)
    {
    }

  if (e.ctrlKey)
    {
    // ctrl-a
    if (iKey == 97)
      {
      // alert (sMessage2);
      bOK = false;
      }

    // ctrl-c
    if (iKey == 99)
      {
      // alert (sMessage2);
      bOK = false;
      }
    }

  if (e.shiftKey)
    {
    }

  if (e.metaKey)
    {
    }

  return bOK;
  }


