function showcptanggia()
{
		jQuery("#increase").show();
		jQuery("#decrease").hide();
		jQuery("#quantitymax").hide();
		jQuery("#quantitymax").hide();
		index =0;
		jQuery("#tab_cpstatistic li").each(function(){
			if(index==0) $(this).addClass('active');
			else $(this).removeClass('active');
			index++;
		});
}

function showcpgiamgia()
{
		jQuery("#increase").hide();
		jQuery("#decrease").show();
		jQuery("#quantitymax").hide();
		index =0;
		jQuery("#tab_cpstatistic li").each(function(){
			if(index==1) $(this).addClass('active');
			else $(this).removeClass('active');
			index++;
		});
}

function showcpkhoplenhnhieu()
{
		jQuery("#increase").hide();
		jQuery("#decrease").hide();
		jQuery("#quantitymax").show();
		index =0;
		jQuery("#tab_cpstatistic li").each(function(){
			if(index==2) $(this).addClass('active');
			else $(this).removeClass('active');
			index++;
		});
}

function showvniindex()
{
		jQuery("#hose").show();
		jQuery("#hastc").hide();
		jQuery("#world").hide();
		index =0;
		jQuery("#tabs_market li").each(function(){
			if(index==0) $(this).addClass('active');
			else $(this).removeClass('active');
			index++;
		});
}

function showhnxindex()
{
		jQuery("#hose").hide();
		jQuery("#hastc").show();
		jQuery("#world").hide();
		index =0;
		jQuery("#tabs_market li").each(function(){
			if(index==1) $(this).addClass('active');
			else $(this).removeClass('active');
			index++;
		});
}

function showworldindex()
{
		jQuery("#hose").hide();
		jQuery("#hastc").hide();
		jQuery("#world").show();
		index =0;
		jQuery("#tabs_market li").each(function(){
			if(index==2) $(this).addClass('active');
			else $(this).removeClass('active');
			index++;
		});
}

function showeventbydate()
{
		jQuery("#event_byday").show();
		jQuery("#event_bycode").hide();
		
		index =0;
		jQuery("#tabs_event li").each(function(){
			if(index==0) $(this).addClass('active');
			else $(this).removeClass('active');
			index++;
		});
}

function showenventbycode()
{
		jQuery("#event_byday").hide();
		jQuery("#event_bycode").show();
		
		index =0;
		jQuery("#tabs_event li").each(function(){
			if(index==1) $(this).addClass('active');
			else $(this).removeClass('active');
			index++;
		});
}

$(function(){
	
	$("#ya").jSuggest({
		url: root_url+"ajax/listcompany/",
		type: "GET",
		data: "searchQuery",
		autoChange: true
	});
	
	 $('#event_bycode_data a').tooltip({
		track: true,
		delay: 0,
		showURL: false,
		showBody: " - ",
		extraClass: "tooltip_box_width",
		fade: 250
	});
	 
	 $('#event_bydate_data a').tooltip({
		track: true,
		delay: 0,
		showURL: false,
		showBody: " - ",
		extraClass: "tooltip_box_width",
		fade: 250
	});

});

function showcurrency()
{
		jQuery("#box-currency-show").show();
		jQuery("#box-quote-show").hide();
		
		index =0;
		jQuery("#tabs-pricequote li").each(function(){
			if(index==0) $(this).addClass('active');
			else $(this).removeClass('active');
			index++;
		});
}

function showquote()
{
		jQuery("#box-currency-show").hide();
		jQuery("#box-quote-show").show();
		
		index =0;
		jQuery("#tabs-pricequote li").each(function(){
			if(index==1) $(this).addClass('active');
			else $(this).removeClass('active');
			index++;
		});
}

$(document).ready(function(){
	$('#bnt_code_event').click(function(){
		$('#event_bycode_data').html('<img src="'+root_url+'public/scripts/thirdparty/jsuggest/ajax-loader.gif'+'" /> Loading...');
		var codestock = $('#ya').val();
		$.ajax({
				  type: "POST",
				  url: root_url+"ajax/listeventbycode/",
				  data: ({codestock:codestock}),
				  success: function(msg){
				  		$('#event_bycode_data').html(msg);
				  }
		});
	 });
});