﻿// JScript File

//vis parameterfelt
function vis_oplysninger_parametre()
{
  if (document.getElementById('vis_oplysninger_txtStofnavn').value != "")
  {
    clearvis_oplysninger();
    document.all.vis_oplysninger_tdHovedparametre.style.display = "block";
    document.all.vis_oplysninger_tdParametre.style.display = "block";
  }
  open();
}


//vis parameteroversigt
function vis_oplysninger_oversigt()
{
  clearvis_oplysninger();
  document.all.vis_oplysninger_tdHovedparametre.style.display = "block";
  document.all.vis_oplysninger_tdParametre.style.display = "block";
  document.all.vis_oplysninger_tdHovedoversigt.style.display = "block";
  document.all.vis_oplysninger_tdOversigt.style.display = "block";
  open();
 }


//vis detaljer
function vis_oplysninger_detaljer()
{
  clearvis_oplysninger();
  document.all.vis_oplysninger_tdHovedparametre.style.display = "block";
  document.all.vis_oplysninger_tdParametre.style.display = "block";
  document.all.vis_oplysninger_tdHovedmaalebetingelser.style.display = "block";     
  document.all.vis_oplysninger_tdMaalebetingelser.style.display = "block";
  open();
 }
 
 
 // vis redigér parametre
function vis_oplysninger_redparametre()
{
  clearvis_oplysninger();
  document.all.vis_oplysninger_tdHovedredparametre.style.display = "block";
  document.all.vis_oplysninger_tdRedparametre.style.display = "block";
  open();
}


// vis redigér enheder
function vis_oplysninger_redenheder()
{
  clearvis_oplysninger();
  document.all.vis_oplysninger_tdHovedredenheder.style.display = "block";
  document.all.vis_oplysninger_tdRedenheder.style.display = "block";
  open();
}


// vis redigér referencer
function vis_oplysninger_redreferencer()
{
  clearvis_oplysninger();
  document.all.vis_oplysninger_tdHovedredreferencer.style.display = "block";
  document.all.vis_oplysninger_tdRedreferencer.style.display = "block";
  open();
}


// vis strukturformelpanel
function vis_oplysninger_strukturformel()
{
  clearvis_oplysninger();
  open();  
  document.all.vis_oplysninger_tdHovedstrukturformel.style.display = "block";
  document.all.vis_oplysninger_tdStrukturformel.style.display = "block";  
}


// vis metabolitpanel
function vis_oplysninger_metabolitter()
{
  clearvis_oplysninger();
  document.all.vis_oplysninger_tdHovedmetabolitter.style.display = "block";
  document.all.vis_oplysninger_tdMetabolitter.style.display = "block"; 
  open();
}


// tøm vis_oplysningersfelter 
function clearvis_oplysninger()
{
  document.all.vis_oplysninger_tdHovedparametre.style.display = "none";
  document.all.vis_oplysninger_tdParametre.style.display = "none";

  document.all.vis_oplysninger_tdHovedmaalebetingelser.style.display = "none";     
  document.all.vis_oplysninger_tdMaalebetingelser.style.display = "none";

  document.all.vis_oplysninger_tdHovedredparametre.style.display = "none";
  document.all.vis_oplysninger_tdRedparametre.style.display = "none";

  document.all.vis_oplysninger_tdHovedoversigt.style.display = "none";
  document.all.vis_oplysninger_tdOversigt.style.display = "none";

  document.all.vis_oplysninger_tdHovedredenheder.style.display = "none";
  document.all.vis_oplysninger_tdRedenheder.style.display = "none";
                           
  document.all.vis_oplysninger_tdHovedstrukturformel.style.display = "none"; 
  document.all.vis_oplysninger_tdStrukturformel.style.display = "none";       

  document.all.vis_oplysninger_tdHovedredreferencer.style.display = "none";
  document.all.vis_oplysninger_tdRedreferencer.style.display = "none";
                           
  document.all.vis_oplysninger_tdHovedmetabolitter.style.display = "none"; 
  document.all.vis_oplysninger_tdMetabolitter.style.display = "none";    

  vis_oplysninger_clear_detaljer();
}


