function mqaStockPrice() { }


mqaStockPrice.prototype = {
		
		init: function() {
			var $mainContent = $(".Main-WebModule");
			var $stockPrDiv  = $("#stock-price");
			var $stockPriceP = $("p.stockprice");
			var $tblSP       = $('table.sp-full');
			var $rhsContent  = $('.RHS-WebModule');
			
			//for all other pages besides the homepage		
             if (typeof $rhsContent !== 'undefined') {
			  if ($rhsContent.filter(":eq(1)").length >0) {
				$rhsContent.filter(":eq(1)").hide();
						$('table.sp-full tbody tr td:first').html("MQA (ASX ID:MQA)");
			  }
             }    
			
			//for the homepage
			if ($mainContent.length >0 && $stockPrDiv.length >0) {
				$mainContent
					.clone()
					.appendTo("div#stock-price.stock div.home-box-inner")
					.end()
					.parent().find("p.stockprice").insertAfter("#stock-price .Main-WebModule");
				
				$('.Main-WebModule:first').show();
				$('.Main-WebModule:last').remove();
				
					if ($tblSP.length >0 ) {
						$('table.sp-full tbody tr td:eq(0)').html("MQA");
					}
			}
	}
};



if (typeof jQuery !== 'undefined') {  

	$(document).ready(function() {
		
		var objStock = new mqaStockPrice(); 
		
		objStock.init();
		
		
	});	
}
