var popOuts = new Array("worship","about","ministry","multi","outreach");
var popOutTop = new Array(5,0,70,128,180);
var mouseStat = new Array();
var closerIteration = 0;
for (var i=0; i<=9; i++) {
	mouseStat[i] = new Array(false, false);
}
function menuMouseOver(section, inType, imgHndl, newSrc) {
	mouseStat[section][inType] = true;
	
	imgHndl.src = "/images/navbar/"+newSrc+".jpg";
		
	setTimeout("if (mouseStat["+section+"]["+inType+"]) closeAllOthers("+section+");",450);	
	if (section <= 5) {
		setTimeout("if (mouseStat["+section+"]["+inType+"]) document.getElementById('popOut_"+popOuts[section]+"').style.display = 'block';",500);    
		setTimeout("if (mouseStat["+section+"]["+inType+"]) document.getElementById('popOut_box').style.top = '"+popOutTop[section]+"px';",500);	
	}
}
function menuMouseOut(section, outType, imgHndl, newSrc) {
	mouseStat[section][outType] = false;
	closerIteration++;
	
	if (outType==0) {
		var outTypeC = 1;
	} else {
		var outTypeC = 0;
	}
	
	if ((!mouseStat[section][outTypeC])&&(!mouseStat[section][outType])) imgHndl.src = "/images/navbar/"+newSrc+".jpg";
	if (section <= 5) {
		setTimeout("if ((!mouseStat["+section+"]["+outTypeC+"])&&(!mouseStat["+section+"]["+outType+"])&&(closerIteration=="+closerIteration+")) document.getElementById('popOut_"+popOuts[section]+"').style.display = 'none';",1500);
		setTimeout("if ((!mouseStat["+section+"]["+outTypeC+"])&&(!mouseStat["+section+"]["+outType+"])&&(closerIteration=="+closerIteration+")) closeAllOthers(-1);",2000);		
	}
}
function mouseOver(section, inType) {
	mouseStat[section][inType] = true;
		
	document.getElementById("javaLink_"+popOuts[section]).style.background="#FFD1D1";
		
	setTimeout("if (mouseStat["+section+"]["+inType+"]) closeAllOthers("+section+");",450);	
	setTimeout("if (mouseStat["+section+"]["+inType+"]) document.getElementById('popOut_"+popOuts[section]+"').style.display = 'block';",500);    
	setTimeout("if (mouseStat["+section+"]["+inType+"]) document.getElementById('popOut_box').style.top = '"+popOutTop[section]+"px';",500);
}
function closeAllOthers(section) {
	closerIteration++;
	for (var i = 0; i < popOuts.length; i++) {
		if (section != i) {	
			if (!mouseStat[i][0]) {
				document.getElementById('popOut_'+popOuts[i]).style.display = 'none';
			}
			if (!mouseStat[i][1]) {
				document.getElementById('popOut_'+popOuts[i]).style.display = 'none';
			}
		}
	}	
}
function mouseOut(section, outType) {
	mouseStat[section][outType] = false;
	closerIteration++;
	
	if (outType==0) {
		var outTypeC = 1;
	} else {
		var outTypeC = 0;
	}
	
	if ((!mouseStat[section][outTypeC])&&(!mouseStat[section][outType])) document.getElementById("javaLink_"+popOuts[section]).style.background="none";
	setTimeout("if ((!mouseStat["+section+"]["+outTypeC+"])&&(!mouseStat["+section+"]["+outType+"])&&(closerIteration=="+closerIteration+")) document.getElementById('popOut_"+popOuts[section]+"').style.display = 'none';",1500);
	setTimeout("if ((!mouseStat["+section+"]["+outTypeC+"])&&(!mouseStat["+section+"]["+outType+"])&&(closerIteration=="+closerIteration+")) closeAllOthers(-1);",2000);		
}	

