﻿// overordent menuhåndtering


function login()
{                      
    document.all.LabelHack.style.display = "none";
    document.all.LabelMissingPassword.innerHTML = "";
    document.all.LabelMissingUsername.innerHTML = "";
    document.all.LabelForkertLogin.style.display = "none";
    var textok = 1;      
    
    if (document.all.TextBoxUsername.value == "")
    {              
      document.all.LabelMissingUsername.innerHTML = "*";
      textok = 0;
    }
    if (document.all.TextBoxPassword.value == "")
    {
      document.all.LabelMissingPassword.innerHTML = "*";
      textok = 0;
    }
    if (textok == 1)
    {   
        startwait();
     //   alert('0¤' + document.all.TextBoxPassword.value + "¤" + document.all.TextBoxUsername.value)
        CallServer('0¤' + document.all.TextBoxPassword.value + "¤" + document.all.TextBoxUsername.value) 
       document.all.TextBoxPassword.value == "";
       document.all.TextBoxUsername.value == "";
    }  
}

function fortryd()
{
    document.all.c6.style.display="none"; 
    document.all.LabelHack.style.display = 'none';
    document.all.LabelMissingPassword.style.display = 'none';
    document.all.LabelMissingUsername.style.display = 'none';
    document.all.LabelForkertLogin.style.display = 'none';
    document.all.TextBoxUsername.innerText = ""
    document.all.TextBoxPassword.innerText = ""
}

//vis menu 1
function page1() {
  reset();
	document.all('td1').style.backgroundColor="#abcdef";
	document.all.c1.style.display="block";
	roles_access(1);
}

//vis menu 2
function page2() {
  reset();
	document.all.td2.style.backgroundColor="#abcdef";
	document.all.c2.style.display="block";
	roles_access(2);
}

//vis menu 3
function page3() {
  reset();
	document.all.td3.style.backgroundColor="#abcdef";
	document.all.c3.style.display="block";
	roles_access(3);
}

//vis menu 4
function page4() {
  reset();
	document.all.td4.style.backgroundColor="#abcdef";
	document.all.c4.style.display="block";
	roles_access(4);
}

//vis menu 5
function page5() {
  reset();
	document.all.td5.style.backgroundColor="#abcdef";
	document.all.c5.style.display="block";
	roles_access(5);	
}

//vis menu logind
function logind() {
  reset();
  document.all.velkomstsalut.style.display="none";
  document.all.c6.style.display="block";   
  document.all.wrapper.style.display="none";
  document.all.TextBoxUsername.focus();
}

//åben system efter logind
function open() {
  document.all.wrapper.style.display="block";
}

function close() {
  document.all.wrapper.style.display="none";
}



function close() {
  document.all.wrapper.style.display="none";
}

//vis menu 1_1
function page1_1() {
  reset();
  document.getElementById('td1').style.backgroundColor="#abcdef";
	document.all.td1_1.style.backgroundColor="#abcdef";
	document.all.c1_1.style.display="block";
	document.all.c1.style.display="block";
	clearvis_oplysninger();
}

//vis menu 1_2
function page1_2() { 
  reset();
  document.all.td1.style.backgroundColor="#abcdef";
	document.all.td1_2.style.backgroundColor="#abcdef";
	document.all.c1_2.style.display="block";
	document.all.c1.style.display="block";
	clearstofregistrering();	
}

//vis menu 1_3
function page1_3() {
  reset();
  document.all.td1.style.backgroundColor="#abcdef";
	document.all.td1_3.style.backgroundColor="#abcdef";
	document.all.c1_3.style.display="block";
	document.all.c1.style.display="block";
}

//vis menu 1_4
function page1_4() {
  reset();
  document.all.td1.style.backgroundColor="#abcdef";
	document.all.td1_4.style.backgroundColor="#abcdef";
	document.all.c1_4.style.display="block";
	document.all.c1.style.display="block";
}

