function isNull(aValue) {
	return((("" + aValue) == "null") && (aValue != "null") &&
	(("" + aValue) != "undefined") && (aValue != "undefined"));
}

function isUndefined(aValue) {
	return(("" + aValue) == "undefined");
}

function isEmpty(s) {
	return (isNull(s) || isUndefined(s) || (s.length == 0) || (s == ""))
}


// featured listings roll arrays
var _flimages  = new Array();


function addNewFLImage(_name) {
	_flimages[_flimages.length?_flimages.length:0] = new Image();
	_flimages[_flimages.length-1].src=_name;
}

var FLLOCATION = 1; // should be reset by the calling page for different starting point
var FLINTERVAL = 5000;// 1 second = 1000 milliseconds.
var fltimer = null;

function rotateFLImages(_direction) {
	FLLOCATION += _direction > 0 ? 1 : -1;
	if (FLLOCATION < 0) FLLOCATION = _flimages.length - 1;
	if (FLLOCATION >= _flimages.length) FLLOCATION = 0;
	var _x = FLLOCATION;
	document.rotateimg1.src=_flimages[_x].src;

	/*
	document.rotateimg1.alt="Details for MLS ID " + _flmlsIds[_x];
	_flmlsId = _flmlsIds[_x];
	document.forms['searchresults'].rotateline1.value=_flprices[_x];
	document.forms['searchresults'].rotateline2.value=_fltypes[_x];
	document.forms['searchresults'].rotateline3.value=_flcities[_x];
	document.forms['searchresults'].rotateline4.value="MLS ID "+_flmlsIds[_x];
	document.forms['searchresults'].rotateline5.value=_flagents[_x];
	document.forms['searchresults'].rotateline6.value=_floffices[_x];
	*/
}

function stopFLAutoRotate() {
	if (fltimer != null) {
		clearInterval(fltimer);
		fltimer = null;
	}
}

function startFLAutoRotate(_d) {
	stopFLAutoRotate();
	if (_d > 0)
		fltimer=setInterval('rotateFLImages(+1)',FLINTERVAL);
	else
		fltimer=setInterval('rotateFLImages(-1)',FLINTERVAL);
}

