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_27711 = [];
var item = {};
item["img"] = new Image();
item["img"].src = "https://iss-cdn.myrealpage.com/IE4HX4qDUaht5riShEWcus6hXMP9H905Xt7TY5nqMcg/rs:auto:0:0:0/g:sm/aHR0cDovL3MzLmFtYXpvbmF3cy5jb20vbXJwLWxpc3RpbmdzLzcvMi8xLzExMDIyNzEyNy9hYjhkYjFjODQwZGJlNGNjNThhN2FiMWU1YmQ4MjIxMS5qcGc";
item["url"] = "mylistings-110227127.property";
item["desc"] = "$1,175,000 : 1372 Saturna Drive ";
item["banner"] = "//res.myrealpage.com/wps/rest/20196/l/showcase/110227127/img/ribbon/custom-banner?txt=Parksville+House%21&c=#4a90e2";
item["recipLogo"] = "";
item["attribution"] = "See Realtor.ca for full listing details.";
mrp_slideroll_images_27711.push( item );
item["current"] = true;
var item = {};
item["img"] = new Image();
item["img"].src = "https://iss-cdn.myrealpage.com/8hOZuSJdWOAMvwKCn_fxIu6uIuLtugUYGdmLojfyU9A/rs:auto:0:0:0/g:sm/aHR0cDovL3MzLmFtYXpvbmF3cy5jb20vbXJwLWxpc3RpbmdzLzcvMi8xLzExMDIyNzEyNy85N2IyOGU3OWIwNTVhY2YwYmFkNDM5ZGI1N2ZjMTZiYi5qcGc";
item["url"] = "mylistings-110227127.property";
item["desc"] = "$1,175,000 : 1372 Saturna Drive ";
item["banner"] = "//res.myrealpage.com/wps/rest/20196/l/showcase/110227127/img/ribbon/custom-banner?txt=Parksville+House%21&c=#4a90e2";
item["recipLogo"] = "";
item["attribution"] = "See Realtor.ca for full listing details.";
mrp_slideroll_images_27711.push( item );
var item = {};
item["img"] = new Image();
item["img"].src = "https://iss-cdn.myrealpage.com/8-SS6yfSc_qmGs6P6hWCa3_OcO0bXaPRL3xsT_rX1YM/rs:auto:0:0:0/g:sm/aHR0cDovL3MzLmFtYXpvbmF3cy5jb20vbXJwLWxpc3RpbmdzLzcvMi8xLzExMDIyNzEyNy9lMmQyODgwMGJhMDlhNjA4MjZhN2VhZjIwY2UxNjZjMi5KUEc";
item["url"] = "mylistings-110227127.property";
item["desc"] = "$1,175,000 : 1372 Saturna Drive ";
item["banner"] = "//res.myrealpage.com/wps/rest/20196/l/showcase/110227127/img/ribbon/custom-banner?txt=Parksville+House%21&c=#4a90e2";
item["recipLogo"] = "";
item["attribution"] = "See Realtor.ca for full listing details.";
mrp_slideroll_images_27711.push( item );
var item = {};
item["img"] = new Image();
item["img"].src = "https://iss-cdn.myrealpage.com/E8OSkW_wN432693FJVtOKZMo92v4QutHEdJOvIgNc00/rs:auto:0:0:0/g:sm/aHR0cDovL3MzLmFtYXpvbmF3cy5jb20vbXJwLWxpc3RpbmdzLzcvMi8xLzExMDIyNzEyNy9iYWQ2MDA2ODNjZDllNjJlYzE1YjBiZWFiN2I2NDMzNC5qcGc";
item["url"] = "mylistings-110227127.property";
item["desc"] = "$1,175,000 : 1372 Saturna Drive ";
item["banner"] = "//res.myrealpage.com/wps/rest/20196/l/showcase/110227127/img/ribbon/custom-banner?txt=Parksville+House%21&c=#4a90e2";
item["recipLogo"] = "";
item["attribution"] = "See Realtor.ca for full listing details.";
mrp_slideroll_images_27711.push( item );
var item = {};
item["img"] = new Image();
item["img"].src = "https://iss-cdn.myrealpage.com/JDos6b1-9Kq5QIOMHFtx53KERB3IMnbG_u6oRSpPSIY/rs:auto:0:0:0/g:sm/aHR0cDovL3MzLmFtYXpvbmF3cy5jb20vbXJwLWxpc3RpbmdzLzUvNS8zLzExMDE5NzM1NS85ODc4MGJhZTJjNmI2ZjVhOWJhMjQxNjZmODkwZTRkZi5qcGVn";
item["url"] = "mylistings-110197355.property";
item["desc"] = "$299,900 : 501 1250 Burnaby Street Vancouver";
item["banner"] = "//res.myrealpage.com/wps/rest/20196/l/showcase/110197355/img/ribbon/custom-banner?txt=Ocean+View%21&c=#4a90e2";
item["recipLogo"] = "";
item["attribution"] = "Listed by RE/MAX Crest Realty";
mrp_slideroll_images_27711.push( item );
var item = {};
item["img"] = new Image();
item["img"].src = "https://iss-cdn.myrealpage.com/a7a9XY1xBmt2Hk5tdgKlufLf9l4LFQzyEGy63mdqTak/rs:auto:0:0:0/g:sm/aHR0cDovL3MzLmFtYXpvbmF3cy5jb20vbXJwLWxpc3RpbmdzLzUvNS8zLzExMDE5NzM1NS9lNDQ4YjY4Yzk1NDJlNTg5ODMxYjRkZDQ2YTc4NDUzYy5qcGVn";
item["url"] = "mylistings-110197355.property";
item["desc"] = "$299,900 : 501 1250 Burnaby Street Vancouver";
item["banner"] = "//res.myrealpage.com/wps/rest/20196/l/showcase/110197355/img/ribbon/custom-banner?txt=Ocean+View%21&c=#4a90e2";
item["recipLogo"] = "";
item["attribution"] = "Listed by RE/MAX Crest Realty";
mrp_slideroll_images_27711.push( item );
var item = {};
item["img"] = new Image();
item["img"].src = "https://iss-cdn.myrealpage.com/Wrt4CZbz7tZLy6M88DW-hZgIibr-rguRZ3vwsAENiKo/rs:auto:0:0:0/g:sm/aHR0cDovL3MzLmFtYXpvbmF3cy5jb20vbXJwLWxpc3RpbmdzLzUvNS8zLzExMDE5NzM1NS80YzZmM2Q2MzlmNTgxYTk2NDdjNmNjNmRkZWE0NjkzZS5qcGVn";
item["url"] = "mylistings-110197355.property";
item["desc"] = "$299,900 : 501 1250 Burnaby Street Vancouver";
item["banner"] = "//res.myrealpage.com/wps/rest/20196/l/showcase/110197355/img/ribbon/custom-banner?txt=Ocean+View%21&c=#4a90e2";
item["recipLogo"] = "";
item["attribution"] = "Listed by RE/MAX Crest Realty";
mrp_slideroll_images_27711.push( item );
var item = {};
item["img"] = new Image();
item["img"].src = "https://iss-cdn.myrealpage.com/DacHZsTnLGXePqvtuSNsmmtKKR4RlKpInpN_0VqxFU4/rs:auto:0:0:0/g:sm/aHR0cDovL3MzLmFtYXpvbmF3cy5jb20vbXJwLWxpc3RpbmdzLzUvNS8zLzExMDE5NzM1NS9lYmE5M2ZiZmYzNTI0MWU4YzkyZTM5YmNhMjhhM2I5Yy5qcGVn";
item["url"] = "mylistings-110197355.property";
item["desc"] = "$299,900 : 501 1250 Burnaby Street Vancouver";
item["banner"] = "//res.myrealpage.com/wps/rest/20196/l/showcase/110197355/img/ribbon/custom-banner?txt=Ocean+View%21&c=#4a90e2";
item["recipLogo"] = "";
item["attribution"] = "Listed by RE/MAX Crest Realty";
mrp_slideroll_images_27711.push( item );
var item = {};
item["img"] = new Image();
item["img"].src = "https://iss-cdn.myrealpage.com/sI0nvSXrG-0Z231mqhFZT-KLiq1_7q8uuUFS2dBlBdw/rs:auto:0:0:0/g:sm/aHR0cDovL3MzLmFtYXpvbmF3cy5jb20vbXJwLWxpc3RpbmdzLzcvNS8zLzExMDE5NzM1Ny85NzRjNjAwNWRlYjNkOTEyODEyMGNlZjAxMzZmYTNkMy5qcGVn";
item["url"] = "mylistings-110197357.property";
item["desc"] = "$299,900 : 1205 1250 Burnaby Street Vancouver";
item["banner"] = "//res.myrealpage.com/wps/rest/20196/l/showcase/110197357/img/ribbon/custom-banner?txt=Penthouse%21&c=#4a90e2";
item["recipLogo"] = "";
item["attribution"] = "Listed by RE/MAX Crest Realty";
mrp_slideroll_images_27711.push( item );
var item = {};
item["img"] = new Image();
item["img"].src = "https://iss-cdn.myrealpage.com/WfVovAux71kzhxPjcymx90buBBxuCcvvqMZBRXrFTaw/rs:auto:0:0:0/g:sm/aHR0cDovL3MzLmFtYXpvbmF3cy5jb20vbXJwLWxpc3RpbmdzLzcvNS8zLzExMDE5NzM1Ny9kNWIyY2JkMDIxNGE3Y2Q3ZTZmOTcxYjIwZTVjNmVhZC5qcGVn";
item["url"] = "mylistings-110197357.property";
item["desc"] = "$299,900 : 1205 1250 Burnaby Street Vancouver";
item["banner"] = "//res.myrealpage.com/wps/rest/20196/l/showcase/110197357/img/ribbon/custom-banner?txt=Penthouse%21&c=#4a90e2";
item["recipLogo"] = "";
item["attribution"] = "Listed by RE/MAX Crest Realty";
mrp_slideroll_images_27711.push( item );
var item = {};
item["img"] = new Image();
item["img"].src = "https://iss-cdn.myrealpage.com/5iquhiDES42T6WCOvrPr2ebIKMfR3AHBJ1pO6hZ-ask/rs:auto:0:0:0/g:sm/aHR0cDovL3MzLmFtYXpvbmF3cy5jb20vbXJwLWxpc3RpbmdzLzcvNS8zLzExMDE5NzM1Ny9mMjFlMGNiYWM5ODIyZTQyNDViOWIwYWMzMmM0N2IzMS5qcGVn";
item["url"] = "mylistings-110197357.property";
item["desc"] = "$299,900 : 1205 1250 Burnaby Street Vancouver";
item["banner"] = "//res.myrealpage.com/wps/rest/20196/l/showcase/110197357/img/ribbon/custom-banner?txt=Penthouse%21&c=#4a90e2";
item["recipLogo"] = "";
item["attribution"] = "Listed by RE/MAX Crest Realty";
mrp_slideroll_images_27711.push( item );
var item = {};
item["img"] = new Image();
item["img"].src = "https://iss-cdn.myrealpage.com/Cg4hR8Jk8w_utN5zGFnjErfC5RBB_WQRr9t3r-jOeE8/rs:auto:0:0:0/g:sm/aHR0cDovL3MzLmFtYXpvbmF3cy5jb20vbXJwLWxpc3RpbmdzLzcvNS8zLzExMDE5NzM1Ny9iMmUyMWRlOTQ0NDMyMzRmMGY4NGRhM2UyM2JmNWY2Ni5qcGVn";
item["url"] = "mylistings-110197357.property";
item["desc"] = "$299,900 : 1205 1250 Burnaby Street Vancouver";
item["banner"] = "//res.myrealpage.com/wps/rest/20196/l/showcase/110197357/img/ribbon/custom-banner?txt=Penthouse%21&c=#4a90e2";
item["recipLogo"] = "";
item["attribution"] = "Listed by RE/MAX Crest Realty";
mrp_slideroll_images_27711.push( item );
document.write( "