/***
*	javascript file 
*	(c) 2007 by Mirko Scharf
***/

function sendEmail() {
	if( !$('senderName').value.match(/\w/) )	{ showWarning( msg_no_name ); return false; }
	if( !$('email').value.match(/\w/) )			{ showWarning( msg_no_email ); return false; }
	if( !checkEmail( $('email').value ) )		{ showError( msg_wrong_email ); return false; }
	if( !$('mailTitle').value.match(/\w/) )		{ showWarning( msg_no_title ); return false; }
	if( !$('mailText').value.match(/\w/) )		{ showWarning( msg_no_text ); return false; }

	var postTxt = Form.serialize( $( "frmContact" ) );
	
	ajaxRequest(
		'/!contactSend',
		true,
		postTxt,
		function( t ) {
			res = deflateJSON( t.responseText );
			if ( res.result != 0 ) {
				showError( msg_send_email_error );
			}
			else {
				showMessage( msg_send_email_ok );
				$( 'frmContact' ).reset();
			}
		}
	);

	
}

