function showHide(which) {
  var whichStatus = eval("document.getElementById('"+which+"').style.display;");

  if (whichStatus=='none')
  {
    eval("document.getElementById('"+which+"').style.display='block';");
  }
  else {
    eval("document.getElementById('"+which+"').style.display='none';");
  }
}

function mouseoverFrontpageBox(which) {
  eval("document.getElementById('"+which+"_mouseover').style.display='block';");
  eval("document.getElementById('"+which+"').style.zIndex='1';");
}

function mouseoverFrontpageBoxhide(which) {
  eval("document.getElementById('"+which+"_mouseover').style.display='';");
  eval("document.getElementById('"+which+"').style.zIndex='0';");
}

function showHideBottomBars(which) {
  var whichStatus = eval("document.getElementById('"+which+"boxbottom').style.display;");
  var img = document.getElementById(which+"icon");
  var imgsrc = img.src.substring(0,img.src.lastIndexOf("/")+1);
  var anchor = document.getElementById(which+"showall");
  //alert(whichStatus);
  
  document.getElementById('minsideboxbottom').style.display='none';
  document.getElementById('minsidebox').style.display='none';
  document.getElementById('minsidetop').className='bottomminsideclosed';
  document.getElementById('minsideshowall').innerHTML='Vis alle informationer';
  document.getElementById('minsideshowall').title='Vis alle informationer';
  document.getElementById('minsideicon').src=imgsrc+'plus.gif';

  document.getElementById('virksomhedboxbottom').style.display='none';
  document.getElementById('virksomhedbox').style.display='none';
  document.getElementById('virksomhedtop').className='bottomvirksomhedclosed';
  document.getElementById('virksomhedshowall').innerHTML='Vis alle informationer';
  document.getElementById('virksomhedshowall').title='Vis alle informationer';
  document.getElementById('virksomhedicon').src=imgsrc+'plus.gif';

  document.getElementById('ivaerksaetterboxbottom').style.display='none';
  document.getElementById('ivaerksaetterbox').style.display='none';
  document.getElementById('ivaerksaettertop').className='bottomivaerksaetterclosed';
  document.getElementById('ivaerksaettershowall').innerHTML='Vis alle informationer';
  document.getElementById('ivaerksaettershowall').title='Vis alle informationer';
  document.getElementById('ivaerksaettericon').src=imgsrc+'plus.gif';

  document.getElementById('vaekstboxbottom').style.display='none';
  document.getElementById('vaekstbox').style.display='none';
  document.getElementById('vaeksttop').className='bottomvaekstclosed';
  document.getElementById('vaekstshowall').innerHTML='Vis alle informationer';
  document.getElementById('vaekstshowall').title='Vis alle informationer';
  document.getElementById('vaeksticon').src=imgsrc+'plus.gif';

  document.getElementById('vaerktoejboxbottom').style.display='none';
  document.getElementById('vaerktoejbox').style.display='none';
  document.getElementById('vaerktoejtop').className='bottomvaerktoejclosed';
  document.getElementById('vaerktoejshowall').innerHTML='Vis alle informationer';
  document.getElementById('vaerktoejshowall').title='Vis alle informationer';
  document.getElementById('vaerktoejicon').src=imgsrc+'plus.gif';

  if (whichStatus == 'none' || whichStatus == '') {
    eval("document.getElementById('"+which+"boxbottom').style.display='block';");
    eval("document.getElementById('"+which+"box').style.display='block';");
    eval("document.getElementById('"+which+"top').className='bottom"+which+"open';");
    eval("document.getElementById('"+which+"showall').innerHTML='Skjul alle informationer';");
    eval("document.getElementById('"+which+"showall').title='Skjul alle informationer';");
    eval("document.getElementById('"+which+"icon').src='"+imgsrc+"minus.gif';");    
  }  
}

function showhidereadmore(which) {
  tmpVar = eval("document.getElementById('"+which+"').style.display;");
  if (tmpVar=='block')
  {
    eval("document.getElementById('"+which+"').style.display='none';");
    eval("document.getElementById('"+which+"link').className='plus';");
  }
  else
  {
    eval("document.getElementById('"+which+"').style.display='block';");
    eval("document.getElementById('"+which+"link').className='minus';");
  }
}

