//Requires Moo Tools and MooSlide Frameworks :)
window.addEvent('domready',function(){


$('ajaxContact').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 = $('errorMessage').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');
			feed = response;
			if(feed != 'messagesent'){
			 //Refresh Capture Image
			 capture = document.getElementById('capture');
			 capture.src = capture.src + "?" + Math.random();
			 
			 log.set('html', response);
			 
			}
			else{
			 
			 var form = $('msgBox').empty().addClass('ajax-loading');
			 form.set('html','<h3 style="margin-left:10px;">Thanks for your message!!! click the close button to the left to close the form</h3>')
			 
			}
			
		}});
		//Send the form.
		this.send();
	});
            
               
                //Moo Slide
                var px = new mooSlide2({
                
                slideSpeed: 1700,
                fadeSpeed: 500, 
                toggler:'toggle', 
                content:'contact', 
                height:200, 
                removeOnClick: false, 
                opacity:'0.8', 
                effects:Fx.Transitions.Bounce.easeOut,
                closeBtn:'contactClose',
                from:'bottom'
                });
                
                });