// JavaScript Document
function initPage()
{
	InitialiseScrollableArea();
}

function ShowScrollbar()
{
	myHeight = getElementStyle('divMainContent', 'height', 'height');
	myDiv = getObj('divMainContent');
	myScrollers = getObj('divScrollers');
	
	if ((myHeight == 'auto') || (document.getElementById('divMainContent')))
		myHeight = document.getElementById('divMainContent').offsetHeight;
	
	myHeight = parseInt(myHeight);

	var browserName = navigator.appName;
	
	maxHeight = '166';
	
	if (browserName == 'Netscape')
		maxHeight = '166';
	else if (browserName == 'Microsoft Internet Explorer')
		maxHeight = '185';
		
	if (myHeight > maxHeight)
	{
		myScrollers.style.visibility = 'visible';
		// alert('myHeight: ' + myHeight);
		// alert('maxHeight: ' + maxHeight);
	}
	
	// alert('myHeight: ' + myHeight);
	// alert('maxHeight: ' + maxHeight);	
	
	myDiv.style.visibility = 'visible';
}

function getObj(name)
{
	if (document.getElementById)
	  {
		this.obj = document.getElementById(name);
	  }
	  else if (document.all)
	  {
		this.obj = document.all[name];
	  }
	  else if (document.layers)
	  {
		this.obj = document.layers[name];
	  }
	  
	  return(this.obj);
}

function getElementStyle(elemID, IEStyleProp, CSSStyleProp) {
    var elem = document.getElementById(elemID);
    if (elem.currentStyle) {
        return elem.currentStyle[IEStyleProp];
    } else if (window.getComputedStyle) {
        var compStyle = window.getComputedStyle(elem, "");
        return compStyle.getPropertyValue(CSSStyleProp);
    }
    return 0;
}

var state = 'hidden';

function showhide(layer_ref) {
	if (state == 'visible') {
		state = 'hidden';
	}
	else {
		state = 'visible';
	}
	
	if (document.all) { //IS IE 4 or 5 (or 6 beta)
		eval( "document.all." + layer_ref + ".style.visibility = state");
	}
	
	if (document.layers) { //IS NETSCAPE 4 or below
		document.layers[layer_ref].visibility = state;
	}

	if (document.getElementById && !document.all) {
		maxwell_smart = document.getElementById(layer_ref);
		maxwell_smart.style.visibility = state;
	}
}

