var popUpWin=0;	
var HelpInscripcion = new Array();
HelpInscripcion[0]="Introduce el promedio de notas obtenidas hasta ahora en bachillerato. Si est&aacutes cursando el &uacuteltimo a&ntildeo, introduce el promedio de los primeros cuatro. Si ya eres bachiller, el promedio de los cinco a&ntildeos. Coloca dos decimales. Es importante introducir este n&uacutemero correctamente, ya que es usado a la hora de hacer predicciones estad&iacutesticas sobre tu posible desempe&ntildeo con respecto al grupo de estudiantes que competir&aacute contigo por el cupo universitario.";
HelpInscripcion[1]="Es el identificador por el cual ser&aacutes conocido en alaUniversidad.com. Escoge el nombre de tu preferencia, preferiblemente algo f&aacutecil de recordar para ti. Ser&aacute tu identificador para ingresar, as&iacute como para interactuar en el foro y en el chat. Podr&aacute tener una longitud m&aacutexima de 15 caracteres."; 
HelpInscripcion[2]="Clave que utilizar&aacutes para ingresar al sistema. Deber&iacutea tener entre 5 y 12 caracteres y contener al menos una letra y un n&uacutemero. Escoge una palabra clave que sea f&aacutecil de recordar para ti, pero que no sea f&aacutecil de adivinar para terceras personas.";
HelpInscripcion[3]="Pregunta que te ser&aacute formulada en caso de que olvides tu contrase&ntildea para poder restablecerla. Escoge una pregunta que sea significativa para ti, pero que no sea obvia para los dem&aacutes (por ejemplo, &iquest de que color tengo el pelo?).";
HelpInscripcion[4]="Indica el medio que utilizas con m&aacute;s frecuencia para conectarte a Internet. Esta informaci&oacuten nos ser&aacute muy &uacutetil a la hora de prestarte un mejor servicio.";
HelpInscripcion[5]="Indica la(s) carrera(s) que deseas estudiar y en que instituci&oacute;n.";

function popUpWindowNE(URLStr){
		if(popUpWin){
			if(!popUpWin.closed) popUpWin.close();
		}
		popUpWin = open(URLStr,'popUpWin','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=yes,width=800,height=550,left=100, top=100,screenX=250,screenY=250');
	}

function LoadPopUp(aTit,aRef)
{
	popupWinbChangeTexts = true;	
	popupWinnTitle = aTit;
	popupWinespopup_winLoad();
	document.getElementById('popupWin').style.bottom ='0%';
	document.getElementById('popupWin_content').innerHTML=HelpInscripcion[aRef];
}

function llenarCiudades(ed) 
{
	var i;
	var edoNuevo = ed;
	var cboCdad = window.document.getElementById("cbociudad");
	if (edoNuevo == "0" )
	{
		cboCdad.selectedIndex=-1;
		cboCdad.length=0;		
		cboCdad.options[0] = new Option("seleccione un estado","0");					
		return;
	}
	limpiar(cboCdad);
	cboCdad.options[0] = new Option("seleccione una ciudad","0");
	var d = 1;			
	for (var i=0;i<arrCdad.length;i++)
	{				
		if (arrCdad[i][2]==edoNuevo)
		{
			cboCdad.options[d++] = new Option(arrCdad[i][0],arrCdad[i][1]);
		}
	}				
}
function limpiar(cbo) 
{	
	cbo.selectedIndex = -1;
	cbo.length = 0;
}
function CargarCursosSubc(SubCatCodigo) 
{
	var obj= window.document.getElementById("inpMultiuso"); 
	obj.value=SubCatCodigo + "-S";
	__doPostBack("lnkBuscarSubC",'');	
}
function CargarCursosCat(CatCodigo) 
{
	var obj= window.document.getElementById("inpMultiuso"); 
	obj.value=CatCodigo + "-C";
	__doPostBack("lnkBuscarCat",'');	
}
function ContactarCurso(CodCurso)
{
	window.location.href="ContactarCurso.aspx?codCurso="+ CodCurso 
}
function CursoSelec(CodCurso)
{
	var obj= window.document.getElementById("inpMultiuso"); 
	obj.value=CodCurso;
	__doPostBack("lnkInfoCurso",'');	
}

function acceptNum(evt)
{	
	var nav4 = window.Event ? true : false;
	var key = nav4 ? evt.which : evt.keyCode;
	return (key <= 13 || (key >= 48 && key <= 57));							
}
function EliminarCurso(codCurso)
{
	var obj= window.document.getElementById("inpMultiuso"); 
	obj.value=codCurso;
	__doPostBack("lnkEliminarCurso",'');	
}
function llenarSubCategorias(cat) 
{
	var i;
	var catNuevo = cat;
	var cbosubcat = window.document.getElementById("ddlSubCategoria");
	if (catNuevo == "0" )
	{
		cbosubcat.selectedIndex=-1;
		cbosubcat.length=0;		
		cbosubcat.options[0] = new Option("seleccione un estado","0");					
		return;
	}
	limpiar(cbosubcat);
	cbosubcat.options[0] = new Option("seleccione una sub-categoria","0");
	var d = 1;			
	for (var i=0;i<arrSubCat.length;i++)
	{				
		if (arrSubCat[i][2]==catNuevo)
		{
			cbosubcat.options[d++] = new Option(arrSubCat[i][0],arrSubCat[i][1]);
		}
	}				
}			
			
