function objetoAjax()
{
		var xmlhttp=false;
		try 
		{
			xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
		} 
		catch (e) 
		{
			try 
			{
			   xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
			} 
			catch (E) 
			{
				xmlhttp = false;
			}
		}
		
		if (!xmlhttp && typeof XMLHttpRequest != 'undefined') 
		{
			xmlhttp = new XMLHttpRequest();
		}
		return xmlhttp;
}

var $ = jQuery.noConflict()
var x;
x=jQuery(document);

function ocultarRecuadro()
{
  var x=jQuery("#loginPan");
  x.hide("slow");
}

function showTypeFormLogin()
{
	var x=jQuery("#miSelect").val();
	
	//jQuery("#destino").load("recibe_parametros.php", {idTypeUser: x});
	
	if (x == 0)
	{
		var y;
		y=jQuery(document);
		var y=jQuery("#tutorialPanLogin"); y.fadeIn("slow"); 
		var y=jQuery("#loginPanParticular"); y.hide("");
		var y=jQuery("#loginPanEmpresa"); y.hide("");
	}
	else if (x == 1)
	{
		var y;
		y=jQuery(document);
		var y=jQuery("#tutorialPanLogin"); y.hide(""); 
		var y=jQuery("#loginPanParticular"); y.fadeIn("slow");
		var y=jQuery("#loginPanEmpresa"); y.hide("");
	}
	else if (x == 2)
	{
		var y;
		y=jQuery(document);
		var y=jQuery("#tutorialPanLogin"); y.hide(""); 
		var y=jQuery("#loginPanParticular"); y.hide("");
		var y=jQuery("#loginPanEmpresa"); y.fadeIn("slow");
	}
}

function setTypeFormLogin(idValue) 
{
	document.getElementById('miSelect').value = idValue;
	
	if (idValue == 1)
	{
		var y;
		y=jQuery(document);
		var y=jQuery("#tutorialPanLogin"); y.hide(""); 
		var y=jQuery("#loginPanParticular"); y.fadeIn("slow");
		var y=jQuery("#loginPanEmpresa"); y.hide("");
	}
	else if (idValue == 2)
	{
		var y;
		y=jQuery(document);
		var y=jQuery("#tutorialPanLogin"); y.hide(""); 
		var y=jQuery("#loginPanParticular"); y.hide("");
		var y=jQuery("#loginPanEmpresa"); y.fadeIn("slow");
	}
}

function showPersonal()
{
	var y=jQuery("#beneficiosIndividuales"); y.fadeIn("slow"); 
	var y=jQuery("#beneficiosEmpresas"); y.hide("");
}

function showEmpresa()
{
	var y=jQuery("#beneficiosIndividuales"); y.hide(""); 
	var y=jQuery("#beneficiosEmpresas"); y.fadeIn("slow");
}

function showAfiliarse()
{
	var y=jQuery("#comoAfiliarse"); y.fadeIn("slow"); 
	var y=jQuery("#contactenos"); y.hide("");
}

function showContacto()
{
	var y=jQuery("#comoAfiliarse"); y.hide(""); 
	var y=jQuery("#contactenos"); y.fadeIn("slow");
}

function mostrarRecuadro()
{
  var x=jQuery("#loginPan");
  x.show("slow");
}

function ocultarRecuadroAut()
{
	jQuery("#loginPanAutenticado").hide("slow");
}

function mostrarRecuadroAut()
{
  var x=jQuery("#loginPanAutenticado");
  x.show("slow");
}

function show_result(divNum)
{
	var x=jQuery("#demo"+divNum);
  	x.show("slow");
}

function show_result1(divNum, idPais)
{
	divResult = document.getElementById('main-content');

	searchOption = true
	ajax=objetoAjax();
			
	ajax.open("POST", "aux_i_empleos.php",true);
	ajax.onreadystatechange=function() 
	{
		if (ajax.readyState==4) 
		{
			divResult.innerHTML = ajax.responseText;
			
			
			var x=jQuery("#demo"+divNum);
  			x.show("slow");
			
			jQuery(document).ready(function() {
				jQuery('#table'+divNum).dataTable( {
					"aaSorting": [[ 0, "desc" ]], "sPaginationType": "full_numbers"
				} );
			} );
		}
	}
	
	ajax.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
	ajax.send("searchOption="+searchOption+"&Pais="+idPais+"&whichSearch="+divNum);
}
