var mydom, mywidth, myheight;

mywidth = screen.width;
myheight = screen.height;

myctrl = 0;


if (document.all)
  mydom = "ie";
else {
  if (document.documentElement)
    mydom = "w3c";
  else
    mydom = "n";
}

function chkRemove() {
  return confirm("OK to remove?");
}

function chkUnlink() {
  return confirm("OK to unlink?");
}

function chkUploadQuery() {
  return confirm("OK to upload query?");
}
function activateCtrl(val) {
  myctrl = val;
}
function chkUtils() {
  val = myctrl;
  if (myctrl) {
    myctrl = 0;
    switch (val) {
      case 1:
        msg = "OK to delete?";
        break;
      case 2:
        msg = "OK to add?";
        break;
      case 3:
        msg = "OK to restore?";
        break;
      case 4:
        msg = "OK to replace?";
        break;
      case 5:
         msg = "OK to execute?";
         break;
      case 6:
         msg = "OK to dump?";
         break;
      default:
        msg = "OK to procede?";
        break;
    }
    return confirm(msg);
  }
  return true;
}

function chkLogin() {
var theus, thepw, theform;

  switch(mydom) {
    case "ie":
    case "w3c" :
      theus = document.getElementById("us");
      thepw = document.getElementById("pw");
      theform = document.getElementById("login");
      if (theus.value == "") {
        alert("Username has to be specified!");
        theus.focus();
      } else {
        if (thepw.value == "") {
          alert("Password must be specified!");
          thepw.focus();
        } else
          theform.submit();
      }
      break;
    case "n":
      theus = document.login.us;
      thepw = document.login.pw;
      theform = document.login;
      break;
  }
}
