function isdefined( variable)
{
    return (typeof(window[variable]) == "undefined")?  false: true;
}

var contactSubmit = function(){
	// Stops the submission of the form.
	//new Event(evt).stop();

	// Sends the form to the action path,
	// which is 'script.php'
	$('contact-form').addEvent('submit', function(e) {
		//Prevents the default submit event from loading a new page.
		e.stop();
		//Empty the log and show the spinning indicator.
		//var log = $('log_res').empty().addClass('ajax-loading');
		//Set the options of the form's Request handler. 
		//("this" refers to the $('myForm') element).
		this.set('send', {onComplete: function(response) { 
			if (response != '1')
				alert(response);
			else
				alert('sent!');
		}});
		//Send the form.
		this.send();
	});
	/*$('contact-form').send({
		onComplete: function(response) {
			if (response != '1')
			{
				alert(response);
			} else {
				box.close();
			}
		}
	});*/
}