// LIB v1.0 J.P. Buuron

var chSesfid = "";

/* CUSTOM FUNCTIE VOOR UITLOGGEN */

function fuUitloggen() {
  // clear sess
  chSesfid= "";
  // load startpage
  document.location.replace('/asp/appmain.asp?appactie=lg_start');
}


// LIB FUNCTIONS
function fuCallUrl(pichFrm,pichUrl,pichRefresh) {
  //if( pichRefresh ) alert( 'pichRefresh! = ' + pichRefresh );
  var chKoppel, chCmd, inPos;
  
  var inPos = pichUrl.indexOf("?");
  if (inPos != -1) { chKoppel = '&' } else { chKoppel = '?'; }
  
  //if (pichRefresh) {
  //  chCmd = pichFrm + ".document.location.replace('" + pichUrl + chKoppel + "sesfid=" + chSesfid + "')";
  //  eval(chCmd);    
  //} 
  //else {
  //  chCmd = pichFrm + ".document.location.href = '" + pichUrl + chKoppel + "sesfid=" + chSesfid + "'";
  //  eval(chCmd);
  //}
  
  location.href = pichUrl;
  
  
}

function fuOpenWindow(pichUrl,piinWidth,piinHeight) {
  var chKoppel, chCmd, inPos;
  
  var inPos = pichUrl.indexOf("?");
  if (inPos != -1) { chKoppel = '&' } else { chKoppel = '?'; }  
  
  chCmd = "window.open('" + pichUrl + chKoppel + "sesfid=" + chSesfid + "','NieuwWindow','width=" + piinWidth + ",height=" + piinHeight + "');"
  alert(chCmd);
  eval(chCmd);  
}


function fuSetHidden(pichField) {
 
  var chCmd, retvalue, test;
  chCmd = pichField;
  eval(chCmd);
  return true;
  
}


function fuCheckSessie() {
  if (chSesfid == "") {
    return false;
  } 
  else {
    return true;
  }
}

// MCW Afvangen refresh (F5) refresh sessie
function fuRefreshSessie(pichSessie) {
  chSesfid = pichSessie;
}

