function validarMail(correo,etiqueta)
{
	expresionRegular=/^[_a-z0-9A-Z-]+(.[_a-z0-9A-Z-]+)*@[a-z0-9A-Z-]+(.[a-z0-9A-Z-]+)*(.[a-zA-Z]{2,3})$/
    if(!expresionRegular.exec(correo)){
		mostrar_validacion(etiqueta);
        return false;
    }
	else{
        return true;
    };
};

function mostrar_validacion(aidi)
{
	document.getElementById(aidi).style.display="inline";
	document.getElementById(aidi).style.color="#F00";
	document.getElementById(aidi).style.fontSize="10px";
};

function ocultar_validacion(aidi)
{
	document.getElementById(aidi).style.display="none";
};

function validar_campo(campo,etiqueta){
	if (campo == ""){
		mostrar_validacion(etiqueta);
		return false; 
	}
	else{
		ocultar_validacion(etiqueta);
		return true;
	}; 
};

function validar()
{
	if (validacion()==false){
		/*alert('Es Necesario llenar los campos requeridos');*/
		return false;
	}else
	{return true;};
};

function validar_rb(radiob)
{
	vali=false;
	for (i=radiob.length-1; i > -1; i--){if (radiob[i].checked){vali=true;}}
	if(vali==true){return true;}else{return false;}
};

/*
function validacion() 
{
	nombre = validar_campo(document.form1.p_name.value,"p_name_v");
	correo = validar_campo(document.form1.p_correo_e.value,"p_correo_e_v");
	correo_valido = validarMail(document.form1.p_correo_e.value,"mail_invalido");
	nom_reserva = validar_campo(document.form1.n_reserva.value,"n_reserva_v");
	hotel_e = validar_campo(document.form1.hotel.value,"hotel_v");
	hotel_e2 = validar_campo(document.form1.hotel2.value,"hotel2_v");
	habitaciones = true;
	if ((document.form1.simple_1.value == "selec." && document.form1.doble_1.value == "selec.")&& document.form1.matrimonial_1.value == "selec." ){ 
		mostrar_validacion("habitaciones_v"); 
		habitaciones = false;}
	else{
		ocultar_validacion("habitaciones_v");
		habitaciones = false;};
	if ((((((nombre==true && correo==true)&&correo_valido==true)&&nom_reserva==true)&&hotel_e==true)&&hotel_e2==true)&&habitaciones==true){
		return true}
	else{
		return false};
};
*/

