function thumbLoad(imgId) {
var thisImage = document.getElementById(imgId);
var path = thisImage.src;
var oImg = new Image();
oImg.src = path;
if (/MSIE (\d+\.\d+);/.test(navigator.userAgent)){ //test for MSIE x.x;
	if (oImg.height > oImg.width) {
		thisImage.height = 91;
		thisImage.width = oImg.width*(91 / oImg.height);
		thisImage.style.marginTop = "0px";
		
	} else {
		thisImage.width = 91;
		thisImage.height = oImg.height*(91 / oImg.width);
		var margin = (91-thisImage.height)/2;
		thisImage.style.marginTop = margin+"px";
	}
} else {
// For FF check if image has loaded yet
oImg.onload = function(){
//window.alert(oImg.src + ' ' + oImg.width + ' x ' + oImg.height);
	if (oImg.height > oImg.width) {
		thisImage.height = 91;
		thisImage.width = oImg.width*(91 / oImg.height);
		thisImage.style.marginTop = "0px";
		
	} else {
		thisImage.width = 91;
		thisImage.height = oImg.height*(91 / oImg.width);
		var margin = (91-thisImage.height)/2;
		thisImage.style.marginTop = margin+"px";
	}
} // end onload
} // end IE check
}

function thumbLoad_building(imgId) {
var thisImage = document.getElementById(imgId);
var path = thisImage.src;
var oImg = new Image();
oImg.src = path;
if (/MSIE (\d+\.\d+);/.test(navigator.userAgent)){ //test for MSIE x.x;
	if (oImg.height > oImg.width) {
		thisImage.height = 575;
		thisImage.width = oImg.width*(575 / oImg.height);
		thisImage.style.marginTop = "0px";
		
	} else {
		thisImage.width = 575;
		thisImage.height = oImg.height*(575 / oImg.width);
		var margin = (575-thisImage.height)/2;
		thisImage.style.marginTop = margin+"px";
	}
} else {
// For FF check if image has loaded yet
oImg.onload = function(){
//window.alert(oImg.src + ' ' + oImg.width + ' x ' + oImg.height);
	if (oImg.height > oImg.width) {
		thisImage.height = 575;
		thisImage.width = oImg.width*(575 / oImg.height);
		thisImage.style.marginTop = "0px";
		
	} else {
		thisImage.width = 575;
		thisImage.height = oImg.height*(575 / oImg.width);
		var margin = (575-thisImage.height)/2;
		thisImage.style.marginTop = margin+"px";
	}
} // end onload
} // end IE check
}

function priPicLoad(imgId) {
if(!imgId) { var imgId = 'listingDetailImg'; }
var thisImage = document.getElementById(imgId);
var path = thisImage.src;
var oImg = new Image();
oImg.src = path;
if (/MSIE (\d+\.\d+);/.test(navigator.userAgent)){ //test for MSIE x.x;
	if (oImg.height > oImg.width) {
		thisImage.height = 402;
		thisImage.width = oImg.width*(402 / oImg.height);
		thisImage.style.marginTop = "0px";
		//alert('p');
	} else {
		thisImage.width = 402;
		thisImage.height = oImg.height*(402 / oImg.width);
		//thisImage.style.marginTop = "79px";
		var margin = (402-thisImage.height)/2;
		thisImage.style.marginTop = margin+"px";
		//alert('l');
	}
} else {
// For FF check if image has loaded yet
oImg.onload = function(){
//window.alert(oImg.src + ' ' + oImg.width + ' x ' + oImg.height);
	if (oImg.height > oImg.width) {
		thisImage.height = 402;
		thisImage.width = oImg.width*(402 / oImg.height);
		thisImage.style.marginTop = "0px";
		//alert('p');
	} else {
		thisImage.width = 402;
		thisImage.height = oImg.height*(402 / oImg.width);
		//thisImage.style.marginTop = "79px";
		var margin = (402-thisImage.height)/2;
		thisImage.style.marginTop = margin+"px";
		//alert('l');
	}
} // end onload
} // end IE check
}

function priPicLoad_building(imgId) {
if(!imgId) { var imgId = 'listingDetailImg'; }
var thisImage = document.getElementById(imgId);
var path = thisImage.src;
var oImg = new Image();
oImg.src = path;
if (/MSIE (\d+\.\d+);/.test(navigator.userAgent)){ //test for MSIE x.x;
	if (oImg.height > oImg.width) {
		thisImage.height = 575;
		thisImage.width = oImg.width*(575 / oImg.height);
		thisImage.style.marginTop = "0px";
	} else {
		thisImage.width = 575;
		thisImage.height = oImg.height*(575 / oImg.width);
		//thisImage.style.marginTop = "79px";
		var margin = (575-thisImage.height)/2;
		//thisImage.style.marginTop = margin+"px";
		thisImage.style.marginTop = "0px";
	}
} else {
// For FF check if image has loaded yet
oImg.onload = function(){
//window.alert(oImg.src + ' ' + oImg.width + ' x ' + oImg.height);
	if (oImg.height > oImg.width) {
		thisImage.height = 575;
		thisImage.width = oImg.width*(575 / oImg.height);
		thisImage.style.marginTop = "0px";
	} else {
		thisImage.width = 575;
		thisImage.height = oImg.height*(575 / oImg.width);
		//thisImage.style.marginTop = "79px";
		var margin = (575-thisImage.height)/2;
		//thisImage.style.marginTop = margin+"px";
		thisImage.style.marginTop = "0px";
	}
} // end onload
} // end IE check
}





function medPicLoad(imgId) {
var thisImage = document.getElementById(imgId);
var path = thisImage.src;
var oImg = new Image();
oImg.src = path;
if (/MSIE (\d+\.\d+);/.test(navigator.userAgent)){ //test for MSIE x.x;
	if (oImg.height > oImg.width) {
		thisImage.height = 290;
		thisImage.width = oImg.width*(290 / oImg.height);
		thisImage.style.marginTop = "0px";
	} else {
		thisImage.width = 290;
		thisImage.height = oImg.height*(290 / oImg.width);
		//thisImage.style.marginTop = "56px";
		var margin = (290-thisImage.height)/2;
		thisImage.style.marginTop = margin+"px";
	}
} else {
// For FF check if image has loaded yet
oImg.onload = function(){
//window.alert(oImg.src + ' ' + oImg.width + ' x ' + oImg.height);
	if (oImg.height > oImg.width) {
		thisImage.height = 290;
		thisImage.width = oImg.width*(290 / oImg.height);
		thisImage.style.marginTop = "0px";
	} else {
		thisImage.width = 290;
		thisImage.height = oImg.height*(290 / oImg.width);
		//thisImage.style.marginTop = "56px";
		var margin = (290-thisImage.height)/2;
		thisImage.style.marginTop = margin+"px";
	}
} // end onload
} // end IE check
}
