function initZoekopdracht(keyword) {
  if(keyword == "Zoekopdracht") {
    document.getElementById('search_field').value = "";
  }
}

function checkZoekopdracht(keyword) {
  if(keyword == "") {
    document.getElementById('search_field').value = "Zoekopdracht";
  }
}

function placeFooter()
{
  var viewportheight;
  if(typeof window.innerWidth != 'undefined') { viewportheight = window.innerHeight }
  else if(typeof document.documentElement != 'undefined' && typeof document.documentElement.clientWidth != 'undefined' && document.documentElement.clientWidth != 0) { viewportheight = document.documentElement.clientHeight }
  else { viewportheight = document.getElementsByTagName('body')[0].clientHeight }
  
  var vp = viewportheight;
  var h = document.getElementById('content_main').offsetTop;
  var cc = document.getElementById('content_main').offsetHeight;
  var c = h;
  var f = document.getElementById('footer').offsetHeight;
  var p = 0;
  
  var max = vp-(h+f+p);
  if(cc < max) {
    document.getElementById('content_main').style.height=max+'px'
  }
}

function confirmDelete(p, id, sub)
{
  if (confirm("Weet je zeker dat je dit item wilt verwijderen?")) {
    var newloc = '?p='+p;
    if(sub) {
      newloc=newloc+'&sub='+sub;
    }
    newloc = newloc+'&delete&id='+id;
    window.location = newloc;
  } else {
    return false;
  }
}

function up(p, id, sub)
{
  var newloc = '?p='+p;
  if(sub) {
    newloc=newloc+'&sub='+sub;
  }
  newloc = newloc+'&up&id='+id;
  window.location = newloc;
}

function down(p, id, sub)
{
  var newloc = '?p='+p;
  if(sub) {
    newloc=newloc+'&sub='+sub;
  }
  newloc = newloc+'&down&id='+id;
  window.location = newloc;
}
