function showDivForEmail ()
{
	document.getElementById('light').style.display='block';
	document.getElementById('fade').style.display='block';
}
function hideDivForEmail ()
{
	document.getElementById('light').style.display='none';
	document.getElementById('fade').style.display='none'
}

var sendmailClass = new Class ({

	initialize: function()
	{
		this.setEvents();
	},

	setEvents: function()
	{
		var oBtnSendEmail = $('sendEmail');

		if(oBtnSendEmail) {
			oBtnSendEmail.removeEvents();
			oBtnSendEmail.addEvent('click', this.sendEmail.create({bind : this}));
		}
	},

	sendEmail: function(oEvent)
	{
		var oBtn = $(oEvent.target);
		var oForm = $(oBtn.get('rel'));

		var validator = oForm.retrieve('validation');
		if( validator!=null && !validator.doValidate() ){

		} else {
			oForm.send();
			var oDiv = $('emailForm');
			oDiv.set('style', 'display:none');
			var oDiv = $('emailFormThanx');
			oDiv.set('style', 'display:block');
		}

		return false;
	}

});

// -------------------------------------------------------------------------- //

sendmailInit = function()
{
	sendmailObj = new sendmailClass();
}

var sendmailObj;

window.addEvent('domready', sendmailInit);



