//*****************************************************************
function stateOrProvince(callingformfield, value, formfieldname, lr) {
	var callingForm=eval(callingformfield);
	var theForm=eval(formfieldname);
	var theVal=eval(value);
  
	if( theVal == 40 ){
		populatePulldown(theForm, "provinceArray", theForm);
	} else if ( theVal == 1 ){
		populatePulldown(theForm, "stateArray", callingForm);
	} else{
		populatePulldown(theForm, "naArray", callingForm);
 	}
}
//*****************************************************************
function stateRegionOrProvince(callingformfield, value, formfieldname) {
	var callingForm=eval(callingformfield);
	var theForm=eval(formfieldname);
	var theVal=eval(value);
  
	if( theVal == 40 ){
		populatePulldown(theForm, "provinceArray", theForm);
	} else if ( theVal == 1 ){
		populatePulldown(theForm, "listingStateRegionArray", callingForm);
	} else{
		populatePulldown(theForm, "naArray", callingForm);
 	}
}
//*****************************************************************
function county(callingformfield, value, formfieldname, multiLength) {
	var callingForm=eval(callingformfield);
	var theForm=eval(formfieldname);
	var theVal=eval(value);
  
	if(theVal >= 2 && theVal <= 52){
		populatePulldown(theForm, "countyArray"+theVal, theForm);
		if(theForm.options.length > 2){theForm.multiple = true; theForm.size = (theForm.options.length >= multiLength ? multiLength : theForm.options.length); document.getElementById("county_help").style.display = ''; eval("theForm.options[0] = " + "new Option('--- Choose One or More Counties ---','')");}
  } else{
  	populatePulldown(theForm, "naArray", callingForm);
		theForm.multiple = false; theForm.size = 1;  document.getElementById("county_help").style.display = 'none';
 	}
}
//*****************************************************************
function setSegment(){
	if(document.searchcolumn.i.value != ""){
		FixSubMenu('searchcolumn','', 'i', 's'); document.searchcolumn.s.disabled = false;
	}
	if(document.searchholder.s_holder.value != ""){
		document.searchcolumn.s.value = document.searchholder.s_holder.value;
	}
}
//*****************************************************************
function setCounty(){
	if(document.searchcolumn.lr.value != ""){
		county(document.searchcolumn.lco, document.searchcolumn.lr.value, document.searchcolumn.lco, 8);
	}
	if(document.searchholder.lco_holder.value != ""){
		setMultiple(document.searchcolumn.lco, document.searchholder.lco_holder.value);
	}
}