﻿function getObj(ID){return document.getElementById(ID)}
function txtVal(ID){return getObj(ID).value}

function nocontextmenu() {
  event.cancelBubble = true;
  event.returnValue  = false;
  return false;
}

function norightclick(e) {
  if (window.Event)   {
    if (e.which == 2 || e.which == 3) return false;
  }
  else if (event.button == 2 || event.button == 3)  {
    event.cancelBubble = true;
    event.returnValue  = false;
    return false;
  }
}

function openWindow(url,w,h,name)
{
	var posL=(screen.width-w)/2, posT=(screen.height-h)/2;	
	var winatur='top='+posT+',left='+posL+'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,copyhistory=no,width='+w.toString()+',height='+h.toString();
	var winUID=window.open(url,name,winatur);
	winUID.focus();
}

if (window.Event) {
	window.document.captureEvents(Event.MOUSEUP)
}

if (window.document.layers) {
	window.document.captureEvents(Event.MOUSEDOWN)
}

window.document.oncontextmenu = nocontextmenu;
window.document.onmousedown   = norightclick;
window.document.onmouseup     = norightclick;

