function valida_form(elementos){
	var arrElementos = elementos.split("|");
	var nom;var valor;var i;
	var tipo = ( document.getElementById("selTipoContacto") ) ? document.getElementById("selTipoContacto").options[document.getElementById("selTipoContacto").selectedIndex].value : "notipocontacto";
	for(i=0;i<arrElementos.length;i=i+3){
		nom = arrElementos[i];
		if(Left(nom, 1) == "@"){
			nom = String(nom).substring(1, nom.length);
			if(!IsEmail(document.getElementById(nom).value)){
				alert(arrElementos[i+1] + "\t");
				document.getElementById(nom).focus();
				return false;
			}
		} else if(Left(nom, 3) == "NaN"){
			nom = String(nom).substring(3, nom.length);
			valor = document.getElementById(nom).value
			if(Trim(valor).length==0 || isNaN(valor)){
				alert(arrElementos[i+1] + "\t");
				document.getElementById(nom).focus();
				return false;
			}
		} else if(Left(nom, 3) == "DaT") {
			nom = String(nom).substring(3, nom.length);
			if(!IsDate(document.getElementById(nom).value)){
				alert(arrElementos[i+1] + "\t");
				document.getElementById(nom).focus();
				return false;
			}
		} else {
			if(nom=='txtTelefono' && tipo!='telefono') continue;
			valor = document.getElementById(nom).value
			if(Trim(valor).length==0 || valor == arrElementos[i+2]){
				alert(arrElementos[i+1] + "\t");
				document.getElementById(nom).focus();
				return false;
			}
		}
	}
	var frm = document.getElementById("frm_contacto");
	if(frm){
		var tempobj;
		for (i=0;i<frm.length;i++){
			tempobj=frm.elements[i]
			if(tempobj.type && tempobj.type.toLowerCase()=="submit") tempobj.disabled=true;
		}
	}
	return true;
}
function clearText(thefield){
	if (thefield.defaultValue==thefield.value)
	thefield.value = "";
}
function resetText(thefield){
	if(thefield.value==""){
	thefield.value=thefield.defaultValue;
	}
}