// JavaScript Document


 function get_comcur( intype, p_url ) {
        $.ajax({
          url: "/php-bin/abn/get_" + p_url + ".php",
          data: "p_type=" + intype,
          cache: false,
          success: function(html){
            $("#" + intype + "Table tr:last").after(html);
          }
        });
    }
 
    function open_popup() {
        var myw = window.open('/pls/cms/abn.market_details?p_code=' + document.getElementById('p_code').value,'_blank','toolbar=no,location=no,status=no,menubar=no,scrollbars=no,width=645,height=470,resizable');
    }
    
    function do_show ( indiv ) {
        $(".div_graph").hide();
        $("#" + indiv).show();
    }
    
    function do_showaf ( indiv ) {
        $(".div_graphaf").hide();
        $("#" + indiv).show();
    }
    
    $(document).ready(function(){
        get_comcur("currencies", "comcur");
        get_comcur("commodities", "comcur");
        get_comcur("indicators", "indicators");
        get_comcur("Afindicators", "allafrica");
        $("#graph_container").load("/php-bin/abn/get_graphs.php", function() { $("#graphs_J203").show(); } );
        $("#Afgraph_container").load("/php-bin/abn/get_graphsaf.php", function() { $("#graphs_JA0R").show(); } );
        
    });
/*    
	function search_it() {
		if ( $('#p_search').val().length > 2 ) {
			$.post('/php-bin/abn/test.php', { srch: $('#p_search').val() }, function(html) {
				$('#company_lookup').html(html);
				
			});
		}
	}
*/	
	$(document).ready( function() {
	   $("#company_lookup").load('/php-bin/abn/get_companylist.php');
		//$("#p_search").keyup(function () { search_it(); } );
	});
	
