function scaleImage(b, a, c) {
	if(b = document.getElementById(b)) {
		var d = b.clientWidth || b.width, f = b.clientHeight || b.height;
		a = a || d;
		c = c || f;
		var e = $("#listingImageFrame");
		if(e.length > 0) {
			var g = e.width() || a;
			e = e.height() || c;
			if(g < a || e < c) {
				a = g;
				bowH = e
			}
		}b.style.maxWidth = a + "px";
		b.style.maxHeight = c + "px";
		if(d > a || f > c) {
			a = Math.min(a / d, c / f);
			b.style.width = parseInt(d * a + 0.5) + "px";
			b.style.height = parseInt(f * a + 0.5) + "px"
		}
	}
}
function loadAltImage(b, a) {
	if(b = document.getElementById(b))b.src = a
}
function bindToolTipImageHandler(b) {
	$(b).tooltip({delay:0, showURL:false, bodyHandler:function() {
		var a = $("<img />").attr("src", $(this).attr("src"));
		if($(this).attr("id") && $(this).attr("altUrl")) {
			var c = "image-" + $(this).attr("id"), d = $(this).attr("altUrl");
			$(a).attr("id", c);
			$(a).error(function() {
				loadAltImage(c, d)
			})
		}return a
	}})
}
;
