$(function() {

	// load the events1 window
	$('a.events1').click(function(){

		// scroll to top
		$('html, body').animate({scrollTop:0}, 'fast');

		// before showing the events1 window, reset the form incase of previous use.
		$('.success, .error').hide();
		$('form#eventsForm').show();
		
		// Reset all the default values in the form fields
		$('#name').val('Your name');
		$('#email').val('Your email address');
		$('#comment').val('Enter your comment or query...');

		//show the mask and events divs
		$('#mask').show().fadeTo('', 0.7);
		$('div#events').fadeIn();

		// stop the events1 link from doing its default action
		return false;
	});

	// close the events1 window is close div or mask div are clicked.
	$('div#close, div#mask').click(function() {
		$('div#events, div#mask').stop().fadeOut('slow');

	});

	$('#eventsForm input').focus(function() {
		$(this).val(' ');
	});
	
	$('#eventsForm textarea').focus(function() {
        $(this).val('');
    });

	
	
});
