// JavaScript Document

/*Show or Hide elements using CSS and div tags
Add a div to the area to be hidden
	<div style="display:none; padding-left:20px;" id="DivName"></div>
And add an onlcick option to the controlling form element
	onclick="showhide('DivName');"
*/
function showhide(id){
	if (document.getElementById){
		obj = document.getElementById(id);
			if (obj.style.display == "none"){
				obj.style.display = "";
			} else {
			obj.style.display = "none";
			}
		}
	}
	
/* the select box to be used for the following script to work should look like this:
     <select name="source" onchange="enableOther('source', 'source_other');">
   the select box will also need to be on a form called form1 */

function enableOther(selectName, otherName){
	/* break down the select box and see the value="" area in the selectedText variable */
	var selectedItem = document.form1[selectName].selectedIndex;
	var selectedText = document.form1[selectName].options[selectedItem].value;
	
	/* check to see if the other is selected and enable the other text box if so */
	if(selectedText=="Other" || selectedText=="other"){
		document.form1[otherName].disabled=false;
	}
	/* if other is not selected, disable the text box and clear its contents */
	else
	{
		document.form1[otherName].disabled=true;
		document.form1[otherName].value="";
	}
}

function enableOtherCheckbox(boxName, otherName){
	var selectedItem = document.form1[boxName].name;
	if(selectedItem.checked="true"){
		document.form1[otherName].disabled=false;
	}
	else
	{
		document.form1[otherName].disabled=true;
		document.form1[otherName].value="";
	}
}