/* 
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */


function llenarListaCatalogo(arreglo, listaEl, seleccion,texto){
	var campo = document.getElementById(listaEl);
    campo.length = 0;
	//alert(arreglo.length)
    var cont = 0;
    //if (seleccion=="0"){
        campo.options[0] = new Option(texto,"");
        cont = cont + 1;
    //}
    for(var j=0;j<arreglo.length;j++){
		campo.options[j+1] = new Option(unescape(arreglo[j].nombre),arreglo[j].ide);
		if (seleccion == arreglo[j].ide) {
			campo.options[j+1].selected = true;
		}
	}
}

var validar_busqueda = function(){
	var texto = document.getElementById("txtTitulo").value;
	var tema = document.getElementById("lista_temas").value;
	if (texto && tema){
		var variables = "?tema="+tema+"&texto="+texto
		window.frames['frame1'].location.href = "busquedas.html"+variables
	}else{
		alert("Favor de llenar el titulo y el tema, gracias...")
	}
	//alert(texto)
}
