var contactForm = new Class ({	Implements: [Events, Options],	options: {		formid: "",		responseEl: null,		subject: ""	},	initialize: function(options){		this.setOptions(options);		var mObj = new Element('form', {method: 'post', action: '/cgi-bin/mail-a-form', id: 'frm' + this.options.formid, 'class': 'frm'});		mObj.adopt(new Element('input', {type: 'hidden',name: 'to',value: this.options.formid + '@bloody-wicked.com', 'class': 'frmto'}));		mObj.adopt(new Element('div', {'class': 'lfloat lpad15'}).appendText('your e-mail address:'));		mObj.adopt(new Element('input', {type: 'text',name: 'from',size: '90'}));		mObj.adopt(new Element('br'));		mObj.adopt(new Element('div', {'class': 'lfloat lpad15'}).appendText('subject:'));		mObj.adopt(new Element('input', {type: 'text',name: 'subject',size: '90',value: this.options.subject}));		mObj.adopt(new Element('br'));		mObj.adopt(new Element('textarea', {name: 'bloody-body',rows: '5',cols: '110'}));		mObj.adopt(new Element('input', {type: 'hidden',name: 'required',value: 'from'}));		mObj.adopt(new Element('input', {type: 'hidden',name: 'required',value: 'subject'}));		mObj.adopt(new Element('input', {type: 'hidden',name: 'required',value: 'bloody-body'}));		mObj.adopt(new Element('br'));		mObj.adopt(new Element('div', {'class': 'rfloat'}).adopt(new Element('input', {type: 'submit', 'class': 'frmbut',value: 'send'})));		mObj.adopt(new Element('div', {'id': 'frmmsgdis'}));		this.form = mObj;		this.form.addEvent('submit', this.postAddition.bind(this));	},	postAddition: function(e){		new Event(e).stop();		this.form.getChildren().getLast('frmmsgdis').set('text','');		this.formButton = this.form.getChildren().getLast('input').set('disabled');		this.form.fade(0.2);		this.form.addClass('loading');		var myHTMLRequest = new Request.HTML({ url: '/cgi-bin/mail-a-form',onComplete: this.loadResults.bind(this) }).post(this.form);	},	loadResults: function(responseTree, responseElements, responseHTML, responseJavaScript){		this.result = responseElements.get('text');		this.workresponse(this.result);	},	workresponse: function(e){		if($chk(e)){			if(e.contains("Form sent")){				this.form.reset();				this.respmsg = 'your message has been sent, you will be hearing from me soon' ;			} else if (e.contains("geen geldig email adres")){				this.respmsg = 'the email address you submitted is not valid.';			} else if (e){ this.respmsg = 'there was no value for the ' + e + ' field submitted. please try again' ; }		} else { this.respmsg = 'an error prevented this email from being processed.' ; }		this.form.getChildren().getLast('frmmsgdis').appendText(this.respmsg);		this.form.removeClass('loading');		this.form.fade(1);		this.formButton.erase('disabled');	},	validateMail : function(){		var regex = /^[^\s()<>@,;:\/]+@\w[\w\.-]+\.[a-z]{2,}$/i		return regex.test(this.objForm.getElement('frm').getElement('from').get('value'));	}});