animatedcollapse.addDiv('asignacion', 'fade=1,height=100px,hide=1,group=postulador');
animatedcollapse.addDiv('historico', 'fade=1,height=100px,hide=1,group=postulador');
animatedcollapse.addDiv('postulacion', 'fade=1,height=100px,hide=1,group=postulador');
animatedcollapse.addDiv('historico2', 'fade=1,height=100px,hide=1,group=postulador');
animatedcollapse.init();

function testReset() {
	document.getElementById("anio1").selectedIndex = 
	document.getElementById("anio1").getAttribute("default");
	
	document.getElementById("anio2").selectedIndex = 
	document.getElementById("anio2").getAttribute("default");
	
	document.getElementById("criterio1").selectedIndex = 
	document.getElementById("criterio1").getAttribute("default");
	
	document.getElementById("criterio2").selectedIndex = 
	document.getElementById("criterio2").getAttribute("default");
	
	document.getElementById("criterio3").selectedIndex = 
	document.getElementById("criterio3").getAttribute("default");
	
	document.getElementById("criterio4").selectedIndex = 
	document.getElementById("criterio4").getAttribute("default");
}
					
					




function agregar_opcion()
{
// completar menu desplegable
	var menu = new Array();
	menu[1]=new Array ('1','1',"Quintil de Ingreso Perc\u00E1pita");
	menu[2]=new Array ('1','2','Nivel de Estudio');
	menu[3]=new Array ('1','3','Notas EM');		
	menu[4]=new Array ('1','4','Puntajes PSU');
	menu[5]=new Array ('1','5','Elegibilidad y Matr\u00EDcula Informada');
	menu[6]=new Array ('2','1','Regi\u00F3n del Grupo Familiar');
	menu[7]=new Array ('2','2','Nivel de Estudio');
	menu[8]=new Array ('2','3','Quintil de Ingreso Perc\u00E1pita');		
	menu[9]=new Array ('2','4','Notas EM');
	menu[10]=new Array ('2','5','Puntajes PSU');
	menu[11]=new Array ('2','6','Elegibilidad y Matr\u00EDcula Informada');	
	menu[12]=new Array ('3','1','Tipo Establecimiento EM');
	menu[13]=new Array ('3','2','Quintil de Ingreso Perc\u00E1pita');
	menu[14]=new Array ('3','3','Regi\u00F3n del Grupo Familiar');
	menu[15]=new Array ('3','4','Nivel de Estudio');		
	menu[16]=new Array ('3','5','Notas EM');
	menu[17]=new Array ('3','6','Puntajes PSU');
	menu[18]=new Array ('3','7','Elegibilidad y Matr\u00EDcula Informada');
	// menu[19]=new Array ('3','8','% con Respaldo del Total de Postulantes');

	
var selec = document.porasignacion.criterio.options;
var combo = document.porasignacion.opcion.options;
combo.length = 0;

var popular1 = new Option("Seleccione Opci\u00F3n... ","0","","");
					combo[0] = popular1;

var j=1; while(j<4) {

    if (selec[j].selected == true)
    {
	
	//*********CICLO PARA LA LISTA DINAMICA***************//
		aux = document.porasignacion.criterio.value;
		k=1;
		for (i=1; i<20; i++)
		{
			if (menu[i][0] == aux) 
			{
 				var popular1 = new Option(menu[i][2],menu[i][1],"","");
				combo[k] = popular1;
				k++;
			}
		}
	//***********************************************//
    }
	j++;
	}
	
}

function carga_ventana()
{
	myLightWindow.activateWindow({href: 'http://stickmanlabs.com/images/kevin_vegas.jpg'});
}
function val_epostu()
{
	if (document.porasignacion.anio.value != 0)	
	{
			if (document.porasignacion.criterio.value != 0)
			{
					if (document.porasignacion.opcion.value != 0)
					{
						opcion = document.porasignacion.opcion.value;
						anio = document.porasignacion.anio.value;
						criterio = document.porasignacion.criterio.value;
						// alert("http://ww2.ingresa.cl/wp-content/themes/wp-ingresa/tablas/"+anio+"_"+criterio+"-"+opcion+".png");
						Lightbox.show("http://ww2.ingresa.cl/wp-content/themes/wp-ingresa/tablas/"+anio+"_"+criterio+"-"+opcion+".png", "Proceso de Postulaci&oacute;n "+anio,'');
					}
			}
			else
			{
					alert("Debe seleccionar un criterio de b\u00fasqueda");
			}
	}
	else
	{
		alert("Primero debe seleccionar a\u00f1o a consultar");	
	}
}


