var xhr = null; 
function getXhr(){
     if(window.XMLHttpRequest)
		xhr = new XMLHttpRequest(); 
	else if(window.ActiveXObject){ 
		try{
			xhr = new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e){
		xhr = new ActiveXObject("Microsoft.XMLHTTP");
		}
	}else{
		alert("Votre navigateur ne supporte pas les objets XMLHTTPRequest..."); 
		xhr = false; 
	} 
}

function updateMetier(){
	//getXhr();
	
	var region = document.getElementById('region').options[document.getElementById('region').selectedIndex].value;
	// var poste4 = document.getElementById('poste4').options[document.getElementById('poste').selectedIndex].value;
	poste = '';
	posteMini = true;
	$("li> input:checked").each(function (compt) {
		posteMini = false;
		poste += $(this).attr("id")+';';
		// alert(toto);
		// idChecked[compt] = $(this).attr("value");
		// alert(idChecked[compt]);
	});
	if(posteMini){
		poste = '-1';
	}
	// alert(poste);
	$.post('/scripts/emploi.php',{
			region : region,
			poste : poste
		},function(data){
		$('#affichageOffres').html(data);
		});
	/*xhr.onreadystatechange = function(){
		if(xhr.readyState == 4 && xhr.status == 200){
			var toto = xhr.responseText;
				$('#affichageOffres').html(xhr.responseText);
		}
    }
		
	xhr.open("POST","/scripts/emploi.php",true);
	xhr.setRequestHeader('Content-Type','application/x-www-form-urlencoded'); 
	xhr.send('region='+region+'&poste='+poste); */
}




