function setHeights() {

	var topicHeight = 0;
	var addPage = 0;
	var addDesktop = 0;
	$(".oneTopic").each( function(i) {
		$(this).height() > topicHeight?topicHeight=$(this).height():topicHeight;
	});
	$(".oneTopic").height(topicHeight + "px");
	var contentHeight = $("#frontContent").height();
	var notepadTopHeight = $("#notepadTop").height();
	var navBarHeight = $("#navBar").height();
	var topAdHeight = $("#topLeaderboardAd").height();
	var bottomAdHeight = $("#bottomLeaderboardAd").height();
	var stickyNotesContainerHeight = $("#stickyNotesContainer").height();
	var mostPopularTop = $("#mostPopularTop").height();
	var mostPopularBottom = $("#mostPopularBottom").height();

	var largeUnitAd = $("#largeUnitAd").height();

	if(contentHeight < stickyNotesContainerHeight) {
		contentHeight = stickyNotesContainerHeight;
		}

	var totalHeight = contentHeight + notepadTopHeight;

	if (topicHeight != 0 && navigator.appName=="Netscape") {
//		addPage = 1550;
//		addDesktop = 1550;
		addPage = 750;
		addDesktop = 750;

		if (navigator.appVersion.indexOf("Mac")!=-1) {
			addPage += 200;
			addDesktop += 200;
		}
		if(topicHeight < 100) {
			addPage = 275;
			addDesktop = 275;
		}
	}

	var totalContentHeight = totalHeight-notepadTopHeight + 80 + addPage;



	var totalNotepadHeight = totalContentHeight + notepadTopHeight;
	if($('#topicsContainer').size() > 0) {
		totalNotepadHeight += 195;
		totalContentHeight += 195;
		totalHeight += 195;

	}

	if (stickyNotesContainerHeight < totalNotepadHeight) {
		stickyNotesContainerHeight = totalNotepadHeight-32;
	}
	$("#notepadLine").height(totalContentHeight + "px");
	$("#notepadContainer").height(totalNotepadHeight + "px");
	$("#desktop").height((totalHeight + navBarHeight + 250 + addDesktop) + "px");
	$("#stickyNotesContainer").css("height",stickyNotesContainerHeight + "px");
	$("#recentlyDiscussed").css("height",(stickyNotesContainerHeight - mostPopularTop - mostPopularBottom - largeUnitAd - 84) + "px");

}


function positionItem(name,item,verticalOffset,centerOffset){
	var windowWidth;
	var windowHeight;
	if (parseInt(navigator.appVersion)>3) {
 		if (navigator.appName=="Netscape") {
  			windowWidth = window.innerWidth;
  			windowHeight = $("#desktop").height();
		 }
 		if (navigator.appName.indexOf("Microsoft")!=-1) {
  			windowWidth = document.body.offsetWidth;
  			windowHeight = $("#desktop").height() - 20;
 		}
	}
	//var itemHeight = item.height();
	var itemWidth = item.width();
	if (name == "pencil") {
		  verticalOffset = windowHeight - verticalOffset;
	}
	item.css({  
	"position": "absolute",  
	"top": verticalOffset + "px",  
	"left": ((windowWidth/2-itemWidth/2) + centerOffset) + "px",
	"visibility": "visible"  
	});  
 
} 

$(document).ready(function(){
	setHeights();
//	positionItem("clip",$("#paperclipFront"),500,60);
	positionItem("pencil",$("#pencilFront"),-65,-125);
});
