var filter = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;

$(window).ready(function() {

						 

$('.site').attr('target', '_blank');

	$('#formName2').click(function() { 



		if($(this).val() == 'Name*')



		{



			$(this).val('');



		}



	});

	

	$('#formName2').blur(function() { 



		if($(this).val() == '')



		{



			$(this).val('Name*');



		}



	});

	

	$('#formEmail2').click(function() { 



		if($(this).val() == 'Email Address*')



		{



			$(this).val('');



		}



	});

	

	$('#formEmail2').blur(function() { 



		if($(this).val() == '')



		{



			$(this).val('Email Address*');



		}



	});

	

			$('.submit2').click(function() { 



		var valid = true;



		$('.mustFields2').each(function() { 		



			if($(this).val() == '' || $(this).val() == 'Please enter...')



			{



				$(this).val('Please enter...');



				valid = false;



			}



			else if($(this).attr('id') == 'formEmail2'){



				if (!filter.test($(this).val())) {



					valid = false;



					alert('Please enter a valid email address...');



				}



			}



		});



		



		if(valid)



		{



			var msgbody = 'Name: ' + $('#formSalu :selected').text() + ' ' + $('#formName2').val() + '\n' + 



						'Email: ' + 	$('#formEmail2').val() + '\n' ; 	



			$.post("sendemail_2.php", { emailFrom: $('#formEmail2').val(), subject: 'Registration details of ' + $('#formName2').val(), message: msgbody },



				function(data){



					$('.form2').hide().html("<div class=\"thank_you2\">Thank you for the registration.</div>").fadeIn('fast');		



				}



			);	



					



		}



		



		return false;



	});

	

	

});
