//*******************************************************************************
//Name:         Mod
//Purpose:      Calculates the remainder when dividing a by b.
//Author:       Daniel Yong
//Date Written: 14 July 2005
//Inputs:       a		numerator
//				b		denominator
//Outputs:      None.
//Modification History
//Name                  Date        Issue#  Reason
//*******************************************************************************
function Mod(a, b)
{
	return a-Math.floor(a/b) * b;
}

//*******************************************************************************
//Name:         getSelectedValue
//Purpose:      Get the selected item value from the specified list.
//Author:       Daniel Yong
//Date Written: 14 July 2005
//Inputs:       listCtrl	The control that holds the list of options
//Outputs:      string		Value of selected item
//Modification History
//Name                  Date        Issue#  Reason
//*******************************************************************************
function getSelectedValue(listCtrl)
{
	var val;
	
	// find the selected item and get the value
	if (listCtrl != null)
	{
		if (listCtrl.selectedIndex >= 0)
		{
			var len = 0;
			for (len = 0; len < listCtrl.options.length; len++)
			{
				if (listCtrl.options[len].selected)
				{
					val = listCtrl.options[len].value;
					break;
				}
			}
		}
	}
	
	return val;
}

