//
//$Log: admin_utils.js,v $
//Revision 1.2  2007/04/10 13:03:16  diginnet
//add checkProd() and checkSubProd()
//
//Revision 1.1  2007/04/08 20:54:24  diginnet
//panic checkpoint after disk failure
//
//

/**
	checkProdGroup()
	Validate form elements for
	adding / amending product group entries
	
*/
function checkProdGroup(prod_group_name, prod_group_notes)
{
	var key = getObjValue(prod_group_name);
	var notes = getObjValue(prod_group_notes);
	
	if (!key || key.trim() == '')
	{
		alert("Please enter a product group name");
		return false;
	}
	
	if (!notes || notes.trim() == '')
	{
		alert("Please enter notes for\nthis product group");
		return false;
	}
		
	return true;
	
}

/**
	checkProd()
	Validate form elements for
	adding / amending product entries
	
*/
function checkProd(prod_name, prod_notes)
{
	var key = getObjValue(prod_name);
	var notes = getObjValue(prod_notes);
	
	if (!key || key.trim() == '')
	{
		alert("Please enter a product name");
		return false;
	}
	
	if (!notes || notes.trim() == '')
	{
		alert("Please enter notes for\nthis product");
		return false;
	}
		
	return true;
	
}

/**
	checkSubProd()
	Validate form elements for
	adding / amending sub-product entries
	
*/
function checkSubProd(subprod_name, subprod_notes)
{
	var key = getObjValue(subprod_name);
	var notes = getObjValue(subprod_notes);
	
	if (!key || key.trim() == '')
	{
		alert("Please enter a sub-product name");
		return false;
	}
	
	if (!notes || notes.trim() == '')
	{
		alert("Please enter notes for\nthis sub-product");
		return false;
	}
		
	return true;
	
}


/**
	checkSysCtl()
	Validate form elements for
	adding / amending sys_ctl entries
	
*/
function checkSysCtl(ctl_key, ctl_val, ctl_notes)
{
	var key = getObjValue(ctl_key);
	var val = getObjValue(ctl_val);
	var notes = getObjValue(ctl_notes);
	
	if (!key || key.trim() == '')
	{
		alert("Please enter a control key");
		return false;
	}
	
	if (!val || val.trim() == '')
	{
		alert("Please enter a control value");
		return false;
	}
	
	if (!notes || notes.trim() == '')
	{
		alert("Please enter notes for\nthis control parameter");
		return false;
	}
	
	return true;
	
}