function AdjustColumnsHeight()
{
  // set vars
  var pageMinWidthIs = 800;
  var pageMinHeightIs = 300;
  
  // get a reference to the  DIVS
  var centerCol = window.document.getElementById('mainindex'); 
  var footer = window.document.getElementById('footer');                 
  
  //get window size  
  var myWidth = 0, myHeight = 0;
  if( typeof( window.innerWidth ) == 'number' ) {
    //Non-IE
    myWidth = window.innerWidth;
    myHeight = window.innerHeight;
  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    //IE 6+ in 'standards compliant mode'
    myWidth = document.documentElement.clientWidth;
    myHeight = document.documentElement.clientHeight;
  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    //IE 4 compatible
    myWidth = document.body.clientWidth;
    myHeight = document.body.clientHeight;
  }
  //window.alert( 'Width = ' + myWidth );
  //window.alert( 'Height = ' + myHeight );

  
  // calculate the max height                     
  var hCenterCol = centerCol.offsetHeight;
  //var hFooter = footer.offsetHeight;
                                     
  //window.alert( 'Height = ' + hFooter );
  if( hCenterCol < myHeight) {
    window.document.getElementById('mainindex').style.height = myHeight - 20 + 'px';
  }                                 
  // calculate the max width
  var wCenterCol = centerCol.offsetWidth;
  var maxWidth = Math.max(pageMinWidthIs,wCenterCol);
  window.document.getElementById('maincontainer').style.width = myWidth + 'px';
  window.document.getElementById('mainindex').style.width = myWidth + 'px';
  
  // Show the footer                                
  //window.document.getElementById('footer').style.visibility = 'inherit';
}


function setVisibility(id, visibility) {
	document.getElementById(id).style.display = visibility;
}

// Copyright 2006-2007 javascript-array.com

var timeout	= 500;
var closetimer	= 0;
var ddmenuitem	= 0;

// open hidden layer
function mopen(id)
{	
	// cancel close timer
	mcancelclosetime();

	// close old layer
	if(ddmenuitem) ddmenuitem.style.visibility = 'hidden';

	// get new layer and show it
	ddmenuitem = document.getElementById(id);
	ddmenuitem.style.visibility = 'visible';

}
// close showed layer
function mclose()
{
	if(ddmenuitem) ddmenuitem.style.visibility = 'hidden';
}

// go close timer
function mclosetime()
{
	closetimer = window.setTimeout(mclose, timeout);
}

// cancel close timer
function mcancelclosetime()
{
	if(closetimer)
	{
		window.clearTimeout(closetimer);
		closetimer = null;
	}
}

// close layer when click-out
document.onclick = mclose; 

function fadeIn(objId, opacity) {
// fade in image function
    if (document.getElementById) {
        obj = document.getElementById(objId);
        if (opacity <= 100) {
            setOpacity(obj, opacity);
            opacity += 10;
            window.setTimeout("fadeIn('" + objId + "'," + opacity + ")", 100);
        }
    }
}

function setOpacity(obj, opacity) {
//sets opasity of a control
    opacity = (opacity == 100) ? 99.999 : opacity;

    // IE/Win
    obj.style.filter = "alpha(opacity:" + opacity + ")";

    // Safari<1.2, Konqueror
    obj.style.KHTMLOpacity = opacity / 100;

    // Older Mozilla and Firefox
    obj.style.MozOpacity = opacity / 100;

    // Safari 1.2, newer Firefox and Mozilla, CSS3
    obj.style.opacity = opacity / 100;
}
