{"advancedFields":"on","queryArray":{"stp":"s"}}

{"queryArray":{"stp":"s"}}
{"min":{"1":"200000","2":"200000","3":"200000","5":"200000","7":"200000","8":"200000","9":"200000"},"max":{"1":"800000","2":"800000","3":"800000","5":"800000","7":"800000","8":"800000","9":"800000"}}
ajaxURL = '/idx/ajax/search.php';
var ajaxLoadLarge = "<img src='/images/ajaxLoadLarge.gif' style='display:block; margin: 0 auto;' />";

var fieldID, idxID, mlsPtID;
var timer = null;

/**
 * On ready function
 * Functions and code in within this function will execute once jQuery has determined the page is ready
 * meaning all elements have been drawn
 */
idx(document).ready(function() 
{	
	/**
	 * When the limit map search check box is changed
	 */
	idx('#IDX-useMapBounds').change(function() {
		if (idx(this).is(':checked'))
		{
			// Checked - remove the class to not include in submit
			idx('.IDX-mapSearchInput').removeClass('IDX-noSubmit');
		}	
		else
		{
			// Unchecked - add the class to not include in submit
			idx('.IDX-mapSearchInput').addClass('IDX-noSubmit');
		}
	});
	
	
	var pageInfoGet = idx.parseJSON(idx('#IDX-pageInfoGet').html());
	
	/**
	 * If we are here to edit the saved search
	 */
	idx('#IDX-formEditSS').live('click', function() {
			var queryString = generateQueryString('#IDX-searchForm');
			
			// Don't forget to append the page name as well
			queryString = 'page=' + pageInfoGet.page + '&' + queryString;
			var options = {
					"action": "editSaveSearch",
					"queryString": queryString,
					"editSavedSearchID": pageInfoGet.ssid,
			};
			idx.ajax({
				url: ajaxURL,
				async: false,
				dataType: 'json',
				data: options,
				type: 'POST',
				success: function (data) {
					if (data.error == false) 
					{
						idx('#IDX-editSavedSearchMessage').html('Your saved search is edited successfully.');
						idx('#IDX-editSavedSearch').dialog({modal:true, width:300, height:100, title:'Success', autoOpen:false, draggable:false, resizable:false,
									close: function(event, ui) {
										window.location = '/idx/myaccount?section=savedsearch';
									}
								});
						idx('#IDX-editSavedSearch').dialog('open');
					} // end if
					else 
					{
						idx('#IDX-editSavedSearchMessage').html('Unable to edit your saved search.');
						idx('#IDX-editSavedSearch').dialog({modal:true, width:300, height:100, title:'Error', autoOpen:false, draggable:false, resizable:false});
						idx('#IDX-editSavedSearch').dialog('open');
						return false;
					} // end else
				}
			});		
	});
	
}); // end doc ready



/**
 * This function takes a wrapping div id and creates the url string for the search
 * @param formElement the element containing all of the search elements
 * @returns just the elements that make up the search, none of the path info
 */
function generateQueryString(formElement)
{
	var query = '';
	idx(formElement+' :input').each(function() {
		var elementName = idx(this).attr('name');
		var elementID = idx(this).attr('id');
                var elementType = determineInputType(idx(this));
		var elementValue = idx(this).val();
		if(elementName && elementName != 'ccz-radio' && elementValue && elementValue != null)
		{
			if(elementType != 'select-multiple' && elementType != 'radio' && elementType != 'checkbox')
			{
				if(elementName == 'lp' || elementName == 'hp')
					var value = elementValue.replace(/\D/g, "");
				else
					var value = elementValue;
				query = query + elementName + '=' + escapeHTML(value) + '&';		
			} // end if
			else if(idx(this).prop('disabled') != true)
			{
				if(elementType == 'radio' || elementType == 'checkbox')
				{
					if(idx(this).prop('checked') == true)
						query = query + elementName + '=' + escapeHTML(elementValue) + '&';
				} // end if
				else
				{
					idx('#' + elementID + ' option').each(function() {
						if(idx(this).prop('selected') == true)
							query = query + elementName + '=' + escapeHTML(idx(this).val()) + '&';
					});
				} // end else
			} // end else if
		} // end if
	});
	
	var url = query.substring(0, query.length - 1);
	return url; 

} // end function generateQueryString

/**
 * This function will determine which type the input field is
 */
function determineInputType(obj)
{
	var elementType = '';
	if(idx(obj).is(':hidden'))
		elementType = 'hidden';
	else if(idx(obj).is(':button'))
		elementType = 'button';
	else if(idx(obj).is(':checkbox'))
		elementType = 'checkbox';
	else if(idx(obj).is(':file'))
		elementType = 'file';
	else if(idx(obj).is(':radio'))
		elementType = 'radio';
	else if(idx(obj).is(':reset'))
		elementType = 'reset';
	else if(idx(obj).is(':submit'))
		elementType = 'submit';
	else if(idx(obj).is(':text'))
		elementType = 'text';
	else if(idx(obj).is('select'))
	{
		if(idx(obj).prop('multiple'))
			elementType = 'select-multiple';
		else
			elementType = 'select';
	} // end else if
	return elementType;
} // end function determineInputType

/**
 * This function will replace white space with '+' and then escape the string
 */
function escapeHTML(str)
{
        str = String(str);
        if(str != '')
        {
                str = str.split(' ').join('+');
                return escape(str);
        } // end if
        else
                return '';
} // end function escapeHTML


Contact us today!

Address
6013 Wesley Grove Blvd. Suite 102
Wesley Chapel, FL 33544

Contact
813-345-8559
 

Our Hours
Sun Closed
Mon-Fri 09:00 AM - 05:00 PM
Sat Closed