$(document).ready(function() {

	var $menu = $('.menu');
	$menu.find('a.about').attr('href', 'about/history-and-background');
	$menu.find('a.projects').attr('href', 'projects/current-projects');
	$menu.find('a.equipment').attr('href', 'equipment/longwall-equipment');
	$menu.find('a.corporate').attr('href', 'corporate/board-of-directors');
	$menu.find('a.news').attr('href', 'news/news-stories');
	$menu.find('li.home ul').css('display', 'none');

	// get the ASX share price
	if(("" + window.location).match(/investors$/)) {
		var $asx_code = 'DSB';
		var $asx_url = $('script[src$="global.js"]').attr('src').replace('jscript/global.js', 'includes/getASX.php?code=' + $asx_code);
		var $gif = $('#header').css('background-image').replace('url(', '').replace('header-bg.jpg)', 'ajax-loader.gif');
		$gif = './includes/template/images/ajax-loader.gif';
		var $loading = $('<img src="' + $gif + '" alt="Loading the share price" style="border:0;width:16px;height:11px;" />');

		$('#page_content a:first').replaceWith($loading);

		$.ajax({
			url: $asx_url, 
			cache: false, 
			/* type: 'text',  */
			success: function(html) {				
				var $row = $(html).find('#col .row:first');
				var $code = $.trim($row.text());
				var $price = $.trim($row.next().text());
				var $change = $.trim($row.next().next().text());

				var $info = "Current Share Price : " + $price + "<br />";
				$info += "Change +/- : " + $change + "<br />";
				$info += "ASX Code : " + $code + "<br />";
				$info += "<small>(information source: <a href=\"http://www.asx.com.au/asx/markets/equityPrices.do";
				$info += "?by=asxCodes&asxCodes=" + $asx_code + "\">ASX</a>, ";
				$info += "data is delayed by 20 minutes)</small>";

				$loading.replaceWith($info);
			}
		});


	}

});