function CambiarCheck()
{
	var ndir = window.document.getElementById("rdbTiempoDias").checked;
	var objdias= window.document.getElementById("ddldiasP")
	var objMeses= window.document.getElementById("ddlMesesP")	
	if (ndir==true)
	{
		objdias.disabled="";
		objMeses.disabled="disabled";
		objMeses.selectedIndex=0;
	}
	else
	{
		objdias.disabled="disabled";;
		objMeses.disabled="";
		objdias.selectedIndex=0;
	}				
}
			
function ValidarCampos()
{
	var valid=true;
	var objCat= window.document.getElementById("ddlCategoria")
	var objSubCat= window.document.getElementById("ddlSubCategoria")
	var objEdo= window.document.getElementById("cboestado")
	var objCda= window.document.getElementById("cbociudad")
	var objAcad = window.document.getElementById("txtacademia").value   
	var objAcadA = window.document.getElementById("txtnombreAcadA").value
	var objdiasRdb= window.document.getElementById("rdbTiempoDias")
	var objdias= window.document.getElementById("ddldiasP") 				
	var objMesesRdb= window.document.getElementById("rdbTiempoMeses")
	var objMeses= window.document.getElementById("ddlMesesP")				
	if (objdiasRdb.checked==true)
	{
		if (objdias.selectedIndex==0)
		{
			var lbldias= window.document.getElementById("Label8");
			lbldias.innerText ="este campo es obligatorio"
			valid=false
		}
		else
		{
			var lbldias= window.document.getElementById("Label8");
			lbldias.innerText =""
		}
	}
	else
	{
		if (objMeses.selectedIndex==0)
		{
			var lblMeses= window.document.getElementById("Label14");
			lblMeses.innerText ="este campo es obligatorio"
			valid=false
		}
		else
		{
			var lblMeses= window.document.getElementById("Label14");
			lblMeses.innerText =""
		}	
	}	
	if (objAcad!=objAcadA)
	{
		alert('Escriba el nombre de la academia como muestra de que acepto el contrato')	
		valid=false
	}
	if (objCat.selectedIndex==0)
	{
		var lblCat= window.document.getElementById("Label5");
		lblCat.innerText ="este campo es obligatorio"
		valid=false
	}
	else
	{
		var lblCat= window.document.getElementById("Label5");
		lblCat.innerText =""
	}
	if (objSubCat.selectedIndex==0)
	{
		var lblSubCat= window.document.getElementById("Label6");
		lblSubCat.innerText ="este campo es obligatorio"
		valid=false
	}
	else
	{
		var lblSubCat= window.document.getElementById("Label6");
		lblSubCat.innerText =""
	}
	if (objEdo.selectedIndex==0)
	{
		var lblEdo= window.document.getElementById("lblerrorestado");
		lblEdo.innerText ="este campo es obligatorio"
		valid=false
	}
	else
	{
		var lblEdo= window.document.getElementById("lblerrorestado");
		lblEdo.innerText =""
		if (objCda.selectedIndex==0)
		{
			var lblCda= window.document.getElementById("lblerrorciudad");
			lblCda.innerText ="este campo es obligatorio"
			valid=false
		}
		else
		{
			var lblCda= window.document.getElementById("lblerrorciudad");
			lblCda.innerText =""					
		}
	}
	return valid; 
}

function CambiarImagen()
{
	var obj1= window.document.getElementById("txtimagen").value
	var obj2= window.document.getElementById("txtimagen2")
	obj2.value= obj1
}

function ValidarCamposMod()
{
	var valid=true;
	var objCat= window.document.getElementById("ddlCategoria")
	var objSubCat= window.document.getElementById("ddlSubCategoria")
	var objEdo= window.document.getElementById("cboestado")
	var objCda= window.document.getElementById("cbociudad")
	var objAcad = window.document.getElementById("txtacademia").innerText    	
	var objdias= window.document.getElementById("ddldiasP") 
	var objdias2= window.document.getElementById("ddldiasP")
	if ((objdias.selectedIndex==0) && (objdias2.selectedIndex==0))
	{
		var lbldias= window.document.getElementById("Label8");
		lbldias.innerText ="este campo es obligatorio"
		valid=false
	}
	else
	{
		var lbldias= window.document.getElementById("Label8");
		lbldias.innerText =""
	}	
	if (objCat.selectedIndex==0)
	{
		var lblCat= window.document.getElementById("Label5");
		lblCat.innerText ="este campo es obligatorio"
		valid=false
	}
	else
	{
		var lblCat= window.document.getElementById("Label5");
		lblCat.innerText =""
	}
	if (objSubCat.selectedIndex==0)
	{
		var lblSubCat= window.document.getElementById("Label6");
		lblSubCat.innerText ="este campo es obligatorio"
		valid=false
	}
	else
	{
		var lblSubCat= window.document.getElementById("Label6");
		lblSubCat.innerText =""
	}
	if (objEdo.selectedIndex==0)
	{
		var lblEdo= window.document.getElementById("lblerrorestado");
		lblEdo.innerText ="este campo es obligatorio"
		valid=false
	}
	else
	{
		var lblEdo= window.document.getElementById("lblerrorestado");
		lblEdo.innerText =""
		if (objCda.selectedIndex==0)
		{
			var lblCda= window.document.getElementById("lblerrorciudad");
			lblCda.innerText ="este campo es obligatorio"
			valid=false
		}
		else
		{
			var lblCda= window.document.getElementById("lblerrorciudad");
			lblCda.innerText =""					
		}
	}
	return valid; 
}