function showLayer (chosenLayer ) {
	setLayer('courseSummary', 'furtherInfoDetails' );
	setLayer('courseOptions', 'furtherInfoDetails' );
	setLayer('courseDives', 'furtherInfoDetails' );
	setLayer('courseTheory', 'furtherInfoDetails' );
	setLayer('courseSchedule', 'furtherInfoDetails' );
	setLayer('courseCosts', 'furtherInfoDetails' );
	setLayer(chosenLayer, 'furtherInfoDetailsVisible' );
}

function setLayer( whichLayer, newStyle ) {
	var elem;
	if( document.getElementById ) // this is the way the standards work
		elem = document.getElementById( whichLayer );
	else if( document.all ) // this is the way old msie versions work
		elem = document.all[whichLayer];
	else if( document.layers ) // this is the way nn4 works
		elem = document.layers[whichLayer];
	elem.className = newStyle;
}

function getElementLeftPosition(e) {
	var x=0;
        var y="";
	var checkName = "content";
	while(e){
		var thisName = e.className; 
		if ( thisName != checkName ) x+=e.offsetLeft;
		y = y + "\n class=" + e.className + " offset=" + e.offsetLeft + " total=" + x;
		e=e.offsetParent;
	}
	// alert ( y );
	return x;
}

function getElementTopPosition(e) {
	var y=0;
	while(e){
		y+=e.offsetTop;
		e=e.offsetParent;
	}
	return y;
}


function ShowPopup(hoveritem,thetext) {
	hp = document.getElementById("hoverPopup");

	// Set position of hover-over popup
	hp.style.top = (getElementTopPosition(hoveritem) + 15) + 'px';
	hp.style.left = (getElementLeftPosition(hoveritem) + 15) + 'px';

	// Set the popup text
	hp.innerHTML = thetext;
	//hp.innerHTML = thetext + "<BR/>left: " + hp.style.left + "<BR/>top: "+hp.style.top;

	// Set popup to visible
	hp.style.visibility = "Visible";
}

function HidePopup() {
	hp = document.getElementById("hoverPopup");
	hp.style.visibility = "Hidden";
}



