function trim (chaine) {
 return chaine.replace(/(^\s*)|(\s*$)/g, "");
}

	

function load_ville_footer(txt_select,txt_select2,page_id) {
	
	var p_id = document.form_store2.province.value;
	
	var strurl = "../system/process/load_ville.php";
	parameters = "p_id=" + p_id + "&txt_select=" + txt_select+ "&txt_select2=" + txt_select2 + "&page_id=" + page_id;
	
	var xhr_object = getHTTPObject();
	
	xhr_object.open("POST",strurl, true);
	
	xhr_object.onreadystatechange = function() {
	   
	 if(xhr_object.readyState == 4) {
		   retour = xhr_object.responseText;
		   var stepinter = document.getElementById("commune2");
		   stepinter.innerHTML = retour;
		   
		};
	}
	
	xhr_object.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
    xhr_object.setRequestHeader("Content-length", parameters.length);
    xhr_object.setRequestHeader("Connection", "close");
	xhr_object.send(parameters);
	
}

function load_code_footer(txt_select,page_id) {
	
	//var v_id = document.form_store2.ville.value;
	var v_id = document.form_store2.sujet_select7.value;
	
	var strurl = "../system/process/load_code_footer.php";
	parameters = "v_id=" + v_id+ "&txt_select=" + txt_select + "&page_id=" + page_id;
	
	var xhr_object = getHTTPObject();
	
	xhr_object.open("POST",strurl, true);
	
	xhr_object.onreadystatechange = function() {
	   
	 if(xhr_object.readyState == 4) {
		   retour = xhr_object.responseText;
		   var stepinter = document.getElementById("code2");
		   stepinter.innerHTML = retour;
		 
	};
	}
	
	xhr_object.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
    xhr_object.setRequestHeader("Content-length", parameters.length);
    xhr_object.setRequestHeader("Connection", "close");
	xhr_object.send(parameters);
	
}



function load_point2(objett) {
	
	
	var c_id = objett.value;
	
	document.form_store2.c_id.value = c;
	alert(c);
	
}


function getHTTPObject() {
  var xmlhttp;
  /*@cc_on
  @if (@_jscript_version >= 5)
    try {
      xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
      } catch (e) {
      try {
        xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
        } catch (E) {
        xmlhttp = false;
        }
      }
  @else
  xmlhttp = false;
  @end @*/
  if (!xmlhttp && typeof XMLHttpRequest != 'undefined') {
    try {
      xmlhttp = new XMLHttpRequest();
      } catch (e) {
      xmlhttp = false;
      }
    }
  return xmlhttp;
}


