// displays only the div with id = "content" + var divID
function showContent(divID)
{
	var count = 3; // number of elements
	
	// loop through all named elements to find the one that matches var divID
	
	for (i = 1; i <= count; i++)
	{
		var theDiv = eval("content"+i);  //USAGE:  <div id="contentxxx">
		//alert(theDiv);
		if(divID == i)
		{
			theDiv.style.display = "block";
		}
		else
		{
			theDiv.style.display = "none";
		}
	}
}

function moveBeforeSubmit()
{
	//alert(document.form1.btype[i].value);
	
	//loop through all btype (radio object) array elements to see if they are selected
	for( var i = 0; i < document.form1.btype.length; i++) // I always forge tthat in JS you use "array.length"
	{	

		if(document.form1.btype[i].checked == true)
		{
			if(document.form1.btype[i].value == "both")
			{

				idValue = document.form1.stu_id_both.value;
				document.form1.stu_id.value = idValue;
				
				usernameValue = document.form1.username_both.value;
				document.form1.username.value = usernameValue;
			}
			else if (document.form1.btype[i].value == "id")
			{

				document.form1.stu_id.value = document.form1.stu_id_only.value;
				//alert('id');
			}
			else if (document.form1.btype[i].value == "username")
			{
				//alert('username');
				document.form1.username.value = document.form1.username_only.value;
			}
			else
			{
				alert('oops: type error');
			} //end of data move code
		} // end of "if checked "
	} // end of for loop 
}


function bodyLoad()
{
	//test that DIV actually are being used/exist
	if( document.getElementById("nojs") != null && document.getElementById("usertypes") != null)
	{
		document.getElementById("nojs").style.display = 'none';
		document.getElementById("usertypes").style.display = 'block';
	}
}
