<!--
function suburb_detail_onclick(x_button)
{
	if (x_button == 'save')
	{
		if(suburb_detail_validate() == false)
			return;
		
		ajax_showdiv('div_form_1');

		var x_id = document.getElementById('suburb_id').value;

		var url = 'modules/suburb/suburb_detail.php';

		var param = 'mode=update';
		param += '&id=' 				+ x_id;
		param += '&suburb_status_id='	+ document.getElementById('suburb_status_id').value;
		param += '&suburb_notes='		+ encodeURIComponent(document.getElementById('suburb_notes').value);

		param += '&suburb_name=' 		+ encodeURIComponent(document.getElementById('suburb_name').value);
		param += '&suburb_state_id='	+ document.getElementById('suburb_state_id').value;

		param += '&suburb_postcode=' 	+ document.getElementById('suburb_postcode').value;
		param += '&suburb_km=' 			+ document.getElementById('suburb_km').value;
		param += '&suburb_lat=' 		+ document.getElementById('suburb_lat').value;
		param += '&suburb_lon=' 		+ document.getElementById('suburb_lon').value;

		param += '&suburb_mini=' 		+ document.getElementById('suburb_mini').value;
		param += '&suburb_ute=' 		+ document.getElementById('suburb_ute').value;

		for (i=1; i<=20; i++)
		{
			param += '&suburb_ton' + i +'=' 	+ document.getElementById('suburb_ton' + i).value;
		}
		
		var div = 'div_popup_1';
		var callback = "index_location('transport', 'suburb', 'summary', '" + x_id + "')";
		
		ajax_processRequestPost(url,param,div,callback)
	}
	return false;
}

function suburb_detail_validate()
{
	if (!isEmpty('suburb_name', 'Please enter a \'Name\''))
		return false;

	// All Good.
	return true;
}

function suburb_detail_highlight()
{
	index_bg_color('suburb_name','#99FF99');
	index_bg_color('suburb_state_id','#99FF99');
	index_bg_color('suburb_mini','#99FF99');
	index_bg_color('suburb_ute','#99FF99');
	for (i=1; i<=20; i++)
	{
		index_bg_color('suburb_ton' + i,'#99FF99');
	}
}

function suburb_detail_onload(id)
{
	if ((id == 'insert')  || (id == 'edit') || (id == 'view'))
		ajax_showpopup('div_popup_1','div_result');
		
	suburb_detail_highlight();

	index_conv_dec('suburb_km',0);	
	index_conv_dec('suburb_lat',2);	
	index_conv_dec('suburb_lon',2);	

	index_conv_dec('suburb_mini',2);	
	index_conv_dec('suburb_ute',2);	

	for (i=1; i<=20; i++)
	{
		index_conv_dec('suburb_ton' + i,2);	
	}
}
-->
