//================================================
// initiate ajax signup
//================================================
function dogfoodsignup () 
{
	// status
	document.getElementById("recipe-email").style.display = "none" ;
	document.getElementById("recipe-button").style.display = "none" ;
	document.getElementById("recipe-feedback").innerHTML = '<span class="orange">Processing...</span>' ;
		
	// email
	email = document.getElementById("recipe-email").value ;
	
	// make url
	var url="/ajax/dog-food-recipes/signup.php?email=" + escape(email) + "&nocache=" + Math.random() ;
	
	// instantiate ajax
	ajaxobject = getajax () ;					// get object
	setajaxevent ( ajaxobject , recipereturn ) ;	// point event to recipereturn function
	ajaxobject.open ( "GET" , url , true ) ;		// true means asyncronous, i.e. must wait for operation to complete
	ajaxobject.send ( null ) ;					// send request
}

//================================================
// give user feedback
//================================================
function recipereturn ( ajaxtext )
{
	document.getElementById("recipe-feedback").innerHTML = ajaxtext ;
	document.getElementById("recipe-email").style.display = "" ;
	document.getElementById("recipe-button").style.display = "" ;
	if ( ajaxtext.indexOf ("Success" ) >= 0 ) 
	{
		document.getElementById("recipe-email").value = "" ;
	}
}