	/*
		Created by Benjamin Cool
		
	
	*/

	function sendContact(id){
		
		document.getElementById("send_button").onclick = function(){};

		Ext.Ajax.request({
			url:'/contact.php',
			params:{
				id:id,
				first:getValue("first_name"),
				last:getValue("last_name"),
				email:getValue("email"),
				h_phone:getValue("h_phone"),
				w_phone:getValue("w_phone"),
				c_phone:getValue("c_phone"),
				pref_time:getValue("pref_time"),
				pref_num:getValue("pref_num"),
				comment:getValue("comment")
			},
			method:'post',
			callback:function(options,success,response){
				alert(response.responseText);
				
				clearField("first_name");
				clearField("last_name");
				clearField("email");
				clearField("h_phone");
				clearField("w_phone");
				clearField("c_phone");
				clearField("comment");
				
				document.getElementById("send_button").onclick = function(){
					sendContact(options.id);
				};
			},
			scope:this,
			id:id
		});

	
	}
	
	function getValue(id){
		return document.getElementById(id).value;
	}
	
	function clearField(id){
		document.getElementById(id).value = "";
	}
