
function ShowHideOnChecked( ctrl, toShow, toHide)
{
	/*
		ctrl - radio button or check box id
		toShow - array with the IDs of the elements to be shown
		toHide - array with the IDs of the elements to be hidden
		*/
	
	if (ctrl.checked)
	{
		for( i = 0; i< toShow.length; i++)
		{
			if (document.getElementById(toShow[i]) != null)
			{
				Display(document.getElementById(toShow[i]));
//				document.getElementById(toShow[i]).focus();
			}
		};
		for(i=0; i < toHide.length; i++)
		{
			if (document.getElementById(toHide[i]) != null)
			{
				UnDisplay(document.getElementById(toHide[i]));
			}
		}					
	}
	else
	{
		for( i = 0; i< toShow.length; i++)
		{
			if (document.getElementById(toShow[i]) != null)
			{
				UnDisplay(document.getElementById(toShow[i]));
			}
		};
		for(i=0; i < toHide.length; i++)
		{
			if (document.getElementById(toHide[i]) != null)
			{
				Display(document.getElementById(toHide[i]));
			}
		}
		
	}
}

function Display(displayControl)
{
	if(displayControl != null)
	{
		displayControl.style.display='';			
	}
}
function UnDisplay(displayControl)
{
	if (displayControl != null)
	{
		displayControl.style.display='none';
	}
}