$(document).ready(function(){
		
	//this function attached focus and blur events with input elements
	var addFocusAndBlur = function($input, $val){
		
		$input.focus(function(){
			if (this.value == $val) {this.value = '';}
		});
		
		$input.blur(function(){
			if (this.value == '') {this.value = $val;}
		});
	}
	
	//this function attached focus and blur events with textarea elements
	var addFocusAndBlur = function($textarea, $val){
		
		$textarea.focus(function(){
			if (this.value == $val) {this.value = '';}
		});
		
		$textarea.blur(function(){
			if (this.value == '') {this.value = $val;}
		});
	}

	// example code to attach the events
	addFocusAndBlur(jQuery('#nombre'),'Nombre*');
	addFocusAndBlur(jQuery('#nombrePA'),'Nombre*');
	addFocusAndBlur(jQuery('#nombreNI'),'Nombre*');
	addFocusAndBlur(jQuery('#apellidos'),'Apellidos*');
	addFocusAndBlur(jQuery('#apellidosPA'),'Apellidos*');
	addFocusAndBlur(jQuery('#apellidosNI'),'Apellidos*');
	addFocusAndBlur(jQuery('#correo'),'Correo electrónico*');
	addFocusAndBlur(jQuery('#correoPA'),'Correo electrónico*');
	addFocusAndBlur(jQuery('#correoNI'),'Correo electrónico*');
	addFocusAndBlur(jQuery('#telefono'),'Teléfono*');
	addFocusAndBlur(jQuery('#telefonoPA'),'Teléfono*');
	addFocusAndBlur(jQuery('#telefonoNI'),'Teléfono*');
	addFocusAndBlur(jQuery('#ayuda'),'Cómo le podemos ayudar?');
	addFocusAndBlur(jQuery('#ayudaPA'),'Cómo le podemos ayudar?');
	addFocusAndBlur(jQuery('#ayudaNI'),'Cómo le podemos ayudar?');
	addFocusAndBlur(jQuery('#name'),'Name*');
	addFocusAndBlur(jQuery('#namePA'),'Name*');
	addFocusAndBlur(jQuery('#nameNI'),'Name*');
	addFocusAndBlur(jQuery('#lastname'),'Last name*');
	addFocusAndBlur(jQuery('#lastnamePA'),'Last name*');
	addFocusAndBlur(jQuery('#lastnameNI'),'Last name*');
	addFocusAndBlur(jQuery('#email'),'E-mail*');
	addFocusAndBlur(jQuery('#emailPA'),'E-mail*');
	addFocusAndBlur(jQuery('#emailNI'),'E-mail*');
	addFocusAndBlur(jQuery('#phone'),'Phone*');
	addFocusAndBlur(jQuery('#phonePA'),'Phone*');
	addFocusAndBlur(jQuery('#phoneNI'),'Phone*');
	addFocusAndBlur(jQuery('#help'),'How can we help you?');
	addFocusAndBlur(jQuery('#helpPA'),'How can we help you?');
	addFocusAndBlur(jQuery('#helpNI'),'How can we help you?');
	
});