//vis menu 1_5
function page1_5() {
  reset();
  document.all.td1.style.backgroundColor="#abcdef";
	document.all.td1_5.style.backgroundColor="#abcdef";
	document.all.c1_5.style.display="block";
	document.all.c1.style.display="block";
}

//vis menu 2_1
function page2_1() {
  reset();
  document.all.td2.style.backgroundColor="#abcdef";
	document.all.td2_1.style.backgroundColor="#abcdef";
	document.all.c2_1.style.display="block";
	document.all.c2.style.display="block";
}

//vis menu 2_2
function page2_2() {
  reset();
  document.all.td2.style.backgroundColor="#abcdef";
	document.all.td2_2.style.backgroundColor="#abcdef";
	document.all.c2_2.style.display="block";
	document.all.c2.style.display="block";
	bedriftsbeslutninger();
	reset_2_2();
}

//vis menu 2_3
function page2_3() {
  reset();
  document.all.td2.style.backgroundColor="#abcdef";
	document.all.td2_3.style.backgroundColor="#abcdef";
	document.all.c2_3.style.display="block";
	document.all.c2.style.display="block";
}

//vis menu 2_4
function page2_4() {
  reset();
  document.all.td2.style.backgroundColor="#abcdef";
	document.all.td2_4.style.backgroundColor="#abcdef";
	document.all.c2_4.style.display="block";
	document.all.c2.style.display="block";
}

//vis menu 3_1
function page3_1() {
  reset();
  document.all.td3.style.backgroundColor="#abcdef";
	document.all.td3_1.style.backgroundColor="#abcdef";
	document.all.c3_1.style.display="block";
	document.all.c3.style.display="block";
}

//vis menu 3_2
function page3_2() {
  reset();
  document.all.td3.style.backgroundColor="#abcdef";
	document.all.td3_2.style.backgroundColor="#abcdef";
	document.all.c3_2.style.display="block";
	document.all.c3.style.display="block";
	reset_3_2();
}

//vis menu 3_3
function page3_3() {
  reset();
  document.all.td3.style.backgroundColor="#abcdef";
	document.all.td3_3.style.backgroundColor="#abcdef";
	document.all.c3_3.style.display="block";
	document.all.c3.style.display="block";
  importer_lokalitets_liste();
  //aabn_lokaliteter();
}

//vis menu 3_4
function page3_4() {
  reset();
  document.all.td3.style.backgroundColor="#abcdef";
	document.all.td3_4.style.backgroundColor="#abcdef";
	document.all.c3_4.style.display="block";
	document.all.c3.style.display="block";
}

//vis menu 4_1
function page4_1() {
  reset();
  document.all.td4.style.backgroundColor="#abcdef";
	document.all.td4_1.style.backgroundColor="#abcdef";
	document.all.c4_1.style.display="block";
	document.all.c4.style.display="block";
}

//vis menu 4_2
function page4_2() {
  reset();
  document.all.td4.style.backgroundColor="#abcdef";
	document.all.td4_2.style.backgroundColor="#abcdef";
	document.all.c4_2.style.display="block";
	document.all.c4.style.display="block";
}

//vis menu 4_3
function page4_3() {
  reset();
  document.all.td4.style.backgroundColor="#abcdef";
	document.all.td4_3.style.backgroundColor="#abcdef";
	document.all.c4_3.style.display="block";
	document.all.c4.style.display="block";
}

//vis menu 5_1
function page5_1() {
  reset();
  document.all.td5.style.backgroundColor="#abcdef";
	document.all.td5_1.style.backgroundColor="#abcdef";
	document.all.c5_1.style.display="block";
	document.all.c5.style.display="block";
}

//vis menu 5_2
function page5_2() {
  reset();
  document.all.td5.style.backgroundColor="#abcdef";
	document.all.td5_2.style.backgroundColor="#abcdef";
	document.all.c5_2.style.display="block";
	document.all.c5.style.display="block";
}

//vis menu 5_3
function page5_3() {
  reset();
  document.all.td5.style.backgroundColor="#abcdef";
	document.all.td5_3.style.backgroundColor="#abcdef";
	document.all.c5_3.style.display="block";
	document.all.c5.style.display="block";
}

