function signup(thediv, hideform){
	
	//get all the necessary elements
	myform = $(thediv).select('div.formwrapper')[0];
	mymsg = $(thediv).select('div.msg')[0];
	mycomplete = $(thediv).select('div.complete')[0];
	myemail = $(thediv).select('.email')[0];
	
	//check email is in there
	if (myemail.value.include('@') == false) {
		mymsg.show();
		return false;
	}
	else
	{
		//get params
		var params = Form.serialize(myform);
		//alert(params);
		new Ajax.Request( "/handlers/signupmain.php" , {
			parameters: params,
			method: 'post',
		
			onSuccess: function(transport) {
				
				//update form area with thank you message, only hide the form if indicated
				if (hideform == true) {
					myform.hide();
				}
				mymsg.hide();
				mycomplete.show();
				//hide the notification after a while if form remains
				if (hideform == false) {
					setTimeout("mycomplete.hide();myemail.value=''",2500);
				}
			},
			onFailure: function() { 
				
				alert('There was a problem. Please try again.');
				return false;
			}
		});
	}
	return false;
}





function sendfeedback() {
	
	new Ajax.Request("/handlers/talkmain.php", {
		parameters: Form.serialize($('feedback')),
		method: 'post',
		
		onSuccess: function(transport) {
			
			$('feedback').hide();
			$('thanks').show();
		},
		onFailure: function() {	
			alert('There was a problem. Please try again.');
		}
	});
	return false;
	
}
	
	
	
	
	

