// JavaScript Document
function MM_displayStatusMsg(msgStr) { //v1.0
  status=msgStr;
  document.MM_returnValue = true;
}

function CheckForBlankFields()
{
	document.getElementById('submit').disabled=true;
	var strMess = 'You have the following missing fields:\n\n';
	var blnSave = true;
	var objCompany;
	var objInvoice;
	var objAmount;

	if (document.layers)
		{
		objCompany = eval(document['custom']);
		objInvoice = eval(document['item_name']);
		objAmount = eval(document['amount']);
		}
	else if (document.all)
		{
		objCompany = eval(document.all('custom'));
		objInvoice = eval(document.all('item_name'));
		objAmount = eval(document.all('amount'));
		}
	else if (document.getElementById)
		{
		objCompany = eval(document.getElementById('custom'));
		objInvoice = eval(document.getElementById('item_name'));
		objAmount = eval(document.getElementById('amount'));
		}
		
	if(objCompany.value=='')
		{
		blnSave=false;
		strMess = strMess + '\t-Company/Name\n';
		}
		
	if(objInvoice.value=='')
		{
		blnSave=false;
		strMess = strMess + '\t-Invoice #\n';
		}
		
	if(objAmount.value=='')
		{
		blnSave=false;
		strMess = strMess + '\t-Amount\n';
		}

	if (!(blnSave))
		{
		alert(strMess);
		return false;
		}
	else
		{
	return true;
	}

	document.getElementById('submit').disabled=false;
}

function CheckForm()
{
	if(CheckForBlankFields())
		{
		document.getElementById('submit').disabled=true;
		return true;
		}
	else
		{
		document.getElementById('submit').disabled=false;
		return false;
		}
}