//vis menu 5_4
function page5_4() {
  reset();
  document.all.td5.style.backgroundColor="#abcdef";
	document.all.td5_4.style.backgroundColor="#abcdef";
	document.all.c5_4.style.display="block";
	document.all.c5.style.display="block";
}

//vis menu 5_5
function page5_5() {
  reset();
  document.all.td5.style.backgroundColor="#abcdef";
	document.all.td5_5.style.backgroundColor="#abcdef";
	document.all.c5_5.style.display="block";
	document.all.c5.style.display="block";
}

//reset all menuer til skjult
function reset() {
  document.all.c1.style.display="none";
  document.all.c2.style.display="none";
  document.all.c3.style.display="none";
  document.all.c4.style.display="none";
  document.all.c5.style.display="none";
  document.all.c6.style.display="none";
  document.all.c1_1.style.display="none";
  document.all.c1_2.style.display="none";
  document.all.c1_3.style.display="none";
  document.all.c1_4.style.display="none";
  document.all.c1_5.style.display="none";
  document.all.c2_1.style.display="none";
  document.all.c2_2.style.display="none";
  document.all.c2_3.style.display="none";
  document.all.c2_4.style.display="none";
  document.all.c3_1.style.display="none";
  document.all.c3_2.style.display="none";
  document.all.c3_3.style.display="none";
  document.all.c3_4.style.display="none";
  document.all.c4_1.style.display="none";
  document.all.c4_2.style.display="none";
  document.all.c4_3.style.display="none";
  document.all.c5_1.style.display="none";
  document.all.c5_2.style.display="none";
  document.all.c5_3.style.display="none";
  document.all.c5_4.style.display="none";
  document.all.c5_5.style.display="none";

  document.getElementById('td1').style.backgroundColor="#f1f1ff";
  document.all.td2.style.backgroundColor="#f1f1ff";
  document.all.td3.style.backgroundColor="#f1f1ff";
  document.all.td4.style.backgroundColor="#f1f1ff";
  document.all.td5.style.backgroundColor="#f1f1ff";
  document.all.td1_1.style.backgroundColor="#f1f1ff";
  document.all.td1_2.style.backgroundColor="#f1f1ff";
  document.all.td1_3.style.backgroundColor="#f1f1ff";
  document.all.td1_4.style.backgroundColor="#f1f1ff";
  document.all.td1_5.style.backgroundColor="#f1f1ff";
  document.all.td2_1.style.backgroundColor="#f1f1ff";
  document.all.td2_2.style.backgroundColor="#f1f1ff";
  document.all.td2_3.style.backgroundColor="#f1f1ff";
  document.all.td2_4.style.backgroundColor="#f1f1ff";
  document.all.td3_1.style.backgroundColor="#f1f1ff";
  document.all.td3_2.style.backgroundColor="#f1f1ff";
  document.all.td3_3.style.backgroundColor="#f1f1ff";
  document.all.td3_4.style.backgroundColor="#f1f1ff";
  document.all.td4_1.style.backgroundColor="#f1f1ff";
  document.all.td4_2.style.backgroundColor="#f1f1ff";
  document.all.td4_3.style.backgroundColor="#f1f1ff";
  document.all.td5_1.style.backgroundColor="#f1f1ff";
  document.all.td5_2.style.backgroundColor="#f1f1ff";
  document.all.td5_3.style.backgroundColor="#f1f1ff";
  document.all.td5_4.style.backgroundColor="#f1f1ff";
  document.all.td5_5.style.backgroundColor="#f1f1ff";
}

function show_mainmenu()
{
document.all.td1.style.display = 'block';
document.all.td2.style.display = 'block';
document.all.td3.style.display = 'block';
document.all.td4.style.display = 'block';
document.all.td5.style.display = 'block';
document.all.tr_mainmenu.style.display = 'block';  
document.all.tr_banner.style.display = 'none';
}
