//
// ************************
// layer utility routines *
// ************************

function getStyleObject(objectId) {
    // cross-browser function to get an object's style object given its id
    if(document.getElementById && document.getElementById(objectId)) {
	// W3C DOM
	return document.getElementById(objectId).style;
    } else if (document.all && document.all(objectId)) {
	// MSIE 4 DOM
	return document.all(objectId).style;
    } else if (document.layers && document.layers[objectId]) {
	// NN 4 DOM.. note: this won't find nested layers
	return document.layers[objectId];
    } else {
	return false;
    }
} // getStyleObject

function changeObjectVisibility(objectId, newVisibility) {

    // get a reference to the cross-browser style object and make sure the object exists
    var styleObject = getStyleObject(objectId);
    if(styleObject) {
	styleObject.visibility = newVisibility;
	return true;
    } else {
	// we couldn't find the object, so we can't change its visibility
	return false;
    }
} // changeObjectVisibility

function setHeight()
{
	var scrnheight = getScreenHeight();
	leftside = 130 + 17 + 67;
	leftside = leftside + 359; //minimum for graphic
	rightside = 130 + 108 + 173 + 67 - 2; //error somewhere hence the minus 2!
		
	//Check to see if screenheight is less than (other elements + minimum left side)
	if (scrnheight < leftside)
	{
		//nothing
		//alert("screen height is less than the minimum required for left hand side - doing nothing!");
	}
	else
	{
		//Size the left and right objects accordingly
		var rightobj = getStyleObject('right');
		var leftobj = getStyleObject('left');
		var newright = scrnheight - rightside;
		var newleft = scrnheight - leftside;
		
		rightobj.height = newright;
		leftobj.height = newleft;	
	}
	return true;
} // setHeight


function getScreenWidth()
{
	var screen
	if (document.all || document.getElemntsByID)
	{
		screen = document.body.clientWidth;
	}
	else
	{
		screen = window.innerWidth;
	}
	return screen;
} //getScreenWidth


function getScreenHeight()
{
	var screen
	if (document.all || document.getElemntsByID)
	{
		screen = document.body.clientHeight;
	}
	else
	{
		screen = window.innerHeight;
	}
	return screen;
} //getScreenHieght


function getXpos()
{
	var xpos
	if (document.all || document.getElemntsByID) {
		if (document.body.clientWidth > 800) {
		     xpos = (((document.body.clientWidth-810)/2)+100);
		}
		else {
		     xpos = 100;
		}
	} 
	else {
		if (window.innerWidth > 800) {
		     xpos = (((window.innerWidth-810)/2)+100);
		}
		else {
		     xpos = 100;
		}
	}
return xpos;
} // getXpos
//
// ***************************
// netscape css fix routines *
// ***************************
 
function netscapeCssFix() {
  if (document.WM.WM_netscapeCssFix.initWindowWidth != window.innerWidth || document.WM.WM_netscapeCssFix.initWindowHeight != window.innerHeight) {
    document.location = document.location;
  }
}

function netscapeCssFixCheckIn() {
  if ((navigator.appName == 'Netscape') && (parseInt(navigator.appVersion) == 4)) {
    if (typeof document.WM == 'undefined'){
      document.WM = new Object;
    }
    if (typeof document.WM.WM_scaleFont == 'undefined') {
      document.WM.WM_netscapeCssFix = new Object;
      document.WM.WM_netscapeCssFix.initWindowWidth = window.innerWidth;
      document.WM.WM_netscapeCssFix.initWindowHeight = window.innerHeight;
    }
    window.onresize = WM_netscapeCssFix;
  }
}


//
// ********************
// mouseover routines *
// ********************

function on(imgName) { 
if (document.images) 
document.images[imgName].src = eval(imgName + "h.src"); 
} 

function off(imgName) { 
if (document.images) document.images[imgName].src = eval(imgName + ".src"); 
}


