function initGallery() {
	// get combined height of all images
	var totalHeight = ($("#csGalleryImages").children().length - 1) * 280;

	// initialise transition
	$("#csGalleryControlNext").bind("click", function() {
			// get current position, i.e. current image
			var currentTop = parseInt($("#csGalleryImages").css("top"));
			
			// calculate new position
			if (Math.abs(currentTop) < totalHeight) {
				tempTop = currentTop - 280;
			} else {
				tempTop = 0;
			}
			
			// set new position
			$("#csGalleryImages").fadeOut(400,
				function() {
					$("#csGalleryImages").css("top", tempTop);
				}
			).fadeIn(400);
			
			return false;
		}
	);
	
	$("#csGalleryControlPrev").bind("click", function() {
			// get current position, i.e. current image
			var currentTop = parseInt($("#csGalleryImages").css("top"));
			
			// calculate new position
			if (Math.abs(currentTop) != 0) {
				tempTop = currentTop + 280;
			} else {
				tempTop = totalHeight * -1;
			}
			
			// set new position
			$("#csGalleryImages").fadeOut(400,
				function() {
					$("#csGalleryImages").css("top", tempTop);
				}
			).fadeIn(400);
				
			return false;
		}
	);

	return false;
}

function initLogos() {
	var visibleWidth = 122 * 7;
	
	// get combined width of all logos
	var totalWidth = ($("#clientLogos").children().length) * 122;
	
	// set width of list
	$("#clientLogos").css("width", totalWidth);

	// set initial classes for buttons
	$("#clientLogosLeft").addClass("disabled");
	
	if (totalWidth <= visibleWidth)
		$("#clientLogosRight").addClass("disabled");
	
	$("#clientLogosRight").bind("click", function() {
			// get current position
			var currentLeft = parseInt($("#clientLogos").css("left"));
			
			// calculate new position
			var tempLeft = currentLeft - 122;
			
			if ((totalWidth - Math.abs(tempLeft)) >= visibleWidth) {
				// scroll
				$("#clientLogos").animate({
					left: tempLeft + "px"
				}, 400);
				
				// update button statuses
				if ($("#clientLogosLeft").hasClass("disabled"))
					$("#clientLogosLeft").removeClass("disabled");
				
				if ((totalWidth - Math.abs(tempLeft)) == visibleWidth) {
					if (!$("#clientLogosRight").hasClass("disabled"))
					$("#clientLogosRight").addClass("disabled");
				}
			}
			
			return false;
		}
	);
	
	$("#clientLogosLeft").bind("click", function() {
			// get current position
			var currentLeft = parseInt($("#clientLogos").css("left"));
			var currentRight = parseInt($("#clientLogos").css("right"));
			
			// calculate new position
			var tempRight = currentRight + 122;
			var tempRight = currentLeft + tempRight;
			
			if (tempRight <= 0) {
				// scroll
				$("#clientLogos").animate({
					left: tempRight + "px"
				}, 400);
				
				// update button statuses
				if ($("#clientLogosRight").hasClass("disabled"))
					$("#clientLogosRight").removeClass("disabled");
				
				if (tempRight == 0) {
					if (!$("#clientLogosLeft").hasClass("disabled"))
					$("#clientLogosLeft").addClass("disabled");
				}
			}
			
			return false;
		}
	);
	
	return false;
}