// Makes sure the three main divs are the same height.
function adaptMainDivs()
{
    var leftDiv       = document.getElementById('MainLeftDiv');
    var mainDiv       = document.getElementById('MainMainDiv');  
    var rightDiv      = document.getElementById('MainRightDiv');

    if (rightDiv && leftDiv && mainDiv)
    {        
        var height = 0;
        
        // find the highest div
        if (leftDiv.clientHeight       > height) height = leftDiv.clientHeight;
        if (mainDiv.clientHeight       > height) height = mainDiv.clientHeight;
        if (rightDiv.clientHeight      > height) height = rightDiv.clientHeight;

		height += 30;
		
        // set new height
        leftDiv.style.height      = height + 'px';
        mainDiv.style.height      = height + 'px';
        rightDiv.style.height     = height + 'px';
    }
    
    if(rightDiv && mainDiv)
    {
        var height = 0;
        
        // find the highest div
        if (mainDiv.clientHeight       > height) height = mainDiv.clientHeight;
        if (rightDiv.clientHeight      > height) height = rightDiv.clientHeight;

		height += 30;
		
        // set new height
        mainDiv.style.height      = height + 'px';
        rightDiv.style.height     = height + 'px';
    }
}

// Adapts the columns on the startpage
function adaptStartPage()
{
	adaptStartModules();
	
	var StartMainDiv = document.getElementById('StartMainDiv');

    if (StartMainDiv)
    {   
		StartMainDiv.style.height = 'auto';
		var x = StartMainDiv.offsetHeight;
		StartMainDiv.style.height = x + 'px';
    }
}

// Adapts the height of the modules on the startpage
function adaptStartModules()
{
	var maxheight = 0;
	var alltags=document.all? document.all : document.getElementsByTagName("div"); 
	var modules=new Array;
	for (i=0; i<alltags.length; i++)
	{ 
		if (alltags[i].className.indexOf("ModuleBody") != -1)
		{
			
			modules[modules.length] = alltags[i];
			if (alltags[i].offsetHeight > maxheight)
			{
				maxheight = alltags[i].offsetHeight;
			}
		}
	} 
	
	for (i=0; i<modules.length; i++)
	{ 
		modules[i].style.height = maxheight + 'px';
	} 
}
function RedirectScript(url)
{
	if(url != '')
	{
		location.href = url;
	}
}