//Javascript voor printkeuze in dossierpagina

// Global variables
var isCSS, isW3C, isIE4, isNN4, isIE6CSS, isOp;
// initialize upon load to let all browsers establish content objects
function initDHTMLAPI() {
	
    if (document.images) {
        isCSS = (document.body && document.body.style) ? true : false;
        isW3C = (isCSS && document.getElementById) ? true : false;
        isIE4 = (isCSS && document.all) ? true : false;
        isNN4 = (document.layers) ? true : false;
        isIE6CSS = (document.compatMode && document.compatMode.indexOf("CSS1") >= 0) ? true : false;
        isOp = (navigator.userAgent.indexOf("Opera") != -1) ? true : false;
    }
}
// set event handler to initialize API
window.onload = initDHTMLAPI;

// Convert object name string or object reference
// into a valid element object reference
function getRawObject(obj) {
    var theObj;
    if (typeof obj == "string") {
        if (isW3C) {
            theObj = document.getElementById(obj);
        } else if (isIE4) {
            theObj = document.all(obj);
        } else if (isNN4) {
            theObj = seekLayer(document, obj);
        }
    } else {
        // pass through object reference
        theObj = obj;
    }
    return theObj;
}

// Convert object name string or object reference
// into a valid style (or NN4 layer) reference
function getObject(obj) {
    var theObj = getRawObject(obj);
    if (theObj && isCSS) {
        theObj = theObj.style;
    }
    return theObj;
}


// Set the visibility of an object to visible
function show(obj) {
    var theObj = getObject(obj);
    if (theObj) {
        theObj.visibility = "visible";
    }
}

// Set the visibility of an object to hidden
function hide(obj) {
    var theObj = getObject(obj);
    if (theObj) {
        theObj.visibility = "hidden";
    }
}

var menuActief;
var verberg;

function menuShow(menu) {
	menuActief = true;
	menuReset();
	show(menu);
}

function hoverMenu(state, menu) {	
	if(state=='over'){
		menuActief = true;
		clearTimeout(verberg);		
	}else{
		menuUit(menu);	
	}
}

function menuUit(item) {
	menuActief = false;
	verberg = setTimeout("menuHide('" + item + "');", 1000);	
}

function menuHide(item) {	
	if(!menuActief){
		hide(item);
		}
}

function menuReset() {
	var menus = ['printmode'];
	var i;
	for(i = 0; i < menus.length; i++){
		hide(menus[i]);
	}
}