// JavaScript Document
function showDivLayers(toshow,layer_group,layer_count) {
		for (i=1;i<=layer_count;i++) {
			layer = layer_group + "_" + i;
			if (i == toshow && document.getElementById(layer).style.display == "none") 
				document.getElementById(layer).style.display = "block";
			else
				document.getElementById(layer).style.display = "none";
			}
	}
	
function addCategory(form_elem_id) {
	<!-- get new category from user, insert and select --->
	new_cat = prompt("Enter the name for your new category");
	var list_len = document.getElementById(form_elem_id).length;
	if (new_cat != ""){
		document.getElementById(form_elem_id).options[list_len] = new Option(new_cat,new_cat);
		document.getElementById(form_elem_id).selectedIndex = list_len;
		}
	}
	
function checkCustom(field_contents){
	/* If the user fills in the custom field then it should be assued they want to submit it as a response
	This only works after they inputted text. If they change their mind and unselect, we assume they no longer want this
	Note: We assign the option (radio/checkbox) to have the same name as the other options - cause this will affect radio buttons. We then have to make the switch when we're inserting
	 */
	if (field_contents != "") {
		document.getElementById('poll_results_resp_c').checked = true;
	}
}


function nph_change_img_src(name, nsdoc, rpath)
{
     var img = eval((navigator.appName.indexOf('Netscape', 0) != -1) ? nsdoc+'.'+name : 'document.all.'+name);
     if (name == '')    return;
     if (img) {  img.altsrc = img.src;  img.src = rpath; }
}
// -->

	function checkPassword() {
		if ((document.getElementById('password').value != document.getElementById('password_change').value) && (document.getElementById('password').value.length > 0) && (document.getElementById('password_change').value.length > 0)) {
		alert('Your Password and Password Confirmation do not match.\n Please retype them.');
		return false;
		}
		else
		return true;
	}
	
