
function isVisible(id) {
	var el;
	if (document.getElementById) { // DOM3 = IE5, NS6
		el = (document.getElementById(id).style.display == 'block') ? 1 : 0;
	} else {
		if (document.layers) { // Netscape 4
		    el = (document.id.display == 'block') ? 1 : 0;
		} else { // IE 4
		    el = (document.all.id.style.display == 'block') ? 1 : 0;
		}
	}
	return el;
}

function hideDiv(id) {
	//safe function to hide an element with a specified id
	if (document.getElementById) { // DOM3 = IE5, NS6
		document.getElementById(id).style.display = 'none';
	} else {
		if (document.layers) { // Netscape 4
			document.id.display = 'none';
		} else { // IE 4
			document.all.id.style.display = 'none';
		}
	}
}

function showDiv(id) {
	//safe function to show an element with a specified id	  
	if (document.getElementById) { // DOM3 = IE5, NS6
		document.getElementById(id).style.display = 'block';
	} else {
		if (document.layers) { // Netscape 4
		    document.id.display = 'block';
		} else { // IE 4
		    document.all.id.style.display = 'block';
		}
	}
}

function toggleDiv(id) {
	var el = isVisible(id);
	//safe function to show an element with a specified id	  
	
	if(el == 1) {
	    hideDiv(id);
	} else if (el == 0){
	    showDiv(id);
	}
}

function GetXmlHttpObject()
{
    var xmlHttp=null;
    try {
	// Firefox, Opera 8.0+, Safari
	xmlHttp=new XMLHttpRequest();
    } catch (e) {
	//Internet Explorer
	try {
	    xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
	} catch (e) {
	    xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
	}
    }
    
    if (xmlHttp==null) {
	alert ("Browser does not support HTTP Request")
	return
    }

    return xmlHttp;
}

