function saveProces(user,proces){
    window.procesframe.location.href="saveProces.asp?user="+user+"&proces="+proces
}
function saveMarkt(user,markt){
    window.procesframe.location.href="saveMarkt.asp?user="+user+"&markt="+markt
}
function saveMateriaal(user,materiaal){
    window.procesframe.location.href="saveMateriaal.asp?user="+user+"&materiaal="+materiaal
}
function saveTool(user,tool){
    window.saveframe.location.href="saveTool.asp?user="+user+"&tool="+tool
}
function saveActie(user, stapID) {
    //alert('user = '+ user +' en stapID = '+ stapID);
    window.saveframe.location.href="saveActie.asp?user="+user+"&stapID="+stapID;
}

function verwijderTool(user, tool) {
    window.procesframe.location.href="saveTool.asp?user="+user+"&tool="+tool+"&weg=true";
}

function verwijderActie(user, stapID) {
    window.procesframe.location.href="saveActie.asp?user="+user+"&stapID="+stapID+"&weg=true";
}

function makeprocesstring(i){
var processtring = "0"
  for (var e = 0; e < document.frmProces.elements.length; e++) {
    var field = document.frmProces.elements[e];
    if (field.name = "cbproces") {
      if (field.checked == true) {
        processtring = processtring +"," +field.value
        document.frmProces.processtring.value = processtring
      }
    }
  }
  document.frmProces.processtring.value = processtring
  if (i >0) {
      //alleen geselecteerde processen verkennen
      processtring += "&select=true";
  } else {
      processtring += "&select=false";
  }
  window.location.href="tools.asp?processtring="+processtring
}

function fnOpenModal(href){
    var href = "logon_popup.asp?first=True"
    var r =  window.showModalDialog(href, "wlogin", 'dialogWidth:400px;dialogHeight:250px;center:1;')
    if (r==true) {
        window.location.reload();
    } else {
        return false;
    }
}

function NewWindow(mypage,myname,w,h,scroll) {
    var win = null;
    LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
    TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
    settings ='height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',resizable';
    win = window.open(mypage,myname,settings);
    win.focus();
}

function cancelLink() {
    if (window.event.srcElement.tagName == "A" || window.event.srcElement.tagName == "IMG")
       window.event.returnValue = false;
}

