var xmlHttp
var x1
var x2
var x3

function affichage_menu_niveau2_np(id_elt, salon, element, profil) {
	
    var tabs=document.getElementById('recherche_menu_niveau1').getElementsByTagName("a");

    for (var i=0; i < tabs.length; i++)
    {
        if(tabs[i].rel == element.rel) 
           tabs[i].className="selected";

 
        else
           tabs[i].className="";
    }
	if (id_elt.length>0) {
		xmlHttp=GetXmlHttpObject_np();
		if (xmlHttp==null)
		  {
		  alert ("Your browser does not support AJAX!");
		  return;
		  } 
if (profil=="liste") {
	id_elt_n=1;
} else {
	id_elt_n=id_elt;
}
		var url="ajax_np.php";
		url=url+"?id_elt="+id_elt_n;
		url=url+"&salon="+salon;
		url=url+"&sid="+Math.random();

		xmlHttp.onreadystatechange=stateChanged_np;
		xmlHttp.open("GET",url,true);
		xmlHttp.send(null);
	}
	
	if (profil=="profil") {
		x1 = id_elt;
		x2 = salon;
		x3 = "profil";
	} else {
		x1 = id_elt;
		x2 = salon;
		x3 = "liste";
	}
}
function stateChanged_np() 
{ 
	if (xmlHttp.readyState==4)
	{ 
	
		if (xmlHttp.responseText.length==0) {
			document.getElementById("recherche_menu_niveau2").innerHTML=xmlHttp.responseText;
		}
		if (xmlHttp.responseText.length>0) {
			document.getElementById("recherche_menu_niveau2").innerHTML=""+xmlHttp.responseText+"";
		}
		$.fn.nyroModal.settings.width = 796;
		$.fn.nyroModal.settings.height = 600;

		$(".nyroModal").nyroModal();

		if (x3=="profil") {
			affichage_np(x1, x2, '1');
		} else {
			affichage_np(x1, x2, '1');
		}
		
	}
}
function affichage_np(id_conf, salon, onglet) {
		xmlHttp=GetXmlHttpObject_np();
		if (xmlHttp==null)
		  {
		  alert ("Your browser does not support AJAX!");
		  return;
		  } 

		var url="ajax_np_liste.php";
		url=url+"?id_conf="+id_conf;
		url=url+"&salon="+salon;
		url=url+"&onglet="+onglet;
		url=url+"&sid="+Math.random();

		xmlHttp.onreadystatechange=stateChanged_lstnp;
		xmlHttp.open("GET",url,true);
		xmlHttp.send(null);
}
function stateChanged_lstnp() 
{ 
	
	if (xmlHttp.readyState==4)
	{ 
		if (xmlHttp.responseText.length==0) {
			document.getElementById("block_resultats").innerHTML=xmlHttp.responseText;
		}
		if (xmlHttp.responseText.length>0) {
			document.getElementById("block_resultats").innerHTML=""+xmlHttp.responseText+"";
		}
	
		$.fn.nyroModal.settings.width = 796;
		$.fn.nyroModal.settings.height = 600;

		$(".nyroModal_large").nyroModal();
		$(".nyroModal").nyroModal();
	}
}
function GetXmlHttpObject_np()
{
var xmlHttp=null;
try
  {
  // Firefox, Opera 8.0+, Safari
  xmlHttp=new XMLHttpRequest();
  }
catch (e)
  {
  // Internet Explorer
  try
    {
    xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
	 }
  catch (e)
    {
    xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
    }
  }
return xmlHttp;
}
