$(document).ready(function()
{
	slide_boxes("#sliding_top_boxes", 300, .8);
	slide_sidebar("#sliding_sidebar", 150, .8)
});

function slide_boxes(header_id, time, multiplier) {

	var box_left = header_id + " li.box_left";
	var box_mid = header_id + " li.box_mid";
	var box_right = header_id + " li.box_right";

	var timer = 0;

	$(box_left).css("margin-top","-178px");

	timer = (timer*multiplier + time);
	$(box_left).animate({ marginTop: "0" }, 300);

	$(box_mid).css("margin-top","-178px");

	$(box_mid).animate({ marginTop: "0" }, 500);

	$(box_right).css("margin-top","-178px");

	$(box_right).animate({ marginTop: "0" }, 700);
}

function slide_sidebar(header_id, time, multiplier) {

	var list_elements = header_id + " a";

	var timer = 0;

	$(list_elements).each(function(i) {

		$(this).css("margin-left","50px");

		timer = (timer*multiplier + time);
		$(this).animate({ marginLeft: "0" }, timer);

	});

	$(list_elements).each(function(i) {

		$(this).hover(
		function() {
			$(this).animate({ marginLeft: "10px" }, 150);
		},
		function() {
			$(this).animate({ marginLeft: "0"}, 150);
		});
	});

}