//xmlhttp.js
//Function to create an XMLHttp Object.
function getxmlhttp (){
//Create a boolean variable to check for a valid Microsoft ActiveX instance.
var xmlhttp = false;
//Check if we are using Internet Explorer.
try {
//If the JavaScript version is greater than 5.
xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
//If not, then use the older ActiveX object.
try {
//If we are using Internet Explorer.
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
} catch (E) {
//Else we must be using a non-Internet Explorer browser.
xmlhttp = false;
}
}
// If we are not using IE, create a JavaScript instance of the object.
if (!xmlhttp && typeof XMLHttpRequest != 'undefined') {
xmlhttp = new XMLHttpRequest();
}
return xmlhttp;
}


function POST_processajax (serverPage,obj,id,url){
//Get an XMLHttpRequest object for use.
xmlhttp = getxmlhttp();

xmlhttp.onreadystatechange = function() {
if (xmlhttp.readyState == 4) {
	document.getElementById(obj).innerHTML = xmlhttp.responseText;
	reponse(xmlhttp.responseXML);
}
}
xmlhttp.open('POST', serverPage,true);
xmlhttp.setRequestHeader('Content-type','application/x-www-form-urlencoded');
xmlhttp.send('id='+id+'&url='+url);
}

function update(compteur)
{
	var url = document.getElementById('url'+compteur).value;
	var id = document.getElementById('id'+compteur).value;
	var id_td = document.getElementById('id_td'+compteur).value;
	POST_processajax ("http://www.watchmanga.fr/update.php",id_td,id,url);
}