document.oncontextmenu = function(){return false}
var roodMagentaGroen = ['#ff0000', '#ff00ff', '#00ff00'];

function blurLink(x) {
  try {
	x.blur();
  } catch (ignored) {}
}

function vulkers(level) {

    var curProjnaamValue = '';
    
    switch(level) {
      case 1:
        $('projnaam').update();
        break;
      case 2:
        curProjnaamValue = $('projnaam').innerHTML;
        var curProjnaamColor = $('projnaam').getStyle('color');
        setTimeout("hideNext()", 2800);
        break;
      case 3:
        // only on start page, don't hide next
        // resize window
        fitscreenmode(1280, 950);
        //exit function
        return;
    }
    
    $('menucont2').getElementsByClassName('menuitem2').each(function(divtag) {
      divtag.immediateDescendants().each(function(atag) {

	// this info is not from the current page, but the mouseover
        var projInfoString = atag.readAttribute('title');
        var projInfo = eval( "$H(" + projInfoString + ")" );
        // remove the ugly title tooltips
        atag.removeAttribute('title');

	// the info we want
        var projNum = projInfo.projNum;
        var projColor = roodMagentaGroen[(projNum - 1) % 3];
        var projBGColor = projInfo.bgColor;

        
        var projNaam = atag.immediateDescendants()[0].readAttribute('alt');
                
        var atag_onmouseover_org = atag.onmouseover;
        atag.onmouseover = function() {
        	atag_onmouseover_org();
        	$('projnaam').setStyle({color:projColor});
        	$('projnaam').update(projNaam);
        };
        
        var atag_onmouseout_org = atag.onmouseout;
        atag.onmouseout = function() {
        	atag_onmouseout_org();
        	$('projnaam').update(curProjnaamValue);
        	$('projnaam').setStyle({color:curProjnaamColor});
        };
      });
    });
}

var ptState = 0;
function pivtoggle() {
	if (ptState == 0) {
		$('piv').setStyle({display:'block'});
		$('pivtoggle').setStyle({backgroundImage:'url(/fileadmin/templates/main/gfx/pijl'+curProjColor+'O.png)'});
		ptState = 1;
	} else {
		$('piv').setStyle({display:'none'});
		$('pivtoggle').setStyle({backgroundImage:'url(/fileadmin/templates/main/gfx/pijl'+curProjColor+'R.png)'});
		ptState = 0;
	}
}

function hideNext() {
	var next = $('next');
	if (next != "undefined" && next != "null" && next != "" && next != null) {
		var nextBGStyle = $('next').getStyle('backgroundImage');
		$('next').setStyle({backgroundImage:'url(/clear.gif)'});
		$('next').onmouseover = function() {
			$('next').setStyle({backgroundImage:nextBGStyle});
			setTimeout("hideNext()", 2500);
		};
		$('next').onmouseout = function() {
			$('next').setStyle({backgroundImage:'url(/clear.gif)'});
		};
	}
}

function fitscreenmode(w, h) {
	try {
		var myWidth = 0, myHeight = 0;
		if( typeof( window.innerWidth ) == 'number' ) {
			//Non-IE
			myWidth = window.innerWidth;
			myHeight = window.innerHeight;
		} else if ( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
			//IE 6+ in 'standards compliant mode'
			myWidth = document.documentElement.clientWidth;
			myHeight = document.documentElement.clientHeight;
		} else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
			//IE 4 compatible
			myWidth = document.body.clientWidth;
			myHeight = document.body.clientHeight;
		}
		myWidth = w - myWidth;
		myHeight = h - myHeight;
		
		window.resizeBy(myWidth, myHeight);
		window.moveTo(0, 0) ;
	} catch (ignored) {
		screenAvail();
	}
}

function screenAvail() {
	try {
		window.resizeTo(window.screen.availWidth,window.screen.availHeight);
	} catch (ignored) {

	}
}