




// get height of viewable area and set position of Engine logo

function getDimensions ()
{
	var viewportwidth;
	var viewportheight;

	var browser=navigator.appName;

	// the more standards compliant browsers (mozilla/netscape/opera/IE7) use window.innerWidth and window.innerHeight
 
	if (typeof window.innerWidth != 'undefined')
	{
		viewportwidth = window.innerWidth,
		viewportheight = window.innerHeight
	}
 
	// IE6 in standards compliant mode (i.e. with a valid doctype as the first line in the document)

 	else if (typeof document.documentElement != 'undefined' && typeof document.documentElement.clientWidth != 'undefined' && document.documentElement.clientWidth != 0)
 	{
       		viewportwidth = document.documentElement.clientWidth,
       		viewportheight = document.documentElement.clientHeight
 	}
 
 	// older versions of IE
 
 	else
 	{
       		viewportwidth = document.getElementsByTagName('body')[0].clientWidth,
       		viewportheight = document.getElementsByTagName('body')[0].clientHeight
 	}
	
	var data = new Array (viewportwidth, viewportheight);

	return data;
}

function getHeight() 
{
	var data = getDimensions ();
	var viewportheight = data[1];
	var browser=navigator.appName;
	var ie_adjustment = 0;
	if (document.getElementById('logoEngine'))
	{
		if (browser=="Microsoft Internet Explorer")
			ie_adjustment = 0;
		document.getElementById('logoEngine').style.marginTop = (viewportheight + ie_adjustment + -80) + "px";
	}
	if (document.getElementById('logoEngineLogin'))
	{
		if (browser=="Microsoft Internet Explorer")
		{
			ie_adjustment = -51;
		}
		document.getElementById('logoEngineLogin').style.marginTop = (viewportheight + ie_adjustment + -342) + "px";
	}
}


function yellowHilight ()
{
	document.getElementById('yellowHilightText').style.background = "#ffdd00";
}

function whiteHilight ()
{
	document.getElementById('yellowHilightText').style.background = "#ffffff";
}


function showSubNav ()
{
	document.getElementById('subNav').style.display = "block";
	document.getElementById('nextPreviousButtons').style.display = "block";
}

function hideSubNav ()
{
	document.getElementById('subNav').style.display = "none";
	document.getElementById('nextPreviousButtons').style.display = "none";
}

function addEvent (obj, evType, fn)
{ 
	if (obj.addEventListener)
	{ 
   		obj.addEventListener (evType, fn, false); 
   		return true; 
 	} 
	else if (obj.attachEvent)
	{ 
   		var r = obj.attachEvent ("on"+evType, fn); 
   		return r; 
 	} 
	else 
	{ 
   		return false; 
 	} 
}

function getQueryVariable(variable)
{
	var query = window.location.search.substring(1);
	var vars = query.split("&");
	for (var i=0;i<vars.length;i++)
	{
		var pair = vars[i].split("=");
		if (pair[0] == variable)
		{
			return pair[1];
		}
	}
}

function checkSubNavDisplay ()
{
	// if sub_nav_pointer is set then display the sub nav
	var variable = "sub_nav_pointer";
	var qvResult = getQueryVariable(variable);
	if (qvResult >= 0)
	{
		showSubNav ();	
	}
}

function clearAllNav ()
{
	var navItem = new Array ("navAbout", "navArtefacts", "navWork", "navPeople", "navContact");
	for (var i = 0; i < 5; i++)
	{
		document.getElementById(navItem[i]).style.backgroundPosition = "0 0";
	}
}

function hilightAbout () {
	clearAllNav ();
	navAbout.style.backgroundPosition= "0 -30px";
}

function hilightArtefacts () {
	clearAllNav ();
	navArtefacts.style.backgroundPosition= "0 -30px";
}

function hilightWork () {
	clearAllNav ();
	navWork.style.backgroundPosition= "0 -30px";
}

function hilightPeople () {
	clearAllNav ();
	navPeople.style.backgroundPosition= "0 -30px";
}

function hilightContact () {
	clearAllNav ();
	navContact.style.backgroundPosition= "0 -31px";
}

function setContainerHeight ()
{
	var windowData = getDimensions ();
	var windowHeight = windowData[1];
	document.getElementById('pageContainer').style.height = windowHeight + "px";
}



function showExtraNav ()
{
	document.getElementById('extraNav').style.display = "block";
}

function hideExtraNav ()
{
	if (document.getElementById('extraNav'))
	{
		document.getElementById('extraNav').style.display = "none";
	}
}

addEvent(window, 'load', getHeight);
addEvent(window, 'load', hideExtraNav);
addEvent(window, 'resize', getHeight);


// set position of engine logo
if (document.getElementById('logoEngine'))
{
	document.getElementById('logoEngine').style.marginTop = "0px";
}


// for google map
function initialize()
{
	var latlng = new google.maps.LatLng (-34.397, 150.644);
	var myOptions =
	{
		zoom: 8,
		center: latlng,
		mapTypeId: google.maps.MapTypeId.ROADMAP
	};
	var map = new google.maps.Map (document.getElementById ("map_canvas"), myOptions);
}


try
{
    marker.setImage (newImagePath);
}
catch (err)
{
	
}



