function showcasePositionImage( img, containerWidth, containerHeight, fill, autoHeight )
{
var w = img.width;
var h = img.height;
var ratio = w/h;
autoHeight = autoHeight || false;
var imgW = 0;
var imgH = 0;
if( autoHeight || ratio >= 1 ) {
// horizontal
imgW = fill? containerWidth : Math.min( containerWidth, w );
//img.style.width = imgW + "px";
//img.style.height = "auto";
imgH = Math.floor( imgW / ratio );
}
else {
// vertical
imgH = fill? containerHeight : Math.min( containerHeight, h );
//img.style.height = imgH + "px";
//img.style.width = "auto";
imgW = Math.floor( imgH * ratio );
}
if( fill ) {
if( autoHeight || imgW < containerWidth ) {
imgW = containerWidth;
imgH = Math.floor( imgW / ratio );
}
if( imgH < containerHeight ) {
imgH = containerHeight;
imgW = Math.floor( imgH * ratio );
}
}
img.style.width = imgW + "px";
img.style.height = imgH + "px";
img.style.maxWidth = imgW + "px"; // counter-act some WP themes
img.style.visibility = "visible";
// center it
img.style.left = Math.floor( ( containerWidth - imgW ) / 2 ) + "px";
if( autoHeight ) {
img.style.top = "0";
}
else {
img.style.top = Math.floor( ( containerHeight - imgH ) / 2 ) + "px";
}
// special case for ddf
if( img.closest('.region-DDF') ) {
img.style.left = '0px';
img.style.top = '0px';
}
}
function showcaseAutoImage( img, margin, borderWidth, fill, autoHeight )
{
if( img.parentNode.offsetWidth == 0 ) {
setTimeout( function() {
// f** IE
showcaseAutoImage( img, margin, borderWidth, fill, autoHeight );
}, 100 );
return;
}
if( img.src && img.src.indexOf( "/progress" ) != -1 ) {
return;
}
/*
if( !img.width || !img.height ) {
return;
}
*/
/*
// bill: in FF, the original "img" appears to have incorrect non-zero width
// even though the image is not loaded
var tempImage = new Image();
tempImage.src = img.src;
if( tempImage.width == 0 || tempImage.height == 0 ) {
if(img.onload ) {
// already hooked up, no go?
return;
}
img.onload = function() {
showcaseAutoImage( this, margin, borderWidth, fill, autoHeight );
};
return;
}
*/
img.style.margin = "0";
img.style.position = "absolute";
img.style.display = "block";
img.style.visibility = "visible";
var b = isNaN( borderWidth ) ? 1 : borderWidth;
var inner = img.parentNode;
var outer = img.parentNode.parentNode;
var outerW = outer.offsetWidth;
var outerH = outer.offsetHeight;
var containerWidth = outerW - margin*2 - b*2;
var containerHeight = outerH - margin*2 - b*2;
inner.style.width = containerWidth + "px";
if( !autoHeight ) {
inner.style.height = containerHeight + "px";
}
inner.style.position = "absolute";
inner.style.left = margin + "px";
inner.style.top = margin + "px";
inner.style.overflow = "hidden";
// special case for ddf
if( img.closest('.region-DDF') ) {
img.style.left = '0px';
img.style.top = '0px';
}
//inner.style.backgroundColor = "yellow";
if( outer.style.position != "absolute" ) {
outer.style.position = "relative";
}
if( img.src && img.src.indexOf( "/nophoto" ) != -1 ) {
//img.onclick = null;
//img.style.cursor = "default";
fill = false;
}
var progressElem = img.parentNode.querySelectorAll( ".progress" )[0];
if( progressElem ) {
progressElem.parentNode.removeNode( progressElem );
}
showcasePositionImage( img, containerWidth, containerHeight, fill, autoHeight );
if( autoHeight ) {
var imgH = parseInt( img.style.height );
inner.style.height = imgH + "px";
outer.style.height = imgH + (margin*2) + "px";
}
}
var mrp_slideroll_images_109914 = [];
var item = {};
item["img"] = new Image();
item["img"].src = "https://iss-cdn.myrealpage.com/SQYXGaJCBCaNYDyar6CdMRQliRXTCaEQKCPDnwtlxP4/rs:auto:320:0:0/g:sm/aHR0cDovL3MzLmFtYXpvbmF3cy5jb20vbXJwLWxpc3RpbmdzLzMvMC85LzEwODUzODkwMy8wZjg3NGQ5YjE0N2NlNzdlYzg1MjU2ODJkNjBhMGY3Yi5qcGVn";
item["url"] = "//idx.myrealpage.com/wps/myofficelistings/53108/listing.202608154-1621-maclellans-brook-road-greenwood-b2h-5c7.108538903";
item["desc"] = "$849,000 : 1621 MacLellans Brook Road Greenwood";
item["banner"] = "//res.myrealpage.com/wps/img/pixel.gif";
item["recipLogo"] = "";
item["attribution"] = "";
mrp_slideroll_images_109914.push( item );
item["current"] = true;
var item = {};
item["img"] = new Image();
item["img"].src = "https://iss-cdn.myrealpage.com/dXXkLriZ9jM0_8Qw39LeeHnCYUdgpsvyEoWgyHOFGOU/rs:auto:320:0:0/g:sm/aHR0cDovL3MzLmFtYXpvbmF3cy5jb20vbXJwLWxpc3RpbmdzLzcvOC85LzEwODY5Mzk4Ny80YmI3NTg2OWQ3OTJmMTg4Mzc1OWQyNzM1ZGM0OTQyYi5qcGVn";
item["url"] = "//idx.myrealpage.com/wps/myofficelistings/53108/listing.202610098-134-stellar-street-stellarton-b0k-1s0.108693987";
item["desc"] = "$319,000 : 134 Stellar Street Stellarton";
item["banner"] = "//res.myrealpage.com/wps/img/pixel.gif";
item["recipLogo"] = "";
item["attribution"] = "";
mrp_slideroll_images_109914.push( item );
var item = {};
item["img"] = new Image();
item["img"].src = "https://iss-cdn.myrealpage.com/0tKjcWPRXojr2N_jiPULk-yzX7EP8eM9FOnpbAFVzlo/rs:auto:320:0:0/g:sm/aHR0cDovL3MzLmFtYXpvbmF3cy5jb20vbXJwLWxpc3RpbmdzLzcvNi8zLzEwODYwMjM2Ny9jOThhNmZkOGUyZmRmMmNkOGUzNmYwYzY0YWMxYWQ2My5qcGVn";
item["url"] = "//idx.myrealpage.com/wps/myofficelistings/53108/listing.202608842-750-summer-street-new-glasgow-b2h-3y8.108602367";
item["desc"] = "$259,000 : 750 Summer Street New Glasgow";
item["banner"] = "//res.myrealpage.com/wps/img/pixel.gif";
item["recipLogo"] = "";
item["attribution"] = "";
mrp_slideroll_images_109914.push( item );
var item = {};
item["img"] = new Image();
item["img"].src = "https://iss-cdn.myrealpage.com/mhj3WLwv8P0LHIxe8KSJq5ywShKBTJwsSEr9hkrrnI8/rs:auto:320:0:0/g:sm/aHR0cDovL3MzLmFtYXpvbmF3cy5jb20vbXJwLWxpc3RpbmdzLzAvNS8yLzEwODIwNzI1MC84ZWMyYzFmMDRhOGE4ZjY5M2I5ODU0MGFkYjBiYmY5ZS5qcGVn";
item["url"] = "//idx.myrealpage.com/wps/myofficelistings/53108/listing.202604464-6144-highway-4-linacy-b2h-5c4.108207250";
item["desc"] = "$239,000 : 6144 Highway 4 Linacy";
item["banner"] = "//res.myrealpage.com/wps/img/pixel.gif";
item["recipLogo"] = "";
item["attribution"] = "";
mrp_slideroll_images_109914.push( item );
var item = {};
item["img"] = new Image();
item["img"].src = "https://iss-cdn.myrealpage.com/Wc3k-Fz6wbmuuzGFf6yXxQxT3TqDh2LKOiVcCy8fydE/rs:auto:320:0:0/g:sm/aHR0cDovL3MzLmFtYXpvbmF3cy5jb20vbXJwLWxpc3RpbmdzLzMvNS81LzEwODczNTU1My84MmMyMDA5ODA5Yjk5YjhlMzQzMTQzNjBhYjkzYjg5Ny5qcGVn";
item["url"] = "//idx.myrealpage.com/wps/myofficelistings/53108/listing.202610599-lot-east-river-east-side-road-st-paul-s-b0k-1t0.108735553";
item["desc"] = "$35,000 : Lot East River East Side Road St Paul\'s";
item["banner"] = "//res.myrealpage.com/wps/img/pixel.gif";
item["recipLogo"] = "";
item["attribution"] = "";
mrp_slideroll_images_109914.push( item );
var item = {};
item["img"] = new Image();
item["img"].src = "https://iss-cdn.myrealpage.com/5EYAjCuKj0KdCNJCNIgUbCg7hUo0d2cF00KAxBZLcAk/rs:auto:320:0:0/g:sm/aHR0cDovL3MzLmFtYXpvbmF3cy5jb20vbXJwLWxpc3RpbmdzLzQvMC8xLzEwODYyNTEwNC9kMzk0ZmMxMDBmYzA5Njg0ZDg2ZGJlNGQ5NzE1MjJiYy5qcGVn";
item["url"] = "//idx.myrealpage.com/wps/myofficelistings/53108/listing.202609175-lot-east-river-east-side-road-st-paul-s-b2h-5c5.108625104";
item["desc"] = "$35,000 : Lot East River East Side Road St Paul\'s";
item["banner"] = "//res.myrealpage.com/wps/img/pixel.gif";
item["recipLogo"] = "";
item["attribution"] = "";
mrp_slideroll_images_109914.push( item );
var item = {};
item["img"] = new Image();
item["img"].src = "https://iss-cdn.myrealpage.com/89Wx2ekA14uuwCkNYD_ESmOIc9-TMctUBO1GmHw57UM/rs:auto:320:0:0/g:sm/aHR0cDovL3MzLmFtYXpvbmF3cy5jb20vbXJwLWxpc3RpbmdzLzcvMi85LzEwODcyNzkyNy82Nzg4ODgyMDVhOTkzNTg5NDhjZWUyYmQ0OTQwMzQzYS5qcGVn";
item["url"] = "//idx.myrealpage.com/wps/myofficelistings/53108/listing.202610536-264-almont-avenue-new-glasgow-b2h-3g9.108727927";
item["desc"] = "$229,000 : 264 Almont Avenue New Glasgow";
item["banner"] = "//res.myrealpage.com/wps/img/pixel.gif";
item["recipLogo"] = "";
item["attribution"] = "";
mrp_slideroll_images_109914.push( item );
var item = {};
item["img"] = new Image();
item["img"].src = "https://iss-cdn.myrealpage.com/OricoSOQKIailSY9E0g6eepNNhlGXL35d1e6JucBQ0U/rs:auto:320:0:0/g:sm/aHR0cDovL3MzLmFtYXpvbmF3cy5jb20vbXJwLWxpc3RpbmdzLzAvNS85LzEwODQ4NDk1MC9mMTZhN2M5NzYxY2E0YzkyM2FkYmNhMTliZWVjOTZmNy5qcGVn";
item["url"] = "//idx.myrealpage.com/wps/myofficelistings/53108/listing.202607467-1008-glen-forest-drive-westville-b0k-2a0.108484950";
item["desc"] = "$209,000 : 1008 Glen Forest Drive Westville";
item["banner"] = "//res.myrealpage.com/wps/img/pixel.gif";
item["recipLogo"] = "";
item["attribution"] = "";
mrp_slideroll_images_109914.push( item );
document.write( "