	function addMembers()
	{
		var bandMembers = document.getElementById('bandMembers');
		var bandMembersList = document.getElementById('bandMembersList');
		bandMembers.value = bandMembers.value + bandMembersList[bandMembersList.selectedIndex].value + ', ';
	}

	// Remember the current position.
	function storeCaret(text)
	{
		// Only bother if it will be useful.
		if (typeof(text.createTextRange) != "undefined")
			text.caretPos = document.selection.createRange().duplicate();
	}
	
	// Replaces the currently selected text with the passed text.
	function replaceText(text, textarea)
	{
		// Attempt to create a text range (IE).
		if (typeof(textarea.caretPos) != "undefined" && textarea.createTextRange)
		{
			var caretPos = textarea.caretPos;
	
			caretPos.text = caretPos.text.charAt(caretPos.text.length - 1) == ' ' ? text + ' ' : text;
			caretPos.select();
		}
		// Mozilla text range replace.
		else if (typeof(textarea.selectionStart) != "undefined")
		{
			var begin = textarea.value.substr(0, textarea.selectionStart);
			var end = textarea.value.substr(textarea.selectionEnd);
			var scrollPos = textarea.scrollTop;
	
			textarea.value = begin + text + end;
	
			if (textarea.setSelectionRange)
			{
				textarea.focus();
				textarea.setSelectionRange(begin.length + text.length, begin.length + text.length);
			}
			textarea.scrollTop = scrollPos;
		}
		// Just put it on the end.
		else
		{
			textarea.value += text;
			textarea.focus(textarea.value.length - 1);
		}
	}
	
	// Surrounds the selected text with text1 and text2.
	function surroundText(text1, text2, textarea)
	{
		// Can a text range be created?
		if (typeof(textarea.caretPos) != "undefined" && textarea.createTextRange)
		{
			var caretPos = textarea.caretPos, temp_length = caretPos.text.length;
	
			caretPos.text = caretPos.text.charAt(caretPos.text.length - 1) == ' ' ? text1 + caretPos.text + text2 + ' ' : text1 + caretPos.text + text2;
	
			if (temp_length == 0)
			{
				caretPos.moveStart("character", -text2.length);
				caretPos.moveEnd("character", -text2.length);
				caretPos.select();
			}
			else
				textarea.focus(caretPos);
		}
		// Mozilla text range wrap.
		else if (typeof(textarea.selectionStart) != "undefined")
		{
			var begin = textarea.value.substr(0, textarea.selectionStart);
			var selection = textarea.value.substr(textarea.selectionStart, textarea.selectionEnd - textarea.selectionStart);
			var end = textarea.value.substr(textarea.selectionEnd);
			var newCursorPos = textarea.selectionStart;
			var scrollPos = textarea.scrollTop;
	
			textarea.value = begin + text1 + selection + text2 + end;
	
			if (textarea.setSelectionRange)
			{
				if (selection.length == 0)
					textarea.setSelectionRange(newCursorPos + text1.length, newCursorPos + text1.length);
				else
					textarea.setSelectionRange(newCursorPos, newCursorPos + text1.length + selection.length + text2.length);
				textarea.focus();
			}
			textarea.scrollTop = scrollPos;
		}
		// Just put them on the end, then.
		else
		{
			textarea.value += text1 + text2;
			textarea.focus(textarea.value.length - 1);
		}
	}
	
	// Checks if the passed input's value is nothing.
	function isEmptyText(theField)
	{
		// Copy the value so changes can be made..
		var theValue = theField.value;
	
		// Strip whitespace off the left side.
		while (theValue.length > 0 && (theValue.charAt(0) == ' ' || theValue.charAt(0) == '\t'))
			theValue = theValue.substring(1, theValue.length);
		// Strip whitespace off the right side.
		while (theValue.length > 0 && (theValue.charAt(theValue.length - 1) == ' ' || theValue.charAt(theValue.length - 1) == '\t'))
			theValue = theValue.substring(0, theValue.length - 1);
	
		if (theValue == '')
			return true;
		else
			return false;
	}
	
	// Only allow form submission ONCE.
	function submitThisOnce(form)
	{
		if (typeof(form.form) != "undefined")
			form = form.form;
	
		for (var i = 0; i < form.length; i++)
			if (typeof(form[i]) != "undefined" && form[i].name == "submitButton")
				form[i].readonly = true;
	
		return true;
	}
	
	// Set the "inside" HTML of an element.
	function setInnerHTML(element, toValue)
	{
		// IE has this built in...
		if (typeof(element.innerHTML) != 'undefined')
			element.innerHTML = toValue;
		// Otherwise, try createContextualFragment().
		else
		{
			var range = document.createRange();
			range.selectNodeContents(element);
			range.deleteContents();
			element.appendChild(range.createContextualFragment(toValue));
		}
	}
	
	// Set the "outer" HTML of an element.
	function setOuterHTML(element, toValue)
	{
		if (typeof(element.outerHTML) != 'undefined')
			element.outerHTML = toValue;
		else
		{
			var range = document.createRange();
			range.setStartBefore(element);
			element.parentNode.replaceChild(range.createContextualFragment(toValue), element);
		}
	}
	
	// Get the inner HTML of an element.
	function getInnerHTML(element)
	{
		if (typeof(element.innerHTML) != 'undefined')
			return element.innerHTML;
		else
		{
			var returnStr = '';
			for (var i = 0; i < element.childNodes.length; i++)
				returnStr += getOuterHTML(element.childNodes[i]);
	
			return returnStr;
		}
	}
	
	function getOuterHTML(node)
	{
		if (typeof(node.outerHTML) != 'undefined')
			return node.outerHTML;
	
		var str = '';
	
		switch (node.nodeType)
		{
		// An element.
		case 1:
			str += '<' + node.nodeName;
	
			for (var i = 0; i < node.attributes.length; i++)
			{
				if (node.attributes[i].nodeValue != null)
					str += ' ' + node.attributes[i].nodeName + '="' + node.attributes[i].nodeValue + '"';
			}
	
			if (node.childNodes.length == 0 && in_array(node.nodeName.toLowerCase(), ['hr', 'input', 'img', 'link', 'meta', 'br']))
				str += ' />';
			else
				str += '>' + getInnerHTML(node) + '</' + node.nodeName + '>';
			break;
	
		// 2 is an attribute.
	
		// Just some text..
		case 3:
			str += node.nodeValue;
			break;
	
		// A CDATA section.
		case 4:
			str += '<![CDATA' + '[' + node.nodeValue + ']' + ']>';
			break;
	
		// Entity reference..
		case 5:
			str += '&' + node.nodeName + ';';
			break;
	
		// 6 is an actual entity, 7 is a PI.
	
		// Comment.
		case 8:
			str += '<!--' + node.nodeValue + '-->';
			break;
		}
	
		return str;
	}
	
	// Checks for variable in theArray.
	function in_array(variable, theArray)
	{
		for (var i = 0; i < theArray.length; i++)
		{
			if (theArray[i] == variable)
				return true;
		}
		return false;
	}
	
	// Find a specific radio button in its group and select it.
	function selectRadioByName(radioGroup, name)
	{
		if (typeof(radioGroup.length) == "undefined")
			return radioGroup.checked = true;
	
		for (var i = 0; i < radioGroup.length; i++)
		{
			if (radioGroup[i].value == name)
				return radioGroup[i].checked = true;
		}
	
		return false;
	}
	
	// Invert all checkboxes at once by clicking a single checkbox.
	function invertAll(headerfield, checkform, mask)
	{
		for (var i = 0; i < checkform.length; i++)
		{
			if (typeof(checkform[i].name) == "undefined" || (typeof(mask) != "undefined" && checkform[i].name.substr(0, mask.length) != mask))
				continue;
	
			if (!checkform[i].disabled)
				checkform[i].checked = headerfield.checked;
		}
	}

	// cursor placement
	function setSelRange(inputEl, selStart, selEnd)
	{ 
		if (inputEl.setSelectionRange) { 
			inputEl.focus(); 
			inputEl.setSelectionRange(selStart, selEnd); 
		} else if (inputEl.createTextRange) { 
		var range = inputEl.createTextRange(); 
		range.collapse(true); 
		range.moveEnd('character', selEnd); 
		range.moveStart('character', selStart); 
		range.select(); 
		} 
	}

	//Browser Support Code
	function ajaxFunction(fileName, ajaxDiv){
		var ajaxRequest;  // The variable that makes Ajax possible!
		
		try{
			// Opera 8.0+, Firefox, Safari
			ajaxRequest = new XMLHttpRequest();
		} catch (e){
			// Internet Explorer Browsers
			try{
				ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP");
			} catch (e) {
				try{
					ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");
				} catch (e){
					// Something went wrong
					alert("Your browser broke!");
					return false;
				}
			}
		}
		
		// Create a function that will receive data sent from the server
		ajaxRequest.onreadystatechange = function(){
			if(ajaxRequest.readyState == 4){
				var ajaxDisplay = document.getElementById(ajaxDiv);
				ajaxDisplay.innerHTML = ajaxRequest.responseText;
			}
		}
	
		ajaxRequest.open("GET", fileName, true);
		ajaxRequest.send(null); 
	
	
	}