function hide(obj){
	if(obj.style.visibility!='hidden')
		obj.style.visibility='hidden';
}

function show(obj){
	if(obj.style.visibility!='visible')
		obj.style.visibility='visible';
}

function hiderow(id){
	document.getElementById('hideshow'+id).style.display	= 'none';
	document.getElementById('title'+id).style.color			= '#666666';
	document.getElementById('img'+id).src					= '/img/arrow_right.gif';
}

function showrow(id){
	document.getElementById('hideshow'+id).style.display	= 'block';
	document.getElementById('title'+id).style.color			= '#BB9933';
	document.getElementById('img'+id).src					= '/img/arrow_down.gif';
}

function togglerow(id){
	//alert("document.getElementById('hideshow'"+id+").style.display="+document.getElementById('hideshow'+id).style.display);

	if(document.getElementById('hideshow'+id).style.display=='none')
		showrow(id);
	else
		hiderow(id);

}

function conf_submit(formname, prompttext){
	if(confirm(prompttext))	{
		formname.submit();
	}
}

function pollSubmit(modify)
{
	var pollitem = 0;

	for(i=0; i<document.frm_dsm_poll.poll_value.length; i++)
	{
		if(document.frm_dsm_poll.poll_value[i].checked) pollitem=(i+1);
	}

	if(pollitem==0 && modify)
	{
		alert("You must actually select a value");
	}
	else
	{
		if (document.all)
			var xMax = screen.width, yMax = screen.height;
		else
			if (document.layers)
				var xMax = window.outerWidth, yMax = window.outerHeight;
			else
				var xMax = 540, yMax=480;

		var xOffset = (xMax - 540)/2, yOffset = (yMax - 380)/2;

		if(modify)	{window.open('/pollresults.php?selection=' + pollitem,'poll_results','width=540,height=380,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,top='+yOffset+',left='+xOffset+'');}
		else		{window.open('/pollresults.php','poll_results','width=540,height=380,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,top='+yOffset+',left='+xOffset+'');}

	}
}