// JavaScript Document

function validate_recipe_search(thisform)
{
	var PTchk = false;
	
	with(thisform)
	{
		for(i=productType.length-1; i > -1; i--)
		{
			if(productType[i].checked)
			{
				PTchk = true;
			}
		}
		
		if(PTchk == true)
		{
			MTchk = false;
				
			for(i=mealType.length-1; i > -1; i--)
			{
				if(mealType[i].checked)
				{
					MTchk = true;
				}
			}
			
			if(MTchk == true)
			{
				displayCrabAni();
				wait(2000);
			}
			else
			{
				alert('Please Select a type of meal');
				return false;
			}
			
		}
		else
		{
			alert('Please Select a type of crab');
			return false;
		}
	
	}
}

function displayCrabAni()
{
	recipeSearch.submitBtn.src = '/templates/crab/images/submit_btn_ani.gif';
	wait(3000);
}

function wait(msecs)
{
	var start = new Date().getTime();
	var cur = start
	while(cur - start < msecs)
	{
		cur = new Date().getTime();
	}
}

function prodChange (x)
{
	document.getElementById('quick').value = 'quick' + x.value;
	document.getElementById('snacks').value = 'snacks' + x.value;
	document.getElementById('sharing').value = 'sharing' + x.value;
}