// toem detaljefelter
function vis_oplysninger_initier_detaljer()
{
  document.all.vis_oplysninger_Ref_ID.innerText="";
  document.getElementById('vis_oplysninger_ddlBbgenerelt').innerText = "";
  document.getElementById('vis_oplysninger_ddlBbredox').innerText = "";
  document.getElementById('vis_oplysninger_ddlBbmedium').innerText = "";
  document.getElementById('vis_oplysninger_ddlBbkulstof').innerText = "";
  document.getElementById('vis_oplysninger_ddlBeregnet').innerText = "";
  document.getElementById('vis_oplysninger_txtOpdatering').value="";
  document.getElementById('vis_oplysninger_ddlDatakvalitet').innerText = "";
  document.getElementById('vis_oplysninger_ddlForsøgstype').innerText = "";
  document.getElementById('vis_oplysninger_txtTemperatur').value="";
  document.getElementById('vis_oplysninger_txtRedox').value="";
  document.getElementById('vis_oplysninger_txtKulstofindhold').value="";
  document.getElementById('vis_oplysninger_txtMedium').value="";
  document.getElementById('vis_oplysninger_txtPh').value="";
  document.getElementById('vis_oplysninger_txtLand').value="";
  document.getElementById('vis_oplysninger_txtBemaerkninger').value="";
  document.getElementById('vis_oplysninger_txtReference').value="";
  document.getElementById('vis_oplysninger_txtReference').innerHTML = "";
}


//tilfoej blanke felter i rullemenuer
function vis_oplysninger_add_blanks()
{
  //tilføj blanke til ddl'er 
/*  o1 = new Option('',0);
  o2 = new Option('',0);
  o3 = new Option('',0);
  o4 = new Option('',0);
  o5 = new Option('',0);
  o6 = new Option('',0);
  o7 = new Option('',0);            
                    
  document.getElementById('vis_oplysninger_ddlBbgenerelt').add(o1);                          
  document.getElementById('vis_oplysninger_ddlBbredox').add(o2);
  document.getElementById('vis_oplysninger_ddlBbmedium').add(o3);  
  document.getElementById('vis_oplysninger_ddlBbkulstof').add(o4);
  document.getElementById('vis_oplysninger_ddlBeregnet').add(o5);
  document.getElementById('vis_oplysninger_ddlDatakvalitet').add(o6);
  document.getElementById('vis_oplysninger_ddlForsøgstype').add(o7);    */
}


//tilfoej valg til rullemenuer
function vis_oplysninger_add_options()
{
  //tilføj optioner til ddl'er 
/*  o1 = new Option('Ja',1);
  o2 = new Option('Nej',2);
  o3 = new Option('Ja, oxiderende',1);
  o4 = new Option('Ja, reducerende',2);
  o5 = new Option('Nej',3);
  o6 = new Option('Ja, kalk',1);
  o7 = new Option('Ja, ler',2);
  o8 = new Option('Ja, muld',3);
  o9 = new Option('Ja, sand',4);
  o10 = new Option('Ja, vand',5);
  o11 = new Option('Nej',6);
  o12 = new Option('Ja, < 0.001',1);
  o13 = new Option('Ja, 0.001 - 0.01',2);
  o14 = new Option('Ja, > 0.01',3);
  o15 = new Option('Nej',4);
  o16 = new Option('Ja',1);
  o17 = new Option('Nej',2);
  o18 = new Option('God',1);
  o19 = new Option('OK',2);
  o20 = new Option('Usikker',3);
  o21 = new Option('Markforsøg',2);
  o22 = new Option('Laboratorie',2);
            
  document.getElementById('vis_oplysninger_ddlBbgenerelt').add(o1);
  document.getElementById('vis_oplysninger_ddlBbgenerelt').add(o2);
  document.getElementById('vis_oplysninger_ddlBbredox').add(o3);
  document.getElementById('vis_oplysninger_ddlBbredox').add(o4);
  document.getElementById('vis_oplysninger_ddlBbredox').add(o5);
  document.getElementById('vis_oplysninger_ddlBbmedium').add(o6);
  document.getElementById('vis_oplysninger_ddlBbmedium').add(o7);
  document.getElementById('vis_oplysninger_ddlBbmedium').add(o8);
  document.getElementById('vis_oplysninger_ddlBbmedium').add(o9);
  document.getElementById('vis_oplysninger_ddlBbmedium').add(o10);
  document.getElementById('vis_oplysninger_ddlBbmedium').add(o11);
  document.getElementById('vis_oplysninger_ddlBbkulstof').add(o12);
  document.getElementById('vis_oplysninger_ddlBbkulstof').add(o13);
  document.getElementById('vis_oplysninger_ddlBbkulstof').add(o14);
  document.getElementById('vis_oplysninger_ddlBbkulstof').add(o15);
  document.getElementById('vis_oplysninger_ddlBeregnet').add(o16);
  document.getElementById('vis_oplysninger_ddlBeregnet').add(o17);
  document.getElementById('vis_oplysninger_ddlDatakvalitet').add(o18);
  document.getElementById('vis_oplysninger_ddlDatakvalitet').add(o19);
  document.getElementById('vis_oplysninger_ddlDatakvalitet').add(o20);
  document.getElementById('vis_oplysninger_ddlForsøgstype').add(o21);
  document.getElementById('vis_oplysninger_ddlForsøgstype').add(o22);      */
}