function carga_opcion2() {
	var menu= new Array();
menu[0]='Quintil de Ingreso Perc\u00E1pita';
menu[1]='Nivel de Estudios';
menu[2]='Genero';
menu[3]='Tipo de Titulo';
menu[4]='Tipo de Jornada';
menu[5]='Banco administrador';
menu[6]='Instituci\u00F3n acreedora';
menu[7]='Porcentaje de Garantia sobre creditos';
menu[8]='Cobertura entre Aranceles';
menu[9]='Tipo de IES';
menu[10]='Tipo de Establecimiento de EM';
menu[11]='IES';
menu[12]='Tipo IES';
menu[13]='Por participaci\u00F3n en el sistema';

var opcion_1=document.getElementById("criterio2").selectedIndex;

var cant;

if (opcion_1=="1") { a_opciones="12,0,1,2,3,4,5,6,7,8"; cant='10'; }
if (opcion_1=="2") { a_opciones="1,2,3,4,5,6,8"; cant='7'; }
if (opcion_1=="3") { a_opciones="9,0,1,2,10,3,4,5,6"; cant='9'; }
if (opcion_1=="4") { a_opciones="2,3,4,5,6,7,8"; cant='7'; }
if (opcion_1=="5") { a_opciones="3,4,5,6,8"; cant='5'; }
if (opcion_1=="6") { a_opciones="9,0,2,3,4,5,6"; cant='7'; }
if (opcion_1=="7") { a_opciones="4,5,6,8"; cant='4'; }
if (opcion_1=="8") { a_opciones="11,0,1,2,3,5,8,6"; cant='8'; }



var a_opciones2=a_opciones.split(",");
//var cant=a_opciones[a_opciones.length-1];


//limpiar select

    var formObj = document.forms['porpostulacion'];
    formObj.opcion2.options.length = 0;
    


var combo = document.porpostulacion.opcion2.options;

var opt = new Option("Seleccione Opci\u00F3n... ","99","","");
					combo[0] = opt;
if (opcion_1=="1") {
	var opt = new Option("tipo IES","0","","");
					combo[1] = opt;
					
					cant--;
for (i=0;i<=cant;i++) {
	cual=a_opciones2[i];
	
	opt = new Option(menu[cual],i,"","");
	combo[i+1]=opt;
		
}

					
} else {
	cant--;
	for (i=0;i<=cant;i++) {
	cual=a_opciones2[i];
	
	opt = new Option(menu[cual],i+1,"","");
	combo[i+1]=opt;
		
}
	
}

cant=0;


}


function carga_opcion3() {
	var menu= new Array();
menu[0]='Tipo de Instituci\u00F3n';
menu[1]='Nivel de Estudio';
menu[2]='G\u00e9nero';
menu[3]='Tipo de T\u00edtulo T\u00e9cnico';
menu[4]='Tipo de T\u00edtulo Profesional sin Licenciatura';
menu[5]='Tipo de T\u00edtulo Profesional con Licenciatura';
menu[6]='Tipo de T\u00edtulo Bachillerato';
menu[7]='Comprados por el Estado';
menu[8]='Financiados por Instituciones Privadas';
menu[9]='Quintil de Ingreso perc\u00e1pita';
menu[10]='Regi\u00F3n del Grupo Familiar';
menu[11]='Numero de beneficiarios';
menu[12]='Montos Solicitados';



var opcion_1=document.getElementById("criterio3").selectedIndex;

var cant;

if (opcion_1=="1") { a_opciones="0,1,2,3,4,5,6,7,8"; cant='9'; }
if (opcion_1=="2") { a_opciones="9,1,2,3,4,5,6,7,8"; cant='9'; }
if (opcion_1=="3") { a_opciones="10,1,2,3,4,5,6,7"; cant='8'; }
if (opcion_1=="4") { a_opciones="11,12"; cant='2'; }



var a_opciones2=a_opciones.split(",");
//var cant=a_opciones[a_opciones.length-1];


//limpiar select

    var formObj = document.forms['porpostulacion'];
    formObj.opcion2.options.length = 0;
    


var combo = document.porasignacionhistorico.opcion3.options;

var opt = new Option("Seleccione Opci\u00F3n... ","0","","");
					combo[0] = opt;
cant--;
for (i=0;i<=cant;i++) {
	cual=a_opciones2[i];
	
	opt = new Option(menu[cual],i+1,"","");
	combo[i+1]=opt;
		
}
cant=0;


}

