var resourcePath="";
if(window.location.href.indexOf("/Rhythmyx/assembler/render") != -1){
	resourcePath = "http://espanol.hhs.gov/enes/recovery/web_resources/recovery";	
}
else{
	resourcePath = "http://espanol.hhs.gov/enes/recovery";
}

//alert(resourcePath);

// Validation function for recovery feedback

var RecoveryFeedback = {
	defaultText: "Ingrese sus preguntas aqu\355.",	
	isBlank: function(obj, message){
		if (obj.value == ''){
			alert(message);
			obj.focus();
			return false;
		}
		return true;
	},
	isEmail: function(obj, message){
		if(!( /[^@]+@[^@]+\.[^@]+/.test(obj.value))){
			alert(message);
			obj.focus();
			return false;
		}
		return true;		
	},
	
	textAreaOnClick: function(obj){		
		if(obj.value == RecoveryFeedback.defaultText){
			obj.value="";
		}
	},
	
	validate: function (objForm){
		if ( (!RecoveryFeedback.isBlank(objForm.zip, 'El c\363digo postal local es obligatorio.')) || (!RecoveryFeedback.isEmail(objForm.email, 'Se necesita una direcci\363n de correo electr\363nico v\341lida.')) 	){			
			return false;
		}		
		if (objForm.question.value == "" || objForm.question.value == RecoveryFeedback.defaultText){
			alert("Por favor ingrese su pregunta en la casilla correspondiente.");
			objForm.question.focus();
			return false;
		}
		return true;
	}  	
};
