function returnFalse() { return false; };
$(document).ready(function(){	
	// +-+-+-+-+-+- LIST PAGE

			$('.textItem').hide();
			$('#item1').slideDown('slow');
			$('#items h3').click(function() {

				if ($(this).next('.textItem:visible').length != 0)
				{
					$(this).next('.textItem').stop().slideUp('slow');
				}			
				else 
				{
					$('.textItem').slideUp('slow');
					$(this).next('.textItem').stop().slideDown('slow');
				}
			});

			$('#items h3').mouseover(function(){
				$(this).stop().fadeTo('fast', 0.9);								  
			});
			
			$('#items h3').mouseout(function(){
				$(this).stop().fadeTo('slow', 1);								  
			});

	// ***** PROMO BOX
	
	$('.promoBox').mouseover(function(){
		$(this).stop().fadeTo('slow', 0.8);								  
	});
	
	$('.promoBox').mouseout(function(){
		$(this).stop().fadeTo('slow', 1);								  
	});


	/* -++-+-+-+-+-+-+- CONTACT FORM +-+-+-++-+-+- */
	
	$('#submit .button').bind('click', returnFalse);
	var firstName = false;
	var lastName = false;
	var emailFrom = false;
	
	$('#txtFirstName').blur(function(){
		if ($('#txtFirstName').val() == '')
		{
			$('#alertFirstName').append('<p class="red">* Your first name is requested</p>');
			firstName = false;
		}
		else {
			$('#alertFirstName').append('<p class="green">* Field first name completed</p>');	
			firstName = true;
		}		

		if (emailFrom && lastName && firstName)
		{
			$('#submit .button').unbind('click', returnFalse);
		}		
	});

	$('#txtLastName').blur(function(){
		if ($('#txtLastName').val() == '')
		{
			$('#alertLastName').append('<p class="red">* Your last name is requested</p>');	
			lastName = false;
		}
		else {
			$('#alertLastName').append('<p class="green">* Field last name completed</p>');	
			lastName = true;
		}		

		if (emailFrom && lastName && firstName)
		{
			$('#submit .button').unbind('click', returnFalse);
		}	
	});

	var filter=/^.+@.+\..{2,3}$/;
	$('#txtEmailFrom').blur(function(){
		if ($('#txtEmailFrom').val() == '')
		{
			$('#alertEmailFrom').append('<p class="red">* The field email is requested</p>');	
			emailFrom = false;
		}
		else if (filter.test($('#txtEmailFrom').val())) {
			$('#alertEmailFrom').append('<p class="green">* Field email is completed</p>');	
			emailFrom = true;
		}
		else {
			$('#alertEmailFrom').append('<p class="orange">* Please enter a valid email address</p>');	
			emailFrom = false;
		}		
		
		if (emailFrom && lastName && firstName)
		{
			$('#submit .button').unbind('click', returnFalse);
		
		}	
	});


	$('#txtEmailFrom').focus(function(){
		$('#alertEmailFrom').empty();	
	});	
	
	$('#txtFirstName').focus(function(){
		$('#alertFirstName').empty();	
	});		

	$('#txtLastName').focus(function(){
		$('#alertLastName').empty();	
	});	
	
	$('#submit .button').click(function(){
	  if (emailFrom && lastName && firstName)
	  {
	 	$('#submit .button').unbind('click', returnFalse);
	  }
	 
	});	
				  

});


