function fecha_vacia(event)
{	
	var fecha=document.getElementById('fecha');
	if(fecha.value=='')
	{
		alert('Debe ingresar una fecha para la realizar la búsqueda');
		return false;
	}
	return true;
}

function validar(e) { // 1
    tecla = (document.all) ? e.keyCode : e.which; // 2
    if (tecla==8) return true; // 3
    patron =/[A-Za-zñÑ\s\w]/; // 4
    te = String.fromCharCode(tecla); // 5
    return patron.test(te); // 6
} 

function busqueda(e){
	var busqueda = document.getElementById('palabras_claves');	
	if(busqueda.value=='')
	{		
		alert('Debe ingresar al menos una palabra a Buscar');
		return false;
	}
}

function popup(url) 
{
	day = new Date();
	id = day.getTime();
	eval("page" + id + " = window.open(url, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=530,height=350');");
}

function fecha()
{
    var mes = document.getElementById('meses');
    var anio = document.getElementById('anio');
    if(mes.value == 0 || anio.value == 0 )
    {            
            alert('Debe ingresar el mes y el anio para poder realizar la búsqueda');
            return false;
    }
}


function enviarForm()
{
    var flag = false;    
    for ( var i = 0; i < document.encuesta.radiobutton.length; i ++)
    {
        if ( document.encuesta.radiobutton[i].checked ){            
            return true;
        }
    }
    if (flag == false) {
        alert("Por favor, seleccione una opción.");    
    }
    return false;
} 
