function removeNode(node){
	var parent=document.getElementById(node);
	if(parent!=null){
		while(parent.childNodes.length>0){
			parent.removeChild(parent.childNodes[0]);
		}
	}
}

function popupWin(fileToOpen,width,height) {
	gWindow = window.open(fileToOpen,'',"menubar=no,toolbar=no,scrollbars=yes,status=yes,width=" + width + ",height=" + height);
	gWindow.focus();
} 

function loadXMLDoc(url,func){
    if(window.XMLHttpRequest){
        req=new XMLHttpRequest();
        req.onreadystatechange=func;
        req.open("GET",url,true);
        req.send(null);
    }else if(window.ActiveXObject) {
        req=new ActiveXObject("Microsoft.XMLHTTP");
        if(req){
            req.onreadystatechange=func;
            req.open("GET",url,true);
            req.send();
        }
    }
}
function crMess(node,mess,color){
	removeNode(node);	
	var errSmsM=document.getElementById(node);
	var errMess=errSmsM.appendChild(document.createElement("span"));
	errMess.style.color=color;
	//errMess.style.fontWeight="bold";
	errMess.appendChild(document.createTextNode(mess));	
	errSmsM.appendChild(errMess);
}