/**
* Crea el objeto Ajax
*
**/
function newAjax()
{
    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;
} 



/**
* Muestra los datos de la norma seleccionada
*
* @params int      Id de la delegacion
*
**/
function mostrarNormativa(tipo_norma)
{	
       var ajax = newAjax();
	   
	   var normativas = document.getElementById('normativas');
   
	   	   	
       ajax.open("GET","http://www.migraciones.gov.ar/accesible/normativa/normativa.php?n="+tipo_norma,true);
	   ajax.onreadystatechange = function mostrarNorma()
		     					 {
							 	     if (ajax.readyState == 4)
								     {
									    if (ajax.status == 200)
									    { 	
										    if (ajax.responseText != '')
										    {    
 												 //HAY RESULTADOS
											     normativas.innerHTML = ajax.responseText;
										    }										 
                                        }//end status									   
							         }//end state
							     }//end function
	   ajax.send(null);
	   		   
}


