var errors, hddnAreaSizeId, selAreaTypeId, edtAreaSizeName;
var module = baseRootURL + "area_size/";

function registerAreaSize(action)
{
	errors = false;
	validate_hddnAreaSizeId();
	validate_selAreaTypeId();
	validate_edtAreaSizeName();
	if (!errors)
	{
		var data = {};
		data.dummy = ""; //we seem to get errors from the first value, so always add a dummy value first.
		data.action = action;
		if (document.getElementById("hddnAreaSizeId") != null) data.hddnAreaSizeId = hddnAreaSizeId;
		data.selAreaTypeId = selAreaTypeId;
		data.edtAreaSizeName = edtAreaSizeName;
		callModule("area_size/area_size_val.php", data);
	}
}
function insertAreaSize(){registerAreaSize(0)}
function modifyAreaSize(){registerAreaSize(1)}

function validate_hddnAreaSizeId(){
	if (document.getElementById("hddnAreaSizeId") != null) hddnAreaSizeId=document.getElementById("hddnAreaSizeId").value;}
function validate_selAreaTypeId(){selAreaTypeId=validateRequiredSelection("selAreaTypeId", "Please make a valid selection.");}
function validate_edtAreaSizeName(){edtAreaSizeName=validateRequiredText("edtAreaSizeName", "This field is required.");}

function viewAreaSize(id)
{
	var data = {}
	data.dummy = "";
	data.hddnAreaSizeId = id;
	data.action = 2;
	callModule("area_size/area_size_val.php", data);
}

function editAreaSize(id)
{
	var data = {}
	data.dummy = "";
	data.hddnAreaSizeId = id;
	data.action = 3;
	callModule("area_size/area_size_val.php", data);
}

function deleteAreaSize(id, desc)
{
	if (confirm("Are you sure you want to delete "+desc+" and all associated records?"))
	{
		var data = {}
		data.dummy = "";
		data.hddnAreaSizeId = id;
		data.action = 4;
		callModule("area_size/area_size_val.php", data);
	}
}
