
function aleatorio(inferior,superior){ 
    numPosibilidades = superior - inferior 
    aleat = Math.random() * numPosibilidades 
    aleat = Math.round(aleat) 
    return parseInt(inferior) + aleat 
} 

function postula()
{
	nume=aleatorio(1,1000000);
	var xmlHttp;
		try{	
			xmlHttp=new XMLHttpRequest();// Firefox, Opera 8.0+, Safari
		}
		catch (e){
			try{
				xmlHttp=new ActiveXObject("Msxml2.XMLHTTP"); // Internet Explorer
			}
			catch (e){
				try{
					xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
				}
				catch (e){
					alert("No AJAX!?");
					return false;
				}
			}
		}
	xmlHttp.onreadystatechange=function(){
		if(xmlHttp.readyState==4){
			document.getElementById('postula').innerHTML=xmlHttp.responseText;
		}
	}
	xmlHttp.open("GET","postulacion.asp?num=" + nume,true);
	xmlHttp.send(null);
}

function login()
{
	nume=aleatorio(1,1000000);
	var xmlHttp;
		try{	
			xmlHttp=new XMLHttpRequest();// Firefox, Opera 8.0+, Safari
		}
		catch (e){
			try{
				xmlHttp=new ActiveXObject("Msxml2.XMLHTTP"); // Internet Explorer
			}
			catch (e){
				try{
					xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
				}
				catch (e){
					alert("No AJAX!?");
					return false;
				}
			}
		}
	xmlHttp.onreadystatechange=function(){
		if(xmlHttp.readyState==4){
			document.getElementById('login').innerHTML=xmlHttp.responseText;
		}
	}
	//xmlHttp.open("GET","login.asp?num=" + nume,true);
	xmlHttp.open("GET","colegium.html?num=" + nume,true);
	xmlHttp.send(null);
}



function trae_noticias()
{
	nume=aleatorio(1,1000000);
	var xmlHttp;
		try{	
			xmlHttp=new XMLHttpRequest();// Firefox, Opera 8.0+, Safari
		}
		catch (e){
			try{
				xmlHttp=new ActiveXObject("Msxml2.XMLHTTP"); // Internet Explorer
			}
			catch (e){
				try{
					xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
				}
				catch (e){
					alert("No AJAX!?");
					return false;
				}
			}
		}
	xmlHttp.onreadystatechange=function(){
		if(xmlHttp.readyState==4){
			document.getElementById('noticias').innerHTML=xmlHttp.responseText;
		}
	}
	xmlHttp.open("GET","noticias.asp?num=" + nume,true);
	xmlHttp.send(null);
}

function trae_noti(val)
{
	nume=aleatorio(1,1000000);
	var xmlHttp;
		try{	
			xmlHttp=new XMLHttpRequest();// Firefox, Opera 8.0+, Safari
		}
		catch (e){
			try{
				xmlHttp=new ActiveXObject("Msxml2.XMLHTTP"); // Internet Explorer
			}
			catch (e){
				try{
					xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
				}
				catch (e){
					alert("No AJAX!?");
					return false;
				}
			}
		}
	xmlHttp.onreadystatechange=function(){
		if(xmlHttp.readyState==4){
			document.getElementById('noticias').innerHTML=xmlHttp.responseText;
		}
	}
	xmlHttp.open("GET","noticias2.asp?val=" + val + "&num=" + nume,true);
	xmlHttp.send(null);
}
