<!--
function ad_sheep_detail_button(x_button)
{
	if (x_button == 'save_step_1')
	{
		// Ensure that all required fields have been completed...
		if(!ad_sheep_detail_validate_step_1())
			return false;
	
		var qry = 'modules/ad/ad_sheep_detail.php';
		qry += '?mode='						+ 'update_step_1';
		qry += '&step_no='					+ '2';

		qry += '&stock_id='					+ document.getElementById('stock_id').value;
		qry += '&stock_sale_type_id='		+ document.getElementById('stock_sale_type_id').value;
		qry += '&stock_quantity='			+ document.getElementById('stock_quantity').value;
		qry += '&stock_price='				+ document.getElementById('stock_price').value;
		qry += '&stock_price_type_id='		+ index_getRadioButtonValue(document.forms[0].stock_price_type_id);
		qry += '&stock_location_id='		+ document.getElementById('stock_location_id').value;
		qry += '&stock_description='		+ document.getElementById('stock_description').value;
		qry += '&stock_user_name='			+ document.getElementById('stock_user_name').value;
		qry += '&stock_user_suburb='		+ document.getElementById('stock_user_suburb').value;
		qry += '&stock_user_location='		+ document.getElementById('stock_user_location').value;
		qry += '&stock_user_phone='			+ document.getElementById('stock_user_phone').value;
		qry += '&stock_user_email='			+ document.getElementById('stock_user_email').value;
		qry += '&stock_property='			+ document.getElementById('stock_property').value;
		qry += '&stock_other='				+ document.getElementById('stock_other').value;
		qry += '&stock_delivery_point='		+ document.getElementById('stock_delivery_point').value;
		qry += '&stock_delivery_day='		+ document.getElementById('stock_delivery_day').value;
		qry += '&stock_delivery_month='		+ document.getElementById('stock_delivery_month').value;
		qry += '&stock_delivery_year='		+ document.getElementById('stock_delivery_year').value;

		qry += '&sheep_breed_id='			+ document.getElementById('sheep_breed_id').value;
		qry += '&sheep_cross_id='			+ document.getElementById('sheep_cross_id').value;
		qry += '&sheep_category_id='		+ document.getElementById('sheep_category_id').value;
		qry += '&sheep_organic_id='			+ index_getRadioButtonValue(document.forms[0].sheep_organic_id);
		qry += '&sheep_grazing_id='			+ document.getElementById('sheep_grazing_id').value;
		qry += '&sheep_mated_id='			+ index_getRadioButtonValue(document.forms[0].sheep_mated_id);
		qry += '&sheep_scanned_id='			+ document.getElementById('sheep_scanned_id').value;
		qry += '&sheep_age_year='			+ document.getElementById('sheep_age_year').value;
		qry += '&sheep_age_month='			+ document.getElementById('sheep_age_month').value;
		qry += '&sheep_age_day='			+ document.getElementById('sheep_age_day').value;
		qry += '&sheep_shearing='			+ document.getElementById('sheep_shearing').value;
		qry += '&sheep_skin_id='			+ document.getElementById('sheep_skin_id').value;
		qry += '&sheep_scratch_id='			+ index_getRadioButtonValue(document.forms[0].sheep_scratch_id);
		qry += '&sheep_mulesed_id='			+ index_getRadioButtonValue(document.forms[0].sheep_mulesed_id);
		qry += '&sheep_dentition_id='		+ document.getElementById('sheep_dentition_id').value;
		qry += '&sheep_prime_id='			+ document.getElementById('sheep_prime_id').value;
		qry += '&sheep_store_id='			+ document.getElementById('sheep_store_id').value;
		qry += '&sheep_forward_id='			+ document.getElementById('sheep_forward_id').value;
		qry += '&sheep_small_id='			+ document.getElementById('sheep_small_id').value;
		qry += '&sheep_medium_id='			+ document.getElementById('sheep_medium_id').value;
		qry += '&sheep_large_id='			+ document.getElementById('sheep_large_id').value;
		qry += '&sheep_weight='				+ document.getElementById('sheep_weight').value;
		qry += '&sheep_ojd_id='				+ index_getRadioButtonValue(document.forms[0].sheep_ojd_id);
		qry += '&sheep_chemicals='			+ document.getElementById('sheep_chemicals').value;
		qry += '&sheep_health='				+ document.getElementById('sheep_health').value;

		ajaxFunction(qry,'ajax_body');
	
		return false;
	}
	if (x_button == 'save_step_2')
	{
		// Ensure that all required fields have been completed...
		if(!ad_sheep_detail_validate_step_2())
			return false;
	
		var qry = 'modules/ad/ad_sheep_detail.php';
		qry += '?mode='						+ 'update_step_2';
		qry += '&step_no='					+ '3';
		qry += '&stock_id='					+ document.getElementById('stock_id').value;

		ajaxFunction(qry,'ajax_body');
		return false;
	}
	if (x_button == 'save_step_3')
	{
		// Ensure that all required fields have been completed...
		if(!ad_sheep_detail_validate_step_3())
			return false;
	
		var qry = 'modules/ad/ad_sheep_detail.php';
		qry += '?mode='						+ 'update_step_3';
		qry += '&step_no='					+ '4';
		qry += '&stock_id='					+ document.getElementById('stock_id').value;

		// Step 3 - Payment
		qry += '&stock_status_id='			+ document.getElementById('stock_status_id').value;
		ajaxFunction(qry,'ajax_body');
		return false;
	}
}

function ad_sheep_detail_validate_step_1()
{
	// General	
	if (!isSelected('stock_sale_type_id', 'Please select a Sale Type'))
		return false;

	if (!isSelected('sheep_breed_id', 'Please select a Breed'))
		return false;

	if (!isSelected('sheep_category_id', 'Please select a Category'))
		return false;

	if (!isNumeric('stock_quantity', 'Please enter a valid Quantity\n(Numbers only)'))
		return false;

	if (!isNumeric('stock_price', 'Please enter a Price\n(Numbers only)'))
		return false;

	if (!isSelected('stock_location_id', 'Please select a Location'))
		return false;

	// All Good
	return true;
}
function ad_sheep_detail_validate_step_2()
{
	// All Good
	return true;
}
function ad_sheep_detail_validate_step_3()
{
	// All Good
	return true;
}
-->