/********************
	dg 22/09/2004 
********************/

/********************
	Work-around for IE to get the css drop-down menus to work
********************/

<!--//--><![CDATA[//><!--
	sfHover = function() {
		var sfEls = document.getElementById("navsub").getElementsByTagName("LI");
		for (var i=0; i<sfEls.length; i++) {
			sfEls[i].onmouseover=function() {
				this.className+=" sfhover";
			}
			sfEls[i].onmouseout=function() {
				this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
			}
		}
	}
	if (window.attachEvent) window.attachEvent("onload", sfHover);
//--><!]]>
	
/********************
	Determines the viewable page size and sets the height of the contents div
********************/

if ( window.attachEvent ) {
	document.attachEvent("onload", jsSetHeightIE);
	document.attachEvent("onreadystatechange", jsSetHeightIE);
}
else if ( window.captureEvents ) {
	window.captureEvents(Event.ONLOAD);
	window.onload = jsSetHeightGecko;
}
else {
	jsSetHeightCSS();
}

function jsSetHeight() {
	// Set height of page
	if ( window.attachEvent ) { jsSetHeightIE(); }
	else if ( window.captureEvents ) { jsSetHeightGecko(); }
	else { jsSetHeightCSS(); }
}

function jsSetHeightGecko() {
	// Set height of contents div in Netscape, Mozilla, Gecko...
	var lHeight = jsWinHeight();

	if ( lHeight > 0 ) {
		// Get field id
		var oElem = document.getElementById("fullcol");
		// Set element height
		oElem.style.height = lHeight + "px";
	}
}

function jsSetHeightIE() {
	// Set height of contents div in IE
	var lHeight = jsWinHeight();

	if ( lHeight > 0 ) {
		// Get field id
		var oElem = document.getElementById("fullcol");
		// Set element height ?
		if ( oElem != undefined ) {
			oElem.style.height = lHeight + "px";
		}
	}		
}

function jsSetHeightCSS() {
	// Set height of contents div
	// Get height of browser
	var lHeight = jsWinHeight();

	// Write style height for content div
	if ( lHeight > 0 ) {
		document.writeln("<style type='text/css'>#fullcol { height: "+ lHeight +"px;}</style>");
	}
}

function jsWinHeight() {
	// Returns height of browser window.
	var lHeight = 0;

	// Get height of browser window 
	if ( window.innerHeight != undefined ) {
		// Netscape, Mozilla, Gecko engine...
		lHeight = window.innerHeight;
	}
	else if ( document.documentElement != undefined && document.documentElement.clientHeight > 0 ) {
		// MSIE 6
		lHeight = document.documentElement.clientHeight;
		// Remove size of padding
		lHeight-= 4; 
	}
	else if ( document.body != undefined ) {
		// MSIE 4 & 5...
		lHeight = document.body.clientHeight;
	}
	else if ( document.height != undefined ) {
		// Other...
		lHeight = document.height;
	}
	else {
		// Unknown...	
		lHeight = 0;
	}

	// Set true content height
	lHeight-= (186);

	// Return value
	return lHeight;
}
 
/********************
	Pop-up window functions
********************/

function jsPopUp(argSrc, argName) {
	// dg 13/10/04

	// Create image object
	var oImg = new Image();

	// Set image path & size
	oImg.src = argSrc;

	// Open new window
	var oPopup = window.open("", "ttt_popup", "status=yes,width=500,height=500,top=10,left=10,resizable");

	// Display image in new window
	oPopup.document.open();
	oPopup.document.write('<html>\n<head>\n<title>'+ argName +'</title>\n</head>\n');
	oPopup.document.write('<body style="background-color: #fff; padding: 0; margin-top: 20px; margin-left: 20px;">\n<img id="ttt_img" src="'+ oImg.src +'" alt="'+ argName +'" style="border: 0; margin: 0;">\n</body>\n</html>');
	oPopup.document.close();

	// Get image width & height
	lWidth = oImg.width;
	lHeight = oImg.height;

	// Get pop-up window size
	if ( lWidth == 0 ) { lWidth = 500; }
	if ( lHeight == 0 ) { lHeight = 500; }
	lWidth += 50;
	lHeight += 95;

	// Resize pop-up window ?
	if ( lWidth > 0 && lHeight > 0 ) { oPopup.resizeTo(lWidth, lHeight); }

	// Send pop-up window to top 
	if ( window.focus ) { oPopup.focus(); }

	// Return value
	return false;
}