var xmlHttp = null;

function leerCookie(cookieName) {
 var theCookie=""+document.cookie;
 var ind=theCookie.indexOf(cookieName);
 if (ind==-1 || cookieName=="") return ""; 
 var ind1=theCookie.indexOf(';',ind);
 if (ind1==-1) ind1=theCookie.length; 
 return unescape(theCookie.substring(ind+cookieName.length+1,ind1));
}


function verJobsHome(maxSeniority)
{
	var loggedIn = leerCookie('LoginCorporate');

	if (loggedIn != 0) {
			arrUser = loggedIn.split('#');
			usuario = arrUser[1].split('||');
			crearXmlHTTP();
			var url="../js/mostrarJobs.php?user="+usuario+"&maxSeniority="+maxSeniority;
			xmlHttp.onreadystatechange=ajaxMostrarJob;
			xmlHttp.open("GET",url,true);		//acá true es para hacerlo sincronico o asincronico....fijate eso
			xmlHttp.send(null);
		}
		else {
			crearXmlHTTP();
			var url="../js/mostrarJobs.php?user=0&maxSeniority="+maxSeniority;
			xmlHttp.onreadystatechange=ajaxMostrarJob;	
			xmlHttp.open("GET",url,true);		//acá true es para hacerlo sincronico o asincronico....fijate eso
			xmlHttp.send(null);		
		}
		
}	

function ajaxMostrarJob(){

	if(xmlHttp.readyState==4)
	{	
		var resultado = xmlHttp.responseText;	//respuesta de request.php
		
		if (document.getElementById('mostrarJobExcecute') != null ){
			
			document.getElementById('mostrarJobExcecute').innerHTML = resultado;
		}	
	}

}

function crearXmlHTTP()
{
	try
  {
  // Firefox, Opera 8.0+, Safari
  xmlHttp=new XMLHttpRequest();
  }
catch (e)
  {
  // Internet Explorer
  try
    {
    xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
    }
  catch (e)
    {
    try
      {
      xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
      }
    catch (e)
      {
      alert("Your browser does not support AJAX!");
      return false;
      }
    }
  }
  xmlHttp.onreadystatechange=function()
    {
    if(xmlHttp.readyState==4)
      {
		
      }
    }
}