/* _________________________________________*/
// do some ajax stuff here for the insights form -> http://www.ajaxlessons.com/2006/02/11/ajax-workshop-1-ajax-basics-build-a-simple-email-verification-with-prototypejs/
function insights_submit () {
	$('submit').onclick = function () {
		sendData();
	}
}

function sendData () {
	var url = '/inc/sendmail.php';
	//var url = '/process.php';
	var pars = Form.serialize('frm');
	var myAjax = new Ajax.Request( url, {method: 'get', parameters: pars, onLoading: showLoad, onComplete: showResponse} );
}

function showLoad () {
	$('load').style.display = 'block';
}

function showResponse (originalRequest) {
	var newData = originalRequest.responseText;
	$('load').style.display = 'none';
	$('status').innerHTML = newData;
	$('submit_frm').style.display = 'none';
	new Effect.Highlight(document.getElementById('status'))
}

/* _________________________________________*/

addEvent(window,'load',insights_submit);