/**
*	Javascript functions for general purpose
*	@author Giovanni Bolognese
*	@date	April 2010, the 1st
*	@email	gbolognese@zigwebsoftware.nl
*	@copyrights	Zig Websoftware
*/

/**
* @var integer Viewport variable height
*/
var iDeltaV;

/*
*	Dinamich resizing of the height for the body container, so to get always the maximum height.
*	@return void
*/
function adaptViewConteinerHeight()
{
	// Viewport height
	iDeltaV= document.viewport.getHeight();
	
	// Effective initial content-container height
	iDeltaC = $('body_container').getHeight();
	
	if(iDeltaC <=iDeltaV)
	{
		$('body_container').style.height = iDeltaV+'px';
	}
}

/**
*	Function to rendering the navigationmenu entirely green making it longer as the content page (if this is longer then menu navigation)
*	@return void
*/
function resizeNavigationMenu()
{
	var iContainerHeight 	= $('inner_container_block').getHeight();
	var iMenuHeigt			= $('inner_subnav').getHeight();
	
	if(iContainerHeight >= iMenuHeigt)
	{
		$('inner_subnav').style.height	= iContainerHeight+'px';
	}
}

function startEventObserve()
{
	// Changing image for the arabic nutton when onmouseover the button self.
	if($('link_arabic'))
	{
		Event.observe($('link_arabic'), 'mouseover', function(){$('arabic').src='/images/arabic_active.jpg'; } );
		Event.observe($('link_arabic'), 'mouseout', function(){$('arabic').src='/images/arabic.jpg'; } );
	}
	
	if($('navigation_left_block') && $('inner_container_block'))
	{
		resizeNavigationMenu();
	}
}

Event.observe(window, 'load', startEventObserve );
