function setFav(igh) { var http_request = false; if (window.XMLHttpRequest) { http_request = new XMLHttpRequest(); if (http_request.overrideMimeType) { http_request.overrideMimeType('text/xml'); } } else if (window.ActiveXObject) { try {http_request = new ActiveXObject("Msxml2.XMLHTTP");} catch (e) {try {http_request = new ActiveXObject("Microsoft.XMLHTTP");} catch (e) {}} } if (!http_request) { alert(""); return false; } var url = 'https://www.pss-archi.eu/xmlhttp/setfavigh.php?id='+igh; http_request.onreadystatechange = function() {favDisp(http_request,igh);}; http_request.open('GET', url, true); http_request.send(null); } function favDisp(http_request,igh) { if (http_request.readyState == 4) { if (http_request.status == 200) { if (http_request.responseText != "" && http_request.responseText != null) { var infos = new Array(); infos = http_request.responseText.split('|'); var img = document.getElementById("fav_img"+igh); if (infos[0] == 1) { img.src = img.src.substring(0,img.src.lastIndexOf("/")+1)+"fav2.gif"; } else { img.src = img.src.substring(0,img.src.lastIndexOf("/")+1)+"fav1.gif"; } var favnum = document.getElementById("favnum"+igh); if (infos[1] > 0) { favnum.innerHTML = infos[1]; } else { favnum.innerHTML = ""; } } } } }