function errorcheck(form_id)
{
	var missingfields;
	
	missingfields = '';
	
	if(form_id == 'commreq')
	{
		if(document.forms[form_id].commname.value == '')
		{
			missingfields = 'Missing - Commissioner Name \n';			
		}
		
		if(document.forms[form_id].emailaddy.value == '')
		{
			missingfields = missingfields + 'Missing - E-Mail Address \n';	
		}
		
		if(document.forms[form_id].maddress.value == '')
		{
			missingfields = missingfields + 'Missing - Real Name/Mailing Address \n';	
		}
		
		if(document.forms[form_id].whatfor.value == '')
		{
			missingfields = missingfields + 'Missing - Due Date \n';	
		}
		
		if(document.forms[form_id].description.value == '')
		{
			missingfields = missingfields + 'Missing - Commission Description \n';	
		}
		
		if(document.forms[form_id].charinfo.value == '')
		{
			missingfields = missingfields + 'Missing - Character Information \n';	
		}
		
		if(missingfields != '')
		{
			alert('The following errors must be corrected to continue. \n\n' + missingfields);	
		}
		
		else
		{
			confirmation = confirm("You chose: " + document.forms[form_id].comtype[document.forms[form_id].comtype.selectedIndex].text + " as the type of commission you would like. \n\n Are you sure this is correct? \n If not please, PLEASE hit cancel, and pick the right type of commission from the list.");
			
			if(confirmation == true)
			{
				//alert("Ok was pressed")
				document.forms[form_id].submit();
			}
		}
	}
	
	else if(form_id == 'declcomm')
	{
		if(document.forms[form_id].decmessage.value == '')
		{
			missingfields = 'Missing - Decline Message \n';			
		}
		
		if(missingfields != '')
		{
			alert('The following errors must be corrected to continue. \n\n' + missingfields);	
		}
		
		else
		{
			document.forms[form_id].submit();	
		}
		
	}
		
	
	else
	{
		alert('The form could not be tested.  Please contact the webmaster for assistance.');	
	}
	
}

function NoDecs(x)
{

    var tmp = new String();

    tmp=x;

    if (tmp.indexOf(".")>-1)
    {
	    return tmp.length-tmp.indexOf(".")-1;
    }

    else
    {
        return 0;
    }

} 
