function pilates() {

topbar = 65; /* ширина верхней черной полосы */
bottombar = 47; /* ширина нижней черной полосы */
contactsoffset=30; 
//отступ контактов от низа страницы 

scrollheight = $(window).height() - (topbar+bottombar); //вся остальная часть страницы будет занята 
$("div.contacts").css("top",$(window).height() -contactsoffset); //строка с контактами на заданной высоте от низа страницы — не привязана к верху черной полосы


//если окно браузера меньше определенного, мы выставим минимально возможные величины

minheight=600; //не будем делать страницу 600 рх
minwidth=1020; //не будем делать страницу уже 980 рх

minscroll=minheight-(topbar+bottombar);
if(scrollheight < minscroll ) {
	scrollheight = minscroll;
$("div.contacts").css("top", minheight-contactsoffset);

}

scrollwidth = $(window).width();
if(scrollwidth < minwidth) {
	scrollwidth = minwidth;
}

$("#bigsheet").css("height",scrollheight); //присвоение слою с логотипами нужной высоты

$("div.menu").css("left", scrollwidth -(500+25)); //положение меню "дизайн иллюстрации" шириной в 500 рх в 25 пикселях от левого края страницы

tilewidth=480; //ширина одной картинки
tileheight=350; //высота одной картинки
tilesx=6 //количество колонок
tilesy=7 //количество строк

x = -(tilewidth*tilesx) +scrollwidth;
y = -(tileheight*tilesy) +scrollheight +topbar;

$("#scroller").draggable({
	containment:[x,y,0,topbar],
	start:function(event, ui) {
		$(this).css('cursor', 'url(/img/closedhand.cur), move');
	},
	stop:function(event, ui) {
		$(this).css('cursor', 'url(/img/openhand.cur), move');
	}
	});

}

$(document).ready(function() {

Cufon.replace('div.menu a');

$('#shuka_sign').fadeTo(0, 0.6);
$('.menu img').fadeTo(0, 0.6);

$('#logolink').hover(
	function() {
		$('#shuka_sign').fadeTo(0, 1);
	},
	function() {
		$('#shuka_sign').fadeTo(0, 0.6);
	
});

$('.menu img').hover(
	function() {
		$(this).fadeTo(0, 1);
	},
	function() {
		$(this).fadeTo(0, 0.6);
});

$('#designmenu').click(function() {
	$('.designmenu').toggle(100);
});

// это происходит при загрузке страницы 

pilates();

$(window).bind('resize', function() {
	pilates();
});

$('#switcher a').click(function(e) {
	e.preventDefault();
	if($(this).attr('class') != 'inactive') {
		$('#switcher a.inactive').attr('class', '');
		$(this).attr('class', 'inactive');
		current = $(this).attr('id');
		$('.'+current).show();
		$('.'+current).siblings().hide();
		}
});

});

