(function() { var widgetID = 10401; var agentHeaderID = null; var clientLevel = 20; if (!widgetID) { alert('Invalid widget ID given.'); return false; } function widgetMainOut() { var src = (!isNaN(widgetID)) ? 'quicksearchjs.php?widgetid=10401' : 'quicksearchjs.php'; var widgetElement = idx('script[src$="'+src+'"]'); // check for a dynamic widget if (!widgetElement.size()) { var widgetSrc = idx('#idxwidgetsrc-10401'); if (widgetSrc.size()) { widgetElement = widgetSrc; } } var maincID = 'IDX-quicksearch-10401'; var formID = 'IDX-quicksearchForm-10401'; idx('body').on('submit','#'+formID,function(e) { var disabled = []; // disable empty form values idx('input[type="text"]',this).each(function (key,val) { if (idx(this).val() === '') { idx(this).prop('disabled',true); disabled.push(idx(this).attr('id')); } else idx(this).val(idx(this).val().replace(/[^0-9]/g, '')); }); idx('select',this).each(function (key,val) { if (idx('option:selected',this).val() === '') { idx(this).prop('disabled',true); disabled.push(idx(this).attr('id')); } }); setTimeout(function() { idx.each(disabled,function(i,v) { idx('#'+v).attr('disabled',false); }); },250); return true; }); // open in a new window/tab var formTarget = '_self'; var mainc = idx('
').attr({ 'id':maincID, 'class':'IDX-quicksearchWrapper' }).append( idx('
').attr({ 'id':formID, 'class':'IDX-quicksearchForm', 'action':'//reecerproperties.idxbroker.com/idx/results/listings', 'method':'get', 'target':formTarget }) ); widgetElement.after(mainc); idx('#'+maincID).before(''); idx('#'+formID).append( idx('
').attr({ 'id':'IDX-qsIdxIDWrap-10401', 'class':'IDX-qsFieldWrap' }).append( idx('