var bekend = true;
var prevptrlinks = "";
var prevptrrechts = "";
var menu_root = "";
var prev_tab = "";
var prev_tab_saved = "";
var prev_tab_aaaaa = "";
var catobj = "";
var prevobj = "";
var selected_object = '';
var kenmerk_paneel = document.getElementById('paneel');
//var menu_object = document.getElementById('menu_root');
var temp = "";
var temptab_l = "";
var temptab_r = "";

var agtbrw=navigator.userAgent.toLowerCase(); 
var operaaa=(agtbrw.indexOf('opera')!=-1); 
var folder=''; 
var ie = false;
if (document.all) { ie = true; }


function GetElement(curobj){ 
  var folder=''; 
  if (document.getElementById(curobj)) { 
    folder=document.getElementById(curobj); 
  } else { 
    if (ns6==1||operaaa==true) { 
      folder=curobj.nextSibling.nextSibling; 
    } else { 
      folder=document.all[curobj.sourceIndex+1]; 
    } 
  } 
  return folder 
} 
function init() {
menu_root = document.getElementById('menu_root');
menu_root.onmouseover = menu_over();
}

function image(par1,par2,par3) { alert(par1); }

function zetlayout(ditobj){
  if (prevobj) prevobj.border = 0;
  document.pagina.layout.value = ditobj.name;
  ditobj.border = 2;
  prevobj = ditobj;
}



function ganaar(key,layout,plaatje) {  
window.status = key;


      
// waarde[0]=key    waarde[1]=layout waarde[2]=afbeelding 
//    var waarde = ganaar.arguments;
//    var aantal = waarde.lenght;

//-------- indien reeds een selectie maak deze ongedaan-----//
    if(prev_tab) {
      var tab_links  = 'a' + prev_tab;
      temptab_l = document.getElementById(tab_links);
      
      if(temptab_l.className == 'aktief0') { 
        temptab_l.className = 'nivo0'; 
      }
            
      if(temptab_l.className == 'aktief1') { 
        temptab_l.className = 'nivo1'; 
        temptab_l.parentNode.parentNode.className = 'nivo0';
      }
      prev_tab = '';   
    }

//------ Zet nieuwe selectie op aktief ------//    
    var tab_links  = 'a' + key;
    temptab_l = document.getElementById(tab_links);

    if(temptab_l.className == 'nivo0') {
      temptab_l.className = 'aktief0';      
    }
    if(temptab_l.className == 'nivo1') {
      temptab_l.className = 'aktief1';      
      temptab_l.parentNode.parentNode.className = 'aktief0';
    }
    prev_tab = key; prev_tab_saved = '';
          
    var tmpobj = '';
    if (ie) tmpobj = document.all['bericht']; else tmpobj = document.getElementById('bericht');
    tmpobj.innerHTML = 'HAGGER Webdesign 2011';
    var http = layout;

    var foto = plaatje;
    
    if (foto === '') foto = './afbeeldingen/bg_head.png';
    var headerobj =''; 
    if (document.getElementById('headimg')) { 
       headobj=document.getElementById('headimg');
//       alert(headobj.style.backgroundImage);
       headobj.style.backgroundImage = 'url(' + foto + ')'; 
    }    
    main.document.location.href = 'view/view_main.php?groep='+ key;
    if (http.substr(0,4) == 'http') { window.location= http; }
    if (http.substr(0,1) == '.') { main.document.location.href = http; }
}

function menu_uit() {
  window.status = 'uit';
   if(prev_tab_saved) {
      var tab_links  = 'a' + prev_tab;
      temptab_l = document.getElementById(tab_links);
      
      if(temptab_l.className == 'nivo0') { 
        temptab_l.className = 'aktief0'; 
      }
            
      if(temptab_l.className == 'nivo1') { 
        temptab_l.className = 'aktief1'; 
        temptab_l.parentNode.parentNode.className = 'aktief0';
      }
//      prev_tab = ''; 
    }

   prev_tab_saved = prev_tab;
}

function menu_over() {
 window.status = 'over';

   if(prev_tab_saved) {
      var tab_links  = 'a' + prev_tab;
      temptab_l = document.getElementById(tab_links);
      
      if(temptab_l.className == 'aktief0') { 
        temptab_l.className = 'nivo0'; 
      }
            
      if(temptab_l.className == 'aktief1') { 
        temptab_l.className = 'nivo1'; 
        temptab_l.parentNode.parentNode.className = 'nivo0';
      }
//      prev_tab = ''; 
    }
}

function admlayout(sleutel) {
//    parent.main.location = 'add_page.php?key=' + sleutel;
    var data1 = "add_page.php?key=" + sleutel;
    var data2 = "venster";
    var data3 = "width=600,height=500"; 

//alert(data);

window.open(data1,data2,data3);
}
function islid() {
    parent.main.location = 'adm_lid.php';
}

function kenmerken(obj) {
  huidig_object = obj;
  huidig_object.style.border = '1px solid red';
  selected_object = huidig_object;
//alert(huidig_object.style.border);
}



function keuze(ditobj) {
  if (ditobj.value == '1' || ditobj.value == '') {
    switch (document.user.selloc.selectedIndex) {
      case 0: document.user.kenm.value = '-'; document.user.nivo.value = '1'; break; 
      case 1: document.user.kenm.value = 'H'; document.user.nivo.value = '1'; break;
      case 2: document.user.kenm.value = 'M'; document.user.nivo.value = '1'; break;
     default: document.user.kenm.value = '?';
    }
    if (document.user.selgrp.selectedIndex > 0) {
      document.user.kenm.value = document.user.kenm.value + document.user.selgrp.selectedIndex;
      document.user.nivo.value = '1'; 
    }
  } else {
    document.user.nivo.value = ditobj.value;
    document.user.kenm.value = '-';
  }
} 

function show(a)
{
parent.main.document.location.href = a; 

    }

