//document.onmousedown = click;
//document.oncontextmenu = click;

if (document.layers)
{
   document.captureEvents(Event.MOUSEDOWN);
}

function click(e)
{
   if (document.all)
   {
      if (event.button==0||event.button==2||event.button==3||event.keyCode == 13)
      {
         event.cancelBubble = true
         event.returnValue = false;
         return false;
      }
   }
   if (document.layers)
   {
      if (e.which == 3 || e.which == 13)
      {
         return false;
      }
   }
}


function openModalWindow(url, w, h, wname){
  if (document.all&&window.print) {
    eval('window.showModelessDialog(url,wname,"help:0;resizable:0;dialogWidth:'+w+'px;dialogHeight:'+h+'px")');
  } else {
    eval('window.open(url,wname,"width='+w+'px,height='+h+'px,resizable=0,scrollbars=0")');
  }
}

function openWindow(url, w, h, wname){
    winl = (screen.width - w) / 2;
    wint = (screen.height - h) / 2;
    param = "width=" + w + "px,height=" + h + "px,resizable=0,scrollbars=1,top=" + wint + ",left=" + winl;
    window.open(url,wname,param);
}

function openWindowNoScroll(url, w, h, wname){
  var winHandle = null;
  winl = (screen.width - w) / 2;
  wint = (screen.height - h) / 2;
  param = "width=" + w + "px,height=" + h + "px,resizable=0,scrollbars=0,top=" + wint + ",left=" + winl;
  winHandle = window.open(url,wname,param);
  return winHandle;
}

function openWindowNoScrollResizable(url, w, h, wname){
  var winHandle = null;
  winl = (screen.width - w) / 2;
  wint = (screen.height - h) / 2;
  param = "width=" + w + "px,height=" + h + "px,resizable=1,scrollbars=0,top=" + wint + ",left=" + winl;
  winHandle = window.open(url,wname,param);
  return winHandle;
}


function openWindowNoScrollBottom(url, w, h, wname){
  var winHandle = null;
  winl = (screen.width - w) / 2;
  wint = (screen.height - h);
  wint -= 140;
  param = "width=" + w + "px,height=" + h + "px,resizable=0,scrollbars=0,top=" + wint + ",left=" + winl;
  winHandle = window.open(url,wname,param);
  return winHandle;
}

function closePop() {
    self.close();
}

function screenSize(w, h) {
    winl = (screen.width - w) / 2;
    wint = (screen.height - h) / 2;

  window.resizeTo(w,h);
  window.moveTo(wint,winl);
}

function openWindow2(url, w, h, wname){
    //param = "width=" + w + "px,height=" + h + "px,resizable=0,scrollbars=1,top=" + wint + ",left=" + winl;
   	window.open(url,wname,"titlebar=0,resizable=yes,toolbar=no,status=no,menubar=no,scrollbars=yes,width=" + w + ",height=" + h);
}
