﻿<!--
/***************************************************
BEGIN SUPPRESS ERROR MESSAGE SECTION
***************************************************/

// This script suppresses error messages from the status bar.
function handleErr(msg, url, line_no)
{ return true; }

onerror = handleErr;

/***************************************************
END SUPPRESS ERROR MESSAGE SECTION
***************************************************/

/***************************************************
BEGIN CANCEL RIGHT CLICK SECTION
***************************************************/

// This script cancels the right-click event
//document.oncontextmenu = function() { return false; }

/***************************************************
END CANCEL RIGHT CLICK SECTION
***************************************************/

/***************************************************
BEGIN MENU FUNCTIONS SECTION
***************************************************/

function preCacheMenuImages()
{
	if (document.images)
	{
		var imageURLs = new Array(6);
		imageURLs[0] = "images/menu/home_over.gif";
		imageURLs[1] = "images/menu/community_over.gif";
		imageURLs[2] = "images/menu/environment_over.gif";
		imageURLs[3] = "images/menu/projectupdates_over.gif";
		imageURLs[4] = "images/menu/aboutus_over.gif";
		imageURLs[5] = "images/menu/contact_over.gif";
		
		for (var i = 0; i < imageURLs.length; i++)
		{
			var tempImg = new Image(119, 11);
			tempImg.src = imageURLs[i];
		}
	}				
}

// mouseover and mouseout for menu items
function showMenuMouseover(imageName)
{
	var image = document.getElementById(imageName);
	if (image != null)
	{
		image.src = image.src.replace(".gif", "_over.gif");
	}
}

function showMenuMouseout(imageName)
{
	var image = document.getElementById(imageName);
	if (image != null)
	{
		image.src = image.src.replace("_over.gif", ".gif");
	}
}

/***************************************************
END MENU FUNCTIONS SECTION
***************************************************/

/***************************************************
BEGIN GENERAL FUNCTIONS SECTION
***************************************************/

function setLinkHref(link)
{
	link.href = "mailto:" + unescapeHTML(link.innerHTML);
	return true;
}

function resetForm()
{
	document.forms[0].reset();
	var inputs = document.getElementsByTagName("input");
	for (var i = 0; i < inputs.length; i++)
	{
		if (inputs[i].type == "text")
		{
			inputs[i].value = "";
		}
	}
}

function confirmDelete(deleteType, extraMsg)
{
	extraMsg = (extraMsg == null) ? "" : "\n\n" + extraMsg;
	return confirm("Are you sure you want to delete this " + deleteType + "?" + extraMsg);
}

function setInputFieldValue(theField, theValue)
{
	theField.value = theValue;
}

function unescapeHTML(html)
{
	var htmlNode = document.createElement("DIV");
	htmlNode.innerHTML = html;
	if (htmlNode.innerText != undefined)
	{
		return htmlNode.innerText; // IE
	}
	return htmlNode.textContent; // FF and others
}

function closeWindow()
{
	//window.opener ='';
	//window.close();
	self.close();
}

/***************************************************
END GENERAL FUNCTIONS SECTION
***************************************************/

/***************************************************
BEGIN SPECIFIC PAGE FUNCTIONS SECTION
***************************************************/

function initializeMatrixplusGoogleMap()
{
	//return;
	if (endsWith(document.location.href, "ContactUs.aspx") && GBrowserIsCompatible())
	{
		// Brisbane
		var map = new GMap2(document.getElementById("map_canvas"));
		var latLng = new GLatLng(-27.465461,153.027749);
		map.setCenter(latLng, 14);
		//map.setUIToDefault();
		map.setMapType(G_HYBRID_MAP);
		map.addControl(new GMapTypeControl());
		map.addControl(new GSmallMapControl());
		map.addOverlay(new GMarker(latLng));
		map.openInfoWindowHtml(map.getCenter(), "<div style=\"width:150px\">Matrixplus Consulting Pty Ltd<br/>Level 4<br/>127 Creek Street<br/>Brisbane QLD 4000<br/>AUSTRALIA</div>");
	}
}

function initializeSGCPGoogleMap()
{
	return; // not using the Google map any more!

	if ((endsWith(document.location.href, "Default.aspx") || endsWith(document.location.href, "/") || endsWith(document.location.href, ".com.au")) && GBrowserIsCompatible())
	{
		// Alpha
		var map = new GMap2(document.getElementById("map_canvas"));
		var latLng = new GLatLng(-23.65333,146.641045);
		map.setCenter(latLng, 10);
		//map.setUIToDefault();
		map.setMapType(G_HYBRID_MAP);
		map.addControl(new GMapTypeControl());
		map.addControl(new GSmallMapControl());
		map.addOverlay(new GMarker(latLng));
		map.openInfoWindowHtml(map.getCenter(), "<div style=\"height:100px; padding: 0px; margin: 0px; text-align:center;vertical-align:middle\"><b>South Galilee Coal Project</b><br/>(south-west of the township of Alpha,<br/>approximately 180 kilometres west of Emerald)<br/>Galilee Basin<br/>Central-Western Queensland<br/>AUSTRALIA</div>");
	}
}

// not used in SGCP site yet
function showOrHideDiv(objButton, strDivName)
{
	if (objButton.value == "Show")
	{
		document.getElementById("d_clip_container").style.visibility = "hidden";
		animatedcollapse.show(strDivName);
		objButton.value = "Hide";
	}
	else
	{
		animatedcollapse.hide(strDivName);
		objButton.value = "Show";
		document.getElementById("d_clip_container").style.visibility = "visible";
	}
}

// -->
