
function rToolTip(sElement, sContent){
	if(sContent!=''){
		$(sElement).update(sContent);
		new Effect.Appear(sElement);
	}else{
		new Effect.Fade(sElement);
	}
}






function OpenCloseR(oOpen, oClose){
	new Effect.Fade(oClose, {duration: 0.5});
	new Effect.Appear(oOpen, {duration: 0.5, delay: 0.4});
}

/*
Validador de formularios
*/

function rValidator(sForm, bRadio){
	//alert('Falta completar alguno de los campos'); //sacar esta linea ????
	rVal = document.getElementsByClassName("rRequerido");
	bError = false;
	if(bRadio){
		bRadioError = true;	
	}else{
		bRadioError = false;	
	}
	sDebug = '';
	for (i=0; i< rVal.length; i++){
		if(rVal[i].value == ""){
			new Effect.Highlight(rVal[i], {startcolor:'#ff0000'});
			rVal[i].style.border = "1px solid #ff0000";
			bError = true;
		}
		if(rVal[i].type == "radio" && rVal[i].checked == true){
			bRadioError = false;
		}
	}
	
	
	
	if(bError){
		$('rValidatorAlert').show();
		$('rValidatorAlert').scrollTo();
		new Effect.Highlight($('rValidatorAlert'), {startcolor:'#FFCCCC'});
	}else if(bRadioError){
		$('rValidatorAlert').update("<b>Falta completar la encuesta</b>");
		$('rValidatorAlert').show();
		$('rValidatorAlert').scrollTo();
		new Effect.Highlight($('rValidatorAlert'), {startcolor:'#FFCCCC'});
	}else{
		$(sForm).submit();	
	}
}

