/*************************************
 * Menu control voor Hulphond website	*
  **************************************/
  
var currentMenu = "";
var timer=0;
var unglowTimer = 100;
var maxOpaque=0;
var minOpaque=0;
var object;
var dropUpTimer = 0;

function show(item)  {
	currentMenu = 'sub' + item;
	hideAll(); 
	timer=0;
	unglowTimer = 100;
	unglowSub('sub1');
	unglowSub('sub2');
	unglowSub('sub3');
	unglowSub('sub4');
	unglowSub('sub5');
	unglowSub('sub6');
	unglowSub('sub7');
	unglowSub('sub8');
	unglowSub('sub9');
	unglowSub('sub10');
	
	glowSub()
	
	if (document.getElementById('item' + item)) {
		document.getElementById('item' + item).style.display='inline';
	}
	/*
	if (document.getElementById('sub' + item)) {
		document.getElementById('sub' + item).style.display='inline';
	}
	*/
}


function hideAll() {
	var i;
	for (i=1; i<=10; i++) {
		if (document.getElementById('item' + i)) {
			if (document.getElementById('item'+i).className != 'itemselected' ) {
				document.getElementById('item' + i).style.display='none';
			}
		}
		/* if (document.getElementById('sub' + i)) {
			document.getElementById('sub' + i).style.display='none';
		} */
	}
}


function glowSub() {
	maxOpaque = 85;
	if (document.getElementById(currentMenu) ) { 
		if (timer <= maxOpaque ) {
			timer += 5;
			object = document.getElementById(currentMenu).style;
			object.display='inline'; 		
			object.opacity = timer/100;
			object.MozOpacity = timer/100;
			object.KhtmlOpacity = timer/100;
			object.filter = 'alpha(opacity=' + timer + ')';
			/* object.clip = 'rect(0px ' + timer * 3.3 + 'px ' + timer * 3 + 'px 0px)';  */
			object.clip = 'rect(0px 400px ' + 1.3 * timer  + 'px 0px)'; 
			setTimeout("glowSub();", 30); 
		} 
	} 
}

function unglowSub(element) {
	if (document.getElementById(element) ) {
		object = document.getElementById(element).style;
		object.opacity = 0;
		object.MozOpacity = 0;
		object.KhtmlOpacity = 0;
		object.filter = 'alpha(opacity=0)';
		object.display = 'none';
	}
}


function showSP(spons, url) {
	if (document.getElementById("logouitgelicht") ) {
		document.getElementById("logouitgelicht").src="/images/spnsrs/sp_" + spons + ".gif"
	}
	if (document.getElementById("urluitgelicht") ) {
		document.getElementById("urluitgelicht").href= url
	}
}

function hideSP(spons) {
}

var x = 0;
var pos = "";
function barometer() {
	if ( x > -80 ) {
		x-=1;
		pos = "0px " + x + "px";
		document.getElementById("barometer").style.backgroundImage = 'url(../images/barometer_verloop.jpg)'; 
		document.getElementById("barometer").style.backgroundPosition = pos;
		setTimeout("barometer()", 20);  
	}
}


function toggleFAQ(elt) {
	if (elt) {
		current = elt.style.display;
		if (current == 'none') {
			elt.style.display = 'block';
		} else {
			elt.style.display = 'none';
		}
	}
}