var ua = navigator.userAgent.toLowerCase();
if (ua.indexOf('netscape6') != -1)
  document.write('<link rel="stylesheet" type="text/css" href="/EN/CSS/netscape.css">')
else if (ua.indexOf('netscape/7') != -1)
  document.write('<link rel="stylesheet" type="text/css" href="/EN/CSS/netscape.css">')
else if (ua.indexOf('gecko') != -1)
  document.write('<link rel="stylesheet" type="text/css" href="/EN/CSS/netscape.css">')
else
  {
    if (ua.indexOf('ie 6') != -1)
      document.write('<link rel="stylesheet" type="text/css" href="/EN/CSS/ie6.css">')
    else
      document.write('<link rel="stylesheet" type="text/css" href="/EN/CSS/ie.css">');
  }

// ZIP Stat kode Start
/* document.writeln('<script language="JavaScript" type="text/javascript">');
   document.writeln('<!--');
   document.writeln('far="Andre"; jav="Ved ikke"; skh="Andre"; jav=navigator.javaEnabled();');
   document.writeln('ref=""+escape(top.document.referrer); nav=navigator.appName;');
   document.writeln('if (navigator.appName == "Netscape" && (navigator.appVersion.charAt(0) == "2" || navigator.appVersion.charAt(0) == "3")) {skriv=false;} else {skriv=true;}');
   document.writeln('if (skriv==true) { skh=screen.width + "x" + screen.height;');
   document.writeln('if (nav != "Netscape"){far=screen.colorDepth;} else {far=screen.pixelDepth;}');
   document.writeln('puri="brugernavn=amh82&amp;version=150&amp;ssto="+skh+"&amp;referer="+ref+"&amp;colors="+far+"&amp;java="+jav+"&amp;js=true&amp;billed=trans";');
   document.writeln('document.write("<img height=\"1\" width=\"1\" border=\"0\" src=\"http://www.zip.dk/cgi-bin/zipstat/zipstat.cgi?"+puri+"\" alt=\"\" align=left>"); }');
   document.writeln('//-->');
   document.writeln('</script> <noscript>');
   document.writeln('<img height="1" width="1" border="0" src="http://www.zip.dk/cgi-bin/zipstat/zipstat.cgi?brugernavn=amh82&amp;js=false&amp;billed=trans" alt="" align=left></noscript>');
// ZIP Stat kode slut
*/

function getLongDateString() {
  months = new Array("January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December");
  days = new Array("Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday");

  day = days[this.getDay()];
  date = this.getDate();
  month = months[this.getMonth()];
  year = this.getYear();
  if (year < 2000) year = year + 1900;

  dateStr = day + ", " + month + " " + date + ", " + year;
  return dateStr;
}
Date.prototype.getLongDateString=getLongDateString;

function padInt(value, size) {
  str = "" + value;

  while (str.length < size) {
    str = "0" + str;
  }
  
  return str;
}

function getShortDateString() {
  date = this.getDate();
  month = this.getMonth() + 1;
  year = this.getYear();

  if (year < 2000) {
    year = year + 1900;
  }

  return year + "-" + padInt(month, 2) + "-" + padInt(date, 2)
}
Date.prototype.getShortDateString=getShortDateString;


function docDate() {
  lastModified = Date.parse(document.lastModified);
  if (lastModified == 0 || lastModified == null)
  {
    dateStr = "Unknown";
  }
  else
  {
    aDate = new Date();
    aDate.setTime(lastModified);
    dateStr = aDate.getLongDateString();
  }
  return dateStr;
}

function docDateShort() {
  lastModified = Date.parse(document.lastModified);
  if (lastModified == 0 || lastModified == null)
  {
    dateStr = "Unknown";
  }
  else
  {
    aDate = new Date();
    aDate.setTime(lastModified);
    dateStr = aDate.getShortDateString();
  }
  return dateStr;
}


function WriteDocInfo(Title) {
  if (Title != '') parent.document.title = Title;
}

function OpenParentLink(Lochref) {
  parent.location.href = Lochref;
}

function OpenGrantParentLink(Lochref) {
  parrent.parent.location.href = Lochref;
}



MenuItems = new Array();
MenuItemCount = 0;

function MenuItem(id, src, href, hint) {
  this.id = id;
  this.src = src;
  this.href = href;
  this.title = hint;
  this.index = MenuItemCount;
  this.img = new Image();
  this.img.src = '/EN/Images/Buttons/' + src + '_N.gif';
  this.imgsel = new Image();
  this.imgsel.src = '/EN/Images/Buttons/' + src + '_s.gif';
  MenuItemCount++;
}

//ID, Text, Href, Title
MenuItems[MenuItemCount] = new MenuItem('top', 'Top', '#top', 'Click here to return to the top of this page.');
MenuItems[MenuItemCount] = new MenuItem('back', 'Back', 'javascript:history.back()', 'Click here to go back to the previous page.');

function CreateBack() {
  for (Index = 0; Index < MenuItemCount; Index++)
  {
    containt = '<img id="img' + MenuItems[Index].id + '" src="/EN/Images/Buttons/' + MenuItems[Index].src + '_N.gif" onmouseover="ButtonMouseOver(this)" onmouseout="ButtonMouseOut(this)" onblur="ButtonMouseOut(this)" onclick="ButtonClick(this)">';
    document.writeln('<a href="' + MenuItems[Index].href + '" target="mainframe"><td class="menubox" id="' + MenuItems[Index].id + '" title="' + MenuItems[Index].title + '" height="21">' + containt + '</td></a>');
  }  
}

function getButtonIndex(Element) {
  result = 0;
  for (Index = 0; Index < MenuItemCount; Index++)
  {
    if ((Element.id == MenuItems[Index].id) || (Element.id == 'img' + MenuItems[Index].id))result = Index
  }
  return result;
}

function ButtonMouseOver(Element) {
  Element.src = MenuItems[getButtonIndex(Element)].imgsel.src;
}  

function ButtonMouseOut(Element) {
  Element.src = MenuItems[getButtonIndex(Element)].img.src;
}


function ButtonClick(Element) {
  if (Element.id == 'imgtop')
  {
    location.href = '#top';
  }
  else if (Element.id == 'imgback')
  {
    history.back();
  }
  else
  {
    location.href = MenuItems[getButtonIndex(Element)].href;
  }
}