/* 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 popupForm(sideid, height) {
  if (height != null && height != "") {
    h = height;
  } else {
    h = 500;
  }
  w = 586;
//  link = "http://www.ebst.dk/form/form.xsql?emne="+sideid;
  link = "/"+sideid+"/0/199";

  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");
}


// Sitemap
function showHideAll(name, obj) {
  if (!document.getElementsByTagName) return;
  
  var img = document.getElementById(name+"icon");
  var divs = document.getElementsByTagName("div");   

  for (var i=0; i<divs.length; i++) {
    var div = divs[i];
    
    if (div.id.substr(0,4)==name) {
      if (obj.id==(name+"ShowAll")) {
        div.style.display="block";

      } else {
        div.style.display="none";
      }
    }
  }

  if (obj.id==(name+"ShowAll")) {
    obj.id=(name+"HideAll");
    obj.innerHTML="Skjul alle informationer";
    obj.title="Skjul alle informationer";
    img.alt="Fold sammen";
    img.src=img.src.substring(0,img.src.lastIndexOf("/")+1)+"minus.gif";
  } else {
    obj.id=(name+"ShowAll");
    obj.innerHTML="Vis alle informationer";
    obj.title="Vis alle informationer";
    img.alt="Fold ud";
    img.src=img.src.substring(0,img.src.lastIndexOf("/")+1)+"plus.gif";
  }
}

//Faneblade
function showDiv8(theDiv, theElement) {
  var selectedDiv = document.getElementById(theDiv);
  try { var theDiv1 = document.getElementById('div1');} catch (e) { null; }
  try { var theDiv2 = document.getElementById('div2');} catch (e) { null; }
  try { var theDiv3 = document.getElementById('div3');} catch (e) { null; }
  try { var theDiv4 = document.getElementById('div4');} catch (e) { null; }
  try { var theDiv5 = document.getElementById('div5');} catch (e) { null; }
  try { var theDiv6 = document.getElementById('div6');} catch (e) { null; }
  try { var theDiv7 = document.getElementById('div7');} catch (e) { null; }
  try { var theDiv8 = document.getElementById('div8');} catch (e) { null; }

  try { var thePane1 = document.getElementById('pane1');} catch (e) { null; }
  try { var thePane2 = document.getElementById('pane2');} catch (e) { null; }
  try { var thePane3 = document.getElementById('pane3');} catch (e) { null; }
  try { var thePane4 = document.getElementById('pane4');} catch (e) { null; }
  try { var thePane5 = document.getElementById('pane5');} catch (e) { null; }
  try { var thePane6 = document.getElementById('pane6');} catch (e) { null; }
  try { var thePane7 = document.getElementById('pane7');} catch (e) { null; }
  try { var thePane8 = document.getElementById('pane8');} catch (e) { null; }

  try { thePane1.className = 'unselectedFane';} catch (e) { null; }
  try { thePane2.className = 'unselectedFane';} catch (e) { null; }
  try { thePane3.className = 'unselectedFane';} catch (e) { null; }
  try { thePane4.className = 'unselectedFane';} catch (e) { null; }
  try { thePane5.className = 'unselectedFane';} catch (e) { null; }
  try { thePane6.className = 'unselectedFane';} catch (e) { null; }
  try { thePane7.className = 'unselectedFane';} catch (e) { null; }
  try { thePane8.className = 'unselectedFane';} catch (e) { null; }

  if (theDiv == 'div1') { thePane1.className = 'selectedFane'; }
  if (theDiv == 'div2') { thePane2.className = 'selectedFane'; }
  if (theDiv == 'div3') { thePane3.className = 'selectedFane'; }
  if (theDiv == 'div4') { thePane4.className = 'selectedFane'; }
  if (theDiv == 'div5') { thePane5.className = 'selectedFane'; }
  if (theDiv == 'div6') { thePane6.className = 'selectedFane'; }
  if (theDiv == 'div7') { thePane7.className = 'selectedFane'; }
  if (theDiv == 'div8') { thePane8.className = 'selectedFane'; }

  // Set all layers to none
  try { theDiv1.style.display = "none";} catch (e) { null; }
  try { theDiv2.style.display = "none";} catch (e) { null; }
  try { theDiv3.style.display = "none";} catch (e) { null; }
  try { theDiv4.style.display = "none";} catch (e) { null; }
  try { theDiv5.style.display = "none";} catch (e) { null; }
  try { theDiv6.style.display = "none";} catch (e) { null; }
  try { theDiv7.style.display = "none";} catch (e) { null; }
  try { theDiv8.style.display = "none";} catch (e) { null; }

  // Show the actual layer
  selectedDiv.style.display = "block";
}
