(function() {
var widgetID = 42486;
var agentHeaderID = null;
if (!widgetID) {
alert('Invalid widget ID given.');
return false;
}
function widgetMainOut() {
var widgetElement = idx('#idxwidgetsrc-42486');
// if it doesn't exist try getting it the old have via the src
if (!widgetElement.size()) {
var src = (!isNaN(widgetID)) ? 'customshowcasejs.php?widgetid=42486' : 'customshowcasejs.php';
widgetElement = idx('script[src*="'+src+'"]');
}
var propc;
var maincID = 'IDX-showcaseGallery-42486';
var mainc = idx('
').attr({'id': maincID, 'class': 'IDX-showcaseTable'});
widgetElement.after(mainc);
var noPhotoUrl = "https://s3.amazonaws.com/clientphotos.idxbroker.com.s3.amazonaws.com/customNoPhoto/customNoPhoto-909";
idx('#'+maincID).before('');
var propr = idx('').addClass('IDX-showcaseRow');
var aLink, imgUrl, img, thumbnail;
aLink = idx('');
imgUrl = decodeURIComponent("https://s3.amazonaws.com/idx-listing-photos/photos/400a/a004610e5eeacc792a32ba884da5d1c0/b048");
img = '';
thumbnail = aLink.append(img);
propc = idx('').attr('class','IDX-showcaseCell')
.append(
idx('').addClass('IDX-showcaseContainer').append(thumbnail
).append(
idx('').attr('class', 'IDX-showcaseListingID').html('24005243')
).append(
idx('').attr('class', 'IDX-showcaseAddress IDX-showcaseAddressElement').html('184 Brazos Bnd')
).append(
idx('').attr({'class': 'IDX-showcaseCCZ', 'class': 'IDX-showcaseCityStateZip'}).append(
idx('')
.attr('class', 'IDX-showcaseAddressElement IDX-showcaseCity')
.html('Snook')
).append(
idx('').attr('class','IDX-showcaseAddressElement IDX-showcaseComma1').text(', ')
).append(
idx('')
.attr('class','IDX-showcaseAddressElement IDX-showcaseState')
.html('Texas ')
).append(
idx('')
.attr('class','IDX-showcaseAddressElement IDX-showcaseStateAbrv')
.html('TX ')
).append(
idx('')
.attr('class','IDX-showcaseAddressElement IDX-showcaseZipcode')
.html('77878')
)
).append(
idx('').attr('class','IDX-showcasePrice').html('$310,000')
).append(
idx('').attr('class', 'IDX-showcaseBeds').html('4 Bedrooms')
).append(
idx('').attr('class', 'IDX-showcaseBaths').html('2 Total Baths')
).append(
idx('').attr('class', 'IDX-showcaseFull').html('2 Full Baths')
).append(
idx('').attr('class', 'IDX-showcasePartial').html('0 Partial Baths')
).append(
idx('').attr('class', 'IDX-showcaseRemarks').html('Come see one of the best homes in the family-frien ... ')
).append(
idx('').attr('class', 'IDX-showcaseStatus').html('Active')
)
.append(
idx('')
.attr({
'class': 'IDX-showcaseCourtesy',
'style': 'display:block !important; visibility:visible !important;'})
.html('
Listing courtesy of MikeGreen - Keller Williams Realty B/V
Listing courtesy of SaundraMcCulloch - Longitude Real Estate
')
)
);
propr.append(propc);
if (propr.children().size()) {
idx('#'+maincID).append(propr);
}
var gallery = idx("#IDX-showcaseGallery-42486");
var cells = idx("#IDX-showcaseGallery-42486 .IDX-showcaseCell");
var containers = idx('#IDX-showcaseGallery-42486 .IDX-showcaseContainer');
cells.css('box-sizing', 'border-box');
var galleryWidth = gallery.outerWidth();
var cells = idx('#IDX-showcaseGallery-42486 .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-42486');
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=ZgbiVtUkZGU9Ck68KnurxgAAAAE';
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();
}
})();