function mousewait() {
	elem = document.getElementById("mybody");
	if (elem) {
		elem.style.cursor = 'wait';
	}
}

function mousenormal() {
	elem = document.getElementById("mybody");
	if (elem) {
		elem.style.cursor = 'auto';
	}
}

function getReqObject() {
	if (window.XMLHttpRequest) {
		return new XMLHttpRequest();
	} else {
		return new ActiveXObject("Microsoft.XMLHTTP");
	}
}

function createRequest(url,answerTo) {

	mousewait();
	var req = getReqObject();
	req.open("GET",url,true);
	req.onreadystatechange = answerTo;
	req.send(null);			
	return req;
}

function isReqReady(req) {
	if (req.readyState == 4) {
		if (req.status == 200) {
			return true;
		}
	}
	return false;
}

function openwin(aURL,aWinName) {
	ma = "";
	if (screen) {
		w = screen.availWidth;
		h = screen.availHeight;
		if (w < 800) {
			l = (w - 400) / 2;
			t = (h - 400) / 2;
			ma = "Left=" + l + ",Top=" + t + ",WIDTH=400,HEIGHT=400,";		

		} else {
			l = (w - 600) / 2;
			t = (h - 600) / 2;
			ma = "Left=" + l + ",Top=" + t + ",WIDTH=600,HEIGHT=600,";		

		}	
	} else {
		ma = "Left=10,Top=10,WIDTH=400,HEIGHT=400,";
	}
	s =  ma + "toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no";
	awin = window.open (aURL,aWinName,s);
	awin.focus();
}

function openeditorwin(aURL,aWinName) {
	
	ma = "Left=10,Top=10,WIDTH=800,HEIGHT=600,";
	
	s =  ma + "toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no";
	awin = window.open (aURL,aWinName,s);
	awin.focus();
}


function openerrorwin(aURL) {
	
	ma = "Left=10,Top=10,WIDTH=800,HEIGHT=600,";
	
	s =  ma + "toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no";
	awin = window.open (aURL,'Errors',s);
	awin.focus();
}