//////
// CONTACT FORM SHOW HIDE STUFF
function initForm()
{
	// GET ALL THE ELEMENTS
	var optional = document.getElementById("optional");
	var optional_2 = document.getElementById("optional_2");
	var readYes = document.getElementById("readYes");
	var readYes_2 = document.getElementById("readYes_2");
  	var readNo = document.getElementById("readNo");
	var readNo_all = document.getElementById("readNo_all");

	if(readYes.checked == false) {
		// Hide the other two options
		readNo.checked = false;
		readYes_2.checked = false;
	  	optional.className = "hidden";
	  	optional_2.className = "hidden";
		
	} else {
		// Show the first option 
		optional.className = "";
		if(readYes_2.checked == false) {
			// Hide the last option
			optional_2.className = "hidden";
		} else {
			// Show the last option
			optional_2.className = "";
		}
	}
	
	// If the right radio buttons are selected, show the next options
	readYes.onclick = showOptional;
 	readYes_2.onclick = showOptional_2;

	// If the other radio buttons are selected, hide the following options
  	readNo.onclick = hideOptional_2;
  	readNo_all.onclick = hideAll;
	
  	return true;
}

//show functions
function showOptional()
{
	var optional = document.getElementById("optional");
	optional.className = "";
	
	return true;
}

function showOptional_2()
{
	var optional_2 = document.getElementById("optional_2");
	optional_2.className = "";
	
	return true;
}
//hide functions
function hideOptional_2()
{
	var optional_2 = document.getElementById("optional_2");
	optional_2.className = "hidden";

	var coDesc = document.getElementById("coDesc");
	coDesc.options[0].selected = true;	

	return true;
}

function hideAll()
{
	var optional = document.getElementById("optional");
	var optional_2 = document.getElementById("optional_2");
	optional.className = "hidden";
	optional_2.className = "hidden";
	
	var readYes_2 = document.getElementById("readYes_2");
  	var readNo = document.getElementById("readNo");
	var coDesc = document.getElementById("coDesc");
	
	
	readNo.checked = false;
	readYes_2.checked = false;
	coDesc.options[0].selected = true;	
	
	return true;
}

addLoadListener(initForm);
