var detailBox = {
	codes : Array,
	init : function() {
		jQuery('.tab').each(function(x) {
			jQuery(this).bind('click', detailBox.collapse).parent().children().each(function (i) {
				if (jQuery(this).nodeType == 3 && !/\S/.test($(this).html()))
					jQuery(this).remove();
			});
		});
	},
	collapse : function(e) {
		if (jQuery(this).next().css('display') == 'none') {
			jQuery(this).css('backgroundImage', 'url(../includes/images/listings/details-minus.jpg)');
		} else {
			jQuery(this).css('backgroundImage', 'url(../includes/images/listings/details-plus.jpg)');
		}
		jQuery(this).next().slideToggle('slow');
	}
};

jQuery(document).ready(function() {
	detailBox.init();
});

	function flipPicBoxImage (imgID,imgSrc) {
		var img,newImg;
		img = document.getElementById(imgID);
		if (!img) return errorOut('no img');
		newImg = new Image();
		newImg.onload = function () {
			img.src = newImg.src;
			img.width = newImg.width;
			img.height = newImg.height;
		};
		newImg.src = imgSrc;
	}
