
function emailForm(){

	dojo.xhrPost({ 
	    
		form: dojo.byId("contactForm"), 
		
		url : 'contact.php?sendmode=send_it', 
	    
		preventCache: true, 
		
		timeout: 15000, 

		handleAs: "text",
		
		// Run this function if the request is successful 
	    load : function(response, ioArgs) { 
	    	
	    	
	    	// sending back sql result from PHP
	    	if(response == "success"){

	    		dojo.byId("sendButtonArea").innerHTML = "<span style='font-weight: bold; color: maroon;'>Your Email has been sent.<br>Thank you.</span></br>"
	   			console.log(response);	
   		    	console.log("successful xhrPost", response, ioArgs); 
	 		
			}else{

    			// display error
				dojo.byId("sendButtonArea").innerHTML =	"<span style='font-weight: bold; color: red;'>There was a problem sending your email.<br>Please try again.</span><br>"
				console.log(response);
	    		console.log("mail error", response, ioArgs); 

    		}
			/* setTimeout("dojo.byId('tEventName').innerHTML = ''; dojo.style(dojo.byId('mcMsgRow'),'display','none');",1000); */
			return response; //always return the response back 
	    }, 
	
	    // Run this function if the request is not successful 
	    error : function(response, ioArgs) { 
	    	

	        console.log("failed xhrPost", response, ioArgs);
			dojo.byId("sendButtonArea").innerHTML =	"<span style='font-weight: bold; color: red;'>ERROR: There was a problem connecting with the server.<br>Please try again.</span><br>"

	        return response; //always return the response back 
	    } 
	});
	
}
		