function checkFields()
{
	var success = true;

	// first check for missing required fields
	if(
		($F('source') == "") ||
		($F('name') == "") ||
		($F('address1') == "") ||
		($F('city') == "") ||
		($F('state') == "") ||
		($F('country') == "") ||
		($F('zip') == "") ||
		($F('phone') == "") ||
		($F('email') == "")
	)
	{
		success = false;
		alert("Missing Required Fields.");
		//return false;
	}
	
	// lets validate the email address
	strEmail = new String($F('email'));
	if(
		(strEmail.split("@").length != 2) ||
		(strEmail.split("@")[1].split(".").length < 2 )
	)
	{
		success = false;
		alert("Invalid Email Address.");
		//return false;
	}
	
	// check for valid brochureno/customerno if any
/*	if(
		(brochureno.value != "") &&
		!((new String(brochureno.value)).match(/^[0-9]{3,8}$/))
	)
	{
		success = false;
		alert("Invalid Customer ID");
		//return false;
	}*/
	
	if(success)
	{
		new PeriodicalExecuter(function (pe) 
		{
			$('submit_button').disabled = true;
			$('submit_button').innerHTML = "Working...";
			pe.stop();
		}, .2);	
	}
	
	return success;
}

function triggerSelect()
{
	var brochureRows = $$('.brochure');
	var isPromo = ($F('source') == "PROMO");
	for(var i = 0; i < brochureRows.length; i++)
		brochureRows[i].style.display = isPromo?"":"none";
}
