
		function CargaComboClasificacion(){
		
		var almacenClasificacion = document.getElementById("almacenClasificacion");
		var clasificacionSeleccionada = almacenClasificacion.value.split(",");
		
		var comboClasificacion= document.getElementById("listaClasificacion");
		
		//if (comboClasificacion.children.length == 1)
		//{
			var datos_clasificaciones = Divisa.DatosCombos.lista_clasificaciones();
			var pos=0;
			while(datos_clasificaciones.value.Tables[0].Rows[pos] != null) {
				if(datos_clasificaciones.value.Tables[0].Rows[pos].clasificacion != null){
					//alert(datos_generos.value.Tables[0].Rows[pos].clasificacion);
					var elOptNew = addOption("listaClasificacion",datos_clasificaciones.value.Tables[0].Rows[pos].clasificacion,datos_clasificaciones.value.Tables[0].Rows[pos].clasificacion);
					if (datos_clasificaciones.value.Tables[0].Rows[pos].clasificacion == clasificacionSeleccionada[0])
					{
						elOptNew.selected = true;
						//GuardarDatos();
					}
				}
				pos++;
			}
		//}

		CargaGenero();
		//GuardarDatos();
	}	
	
	function CargaGenero(comboGenero){
			
			var almacenGenero = document.getElementById("almacenGenero");
			var generoSeleccionado = almacenGenero.value.split(",");

			var comboClasificacion = document.getElementById("listaClasificacion");
			var clasificacion_seleccionada = comboClasificacion.children[comboClasificacion.selectedIndex].innerText;
			
			var datos_generos = Divisa.DatosCombos.lista_generos(clasificacion_seleccionada);	
			clearOption("listaGenero");
			var haySeleccionado = false;
			var pos=0;
			if (datos_generos.value != null){
				while(datos_generos.value.Tables[0].Rows[pos] != null) {
					var elOptNew = addOption("listaGenero",datos_generos.value.Tables[0].Rows[pos].genero,datos_generos.value.Tables[0].Rows[pos].genero);
					if (datos_generos.value.Tables[0].Rows[pos].genero == generoSeleccionado[0])
					{
						elOptNew.selected = true;
						haySeleccionado = true;
						//GuardarDatos();
						
					}
					pos++;
				}
			}	
			if (!haySeleccionado)
				almacenGenero.value = "Género";	
			//GuardarDatos();
			CargaTematica();
		}
		
		function CargaTematica(comboGenero){
			
			var almacenTematica = document.getElementById("almacenTematica");
			var tematicaSeleccionada = almacenTematica.value.split(",");

			var comboClasificacion = document.getElementById("listaClasificacion");
			var clasificacion_seleccionada = comboClasificacion.children[comboClasificacion.selectedIndex].innerText;
			
			var comboGenero = document.getElementById("listaGenero");
			var genero_seleccionado = comboGenero.children[comboGenero.selectedIndex].innerText;
			
			var datos_tematica = Divisa.DatosCombos.lista_tematicas(clasificacion_seleccionada,genero_seleccionado);	
			
			clearOption("listaTematica");
			
			var haySeleccionado = false;
			var pos=0;
			if (datos_tematica.value != null){
				while(datos_tematica.value.Tables[0].Rows[pos] != null) {
					var elOptNew = addOption("listaTematica",datos_tematica.value.Tables[0].Rows[pos].tematica,datos_tematica.value.Tables[0].Rows[pos].tematica);
					if (datos_tematica.value.Tables[0].Rows[pos].tematica ==tematicaSeleccionada[0])
					{
						elOptNew.selected = true;
						haySeleccionado = true;
					}
					pos++;
				}
			}	
			if (!haySeleccionado)
				almacenTematica.value = "Temática";	
			GuardarDatos();
		}
		
		function GuardarDatos(){
		
		
		//if(this.Id="listaGenero") alert ("clasificacion");
		//if(this.Id="listaClasificacion") alert ("genero");
		//if(this.Id="listaTematica") alert ("tematica");
		
		//alert(this);
		
		
			var almacenClasificacion = document.getElementById("almacenClasificacion");
			var almacenGenero = document.getElementById("almacenGenero");
			var almacenTematica = document.getElementById("almacenTematica");
			
			var comboClasificacion= document.getElementById("listaClasificacion");
			var comboGenero= document.getElementById("listaGenero");
			var comboTematica = document.getElementById("listaTematica");
			
			almacenClasificacion.value = comboClasificacion.children[comboClasificacion.selectedIndex].value+","+ comboClasificacion.children[comboClasificacion.selectedIndex].innerText;
			
			almacenGenero.value = comboGenero.children[comboGenero.selectedIndex].value+","+ comboGenero.children[comboGenero.selectedIndex].innerText;
			
			try{
				almacenTematica.value = comboTematica.children[comboTematica.selectedIndex].value+","+ comboTematica.children[comboTematica.selectedIndex].innerText;
			}
			catch(err){
				almacenTematica.value = "Temática";
			}
		}
		
		
		
	function GuardarDatosAvanzada(){

			var almacenIdioma = document.getElementById("almacenIdioma");
			var almacenIdioma2 = document.getElementById("almacenIdioma2");
			var comboIdioma = document.getElementById("listaIdioma");
			almacenIdioma.value = comboIdioma.children[comboIdioma.selectedIndex].value;
			almacenIdioma2.value = comboIdioma.children[comboIdioma.selectedIndex].innerText;

		}
		
			function GuardarDatosAvanzada2(){
			
			var almacenSub = document.getElementById("almacenSub");
			var almacenSub2 = document.getElementById("almacenSub2");
			var comboSub = document.getElementById("listaSub");
			almacenSub.value = comboSub.children[comboSub.selectedIndex].value;
			almacenSub2.value = comboSub.children[comboSub.selectedIndex].innerText;
		}
		
		
		function addOption(name,text,value) {
			var elOptNew = document.createElement('option');
			elOptNew.text = text;
			elOptNew.value = value;
			var elSel = document.getElementById(name);
			try
			{
				elSel.add(elOptNew, null); // standards compliant; doesn't work in IE
				return elOptNew;
			}
			catch(ex)
			{
				elSel.add(elOptNew); // IE only
				return elOptNew;
			}
		}
		
		
