var ant_period='1d';
function charts(period){
	if (period==ant_period) return;
	document.f_market_data.accion.value='charts_change';
	$("#charts_"+period).addClass("Acti");
	$("#charts_"+ant_period).removeClass("Acti");
	if (period=='1d'){
		$("#img_charts_all_ords").attr("src","http://asx.thebull.com.au/chart/thebull/index-home-intra/xao");

	}
	else{
		$("#img_charts_all_ords").attr("src","http://asx.thebull.com.au/chart/thebull/index-home-hist/xao/"+period);
	}
	ant_period=period;
}

var ant_period_xjo='';
function charts_xjo(period){
	if (period==ant_period_xjo) return;
	document.f_market_data.accion.value='charts_change';
	$("#charts_xjo_"+period).addClass("Acti");
	$("#charts_xjo_"+ant_period_xjo).removeClass("Acti");
	if (period=='1d'){
		$("#img_charts_xjo").attr("src","http://asx.thebull.com.au/chart/thebull/index-home-intra/xjo");

	}
	else{
		$("#img_charts_xjo").attr("src","http://asx.thebull.com.au/chart/thebull/index-home-hist/xjo/"+period);
	}
	ant_period_xjo=period;
}


var ant_tab=1;
function tabs(tab){
	if (tab==ant_tab) return;
	$("#tab_"+tab).addClass("Act");
	$("#table_"+tab).show();
	$("#tab_"+ant_tab).removeClass("Act");
	$("#table_"+ant_tab).hide();
	ant_tab=tab;


}



function market_data_go(){
	document.f_company.action="market_data_company.php";
	document.f_company.RIC.value=$("#RIC_CODE").val();
	document.f_company.submit();
}

function market_data_go_ric(ric){
	document.f_company.action="market_data_company.php";
	document.f_company.RIC.value=ric;
	document.f_company.submit();
}

function market_data_search(){
	document.f_company.accion.value='lookup_code';
	document.f_company.RIC.value=$("#RIC_CODE_SEARCH").val();
	$.ajax({
		type: "POST",
		url: "ajax_market_data.php",
		data: $("#f_company").serialize(),
		async:false,
		success: function(data){
			$("#lookup_code_result").html(data);
		}
	});

	//document.f_company.action="market_data_search.php";
	//$("#RIC").val($("#RIC_CODE").val());
	//document.f_company.submit();
}


function lookup_code(){
	$("#lookup").jqm().jqmShow();
}

