var diverse = null; 
var hjaelp = null;
var spec_be = null; 
var data = null;
var session_timeout = null;
var w = null;
var h = null;
var krom = null;

if ((screen.width == 640) && (screen.height == 480)) {
  w1 = 630; h1 = 315; l1 = 0; t1 = 20; // Hjælp, vejledning m.v.
  w2 = 630; h2 = 315; l2 = 0; t2 = 20; // Specifikation til rubrikker m.v.
  w3 = 630; h3 = 315; l3 = 0; t3 = 20; // Data til rubrikker m.v.
  w4 = 630; h4 = 315; l4 = 0; t4 = 20; // Diverse (specifikation m.v.)
}
else if ((screen.width == 800) && (screen.height == 600)) {
  w1 = 630; h1 = 355; l1 = 20; t1 = 20;
  w2 = 630; h2 = 345; l2 = 44; t2 = 44;
  w3 = 630; h3 = 345; l3 = 68; t3 = 68;
  w4 = 630; h4 = 345; l4 = 92; t4 = 92;
}
else { // ((screen.width >= 1024) && (screen.height >= 768))
  w1 = 650; h1 = 460; l1 = 20; t1 = 20;
  w2 = 650; h2 = 500; l2 = 44; t2 = 44;
  w3 = 650; h3 = 500; l3 = 68; t3 = 68;
  w4 = 650; h4 = 500; l4 = 92; t4 = 92;
}

function aabn_hjaelp_vindue(file) {
  var krom = "width="+w1+",height="+h1+",left="+l1+",top="+t1+",scrollbars=yes,menubar=yes,toolbar=yes,status=yes,resizable=yes";
  hjaelp = window.open(hjaelp_mappe+file,'Hjaelp',krom);
  hjaelp.focus();
}

function aabn_data_vindue(file) {
  if (data && data.open && !data.closed) {
    data.window.focus();
  }
  else {
    var krom = "width="+w3+",height="+h3+",left="+l3+",top="+t3+",scrollbars=yes,menubar=yes,status=yes,resizable=yes";
    data = window.open(html_mappe+'side_indlaeses.htm','Data',krom);
    data.window.focus();
    data.window.location = file;
  }
}

function aabn_spec_be_vindue(person) {
  if (indlaest) {
    krom = "width="+w4+",height="+h4+",left="+l4+",top="+t4+",scrollbars=yes,menubar=yes,status=yes,resizable=yes";
    spec_be = window.open(html_mappe+'specifikation_indlaes.htm','Spec_be',krom);
    if (window.focus) { //Ikke alle browsere understoetter
	spec_be.window.focus();
    }
    clearTimeout(session_timeout);
    session_timeout = setTimeout("check_timeout();",55*60*1000);
    document.spec_be.person.value = person;
    document.spec_be.submit();
  }
  else {
    alert("Siden indlæses... Vent et øjeblik.");
  }
}

function luk_ekstra_vinduer() {
  if (hjaelp && hjaelp.open && !hjaelp.closed) {
    hjaelp.close();
  }
  if (spec_be && spec_be.open && !spec_be.closed) {
    spec_be.close();
  }
  if (data && data.open && !data.closed) {
    data.close();
  }
}
