$(function() {
	
	if(navigator.platform == 'iPad' || navigator.platform == 'iPhone' || navigator.platform == 'iPod')
	{
		 $("#rightCurly").remove();
		 $("#leftCurly").remove();
		 $("#mainContent div.background").remove();
		 
		 $("#header").css("position", "absolute");
		 $("#footer").css("position", "absolute");
		 $("#header").css({left:0, marginLeft:0});
		 $("#footer").css({left:0, marginLeft:0});
		 
		 //$("#footer").remove();
		 //$("#header").remove();
		 
		 $("#mainContent").css("position", "absolute");
		 $("#mainContent").css("overflow", "hidden");
		 $("#mainContent").css({width:1000});
		 $("#mainContent div.content").prepend($("#header"));
		 $("#mainContent div.content").append($("#footer"));
		 $("#mainContent div.content").css({left:0, marginLeft:0});
	};
	
	/*var windowHeight = $(window).height();
	var windowWidth = $(window).width();
	var scrollTarget = 0;
	
	$("#header").css({top:scrollTarget});
	$("#footer").css({top:(scrollTarget + windowHeight - 35)});
	
	$(window).resize(function () {
		windowHeight = $(window).height();
		windowWidth = $(window).width();
	});
	
	$(window).scroll(function () {
		scrollTarget = $(window).scrollTop();
		$("#header").css({top:scrollTarget});
		$("#footer").css({top:(scrollTarget + windowHeight - 35)});					   
	});*/
	
	
	
	var numButtons = $("#mainMenu div.button").length;
	var xPos = 0;
	
	for (var i=0; i<numButtons; i++)
	{
		var buttonWidth = parseFloat($("#mainMenu div.button:eq(" + i + ") img.selected").attr("width"));
		//alert(buttonWidth);
		$("#mainMenu div.button:eq(" + i + ")").css({left:xPos});
		xPos = xPos + buttonWidth - 5;
	}
	
	$( "#mainMenu div.button img.selected" ).css({opacity:0});
	
	$( "#mainMenu div.button" ).mouseover(function() {												
			$("img.selected", this).animate({opacity:1}, 200);
		});
		
	$( "#mainMenu div.button" ).mouseout(function() {												
			$("img.selected", this).animate({opacity:0}, 200);
		});
});
