inMenu = 0;

menus = new Array();
menus[0] = 'home';
menus[1] = 'wedstrijden';
menus[2] = 'spelers';
menus[3] = 'club';
menus[4] = 'fanzone';
menus[5] = 'multimedia';
menus[6] = 'links';
menus[7] = 'about';

/**
 * Hilight button.
 */
function hilightButton( name )
{
	document.getElementById( name ).src = http_root+'/images/menu/submenu/'+name+'2.gif';
}

/**
 * Dehilight button.
 */
function dehilightButton( name )
{
	document.getElementById( name ).src = http_root+'/images/menu/submenu/'+name+'1.gif';
}

/**
 * Showing menu: hilight button and show submenu...
 */
function showMenu( name )
{
	inMenu = 1;
	
	hideAllMenus();
	
	// hilight button
	document.getElementById( name ).src = http_root+'/images/menu/'+name+'2.gif';
	
	// show submenu
	document.getElementById( 'submenu_'+name ).style.visibility='visible';
	
	// hilight active submenu item
	document.getElementById( activesubmenu_name ).src = http_root+'/images/menu/submenu/'+activesubmenu_name+'2.gif';
}

function hideMenu( name )
{
	inMenu = 0;
	
	// dehilight button
	document.getElementById( name ).src = http_root+'/images/menu/'+name+'1.gif';
}

function hideAllMenus()
{
	for( i=0; i<menus.length; i++ )
	{
		if( menus[i] != name )
		{
			// dehighlight menu and hide submenu
			document.getElementById( menus[i] ).src = http_root+'/images/menu/'+menus[i]+'1.gif';
			document.getElementById( 'submenu_'+menus[i] ).style.visibility='hidden';
		}
	}
}

/**
 * Function which resets the menu when mouse pointer is not on the menu
 */
function resetMenu()
{
	// check if mouse pointer is not in menu
	if( !inMenu )
	{
		showMenu( activemenu_name );
	}
	
	setTimeout( 'resetMenu()', 5000 );
}

/**
 * Function that highlights a sebmenu button 
 */
function HighlightSubMenuButton( name )
{
	document.getElementById( name ).src = http_root+'/images/menu/submenu/'+name+'2.gif';
	
	// store that user is active and menu may not reset
	inMenu = 1;
}

/**
 * Function that dehighlights a sebmenu button 
 */		
function DeHighlightSubMenuButton( name )
{
	// only dehighlight if button is not active submenu button
	if( name != activesubmenu_name ) document.getElementById( name ).src = http_root+'/images/menu/submenu/'+name+'1.gif';
	
	// store that user is inactive and menu may reset
	inMenu = 0;
}

function ActivateHeader( header )
{
	document.getElementById( header+'_header' ).src=http_root+'/images/headers/'+header+'_header2.gif';
	document.getElementById( header+'_header' ).style.zIndex=2;
	document.getElementById( header+'_inhoud' ).style.display='block';
}

function DeActivateHeader( header )
{
	document.getElementById( header+'_header' ).src=http_root+'/images/headers/'+header+'_header1.gif';
	document.getElementById( header+'_header' ).style.zIndex=1;
	document.getElementById( header+'_inhoud' ).style.display='none';				
}

// function called several times per second to make sure that footer is always at bottom
function UpdateCSS()
{
	document.getElementById('toolbar_right').style.top=document.documentElement.scrollTop+document.documentElement.clientHeight-90+'px';
	
	setTimeout( 'UpdateCSS()', 10 );
}

// make sure the complete site is never captured in frames
if( top.location.href != self.location.href ) top.location.href = self.location.href;