$(document).ready(function() {
	//Init mouseover for top icons
	var icons = $("#icons .icon img");
	$.each(icons, function() {
		this.onmouseover = function() {
			var oBubble = document.getElementById("icons_bubble");
			if (oBubble == null) {
				oBubble = document.createElement("div");
				oBubble.id = "icons_bubble";
				document.getElementById("icons").appendChild(oBubble);
			}
			oBubble.innerHTML = "<div id=\"icons_bubble_inner\">" + this.getAttribute("alt") + "</div><div id=\"icons_bubble_arrow\"></div>";
			$(oBubble).show();
			var iIconLeft = $(this).offset().left;
			var iIconsDivLeft = $("#icons").offset().left;
			var iIconWidth = 60;
			var iBubbleWidth = $(oBubble).width();
			
			var iIconOffset = iIconLeft - iIconsDivLeft - ((iBubbleWidth - iIconWidth) / 2) - 3;
			oBubble.style.left = iIconOffset + "px";
		};
		this.onmouseout = function() {
			
			$("#icons_bubble").hide();
		};
	});
});

function scrollToApp(sAppId) {
	var iAppOffset = $("#" + sAppId).offset().left;
	var iContentOffset = $("#content-inner").offset().left;
	$("#content-inner").animate({ left : (iContentOffset - iAppOffset) + "px" }, 500);
	
}