function carga_opcion4() {
	var menu= new Array();
menu[0]='Quintil de Ingreso perc\u00e1pita';
menu[1]='Nivel de Estudio';
menu[2]='Notas EM';
menu[3]='Elegibilidad Academica';
menu[4]='Regi\u00F3n del Grupo Familiar';
menu[5]='Establecimiento Educacional';
menu[6]='N\u00famero Total Postulantes';
menu[7]='Nivel de Estudio de Primer a\u00f1o y Curso Superior';
menu[8]='Rango de Notas EM';
menu[9]='N\u00famero Total de Postulantes Elegibles';





var opcion_1=document.getElementById("criterio4").selectedIndex;

var cant;

if (opcion_1=="1") { a_opciones="0,1,2,3"; cant='4'; }
if (opcion_1=="2") { a_opciones="4,1,2,3"; cant='4'; }
if (opcion_1=="3") { a_opciones="6,7,8,9"; cant='4'; }




var a_opciones2=a_opciones.split(",");
//var cant=a_opciones[a_opciones.length-1];


//limpiar select

    var formObj = document.forms['porpostulacionhistorico'];
    formObj.opcion4.options.length = 0;
    


var combo = document.porpostulacionhistorico.opcion4.options;

var opt = new Option("Seleccione Opci\u00F3n... ","0","","");
					combo[0] = opt;
cant--;
for (i=0;i<=cant;i++) {
	cual=a_opciones2[i];
	
	opt = new Option(menu[cual],i+1,"","");
	combo[i+1]=opt;
		
}
cant=0;


}


function asignacion_opcion(seccion) {
	
	opcion=document.getElementById(""+seccion+"").selectedIndex;
	
	anio = '2006';
	//alert("http://ww2.ingresa.cl/wp-content/themes/wp-ingresa/tablas/asign/asignacion-"+anio+"-"+seccion+"_"+opcion+".png");
	Lightbox.show("http://ww2.ingresa.cl/wp-content/themes/wp-ingresa/tablas/asign/asignacion-"+anio+"-"+seccion+"_"+opcion+".png", "Proceso de Admisi&oacute;n "+anio,'');
		
}

function val_epostu2()
{
	if (document.porpostulacion.anio2.value != 0)	
	{
			if (document.porpostulacion.criterio2.value != 0)
			{
					if (document.porpostulacion.opcion2.value != 0)
					{
						
						opcion = document.porpostulacion.opcion2.value;
						anio = document.porpostulacion.anio2.value;
						criterio = document.porpostulacion.criterio2.value;
						//alert("http://ww2.ingresa.cl/wp-content/themes/wp-ingresa/tablas/asign/asignacion-"+anio+"-"+criterio+"_"+opcion+".png");
						Lightbox.show("http://ww2.ingresa.cl/wp-content/themes/wp-ingresa/tablas/asign/asignacion-"+anio+"-"+criterio+"_"+opcion+".png", "Proceso de Asignaci&oacute;n "+anio,'');
					}
			}
			else
			{
					alert("Debe seleccionar un criterio de b\u00fasqueda");
			}
	}
	else
	{
		alert("Primero debe seleccionar a\u00f1o a consultar");	
	}

	if ((document.porpostulacion.criterio2.value=='1')&&(document.porpostulacion.opcion2.value=='0')) {
						
						opcion = document.porpostulacion.opcion2.value;
						anio = document.porpostulacion.anio2.value;
						criterio = document.porpostulacion.criterio2.value;
						
						Lightbox.show("http://ww2.ingresa.cl/wp-content/themes/wp-ingresa/tablas/asign/asignacion-"+anio+"-"+criterio+"_"+opcion+".png", "Proceso de Asignaci&oacute;n "+anio,'');
	}
}

function val_epostu3()
{
	if (document.porasignacionhistorico.criterio3.value != 0)
			{
					if (document.porasignacionhistorico.opcion3.value != 0)
					{
						opcion = document.porasignacionhistorico.opcion3.value;
						criterio = document.porasignacionhistorico.criterio3.value;
						//alert("http://ww2.ingresa.cl/wp-content/themes/wp-ingresa/tablas/historico/historico_"+criterio+"-"+opcion+".png");
						Lightbox.show("http://ww2.ingresa.cl/wp-content/themes/wp-ingresa/tablas/historico/historico_"+criterio+"-"+opcion+".png", "Hist&oacute;rico Asignaci&oacute;n",'');
					}
			}
			else
			{
					alert("Debe seleccionar un criterio de b\u00fasqueda");
			}

	
}

function val_epostu4()
{
	if (document.porpostulacionhistorico.criterio4.value != 0)
			{
					if (document.porpostulacionhistorico.opcion4.value != 0)
					{
						opcion = document.porpostulacionhistorico.opcion4.value;
						criterio = document.porpostulacionhistorico.criterio4.value;
						//alert("http://ww2.ingresa.cl/wp-content/themes/wp-ingresa/tablas/historico/posthistorico-"+criterio+"_"+opcion+".png");
						Lightbox.show("http://ww2.ingresa.cl/wp-content/themes/wp-ingresa/tablas/historico/posthistorico-"+criterio+"_"+opcion+".png", "Hist&oacute;rico Postulaci&oacute;n",'');
					}
			}
			else
			{
					alert("Debe seleccionar un criterio de b\u00fasqueda");
			}

	
}

