function hp_dn(a)
{
    return false
}
//-------------
function hp_cm()
{
    return false
}
//--------------------
function hp_de(e)
{
    //alert(e.target.tagName);
    return(e.target.tagName!=null&&e.target.tagName.search('^(INPUT|TEXTAREA|BUTTON|SELECT)$')!=-1)
};
//-------------------
function hp_md(e)
{
  mac=navigator.userAgent.indexOf('Mac')!=-1;
  if(document.all)
  {
    if(event.button==2||(mac&&(event.ctrlKey||event.keyCode==91)))
    {
      return(false)
    }
  }
  else
  {
    if(e.which==3||(mac&&(e.modifiers==2||e.ctrlKey)))
    {
      return false
    }
    else if(e.which==1)
    {
      window.captureEvents(Event.MOUSEMOVE);
      window.onmousemove=hp_dn
    }
  }
}
//----------------------
function hp_mu(e)
{
  if(e.which==1)
  {
    window.releaseEvents(Event.MOUSEMOVE);
    window.onmousemove=null
  }
}
//----------------------
if(navigator.appName.indexOf('Internet Explorer')==-1||(navigator.userAgent.indexOf('MSIE')!=-1&&document.all.length!=0))
{
  if(document.all)
  {
    mac=navigator.userAgent.indexOf('Mac')!=-1;

    version=parseFloat('0'+navigator.userAgent.substr(navigator.userAgent.indexOf('MSIE')+5),10);
    if(!mac&&version>4)
    {
      document.oncontextmenu=hp_cm
    }
    else
    {
      document.onmousedown=hp_md;
      document.onkeydown=hp_md;
    }
    document.onselectstart=hp_dn
  }
  else if(document.layers)
  {

    window.captureEvents(Event.MOUSEDOWN|Event.modifiers|Event.KEYDOWN|Event.MOUSEUP);
    window.onmousedown=hp_md;window.onkeydown=hp_md;
    window.onmouseup=hp_mu
  }
  else if(document.getElementById&&!document.all)
  {
    document.oncontextmenu=hp_cm;document.onmousedown=hp_de
  }
}
