﻿<!--
// tabselection
function selectTab(strHref) {
    var tabdiv = document.getElementById("tabs"); //select the layer tabs
    var a = tabdiv.getElementsByTagName("a"); //select the anchor elements in tabs
    var found = false;
    var extURL = strHref.split("/"); //split the URL for an external application checkup
    var compare = strHref; //use a temporary var to compare results
    if (a.length > 0) {
        //exception external applications
        if (extURL[7] != "" && extURL[3] == "xchg") {
            compare=extURL[7];
        }
        //loop trough the anchors in tabdiv
        for (var i=0; i<a.length; i++) {
            if (a[i].href.indexOf(compare)>-1) {
                a[i].className="active";
                found = true;
            }
        }
        //set default active
        if (found==false) a[0].className = "active";
    }
}
/*
function selectTab(strHref) {
    var tabdiv = document.getElementById("tabs"); //select the layer tabs
    var a = tabdiv.getElementsByTagName("a"); //select the anchor elements in tabs
    var found = false;
    var extURL = strHref.split("/"); //split the URL for a checkup
    var compare = strHref; //use a temporary var to compare results
    var today = new Date();
    var cdays = new Date().setDate(today.getDate()+2);
    var path="false";
    if (a.length > 0) {
        if (extURL[7] != "" && extURL[3] == "xchg") {
            compare=extURL[7];
        }
        for (var i=0; i<a.length; i++) {
            //alert(a[i].href.indexOf(compare));
            //ik kom _L _P of _H tegen in de url
            if (a[i].href.indexOf(compare)>-1) {
                a[i].className="active";
                found = true;
                //cookie
                if (extURL[5].indexOf("_H")>0) path="huishoudelijk";
                else if (extURL[5].indexOf("_P")>0) path="professioneel"; 
                else if (extURL[5].indexOf("_L")>0) path="lokaal bestuur";                 
                else path="huishoudelijk";
                setCookie("tabs", path, extURL[2]);
            }
        }
        if (found==false){
            a[0].className = "active";
            //ik kom niets tegen in de url
            //dus ik kijk of ik een cookie vind
            var newURL=extURL[5].split(".");
            switch (getCookie("tabs")){
                case "huishoudelijk": redirectURL = newURL[0] + "_H.htm"; break;
                case "professioneel": redirectURL = newURL[0] + "_P.htm"; break;
                case "lokaal bestuur": redirectURL = newURL[0] + "_L.htm"; break;
                default: redirectURL = newURL[0] + "_H.htm"; break;
            }
            extURL[5] = redirectURL;
            loadXMLDoc(extURL.join("/"));
        }           
    }
}
*/
//xmlhttprequest
var xmlhttp;
function loadXMLDoc(getURL){
    xmlhttp=null;
    // code for all new browsers
    if (window.XMLHttpRequest){
        xmlhttp=new XMLHttpRequest();
    }
    // code for IE5 and IE6
    else if (window.ActiveXObject){
        xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
    }
    if (xmlhttp!=null){
            xmlhttp.open("GET",getURL,false);
        xmlhttp.send(null);
        window.location.href=getURL;
    }
    else { alert("Your browser does not support XMLHTTP."); }
}
// uitklapbare tekst
function showHide (rid){
  obj=document.getElementById(rid);
  current=(obj.style.display=='block') ? 'none' : 'block';
  if (obj.style.display=='') current='none';
  obj.style.display=current;
  state=(current=='block') ? 'opened' : 'closed';
  setClassName(rid, state);
}
function setClassName (id, status){
  var setEl = document.getElementById("res_" + id);
  if (setEl) { setEl.className=status; }
}
function toggle_tree(id) {
    element= document.getElementById(id);
    obj= document.getElementById('i_'+ id);
    if (!obj) return;
    
    if (obj.style.display=='visible' || obj.style.display=='block' || obj.style.display=='' ) {
        obj.style.display = 'none';
        if (element.className)
            element.className = "faq_closed";
    }else {
        obj.style.display = 'block';
        if (element.className)
            element.className = "faq_open";
    } 
}
// cookie functions
function setCookie(name, value, domain, expires, path, secure) {
    document.cookie= name + "=" + escape(value) +
        ((expires) ? "; expires=" + expires.toGMTString() : "") +
        ((path) ? "; path=" + path : "") +
        ((domain) ? "; domain=" + domain : "") +
        ((secure) ? "; secure" : "");
}
function getCookie(name) {
    var dc = document.cookie;
    var prefix = name + "=";
    var begin = dc.indexOf("; " + prefix);
    if (begin == -1) {
        begin = dc.indexOf(prefix);
        if (begin != 0) return null;
    } else {
        begin += 2;
    }
    var end = document.cookie.indexOf(";", begin);
    if (end == -1) {
        end = dc.length;
    }
    return unescape(dc.substring(begin + prefix.length, end));
}
function deleteCookie(name, path, domain) {
    if (getCookie(name)) {
        document.cookie = name + "=" +
            ((path) ? "; path=" + path : "") +
            ((domain) ? "; domain=" + domain : "") +
            "; expires=Thu, 01-Jan-70 00:00:01 GMT";
    }
}
//creation of a new popup window
var newPopup = function(obj) {
    _gaq.push(['_trackEvent', 'External', 'Popup', obj.url]);
    obj.width = (typeof obj.width == 'undefined')?screen.width/2:obj.width;
    obj.height = (typeof obj.height == 'undefined')?screen.height/2:obj.height;
    var objContent = document.getElementById('containerShadow');
    if(typeof obj.xpos == 'undefined'){
            var posLeft = (navigator.appName=='Microsoft Internet Explorer')?window.screenLeft:window.screenX;
            var posContentLeft = (objContent)?(objContent.offsetLeft+242):0; 
        //242 = distance from containerShadow to text
            obj.xpos = (objContent)?(posLeft + posContentLeft):((screen.width/2)-(obj.width/2));
    }else{
        obj.xpos = (obj.xpos == "left")?0:obj.xpos;
        obj.xpos = (obj.xpos == "right")?(screen.width-obj.width):obj.xpos;
        obj.xpos = (obj.xpos == "center")?((screen.width/2) - (obj.width/2)):obj.xpos;
    }
    if(typeof obj.ypos == 'undefined'){
        var posTop = (navigator.appName=='Microsoft Internet Explorer')?window.screenTop:(window.screenY+106);
        //106 = default height of the menu bars in FireFox 
        var posContentTop = (objContent)?objContent.offsetTop+234:0;
        //234 = distance from containerShadow to text
        obj.ypos = (objContent)?(posTop+posContentTop):((screen.height/2)-(obj.height/2));        
    }else{
        obj.ypos = (obj.ypos == "top")?0:obj.ypos;
        obj.ypos = (obj.ypos == "bottom")?(screen.height-obj.height):obj.ypos;
        obj.ypos = (obj.ypos == "center")?((screen.height/2) - (obj.height/2)):obj.ypos;
    }
    obj.xoffset = (typeof obj.xoffset == 'undefined')?0:obj.xoffset;
    obj.yoffset = (typeof obj.yoffset == 'undefined')?0:obj.yoffset;
    obj.name = (typeof obj.name == 'undefined')?'Eandis':obj.name;
    obj.scrollbars = (typeof obj.scrollbars == 'undefined')?'yes':obj.scrollbars;
    obj.resizable = (typeof obj.resizable == 'undefined')?'yes':obj.resizable;
    obj.status = 'no';
    obj.loc = 'no';
    obj.toolbar = 'no';
    obj.menubar = 'no';
    obj.titlebar = 'no';
    obj.directories = 'no';
    
    obj.xpos += obj.xoffset
    obj.ypos += obj.yoffset
    var strScrollbars = 'scrollbars = '+obj.scrollbars+',';
    var strResizable = 'resizable = '+obj.resizable+',';
    var strStatus = 'status = '+obj.status+',';
    var strLocation = 'location = '+obj.loc+',';
    var strToolbar = 'toolbar = '+obj.toolbar+',';
    var strMenubar = ' menubar= '+obj.menubar+',';
    var strTitlebar = 'titlebar= '+obj.titlebar+',';
    var strDirectories = 'directories= '+obj.directories+',';
    features = strScrollbars+strResizable+strStatus+strLocation+strToolbar+strMenubar+strTitlebar+strDirectories;
    features +=  'width = '+obj.width+',height = '+obj.height;
    features +=  ',top = ' + obj.ypos;
    features +=  ',left = ' + obj.xpos;
    var newwindow = null;
    newwindow = window.open(obj.url, obj.name, features);
    if (!newwindow.opener) newwindow.opener = self;
    
    if (window.focus) {newwindow.focus()}
}
// DNB remove last pipe in navigation
function noPipe(){
    var scdiv = document.getElementById("shortcuts");
    var span = scdiv.getElementsByTagName("span");
    var i = span.length;
    if (i > 0){
        span[i-1].innerHTML = "";
    }
}
-->
