
function ReplaceElementID(url,id)
{
	var httpRequest;
	if (window.XMLHttpRequest)
	{
		try { httpRequest = new XMLHttpRequest(); }
		catch(e) {}
	} 
	else if (window.ActiveXObject)
	{
		try { httpRequest = new ActiveXObject("Msxml2.XMLHTTP"); } 
		catch(e)
		{
			try { httpRequest = new ActiveXObject("Microsoft.XMLHTTP"); } 
			catch(e) {}
		}
	}
	if(! httpRequest)
	{
		alert('\n\nGiving up :(\n\nCannot create an AJAX connection.');
		return false;
	}
	httpRequest.onreadystatechange = function() { ContainerContents(httpRequest,id); };
	httpRequest.open('GET',url,true);
	httpRequest.send('');
} // function makeRequestGET()

function ContainerContents(content,id)
{
	try
	{
		if (content.readyState == 4)
		{
			if(content.status == 200) { document.getElementById(id).innerHTML=content.responseText; }
			else { alert('\n\nThere was a problem with the request.\n\nStatus code: '+content.status+'\n'+content.statusText); }
		}
	}
	catch(error) { alert('Error: '+error.name+' -- '+error.message+'  id='+id); }
} // function ContainerContents()



function HideContent(d) {
if(d.length < 1) { return; }
document.getElementById(d).style.display = "none";
}
function ShowContent(d) {
if(d.length < 1) { return; }
document.getElementById(d).style.display = "";
}
function ReverseContentDisplay(d) {
if(d.length < 1) { return; }
if(document.getElementById(d).style.display == "none") { document.getElementById(d).style.display = ""; }
else { document.getElementById(d).style.display = "none"; }
}

function ReverseContentToggle(d,e) {
if(d.length < 1) { return; }
if(e.length < 1) { return; }

if(document.getElementById(d).style.display == "none") { document.getElementById(d).style.display = ""; }
else { document.getElementById(d).style.display = "none"; }

if(document.getElementById(e).style.display == "none") { document.getElementById(e).style.display = ""; }
else { document.getElementById(e).style.display = "none"; }
}


function doForm() {
	document.getElementById('formDiv').style.zIndex = "100";
	document.getElementById('formDiv').style.display = "";
	document.getElementById('body').style.backgroundColor = "#303030";
	document.getElementById('button1').style.visibility = "hidden";
}
function clearForm(frm) {
	frm.title1.value = '';
	frm.protocol.options[0].selected = true;
	frm.link1.value = '';
	frm.desc1.value = '';
}
function quitForm(frm) {
	document.getElementById('formDiv').style.zIndex = "-1";
	document.getElementById('formDiv').style.display = "none";
	document.getElementById('body').style.backgroundColor = "white";
	document.getElementById('button1').style.visibility = "visible";
	clearForm(frm);
}


