<!--
function MM_findObj(n, d) { //v4.01
	var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
		d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
	if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
	for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
	if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function CheckValidityBusiness()
{
    var name = MM_findObj("BusinessSearch:txtBusinessName");
    var type = MM_findObj("BusinessSearch:txtBusinessType");
	var city = MM_findObj("BusinessSearch:txtBusinessCity");
    var state = MM_findObj("BusinessSearch:txtBusinessState");
    var msg = '';
     
	if((name == null || name.value == '') && (type == null || type.value == ''))
		msg = msg + 'You must specify business name or business type.\n';
	if(state == null || state.selectedIndex == 0)
	{
		if(city != null && !IsNumeric(city.value))
		{
			msg = msg + 'You must select a state for your search.\n';
		}
		if(city == null || city.value == '')
		{
			msg = msg + 'You must select a state or ZIP for your search.\n';
		}
	}

    if(msg != '') {
		alert(msg);
		return false;
	}
	
	return true;
}

function testForBusinessEnter()
{
	if (event.keyCode == 13)
	{
		document.all.BusinessSearch_ibFindABusiness.focus();
    }
}
function IsNumeric(sText)
{
   var ValidChars = "0123456789";
   var IsNumber=true;
   var Char;

	for (i = 0; i < sText.length && IsNumber == true; i++) 
      { 
		Char = sText.charAt(i); 
		if (ValidChars.indexOf(Char) == -1) 
		{
			IsNumber = false;
		}
	  }
   return IsNumber;
   
}

//-->
