// Javascript to check the fields of the volunteer application
//Suzanne Willett


function checkSuggForm () {
	
	
	origWork = 0;
	perfType = 0;
	prodRights = 0;
	assocPerm = 0;
	runTime = 0;
	contact = 0;

	//alert('I am here sugg form');
	
	
for(i=0; i<document.volApp.elements.length; i++)
	{
//alert('The field name is: ' + document.appForm.elements[i].name + ' and it’s value is: ' + document.appForm.elements[i].value + ' and the type: ' + document.appForm.elements[i].type);

//alert('I am here');
		if( ( document.volApp.elements[i].type == "text" || document.volApp.elements[i].type == "textarea" ) && document.volApp.elements[i].value  == "" ) {
				alert(document.volApp.elements[i].name + ' missing!');
				document.volApp.elements[i].focus();
				return false;
		}
			

} 

		//looping through contMeth
				for (i=0;i<document.volApp.contMeth.length;i++) {
					//alert( 'value for : ' + document.appForm.contMeth[i].name + ' is:' + document.appForm.contMeth[i].value);
						if (document.volApp.contMeth[i].checked) {
						contact = 1;
 					}
	} // loop for origWork	 

	//alert('value for origWork: ' + origWork  );
	if (!contact) {
		alert('Contact method missing!');
	document.volApp.contMeth[0].focus();
				return false;
	} 
	
	//looping through performance type
		/*			for (i=0;i<document.appForm.perfType.length;i++) {
				//	alert( 'value for : ' + document.appForm.perfType[i].name + ' is:' + document.appForm.perfType[i].value);
						if (document.appForm.perfType[i].checked) {
						perfType = 1;
 					}
	} // loop for origWork	

	//alert('value for perfType: ' + perfType  );
	if (!perfType) {
		alert('Performance Type missing!');
	document.appForm.perfType[0].focus();
				return false;
	} 

	//looping through prodRights
			for (i=0;i<document.appForm.prodRights.length;i++) {
				//	alert( 'value for : ' + document.appForm.perfType[i].name + ' is:' + document.appForm.perfType[i].value);
						if (document.appForm.prodRights[i].checked) {
						prodRights = 1;
 					}
	} // loop for origWork	

	//alert('value for perfType: ' + perfType  );
	if (!prodRights) {
		alert('Production Rights missing!');
		document.appForm.prodRights[0].focus();
				return false;
	}
	
	//looping through association permissions
					for (i=0;i<document.appForm.assocPerm.length;i++) {
				//	alert( 'value for : ' + document.appForm.perfType[i].name + ' is:' + document.appForm.perfType[i].value);
						if (document.appForm.assocPerm[i].checked) {
						assocPerm = 1;
 					}
	} // loop for origWork	

	//alert('value for perfType: ' + perfType  );
	if (!assocPerm) {
		alert('Permissions from associations missing!');
		document.appForm.assocPerm[0].focus();
				return false;
	} 

	
		//looping through runTime
					for (i=0;i<document.appForm.runTime.length;i++) {
				//	alert( 'value for : ' + document.appForm.perfType[i].name + ' is:' + document.appForm.perfType[i].value);
						if (document.appForm.runTime[i].checked) {
						runTime = 1;
 					}
	} // loop for origWork	

	//alert('value for perfType: ' + perfType  );
	if (!runTime) {
		alert('Show running time missing!');
		document.appForm.runTime[0].focus();
				return false;
	} 


//check checkbox
		if (!document.appForm.agree.checked) {
				alert('Please check the agree box!');
				document.appForm.agree.focus();
				return false;
	} */
			

	
	
} //end function checkVolForm
