
	var wlFundamentals = {
	
		"Security Details": {
	
			"Symbol": ["MAH", "The Symbol for this security"]
	
			,
		
			"Issuer Name": ["MACMAHON HOLDINGS LIMITED", "Full legal name of the issuer"]
	
			,
		
			"Security Type": ["Ordinary", "The type of this security"]
	
			,
		
			"GICS Sector": ["Industrials", "Global Industry Classification Standard Sector"]
	
			,
		
			"GICS Industry Group": ["Capital Goods", "Global Industry Classification Standard Industry Group"]
	
			,
		
			"First Active Date": ["1/12/1983", "The date on which the security was first entered into the ASX security database"]
	
			,
		
			"First Quoted Date": ["1/12/1983", "The date on which a security was/will be first quoted on the market"]
	
		},
		
		"Fundamentals": {
	
			"Total Class Issue": ["738,631,705", "The total number of securities of this class quoted on the exchange"]
	
			,
		
			"Market Capitalisation": ["$550,280,600", "The current capitalisation of this security (Total Class Issue	x  Current Price)"]
	
			,
		
			"Earnings Rate Per Share": ["$0.0014", "Rolling 12 months earnings per share"]
	
			,
		
			"Earnings Yield": ["0.188%", "Percentage of (Earnings Rate per share / Last Price)"]
	
			,
		
			"52week High/Low": ["0.760 / 0.445", "FIXME"]
	
		}
		
	};
	

function replaceElementWithFundamentalsTable(element) {
	var table, section, row, cell, sectionKey, key;

	// Build a new table from the data structure given
	table = document.createElement('table');
	table.className = "wlFundamentals";

	for (sectionKey in wlFundamentals) {
		row = table.insertRow(table.rows.length);

		cell = row.insertCell(row.cells.length);
		cell.colSpan = 2;
		cell.className = "wlFundamentalsSectionHeader"
		cell.appendChild(document.createTextNode(sectionKey));

		for (key in wlFundamentals[sectionKey]) {
			row = table.insertRow(table.rows.length);

			cell = row.insertCell(row.cells.length);
			cell.appendChild(document.createTextNode(key));
			cell.title = wlFundamentals[sectionKey][key][1];
			cell.className = "wlFundamentalsKey";

			cell = row.insertCell(row.cells.length);
			cell.appendChild(document.createTextNode(
					wlFundamentals[sectionKey][key][0]));
			cell.className = "wlFundamentalsValue";
		}
	}

	// Replace the given element with our new table.
	element.parentNode.insertBefore(table, element);
	element.parentNode.removeChild(element);
}


