function minHeight(objectID, minHeight) {	
	if (document.getElementById) {
		var c_height = document.getElementById(objectID).offsetHeight;
		
		if (c_height < minHeight) {
			document.getElementById(objectID).style.height = minHeight + 'px';
		}
	}
}
function setHeights() {
	var l = document.getElementById("left").offsetHeight;
	var r = document.getElementById("right").offsetHeight;

	if (l > r) minHeight("content", (l - 160));
	else if (r > l) minHeight("left", r);
}
function openProductPhotoGallery() {
	var rows = document.getElementById("photoBox").getElementsByTagName("tr");
	for(i = 0; i < rows.length; i++) {
		if (rows[i].style.display == "none") rows[i].style.display = "block";
	}
	document.getElementById("photoLink").innerHTML = '<a href="#" onclick="closeProductPhotoGallery();return false;">close</a>';	
	setHeights();
}
function closeProductPhotoGallery() {
	var rows = document.getElementById("photoBox").getElementsByTagName("tr");
	for(i = 0; i < rows.length; i++) {
		if (rows[i].className == "photoThumb") rows[i].style.display = "none";
	}
	document.getElementById("photoLink").innerHTML = '<a href="#" onclick="openProductPhotoGallery();return false;">view all photos</a>';	
	setHeights();
}
function swapMain(main_id, i, b, m, c, mode) {
	var a = (mode == 0 ? '<a href="' + b + i + '" rel="lightbox">' : '<a class="no-decoration" href="#" onclick="editGalleryPhoto();return false;">');
	var output = a + '<img src="' + m + i +'" /></a>';
	output += '<div id="main-cap">' + (c.length > 0 ? '<p>' + c + '</p>' : '') + '</div>';
	document.getElementById("main-img").innerHTML = output;
	document.getElementById("main-image-id").value = main_id;
	if (mode == 0) initLightbox();
}
function forgotPassword() {
	document.getElementById("password-forgot").style.display = 'none';
	document.getElementById("password-forgot-msg").style.display = 'block';
	xajax_forgotPassword(document.getElementById("username").value);
}

