function SaveLink(strURL, linkID, desc, query, title) { var ID = linkID; var linkID = 'link' + linkID; document.getElementById(linkID).firstChild.nodeValue = 'saving...'; var xmlHttpReq = false; var self = this; // Mozilla/Safari if (window.XMLHttpRequest) { self.xmlHttpReq = new XMLHttpRequest(); } // IE else if (window.ActiveXObject) { self.xmlHttpReq = new ActiveXObject("Microsoft.XMLHTTP"); } self.xmlHttpReq.open('GET', 'http://search.lycos.co.uk/server.html?l='+strURL+'&d='+desc+'&q='+query+'&t='+title, true); self.xmlHttpReq.setRequestHeader('Content-Type', 'text/html'); self.xmlHttpReq.onreadystatechange = function() { if (self.xmlHttpReq.readyState == 4) { if (self.xmlHttpReq.responseText == 'true') { updatepage('saved',ID); } else if (self.xmlHttpReq.responseText == 'duplicate') { updatepage('duplicate',ID); } else if (self.xmlHttpReq.responseText == 'false') { updatepage('check cookie settings',ID); } else { updatepage('unknown error',ID); } } } self.xmlHttpReq.send('url='+escape('http://search.lycos.co.uk/server.html?l='+strURL+'&d='+desc+'&q='+query+'&t='+title)); } function updatepage(str, id) { document.getElementById('link' + id).firstChild.nodeValue = str; document.getElementById('link' + id).style.color = "red"; document.getElementById('GoLink' + id).style.visibility = "visible"; }