(function() { var widgetID = 10214; var agentHeaderID = null; if (!widgetID) { alert('Invalid widget ID given.'); return false; } function widgetMainOut() { var widgetElement = idx('#idxwidgetsrc-10214'); // if it doesn't exist try getting it the old have via the src if (!widgetElement.size()) { var src = (!isNaN(widgetID)) ? 'customshowcasejs.php?widgetid=10214' : 'customshowcasejs.php'; widgetElement = idx('script[src*="'+src+'"]'); } var propc; var maincID = 'IDX-showcaseGallery-10214'; var mainc = idx('
').attr({'id': maincID, 'class': 'IDX-showcaseTable'}); widgetElement.after(mainc); var noPhotoUrl = "https://s3.amazonaws.com/clientphotos.idxbroker.com/customNoPhoto/customNoPhoto-40230"; idx('#'+maincID).before(''); var propr = idx('
').addClass('IDX-showcaseRow'); var aLink, imgUrl, img, thumbnail; aLink = idx(''); imgUrl = decodeURIComponent("https%3A%2F%2Fapi-trestle.corelogic.com%2Ftrestle%2FMedia%2FHLAND%2FProperty%2FPHOTO-jpeg%2F1072851383%2F1%2FMzczLzE5MTEvMjA%2FMjAvNzM0Mi8xNzE0MTUwMTI3%2FI8sHXKpOP7aspJhloQ_Psn0nzbpAEIIr79UAvN6vrek"); img = '5044 Strafford Oaks Drive'; thumbnail = aLink.append(img); propc = idx('
').attr('class','IDX-showcaseCell') .append( idx('
').addClass('IDX-showcaseContainer').append(thumbnail ).append( idx('
').attr('class', 'IDX-showcaseListingID').html('304107') ).append( idx('
').attr('class', 'IDX-showcaseAddress IDX-showcaseAddressElement').html('5044 Strafford Oaks Drive') ).append( idx('
').attr({'class': 'IDX-showcaseCCZ', 'class': 'IDX-showcaseCityStateZip'}).append( idx('') .attr('class', 'IDX-showcaseAddressElement IDX-showcaseCity') .html('Sebring') ).append( idx('').attr('class','IDX-showcaseAddressElement IDX-showcaseComma1').text(', ') ).append( idx('') .attr('class','IDX-showcaseAddressElement IDX-showcaseState') .html('Florida ') ).append( idx('') .attr('class','IDX-showcaseAddressElement IDX-showcaseStateAbrv') .html('FL ') ).append( idx('') .attr('class','IDX-showcaseAddressElement IDX-showcaseZipcode') .html('') ) ).append( idx('
').attr('class','IDX-showcasePrice').html('$629,000') ).append( idx('
').attr('class', 'IDX-showcaseBeds').html('4 Bedrooms') ).append( idx('
').attr('class', 'IDX-showcaseBaths').html('3 Total Baths') ).append( idx('
').attr('class', 'IDX-showcaseFull').html('3 Full Baths') ).append( idx('
').attr('class', 'IDX-showcasePartial').html('0 Partial Baths') ).append( idx('
').attr('class', 'IDX-showcaseRemarks').html('Come see this amazing custom built pool home which ... ') ).append( idx('
').attr('class', 'IDX-showcaseStatus').html('Active') ) ); propr.append(propc); if (propr.children().size()) { idx('#'+maincID).append(propr); } var gallery = idx("#IDX-showcaseGallery-10214"); var cells = idx("#IDX-showcaseGallery-10214 .IDX-showcaseCell"); var containers = idx('#IDX-showcaseGallery-10214 .IDX-showcaseContainer'); cells.css('box-sizing', 'border-box'); var galleryWidth = gallery.outerWidth(); var cells = idx('#IDX-showcaseGallery-10214 .IDX-showcaseRow .IDX-showcaseCell'); idx(window).resize(function() { cells.find('.IDX-showcaseContainer').height('auto'); var heights = cells.map(function () { return idx(this).outerHeight(); }); var maxHeight = Math.max.apply(null, heights); cells.find('.IDX-showcaseContainer').height(maxHeight); }); idx(window).trigger('resize'); if (agentHeaderID) { idx(function() { var widetSrc = widgetElement.attr('src'); if (widetSrc.match(/.+quicksearchjs\.php/)) { var quicksearchForm = idx('#IDX-quicksearchForm-10214'); quicksearchForm.append(idx('').attr({ type: 'hidden', name: 'agentHeaderID', value: agentHeaderID })); } else if (widetSrc.match(/.+leadloginwidget\.php/)) { var leadLoginForm = idx('#IDX-widgetLeadLoginForm'); leadLoginForm.append(idx('').attr({ type: 'hidden', name: 'agentHeaderID', value: agentHeaderID })); } else if (widetSrc.match(/.+mapwidgetjs\.php/)) { idx('#IDX-map-' + widgetID).on('click', 'a[href^="http"]', function (e) { e.preventDefault(); var href = idx(e.target).attr('href'); if (href.match(/.+\?.+/)) { href = href + '&agentHeaderID=' + agentHeaderID; } else { href = href + '?agentHeaderID=' + agentHeaderID; } window.location.href = href; }); } else { // carousel, showcase, and slideshow var detailsLinks = idx('div[id*='+widgetID+']').find('a[href*=widgetReferer]'); detailsLinks.each(function(index, element) { var originalLink = idx(element).attr('href'); idx(element).attr('href', originalLink + '&agentHeaderID=' + agentHeaderID ); }); } }); } } // build a script tag with our version of jquery provided if it doesn't already exist if (typeof idx == 'undefined') { /** * fake idx object to let other widgets know the first widget has inserted jqidx.js * wait to jqwidx.js loaded, idx will be the jquery object. */ window.idx = {}; var jqsrc = '//d1qfrurkpai25r.cloudfront.net/graphical/javascript/jqwidx.js?auid=Zi9LBUXNqX77ymmPk0NfcwAAAB0'; var idxjs = document.createElement('script'); idxjs.setAttribute('type','text/javascript'); idxjs.setAttribute('id','idx_jquery_include_tag'); idxjs.setAttribute('src',jqsrc); // lets let IE in or he'll just sit outside and drink and cry if (idxjs.readyState) { idxjs.onreadystatechange = function () { if (this.readyState == 'complete' || this.readyState == 'loaded') { widgetMainOut(); } }; } // For gooder browsers else { idxjs.onload = widgetMainOut; } // for loading speed our best bet is to insert our jquery before the first script tag on their site since, at minimum, // this widget is being loaded in a script tag, we know there's at least 1 in the document and we know for sure this // will load before any version of jquery on their site so that we can sequester our version behind noConflict var s1 = document.getElementsByTagName('script')[0]; s1.parentNode.insertBefore(idxjs, s1); } // if the idx jquert is loaded then we need to wait until the idx val is defined else { // wait to the first widget's idx jquery object loaded var callWidgetOut = function () { if (window.idx && window.idx.fn) { widgetMainOut(); } else { setTimeout(function() { callWidgetOut(); }, 500); } }; callWidgetOut(); } })();