function rdocheck(thisform) 
	{
	myOption = -1;
	for (i=thisform.rdoagree.length-1; i > -1; i--) 
		{
		if (thisform.rdoagree[i].checked) 
			{
				myOption = i;
			}
		}
	if (myOption == -1) 
		{
		alert("Please Agree to terms?");
		return false;
		}
	else if (thisform.rdoagree[myOption].value == 0)
		{
		alert("Please Agree to terms?");
		return false;
		}
	else
		{
			thisform.rdoagree[myOption].checked=true;
			return true;
		}
		
	}

function fnnamechk(obj)
		{
			obj.value=trimString(obj.value);
			Page_ClientValidate();
		}
		function trimString (str)
		{
			var str1;
			str1=str;
			return str1.replace(/^\s+/g, '').replace(/\s+$/g, '');
		}
			function stripCharsNotInBag (s, bag)
{   var i;
    var returnString = "";
    for (i = 0; i < s.length; i++)
    {   
        var c = s.charAt(i);
        if (bag.indexOf(c) != -1) returnString += c;
    }
    return returnString;
}


function inputPhone(oControl,lExt)
{
	// strip out any non-valid characters
	cPhone = stripCharsNotInBag(oControl.value,'0123456789-');

	// check for empties
	if (cPhone == '')
	{
		oControl.value = cPhone;
		return null;
	}
	
	// check if the first char is a 1, remove it after there are 2 chars
	if ((cPhone.length == 2) && (cPhone.substring(0,1) == '1'))
		cPhone = cPhone.substring(1,cPhone.length);

	// strip all formatting chars
	cPhone = stripCharsNotInBag(cPhone,'0123456789');

	if (cPhone != '1')
	{
		// add the formatting chars back in
		cPhone = cPhone;

		if (cPhone.length > 2)
			cPhone = cPhone.substring(0,3)+'-'+cPhone.substring(3,cPhone.length);

		if (cPhone.length > 5)
			cPhone = cPhone.substring(0,7)+'-'+cPhone.substring(7,cPhone.length);

		// check for extension
		//if ((cPhone.length > 13) || ((cPhone.length==13) && (lExt) && (oControl.value.substring(oControl.value.length-1,oControl.value.length).toLowerCase()=='x')))
	//	{
	//		if (lExt)
	//			cPhone = cPhone.substring(0,13)+' x'+cPhone.substring(13,cPhone.length);
	//		else
	//			cPhone = cPhone.substring(0,13);
	//	}

	}

	// return the new value
	oControl.value = cPhone;
}