// JavaScript Document
function ajaxLoadForm(url, campos, repositorio){
document.getElementById(repositorio).innerHTML = '';
var xmlHttp;
try {
// Firefox, Opera 8.0+, Safari
xmlHttp=new XMLHttpRequest();
} catch (e) {
// Internet Explorer
try {
xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
} catch (e){
try {
xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
} catch (e) {
alert("Your browser does not support AJAX!");
return false;
}
}
}
//Send the proper header information along with the request
xmlHttp.onreadystatechange=function() {
if(xmlHttp.readyState==4 && xmlHttp.status == 200) {
document.getElementById(repositorio).innerHTML = xmlHttp.responseText;
}
}
xmlHttp.open("POST",url,true);
xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
xmlHttp.setRequestHeader("Content-length", campos.length);
xmlHttp.setRequestHeader("Connection", "close");
xmlHttp.setRequestHeader('Cache-Control', 'no-cache');
xmlHttp.send(campos);
}
