<!-- Minus AutoDato -->
/* mainscript */
if (window.name!='Print') { 
   screenH=screen.height;
   if (screenH>600) { 
     if (window.innerHeight!=null) { textH=window.innerHeight-menuH-45 } else { textH=screenH-menuH-180 };  
     document.write('<STYLE TYPE="text/css">DIV#text{height:' +   textH + 'px}</STYLE>');
}  else {
     if (screen.width>=800) {overflw='overflow-y:auto'} else {overflw='overflow:auto'};
     document.write('<STYLE TYPE="text/css">BODY{background-color:#FCFCFC;' + overflw + '} DIV#main{width:100%;top:0px;left:0px;margin-left:0px} DIV#text{width:720px;padding:0px;margin-left:40px;margin-right:0px;margin-top:20px;margin-bottom:20px;overflow:hidden} IMG#infocon{left:0px}</STYLE>');
  };
} else {
   document.write('<STYLE TYPE="text/css">BODY{background-color:#FFFFFF;overflow:auto} DIV#main{width:800px;top:0px;left:0px;margin-left:0px;padding-left:5px;background-color:#FFFFFF} DIV#menu{display:none;} DIV#text{padding:0px;padding-top:20px;margin:0px;font-size:14px;background-color:#FFFFFF;overflow:visible} DIV#returlinks{display:none;}DIV#vis{display:none;}DIV#skjul{display:block;} A.extern:link{font-size:14px;color:#000000} A.extern:visited{font-size:14px;color:#000000} A.extern:hover{font-size:14px;color:#000000} A.extern:active{font-size:14px;color:#000000} A.intern:link{text-decoration:none;font-size:14px;color:#330099} A.intern:visited{font-size:14px;color:#330099} A.intern:hover{font-size:14px;color:#330099} A.intern:active{font-size:14px;color:#330099}</STYLE>');
};

function testWin() {
 if (window.name!='Print') {
   if ((screenH>600)&&(window.innerHeight==null)&&(document.body.clientHeight!=null)) {        
         document.getElementById('text').style.height=document.body.clientHeight-menuH-16;             
   };
   setUdskrift();
 } else {
        var indeks='';
        if ((location.href.indexOf('d0')==-1) && (location.href.indexOf('info')==-1)) {
              indeks=document.title.slice(0,document.title.indexOf(' ')-1);
              var indeks=' - Emne ' + indeks;
        };
    document.title='Udskrift fra Geologiportalen - Tema om olie og gas' + indeks;
    if (location.href.indexOf('&')==-1) { window.print() }
    else { window.status='Vælg "Udskriv..." eller "Vis udskrift..."';
           return true;          
    };
 };
};

function juster() {
 if ((window.name!='Print')&&(screenH>600)) {
  if (window.innerHeight!=null) {
    document.getElementById('text').style.height=window.innerHeight-menuH-45;  
  } else {
     if (document.body.clientHeight!=null) {
         document.getElementById('text').style.height=document.body.clientHeight-menuH-16;
     };
  };
 };
};

printWin=null;

function printText() { 
if (window.name!='Print') {  
printWin=window.open(location.href,'Print','location=0,status=0,menu=0,menubar=0,toolbar=0,scrollbars=1,resizable=1,width=500,height=400,left=0,top=0');   
 };
};

function printTextWithMenu() { 
if (window.name!='Print') {  
var ref=location.href + '#&';
printWin=window.open(ref,'Print','location=0,status=1,menu=0,menubar=1,toolbar=0,scrollbars=1,resizable=1,width=840,height=900,left=0,top=0');
 };
};

function setUdskrift() {
  if ((browser.indexOf('MSIE')!=-1)||(browser.indexOf('Firefox')!=-1)) {
    document.getElementById('udskriv').style.visibility='visible';
    return(null);
  };
  if (browser.indexOf('Safari')!=-1) {
    if (browser.indexOf('Chrome')!=-1) {return(null)};
    document.getElementById('udskriv').style.visibility='visible';
  };
};

function msie() {
 if (browser.indexOf('MSIE')!=-1) {
      return(true) } else { return(false) };
};

function firefox() {
 if (browser.indexOf('Firefox')!=-1) {
      return(true) } else { return(false) };
};

function safari() {
 if ((browser.indexOf('Safari')!=-1)&&(browser.indexOf('Chrome')==-1)) {
      return(true) } else { return(false) };
};

function printBR(n) {
   for (i=0;i<n;i++) { document.write('<BR>') };
};

function IFS(ie,f,s) {
 if (window.name=='Print') { return(null) };
 if ( msie()==true) {
       printBR(ie); return(null);
 }; 
 if ( firefox()==true) {
       printBR(f); return(null);
 };
 if ( safari()==true) {
       printBR(s); return(null);
 };
 return(null);
};

function pIFS(ie,f,s) {
 if (window.name!='Print') { return(null) };
 if ( msie()==true) {
       printBR(ie); return(null);
 }; 
 if ( firefox()==true) {
       printBR(f); return(null);
 };
 if ( safari()==true) {
       printBR(s); return(null);
 };
 return(null);
};

function shut() {
  window.close();
};

function visFoto(nr) {
   document.getElementById('txt').style.fontWeight='bold';
   document.getElementById('txt').innerHTML=tekster[nr];
   var foto=document.getElementById('foto');
   foto.src=fotos[nr];
   foto.style.width=w[nr]; foto.style.height=h[nr];   
   foto.style.border='1px solid #000000';
};

browser=navigator.userAgent;
if ((window.name!='Print')&&(screenH>600)) {
 if ((browser.indexOf('MSIE')!=-1)||(browser.indexOf('Firefox')!=-1)) {
   docLoc=location.href;
   if (docLoc.charAt(docLoc.length-1)=='#') {
     infoTxt='Du kan bruge de to yderste piletaster til at gå et skridt frem eller tilbage i emnelisten<BR><BR>Med de to andre piletaster kan du rulle visningen af den valgte side uden at skulle have fat i musen';
    document.write('<STYLE TYPE="text/css">IMG#infocon{visibility:visible}</STYLE>');
  };
 }
};

function visInfo() {
   document.getElementById('infotekst').innerHTML=infoTxt;
   document.getElementById('infobox').style.visibility='visible';
};

function skjulInfo() {
   document.getElementById('infobox').style.visibility='hidden';
};

IEmode=null;
tastKode=0;

/* Netscape kode og funktion til detektering af tastaturtryk */
if ((window.name!='Print')&&(screenH>600)&&(navigator.appName=="Netscape")) {
 document.onkeydown=tastetryk;
};

function tastetryk(kode) {
 if (window.name=='Print') { return(null) };
 tastKode=kode.which;
 /* Detektering af tastetryk F9 */
 if (tastKode==120) { printTextWithMenu() };
};

/* Funktion til haandtering af pileknapperne */
function skift(doc1,doc2) {
 if (window.name=='Print') { return(null) };
 if (IEmode==null) {
      if (window.event!=null) { IEmode=true } 
      else { IEmode=false };
 };
 if (IEmode) { var tastNr=window.event.keyCode;
               if (tastNr==120) { printTextWithMenu();
                                  return(null);                  
               };
 } else { var tastNr=tastKode };
 if (tastNr==39) { location.href=doc2 + '.htm' };
 if (tastNr==37) { location.href=doc1 + '.htm' };
 if ((screenH>600)&&(tastNr<=40)&&(tastNr>=32)) { document.getElementById('text').focus() };
};