function add_newsletter( e )
{
	//alert("alert");
	var e_o = get_o('newsletter_email');
	var e = trim(e_o.value);
	if ( !(e != "" &&
			is_email(e))	)
	{
		alert("Invalid e-mail address.");
		return;
	}
	e_o.value = "SENDING...";
	var ev = new Object();
	ev.success = function ( result ) 
	{
		e_o.value = e;		
		//alert(result);
		if ( !(result && result == "OK") )
			alert("Error: Cannot add your e-mail address this time. Please try again later.");
		else
			alert("Success! Your e-mail address has been addeed to our newsletter subscription.");
	};
	ajax_get(ev,"exec.asp?a=1&e="+escape(e));
}

function send_message()
{
	var n = trim(get_o("name").value);
	var r = trim(get_o("rest_name").value);
	var e = trim(get_o("email").value);
	var s = trim(get_o("subject").value);
	var c = trim(get_o("comment").value);
	if ( n == "" ||
			r == "" ||
			e == "" ||
			s == "" ||
			c == "" )
	{
		alert("Please fill-up all fields.");
		return;
	}
	if ( !is_email(e) )
	{
		alert("Invalid e-mail address.");
		return;
	}
	var stat_o = get_o("ajax_status");
	stat_o.style.display = "";
	var ev = new Object();
	ev.success = function ( result ) 
	{
		stat_o.style.display = "none";
		//alert(result);
		if ( !(result && result == "OK") )
			alert("Error: Cannot post your message this time. Please check your inputs and try again.");
		else
			alert("Success! Your message has been forwarded to our customer relation department.\nWe will contact your shortly.\n\nThank You!");
	};
	ajax_post(ev,"exec.asp?a=2","n="+escape(n)+"&r="+escape(r)+"&e="+escape(e)+"&s="+escape(s)+"&c="+escape(c));

}


function send_signup()
{
	var n = trim(get_o("name").value);
	var p = trim(get_o("position").value);
	var r = trim(get_o("rest_name").value);
	var ph = trim(get_o("phone").value);
	var e = trim(get_o("email").value);
	var bwc = trim(get_o("best_way_contact").value);
	var pc = trim(get_o("promo_code").value);
	var hu = trim(get_o("hear_us").value);
	var c = trim(get_o("comments").value);
	if ( n == "" ||
			p == "" ||
			r == "" ||
			e == "" ||
			ph == "" )
	{
		alert("Name, Position/Title, Restaurant Name, E-mail and Phone are all required.");
		return;
	}
	if ( !is_email(e) )
	{
		alert("Invalid e-mail address.");
		return;
	}
	var stat_o = get_o("ajax_status");
	stat_o.style.display = "";
	var ev = new Object();
	ev.success = function ( result ) 
	{
		stat_o.style.display = "none";
		//alert(result);
		if ( !(result && result == "OK") )
			alert("Error: Cannot process your signup information this time. Please check your inputs and try again.");
		else
			alert("Success! Your signup information has been forwarded to our customer relation department.\nWe will contact your shortly.\n\nThank You!");
	};
	ajax_post(ev,"exec.asp?a=3","n="+escape(n)+"&p="+escape(p)+"&r="+escape(r)+"&ph="+escape(ph)+"&e="+escape(e)+"&bwc="+escape(bwc)+"&pc="+escape(pc)+"&hu="+escape(hu)+"&c="+escape(c));
}
