$(document).ready(function() {
	$("ul li:last-child").addClass('last-child');
	
	$('.cycle').cycle({
		fx: 'fade',
		timeout: 8000,
		random: true
	});

	$("#main-form").validate();

	//Clear Inputs / Textareas that are not of the type 'submit'
	$('input,textarea').each(function() {
		if($(this).attr('type')!= 'submit'){
			var default_value = this.value;
			$(this).focus(function() {
				if(this.value == default_value) {
					this.value = '';
				}
			});
			$(this).blur(function() {
				if(this.value == '') {
					this.value = default_value;
				}
			});
		}
		$(this).hover(function(){$(this).addClass('display');},function(){$(this).removeClass('display');});
	});
	//Disclaimer Sliding Effect
	$('#main-form a.overlay_submit').click(function(){
		$('#overlay_response').slideToggle(500, function(){
			if($('#overlay_submit').html()=='Hide Disclaimer'){
				$('#overlay_submit').html('Show Disclaimer');	
			} else {
				$('#overlay_submit').html('Hide Disclaimer');
			}																								 
		});
	});

});
