<!--
//  Title:       Region Summary
//  Developer:   Wade McDonough
//  Verion:      1.0
//  Date:        3 Nov 2006
//  Description: 
// 
/////////////////////////////

function ad_summary_button(x_button)
{
	if (x_button == 'filter_reset')
	{
		document.getElementById('filter_type').value 	= 0;
		document.getElementById('filter_checkbox_1').checked = false;

		var qry = 'modules/ad/ad_summary.php';
		qry += '?filter_type=' 				+ '0';
		qry += '&filter_checkbox_1=' 		+ '';

		ajaxFunction(qry,'ajax_body');
		return false;
	}
	if (x_button == 'filter_apply')
	{
		var qry = 'modules/ad/ad_summary.php';
		qry += '?filter_type=' 				+ document.getElementById('filter_type').value;
		qry += '&filter_checkbox_1=' 		+ document.getElementById('filter_checkbox_1').checked;

		ajaxFunction(qry,'ajax_body');
		return false;
	}

	if (x_button == 'add_new')
	{
		if (!isSelected('stock_type_id', 'Please select an Ad Type'))
			return false;
	
		var stock_type_id = document.getElementById('stock_type_id').value;
		
		if (stock_type_id == 1)
			var qry = 'modules/ad/ad_cattle_detail.php';
		if (stock_type_id == 2)
			var qry = 'modules/ad/ad_sheep_detail.php';
		if (stock_type_id == 3)
			var qry = 'modules/ad/ad_other_detail.php';
		if (stock_type_id == 4)
			var qry = 'modules/ad/ad_advert_detail.php';

		qry += '?mode='  				+ 'insert';
		ajaxFunction(qry,'ajax_body');
		return false;
	}
}
-->