function scrollContent(elementToScroll,container,maxAllowedHeight,newHeight, buttonClass){
	if (($(elementToScroll).length == 0) || ($(container).length == 0) ) {return};
	// if element height is greater than the allowed height, set new height and overflow to hidden,
	// create and append more button
	if ($(elementToScroll).height() > maxAllowedHeight  ) {
		$(elementToScroll).css('overflow','hidden');
		$(elementToScroll).height(newHeight+'px');
		var img = document.createElement('img');
		img.src = "/images/ctlg/album/icons/more.png";
		img.className = buttonClass;
		$(container)[0].appendChild(img);

		//			get the original height and the scroll height of the element
		var elOrigHeight = $(elementToScroll).height();
		var elScrollHeight = $(elementToScroll)[0].scrollHeight;

		$(img).click(function() {
			var x, y;
			// if the scroll height is greater than the original height, set the button to "hide" and scroll up on click
			if (elScrollHeight >$(elementToScroll).height()) {
				x = elScrollHeight;
				y = "/images/ctlg/album/icons/hide.png";
			}
			// else set the button to "more" and scroll down on click
			else {
				x = elOrigHeight;
				y = "/images/ctlg/album/icons/more.png";
			}
			var that = $(this);
			$(this).prev(elementToScroll).animate({height: x}, 'medium',function(){
				that.attr('src',y);
			});

		});
	}
}

function placeButton() {
	if ($('#lists').width()== "230") {
		$('img.reviewToggle').css('left','451px');
	}
	else {
		$('img.reviewToggle').css('left','709px');
	}
}

scrollContent('#theReview','#review','180','140','reviewToggle');
scrollContent('#review','div.review','80','40','reviewToggle');
placeButton();