function fillMetroArea(listName){
	//alert(document.form1.name);
	theList = MM_findObj2(listName)
	if( theList != null ){
		theList.options[0] = new Option("Select Metro Area","")
		for( i = 0; i < metroAreaIDArr.length; i++ ){
			theList.options[i+1] = new Option(metroAreaTxtArr[i],metroAreaIDArr[i])
		}
	}
}

function fillNeighborhood( listName, metroAreaID){
	//alert(metroAreaID);
	theList = MM_findObj2(listName)
	for( i = 0; i < metroAreaIDArr.length; i++ ){
		if( metroAreaIDArr[i] == metroAreaID ){
			theList.length = 1;
			//alert(neighborhoodIDArr[i]);
			theList.options[0] = new Option("Select Metro Neighborhood","");
			for( j = 0; j < neighborhoodIDArr[i].length; j++ ){
				theList.options[j+1] = new Option(neighborhoodTxtArr[i][j],neighborhoodIDArr[i][j]);
			}
		}
	}
}

function submitForm( theForm, searchType ){
	with( theForm ){
		st.value = searchType;
		submit();
	}
}

function MM_findObj2(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;
}

fillMetroArea("metroAreaID");
fillMetroArea("metroAreaID1");
fillMetroArea("metroAreaID2");
fillMetroArea("metroAreaID3");

