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('iframe');
	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);

	label.css('margin-left', (width + img.width())/2 - label.width());
	label.css('display', 'block');
	$("#about").draggable('option', 'containment', [0,0,width-$("#about").width()-20,height-$("#about").height()-20]);
	$("#markvo").draggable('option', 'containment', [0,0,width-$("#markvo").width()-20,height-$("#markvo").height()-20]);
	$("#contacts").draggable('option', 'containment', [0,0,width-$("#contacts").width()-20,height-$("#contacts").height()-20]);
	
	e.preventDefault();
}

$(document).ready(function() {

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

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


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

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

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

$("#markvo").draggable({
	containment:[0,0,1000,800]
});

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

});
