// JScript File

//Variabelen//
var nSpeedSet = 3;
var nHeightCS = -125;
var aHeightCount = new Array();
//

//Functies//
function dropDownInterval(n){
	n--;
	if (aCheck[n] == false){
		setVars(n);
		aSwitch[n] = 0;
		aInterval[n] = setInterval("dropDown('" + n + "')", 1);
	}
}
function HidePanel(n){
    n--;
    if (aCheck[n] == true){      
        clearInterval(aInterval[n]);
		aHeightCount[n] = aHeightCountSet[n];		
		aDiv[n].style.top = aHeightCount[n]+'px';
		aSpeed[n] = nSpeedSet;
		aCheck[n] = false;
    }
}

function ResetPanels(){
	for (i = 0; i <= nDivs; i++){
		clearInterval(aInterval[i]);
		aHeightCount[i] = aHeightCountSet[i];		
		aDiv[i].style.top = aHeightCount[i]+'px';
		aSpeed[i] = nSpeedSet;
		aCheck[i] = false;
	}
	 setTimeout("SetmenuVisible()",100);
}
function SetmenuVisible(){
	document.getElementById("uitklapmenus").style.visibility="visible";
}
function setVars(n) {
    ResetPanels();
	aCheck[n] = true;
}
function dropDown(n){   
	aHeightCount[n] += aSpeed[n];	
	aDiv[n].style.top = aHeightCount[n]+'px';
	switch (aSwitch[n]) {
	case 0 :
		aSpeed[n] *= 1.1;
		if (aHeightCount[n] >= aHeight[n]-20){
			aSpeed[n] = -2;
			aSwitch[n] = 1;
		}
		break;
	case 1 :
		if (aHeightCount[n]<=aHeight[n]-30) {
			aSpeed[n] = 2;
			aSwitch[n] = 2;
		}
		break;
	case 2 :
		if (aHeightCount[n]>=aHeight[n]-22) {
			aDiv[n].style.top = aHeight[n]-22+'px';
			clearInterval(aInterval[n]);
		}
		break;
	}
}


