// email.js

//------------------------------------------
function email_send(o)
	{
/*	alert("About to send email...\n\n"
		+"To: "+o.email+"\n"
		+"From: "+o.from+"\n"
		+"Sub: "+o.subj+"\n\n"
		+"Content: "+o.cont+"\n");
*/
	o.command = "send";
	o.html = true;
	o.cont = escape(o.cont);
	var dataString = $.toJSON(o);
	$.post('email.php', {data: dataString}, done_email_send);
	}
//------------------------------------------
function done_email_send(res)
	{
	var obj = $.evalJSON(res);
	if (obj.success) 
		{
		alert("Your mail has been sent.");
		}
	else
		{
		if (obj.noMailServer) alert("No Mail Server.");
		else alert("Your email could not be delivered.");
		}
	delete obj;
	}