<!--

var mlsWindow;

function openMLS(url)
{
	mlsWindow = window.open(url,"MLS","status,menubar,resizable,scrollbars,copyhistory,left=100,height=580,width=700");
	mlsWindow.focus();
}

function getNumOfSelBoxes(boxes){
	var nc=0;
	if (boxes  != null) {
        	for (i=0; i<boxes.length; i++) {
			if (boxes.item(i).checked)
                        	nc=nc+1;
                }
	}
	return nc;
}

function selectValue(fName, fValue)
{
	var optionElement;

	for (var index=0; index < fName.options.length; index++)
	{
		optionElement = fName.options[index];

		if (optionElement.value == fValue)
		{
			optionElement.selected =  true;
			break;
		}
	}
}
//Child information is mandatory for BalaVihar members only.
function isMemberTypeValid()
{
	var MemberType = document.memDetail.MemberType;

	var aVal = MemberType.options(MemberType.selectedIndex).value;
	if (aVal == 'B')
	{
		return (isEntered(document.memDetail.Child1LastName, "Child Last Name") &&
		isEntered(document.memDetail.Child1FirstName, "Child First Name"));
	}

	return true;
}

//
function clearOptns()
{
	var hFld;
	var vals = document.all("hide");

	for (var i=0; i< vals.length; i++)
	{
		hFld = vals.item(i);
		hFld.value = "";		
	}
}

//Get number of selected options and move the first 10 values to the hidden fields.
function getNumOptions()
{
	var selOptns = 0;
	var optns = document.all("optn");
	var vals = document.all("hide");
	
	clearOptns();
	
	for (var i=0; i< optns.length; i++)
	{
		if (optns.item(i).checked)
		{
			//alert(optns.item(i).value);

			if (selOptns < 10)
				vals.item(selOptns).value = optns.item(i).value;
			selOptns++;
		}

	}

	//for (var i=0; (i< 10) && (i < selOptns); i++)
	//	alert(vals.item(i).value);

	return selOptns;
}

function isEntered(field, fldNm)
{
	if (field.value == "")
	{
		
		alert("Please specify " + fldNm);
		field.focus();
		return false;
	}

	return true;
}


//Select appropriate radio button based on the number of payments and total paymt amount.
/*
function selRbutton(bVal)
{
	if (bVal == 0)
		return;

	var rads = document.memDetail("NoOfPayments");
	for (var i=0; i<rads.length; i++)
	{
		//alert(rads.item(i).value + ' '+i);
		if (bVal == rads.item(i).value)
		{
			rads.item(i).checked = true;
			break;
		}

	}
}
*/
-->
