window.addEvent('domready', function(){
	$('menus').getElements('li.menu_heads').each( function( elem ){
		var list = elem.getElement('ul.links');
		var myFx = new Fx.Slide(list).hide();
		elem.addEvents({
			'mouseenter' : function(){
				myFx.cancel();
				myFx.slideIn();
			},
			'mouseleave' : function(){
				myFx.cancel();
				myFx.slideOut();
			}
		});
	})
	
	if($$('#contactForm').length > 0)
	{ 
	$('contactForm').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 = $('respondHere').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) { 

			log.removeClass('ajax-loading');

			log.set('html', response);

		}});

		//Send the form.

		this.send();

	});
}
});