function ShowHideDiv(divx) 
{
	var showhide_status=document.getElementById(divx).style.display;
	
	if (showhide_status=="none") 
	{
		document.getElementById(divx).style.display="block";
	}
	else 
	{
		document.getElementById(divx).style.display="none";
	}
}



function AjaxAddForm(id, action, waitdiv, resultdiv)
{
	var ajaxRequestAdd; 
	
	try {
		// Opera 8.0+, Firefox, Safari
		ajaxRequestAdd = new XMLHttpRequest();
	} 
	catch (e) {
		// Internet Explorer Browsers
		try {
			ajaxRequestAdd = new ActiveXObject("Msxml2.XMLHTTP");
		} 
		catch (e) {
			try {
				ajaxRequestAdd = new ActiveXObject("Microsoft.XMLHTTP");
			} 
			catch (e) {
				// Something went wrong
				alert("This website requires the use of Javascript. Please enable Javascript from the Tools menu of your web browser. We apologize for any inconvenience.");
				return false;
			}
		}
	}
	// Create a function that will receive data sent from the server
	ajaxRequestAdd.onreadystatechange = function() 
	{
		if(ajaxRequestAdd.readyState == 4  && ajaxRequestAdd.status == 200) {
			document.getElementById(resultdiv).innerHTML = ajaxRequestAdd.responseText;
		}
		
		if(ajaxRequestAdd.readyState!=4) 
		{
			document.getElementById(waitdiv).innerHTML= "<h1 class='clr-1'>One moment please ...</h1>";
		}
	}
	
	var AddQueryString = "?id=" + id + "&action=" + action + "&rannum="+Math.random();
	ajaxRequestAdd.open("GET", "http://www.ctr.ca/ajax/" + AddQueryString, true);
	ajaxRequestAdd.send(null); 
}
