function displayContent(qStr, url, elementID, funcCall){
	// This function sends a request to an XML file.
	// Once the request has been made and the XML Document has been returned,
	// the content (CDATA) from the "<htmlform>" element is obtained and placed into the relevant element.
	// The function accepts 3 parameters:
	//  - qStr - The queary string that is to be submitted along with the request (must men url encoded).
	//  - url - The location of the XML file to send the request to.
	//  - elementID - ID value of the container element that the content is to be placed in.
	// This function can also be used on an event handler with the parameters being used as properties instead.
	
	// Get the relevant properties (if they are available) and assign them to the appropriate varaibles.
	if(this.qStr) var qStr = this.qStr;
	if(this.url) var url = this.url;
	if(this.elementID) var elementID = this.elementID;
	
	// Check to see if the element with the ID reffered to by the varaible "elementID" actually exits.
	if(document.getElementById(elementID)){
		// Element does exist.
		// Get the element and assign it to the varaible "container".
		var container = document.getElementById(elementID);
	}
	else{
		// Element does not exist.
		// Exit the function.
		return;
	}
	// End of IF statement.
	
	// Send a request to get the appropriate information.	
	// Create XmlHttpObject
	var xmlHttp = createHttpRequestObj();
	// Check to see if the "xmlHttp" object was created
	if (xmlHttp == null){
		// The "xmlHttp" object was NOT created
		alert ("Browser does not support HTTP Request");
		// Exit the function.
		return;
	}
	// End of IF statement.
	// Set the "onreadystatechange" event handler.
	xmlHttp.onreadystatechange = function() {
		if(xmlHttp.readyState == 4 && xmlHttp.status == 200){
			// Get the XML Document object.
			var xmlDoc = xmlHttp.responseXML;
			// Get the XML Text.
			//var xmlText = xmlHttp.responseText;
			//window.alert(xmlText);
			//document.getElementById("debug").innerHTML = "";
			//document.getElementById("debug").appendChild(document.createTextNode(xmlText));
			// Get the root element from the XML document.
			var root = xmlDoc.documentElement;
			// Get the status node.
			var status = root.getElementsByTagName("status")[0];
			if(status.getAttribute("error") == "true"){
				window.alert(getNodeValue(status));	
			}
			// Get the "htmlContents" element(s).
			var htmlContents = root.getElementsByTagName("htmlcontent");
			// Check to see if there is at least one "htmlContents" element.
			if(htmlContents.length > 0){
				// Loop through each of the child nodes in the "htmlContents" element.
				for(var i=0; i<htmlContents[0].childNodes.length; i++){
					if(htmlContents[0].childNodes[i].nodeName.toLowerCase() == "#cdata-section"){
						var htmlContent = htmlContents[0].childNodes[i].nodeValue;
						container.innerHTML = htmlContent;
						// Exit the for loop (now that we have the html content).
						break;
					}
					// End of IF statement.
				}
				// End of FOR Loop.
			}
			// End of IF statement.
			
			if(document.getElementById("loader")){
				// Remove the loader.
				container.removeChild(document.getElementById("loader"));
			}
			// End of IF statement.
		}
		else{
			// Check to see if the loader is not being displayed.
			if(!document.getElementById("loader")){
				// Display the loader.
				var contentLoader = getLoader("");
				// Append the loader to the current container.
				container.appendChild(contentLoader);
			}
			// End of IF statement.
		}
		// End of IF Else statement
	};
	// End of "xmlHttp.onreadystatechange" function
	// Open a GET request to the appropriate URL in asynchronus mode.
	xmlHttp.open("POST", url, true);
	// Set the HTTP Request header for the "Content-type".
	xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
	// Send the request.
	xmlHttp.send(qStr);
}
// End of function "displayContent()".

function submitForm(myForm){
	// Create a url encoded query string for the current form.
	var formQS = createQueryString(myForm);
	//window.alert("QS = "+formQS+"\nURL = "+myForm.action);
	// Send a request to the appropriate page to proccess the form submission.
	displayContent(formQS, myForm.action, "FormContainer", null);
	return false;
}
// End of function "submitForm()".

function toggleOther(mySelect, otherID){
	if(document.getElementById(otherID)){
		var otherContainer = document.getElementById(otherID);
		if(mySelect.value.toLowerCase() == "other"){
			otherContainer.style.display = "block";
		}
		else{
			otherContainer.style.display = "none";
		}
		// End of IF Else statement.
	}
	// End of IF statement.
}
// End of function "toggleOther".