function CargaComboIdiomas(){
		
		//alert("Arranco");
		var almacenIdioma = document.getElementById("almacenIdioma");
		//var clasificacionSeleccionada = almacenIdioma.value.split(",");
		
		var comboIdioma= document.getElementById("listaIdioma");
		
		//if (comboClasificacion.children.length == 1)
		//{
			var datos_idiomas = Divisa.DatosCombos.lista_idiomas();
			var pos=0;
			while(datos_idiomas.value.Tables[0].Rows[pos] != null) {
				//if(datos_idiomas.value.Tables[0].Rows[pos].IdIdioma != null){
					//alert(datos_idiomas.value.Tables[0].Rows[pos].IdIdioma);
					var elOptNew = addOption("listaIdioma",datos_idiomas.value.Tables[0].Rows[pos].Idioma,datos_idiomas.value.Tables[0].Rows[pos].IdIdioma);
					//if (datos_idiomas.value.Tables[0].Rows[pos].clasificacion == clasificacionSeleccionada[0])
					//{
					//	elOptNew.selected = true;
						//GuardarDatos();
					//}
				//}
				pos++;
			}
		//}

		//CargaGenero();
		//GuardarDatos();
	}	
	
	function CargaComboSub(){
		
		//alert("Arranco");
		var almacenSub = document.getElementById("almacenSub");
		//var clasificacionSeleccionada = almacenIdioma.value.split(",");
		
		var comboIdioma= document.getElementById("listaSub");
		
		//if (comboClasificacion.children.length == 1)
		//{
			var datos_sub = Divisa.DatosCombos.lista_sub();
			var pos=0;
			while(datos_sub.value.Tables[0].Rows[pos] != null) {
				//if(datos_idiomas.value.Tables[0].Rows[pos].IdIdioma != null){
					//alert(datos_idiomas.value.Tables[0].Rows[pos].IdIdioma);
					var elOptNew = addOption("listaSub",datos_sub.value.Tables[0].Rows[pos].subtitulo,datos_sub.value.Tables[0].Rows[pos].idsubtitulo);
					//if (datos_idiomas.value.Tables[0].Rows[pos].clasificacion == clasificacionSeleccionada[0])
					//{
					//	elOptNew.selected = true;
						//GuardarDatos();
					//}
				//}
				pos++;
			}
		//}

		//CargaGenero();
		//GuardarDatos();
	}
	

		
		function clearOption(name) {
		
			var elSel = document.getElementById(name);
			var numElementos = elSel.length;
			for (pos = 0 ; pos < numElementos-1; pos++){
				elSel.remove(elSel.length-1);
			}
		}
		
		function GuardaYBusca(){
			GuardarDatos();
			__dopostback('botondepego','');
		}