function vis_oplysninger_detalje1()
{
  vis_oplysninger_clear_detaljer();
  vis_oplysninger_detaljer();
  document.all.vis_oplysninger_detalje_1.style.display = "block";
  document.all.vis_oplysninger_nuv_1.innerText="";
  document.all.vis_oplysninger_antal_1.innerText="";
}

function vis_oplysninger_detalje(id)
{
  vis_oplysninger_clear_detaljer();
  vis_oplysninger_detaljer();         
  document.all('vis_oplysninger_detalje_'+id).style.display = "block";
  document.all('vis_oplysninger_nuv_'+id).innerText="";
  document.all('vis_oplysninger_antal_'+id).innerText="";
}
 
function vis_oplysninger_clear_detaljer()
{
  document.all.vis_oplysninger_detalje_1.style.display = "none";
  document.all.vis_oplysninger_detalje_2.style.display = "none";
  document.all.vis_oplysninger_detalje_3.style.display = "none";
  document.all.vis_oplysninger_detalje_4.style.display = "none";
  document.all.vis_oplysninger_detalje_5.style.display = "none";
  document.all.vis_oplysninger_detalje_6.style.display = "none";
  document.all.vis_oplysninger_detalje_7.style.display = "none";
  document.all.vis_oplysninger_detalje_8.style.display = "none";
  document.all.vis_oplysninger_detalje_9.style.display = "none";
  document.all.vis_oplysninger_detalje_10.style.display = "none";
  document.all.vis_oplysninger_detalje_11.style.display = "none";
  document.all.vis_oplysninger_detalje_12.style.display = "none";
  document.all.vis_oplysninger_detalje_13.style.display = "none";
  document.all.vis_oplysninger_Ref_ID.innertext="";
  document.getElementById('vis_oplysninger_ddlBbgenerelt').innerText="";
  document.getElementById('vis_oplysninger_ddlBbredox').innerText="";
  document.getElementById('vis_oplysninger_ddlBbmedium').innerText="";
  document.getElementById('vis_oplysninger_ddlBbkulstof').innerText="";
  document.getElementById('vis_oplysninger_ddlBeregnet').innerText="";
  document.getElementById('vis_oplysninger_txtOpdatering').innertext="";
  document.getElementById('vis_oplysninger_ddlDatakvalitet').innerText="";
  document.getElementById('vis_oplysninger_ddlForsøgstype').innerText="";
  document.getElementById('vis_oplysninger_txtTemperatur').innertext="";
  document.getElementById('vis_oplysninger_txtRedox').innertext="";
  document.getElementById('vis_oplysninger_txtKulstofindhold').innertext="";
  document.getElementById('vis_oplysninger_txtMedium').innertext="";
  document.getElementById('vis_oplysninger_txtPh').innertext="";
  document.getElementById('vis_oplysninger_txtLand').innertext="";
  document.getElementById('vis_oplysninger_txtBemaerkninger').innertext="";           
  document.getElementById('vis_oplysninger_txtReference').innertext="";
}

function excel_note()
{
 alert("Såfremt et stof er valgt vil et klik på knappen 'Detaljer' betyde at alle stoffets dataværdier med tilhørende målebetingelser eksporteres til en Excel-fil. Såfremt der ikke er valgt noget stof - valgboks er tom - vil et klik på knappen 'Detaljer' betyde, at dataværdier inklusive målebetingelser for alle stoffer i databasen eksporteres til en Excel-fil. \n\nStoflisten eksporteres på samme måde.\n\nDet er nødvendigt at tilføje dette websted som et sted man har tillid til under Internetindstillinger | Sikkerhed samt at aktivere kørsel af scriplets og ActiveX objekter for websteder man har tillid til.")
}
