/***********************************************************************\
* File:		MoJoForm.js													*
* Date:		January 5, 2006												*
* Author:	James Carpenter												*
* Purpose:	To create a form system that prevents bot spam submission 	*
\***********************************************************************/

// function to setup correct actions for the form
function makeForm(  action, method, validateFunc )
{
	// if a validation function was passed and is true or if no function passed
	if ( validateFunc == '' || (typeof validateFunc == 'function' && validateFunc() == true) )
	{
		// get a handle to the existing form
		var mojoForm = document.getElementById('mojoForm');
		
		// set up the attributes of the form
		mojoForm.action = action;
		mojoForm.method = method;
			
		// submit the form 
		mojoForm.submit();
	}
}
