// JavaScript Document
var httpRequest = createHttpRequest();
var resultId = '';
var i=1;
var fl=true;
var lID;
var lHeight;
var lp;
function createHttpRequest() {
var httpRequest;
var browser = navigator.appName;
if (browser == "Microsoft Internet Explorer")
httpRequest = new ActiveXObject("Microsoft.XMLHTTP");
else
httpRequest = new XMLHttpRequest();
return httpRequest;
}
function getRequest() {
if (httpRequest.readyState == 4)
document.getElementById(resultId).innerHTML = httpRequest.responseText;
}
function sendRequest(url, _resultId, cont) {
resultId = _resultId;
document.getElementById(resultId).innerHTML = 'Обработка запроса, ждите...';
httpRequest.open('POST', url);
httpRequest.onreadystatechange = getRequest;
httpRequest.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
httpRequest.send(cont);
}
function registr(url, _resultId) {
var cont;
cont='login='+document.getElementById("login").value;
cont+="&password="+document.getElementById("password").value;
sendRequest(url, _resultId, cont);
}
function resize(dID, dHeight, dp)
{
if (dID!=undefined)
lID = dID;
if (dHeight!=undefined)
lHeight = dHeight;
if (dp!=undefined)
lp = dp;
var elem = document.getElementById(lID)
if( elem )
{
i+= fl ? 2 : -2;
if ((i<=0) || (i>=lHeight)) {
clearTimeout(timerID);
var elem2 = document.getElementById(lp);
elem2.innerHTML = elem2.innerHTML=='+' ? '-': '+';
fl=!fl;
}
else {
elem.style.height = i;
timerID = setTimeout("resize()",5);
}
}
}