function IEboxremove() {
	if (document.selection) document.selection.empty()
}

function BrowserCheck() {
  var browser = navigator.appName
  if (browser == "Netscape") this.browser = "ns"
  else if (browser == "Microsoft Internet Explorer") this.browser = "ie"
  else this.browser = browser
  this.ver = parseInt(navigator.appVersion)
  this.ns = (this.browser == "ns" && this.ver >= 4)
  this.ns4 = (this.browser == "ns" && this.ver == 4)
  this.ns5 = (this.browser == "ns" && this.ver == 5)
  this.ns6 = (this.browser == "ns" && this.ver == 6)
  this.ie = (this.browser == "ie" && this.ver >= 4)
  this.ie4 = (navigator.userAgent.indexOf('MSIE 4') > 0)
  this.ie5 = (navigator.userAgent.indexOf('MSIE 5') > 0)
  if (this.ie5) this.ver = 5
  this.min = (this.ns || this.ie)
}

var is = new BrowserCheck()

var isLoaded = false

function preload(srcList) {
  if (document.images) {
    var j = 0;
    for (i = 0; i <= (srcList.length / 2); i++) {
      eval(srcList[j]+' = new Image()')
      eval(srcList[j]+'.src = "'+srcList[++j]+'"')
		  j++
	  }
    isLoaded = true
  }
}

function changeImage(layer,imgName,imgObj) {
  if (isLoaded) {
    if (document.layers && layer!=null) eval('document.'+layer+'.document.images["'+imgName+'"].src = '+imgObj+'.src')
	  else document.images[imgName].src = eval(imgObj+".src")
  }
}

function in_array(myArr,value) {
  for (i=0; i<myArr.length; i++) {
    if (myArr[i]==value) {
      return true;
    }
  }
  return false;
}

function dpt_submit(rootpath) {
    document.frm.action = rootpath + 'departments/search/';
    document.frm.submit();
}

function contact_submit(rootpath, menuid) {
    document.frm.action = rootpath + 'contact/?menuid=' + menuid;
    document.frm.submit();
}

function form_reset() {
    if (confirm('Er du sikker?')) {
        document.frm.reset();
    } else {
        return false;
    }
}

function form_submit() {
    document.frm.submit();
}

function popup(url, width, height) {
    popper = window.open(url,'popupwindow','width='+width+',height='+height+',top=0,left=0,scrollbars=yes,resizable');
    popper.focus();
}

function huskmedlemnr(rootpath) {
    if (confirm('Husk at indtaste dit medlemsnummer.\n\nDet er kun medlemmer, som kan søge. Hvis du ikke er medlem, så tryk OK for at blive det.')) {
        document.location.href = rootpath + 'contact/?menuid=1';
    } else {
        document.frm.medlemnr.focus();
    }
}
