function so_m(id,m) {
var m = (m==null) ? true : false;
document.getElementById('soi' + id).className = m ? 'foc' : '';
document.getElementById('sot' + id).className = m ? 'foc' : '';
}
function toggleHelper() {
	if(favoritesVisible == true ){
		show('flash');
		document.getElementById('flash').style.display = "block";
		show('formField');
	} else {
		hide('flash');
		document.getElementById('flash').style.display = "none";
		hide('formField');
	}
}

/* ********************************************************************** */
/* ***************        BEGIN CALENDAR CODE       ********************* */
var myFloater = -1;
var thisDate;

var dMax = 550;
var dMin = 0;
var sameDate = false;
var aod = "";

var changedDate;
var fType = typeof f;

//-----------------------------------------------------------------
// this function is called from the calendar popup window
function setDate(mn,dy,yr) {
	var dateField;
	if (aod == "arr") {
		 dateField = new validDate(document.searchForm.arrivalDate);
	} else if (aod == "dep") {
		dateField = new validDate(document.searchForm.departureDate);
	}
	_d = new Date()
	_d.setDate(1);
	_d.setMonth(mn);
	_d.setDate(dy);
	_d.setYear(yr);
	// _d.setTime( Date.parse( mn.toString() + "/" + dy.toString() + "/" + yr) );
	dateField.setD(_d);
	dateField.setField();
	arrivalDate_onBlur();
}

//-----------------------------------------------------------------
// this function is called from the calendar icon
function openCal(calType,ciDate,coDate) {
	oInput = ciDate;
	oInput2 = coDate;
	var dt1 = null;
	var dt2 = null;
	
	if (calType == "arrival") {
		aod = "arr";
		thisDate = oInput;
		var thisDate2 = oInput2;
		ciDate.value = thisDate.value;
		document.SearchForm.inputDate.value = thisDate.value;
		sameDate = true;
		changedDate = "dtArr";
	} else {
		aod = "dep";
		dt1 = new Date(oInput.value);
		dt2 = new Date(oInput2.value);
		thisDate = oInput;
		var thisDate2 = oInput2;

		if (dt1 < dt2) {
			coDate.value = thisDate2.value;
			sameDate = true;
		} else {
			ciDate.value = thisDate.value;
			sameDate = true;
		}
		
		document.SearchForm.inputDate.value = thisDate2.value;
		changedDate = "dtDep";
	}

	var mybrand = (fType != "undefined") ? ((f.theBrand) ? f.theBrand.value : "") : "";
	myFloater = window.open('','myWindow','scrollbars=yes,status=no,width=220,height=200,top=450,left=250,resizable=no');

	if (myFloater.opener == null) myFloater.opener = self;

	myFloater.location.href = "/common/property/components/calendar.jsp?brand=" + mybrand;
}
/* ***************         END CALENDAR CODE         ********************** */
/* *********************************************************************** */