/* LBE */
function externalLinks() {
 if (!document.getElementsByTagName) return;
 var anchors = document.getElementsByTagName("a");
 for (var i=0; i<anchors.length; i++) {
   var anchor = anchors[i];
   if (anchor.href && anchor.rel == "external") {       
     anchor.target = "_blank";
   }   
 }
}
window.onload = externalLinks;


function changeLocation(id) { 
  var selectObj = document.getElementById(id)
  var i = selectObj.selectedIndex;

  if(i > 0) {
    window.location = selectObj.options[i].value;
  }

}



function popupForm(sideid, height) {
  if (height != null && height != "") {
    h = height;
  } else {
    h = 500;
  }
  w = 586;
  link = "http://www.ebst.dk/form/form.xsql?emne="+sideid;

  fromLeft = (screen.width-w)/2;
  fromTop = (screen.height-h)/2;

  open(link,"_blank","left="+fromLeft+",top="+fromTop+",width="+w+",height="+h+",status=no,toolbar=no,menubar=no,scrollbars=yes,resizable=yes");
}


function popupWindow(url, height, width) {
  if (height != null && height != "") {
    h = height;
  } else {
    h = 500;
  }

  if (width != null && width != "") {
    w = width;
  } else {
    w = 586;
  }
  
  fromLeft = (screen.width-w)/2;
  fromTop = (screen.height-h)/2;

  open(url,"_blank","left="+fromLeft+",top="+fromTop+",width="+w+",height="+h+",status=no,toolbar=no,menubar=no,scrollbars=yes,resizable=yes");
}
