function pilates(e) {
	var width = $(document).width();
	var height = $(document).height();
	$('#scrollable').css('width', width);
	$('#scrollable').css('height', height);
	$('.items').css('height', height);
	$('.items div').css('height', height);
	$('#switch').css('left', width-78);
	api.getVisibleItems().css('width', width);
	img = api.getVisibleItems().find('img');
	label = api.getVisibleItems().find('.label');
	
	img.css('margin-left', -img.width()/2);
	img.css('margin-top', -img.height()/2);
	$(".arrow").css("top", (height-22)/2);
	$("#next").css("left", (width-30-20));
	$("#footer").css("top", (height-60));
	$("#hidden").css("top", (height-60));

	label.css('top', (height + img.height())/2 + 10);

	if ($.browser.msie) { 
	label.css('margin-left', (width + img.width())/2 - 2*label.width());	
	} else {
	label.css('margin-left', (width + img.width())/2 - label.width());
	}
	label.css('display', 'block');
	$("#project").draggable('option', 'containment', [0,0,width-$("#project").width()-21,height-$("#project").height()-20]);
	e.preventDefault();
}

$(document).ready(function() {

$(".minimize").click(function() {
$("#project").fadeOut();
$("#minimized").fadeIn();

Cufon.replace('#minimized .pus', {fontFamily: 'Franklin Gothic Book'});

});

$("#minimized").click(function() {
$("#project").fadeIn();
$("#minimized").fadeOut();
});


Cufon.replace('#menu ul li', {fontFamily: 'Franklin Gothic Book'});
Cufon.replace('#contacts', {fontFamily: 'Franklin Gothic Book'});
Cufon.replace('#slogan', {fontFamily: 'Franklin Gothic Book'});
Cufon.replace('#project', {fontFamily: 'Franklin Gothic Book'});

Cufon.replace('#switch', {fontFamily: 'Franklin Gothic Book'});

$('#next').click(pilates);
$('#prev').click(pilates);
$(window).load(pilates);
$(window).resize(pilates);

$("#project").draggable({
	containment:[0,0,500,400]
});

});
