function responceGetUser(txt) { if (txt == "OK") window.location = "index.php"; else this.target.innerHTML = txt; } function getUser(targetID, user, password) { aj = new Ajax(document.getElementById(targetID), responceGetUser); aj.setHeader('Content-type', 'application/x-www-form-urlencoded'); aj.addParam("user", user); aj.addParam("password", password); aj.getRequest("POST", "login.php", true); } function getContent(obj, event, target, elementID, page, arg) { if(!target) return false; var args = "?"; args += "target="+target+"&"; if(elementID) args += "elementID=" + elementID + "&"; if(page) args += "page=" + page + "&"; if(arg) args += "arg=" + arg + "&"; window.location = "index.php" + args; return false; }