﻿// Таблицы цен
function viewTable (n) {
	document.getElementById('more_'+n).style.display = 'none';
	document.getElementById('full_'+n).style.display = 'inline';
}
function hideTable (n) {
	document.getElementById('full_'+n).style.display = 'none';
	document.getElementById('more_'+n).style.display = 'inline';
}
//---

// Анимация второго баннера - запуск в конце index.php
var time2 = 0;
function Interval2() {
	if (8 == time2) { bankty_1(); setTimeout("conference_2()", 900); }
	if (20 == time2) { conference_1(); setTimeout("bankty_2()", 900);  time2 = 0; setTimeout("Interval2()", 4000); }
	else { time2 += 1; setTimeout("Interval2()", 1000); }
}
function bankty_1() { $("#banner_bankty").fadeOut(800);  }
function bankty_2() { $("#banner_bankty").fadeIn(800);  }
function conference_1() { $("#banner_conference").fadeOut(800);  }
function conference_2() { $("#banner_conference").fadeIn(800);  }
//---

// Анимация третьего баннера - запуск в конце index.php
var time3 = 0;
function Interval3() {
	if (4 == time3) { teniss_1(); setTimeout("bike_2()", 900); }
	if (16 == time3) { bike_1(); setTimeout("teniss_2()", 900); }
	if (24 == time3) { time3 = 0; setTimeout("Interval3()", 0);  }
	else { time3 += 1; setTimeout("Interval3()", 1000); }
}
function teniss_1() { $("#ban_newyear").fadeOut(800);  }
function teniss_2() { $("#ban_newyear").fadeIn(800);  }
function bike_1() { $("#ban_newyear").fadeOut(800);  }
function bike_2() { $("#ban_newyear").fadeIn(800);  }
//---

//Анимация четвертого баннера - запуск в конце index.php
var time4 = 0;
function Interval4() {
if (12 == time4) { taxi_1(); setTimeout("discounts_2()", 900); }
if (24 == time4) { discounts_1(); setTimeout("taxi_2()", 900); }
if (24 == time4) { time4 = 0; setTimeout("Interval4()", 0);  }
else { time4 += 1; setTimeout("Interval4()", 1000); }
}
function taxi_1() { $("#banner_taxi").fadeOut(800);  }
function taxi_2() { $("#banner_taxi").fadeIn(800);  }
function discounts_1() { $("#banner_discounts").fadeOut(800);  }
function discounts_2() { $("#banner_discounts").fadeIn(800);  }
//---

// Анимация
jQuery(document).ready(function() {
	$(".rooms_1").click(function() { //cofmort
		$.fancybox([
  			{
				'href'	: 'http://otelpark.ru/images/photos/8.jpg',
				'title'	: 'Комфорт с большой кроватью'
			},
  			{
				'href'	: 'http://otelpark.ru/images/photos/9.jpg',
				'title'	: 'Комфорт с большой кроватью'
			},
			{
				'href'	: 'http://otelpark.ru/images/photos/6.jpg',
				'title'	: 'Комфорт с двумя раздельными кроватями'
			},
  			{
				'href'	: 'http://otelpark.ru/images/photos/7.jpg',
				'title'	: 'Комфорт с двумя раздельными кроватями'
			},
			{
				'href'	: 'http://otelpark.ru/images/photos/13.jpg',
				'title'	: 'Комфорт'
			},
			  {
				'href'	: 'http://otelpark.ru/images/photos/14.jpg',
				'title'	: 'Ванная комната в «Комфорт» номере'
			}
		],  {
				'centerOnScroll'	: 'true',
				'transitionIn'		: 'fade',
				'transitionOut'		: 'fade',
				'titlePosition' 	: 'over',
				'titleFormat'		: function(title, currentArray, currentIndex, currentOpts) {
					return '<span id="fancybox-title-over">Фотография ' + (currentIndex + 1) + ' / ' + currentArray.length + (title.length ? ' &nbsp; | &nbsp; ' + title : '') + '</span>';
				}
			}
		);
	});

	$(".rooms_2").click(function() { //junior_suite
		$.fancybox([
			{
				'href'	: 'http://otelpark.ru/images/photos/11.jpg',
				'title'	: 'Люкс'
			},
			{
				'href'	: 'http://otelpark.ru/images/photos/10.jpg',
				'title'	: 'Люкс'
			},
   			{
				'href'	: 'http://otelpark.ru/images/photos/12.jpg',
				'title'	: 'Люкс'
			}
		],  {
				'centerOnScroll'	: 'true',
				'transitionIn'		: 'fade',
				'transitionOut'		: 'fade',
				'titlePosition' 	: 'over',
				'titleFormat'		: function(title, currentArray, currentIndex, currentOpts) {
					return '<span id="fancybox-title-over">Фотография ' + (currentIndex + 1) + ' / ' + currentArray.length + (title.length ? ' &nbsp; | &nbsp; ' + title : '') + '</span>';
				}
			}
		);
	});

	$(".rooms_3").click(function() { //three-room_standart
		$.fancybox([
			{
				'href'	: 'http://otelpark.ru/images/photos/15.jpg',
				'title'	: 'Стандарт'
			},
  			{
				'href'	: 'http://otelpark.ru/images/photos/16.jpg',
				'title'	: 'Стандарт'
			}
		],  {
				'centerOnScroll'	: 'true',
				'transitionIn'		: 'fade',
				'transitionOut'		: 'fade',
				'titlePosition' 	: 'over',
				'titleFormat'		: function(title, currentArray, currentIndex, currentOpts) {
					return '<span id="fancybox-title-over">Фотография ' + (currentIndex + 1) + ' / ' + currentArray.length + (title.length ? ' &nbsp; | &nbsp; ' + title : '') + '</span>';
				}
			}
		);
	});

	$(".rooms_4").click(function() { //standart
		$.fancybox([
			{
				'href'	: 'http://otelpark.ru/images/photos/15.jpg',
				'title'	: 'Стандарт'
			},
  			{
				'href'	: 'http://otelpark.ru/images/photos/16.jpg',
				'title'	: 'Стандарт'
			}
		],  {
				'centerOnScroll'	: 'true',
				'transitionIn'		: 'fade',
				'transitionOut'		: 'fade',
				'titlePosition' 	: 'over',
				'titleFormat'		: function(title, currentArray, currentIndex, currentOpts) {
					return '<span id="fancybox-title-over">Фотография ' + (currentIndex + 1) + ' / ' + currentArray.length + (title.length ? ' &nbsp; | &nbsp; ' + title : '') + '</span>';
				}
			}
		);
	});


	$(".rooms_5").click(function() { //delux
		$.fancybox([
			{
				'href'	: 'http://otelpark.ru/images/photos/3.jpg',
				'title'	: 'Семейный'
			},
			{
				'href'	: 'http://otelpark.ru/images/photos/4.jpg',
				'title'	: 'Семейный'
			},
  			{
				'href'	: 'http://otelpark.ru/images/photos/1.jpg',
				'title'	: 'Семейный'
			},
  			{
				'href'	: 'http://otelpark.ru/images/photos/2.jpg',
				'title'	: 'Семейный'
			},
			{
				'href'	: 'http://otelpark.ru/images/photos/5.jpg',
				'title'	: 'Семейный'
			}
		],  {
				'centerOnScroll'	: 'true',
				'transitionIn'		: 'fade',
				'transitionOut'		: 'fade',
				'titlePosition' 	: 'over',
				'titleFormat'		: function(title, currentArray, currentIndex, currentOpts) {
					return '<span id="fancybox-title-over">Фотография ' + (currentIndex + 1) + ' / ' + currentArray.length + (title.length ? ' &nbsp; | &nbsp; ' + title : '') + '</span>';
				}
			}
		);
	});




	$(".conferences_b").click(function() { //conferences_b
		$.fancybox([
			{
				'href'	: 'http://otelpark.ru/images/photos/24.jpg',
				'title'	: 'Большой конференц-зал'
			},
  			{
				'href'	: 'http://otelpark.ru/images/photos/25.jpg',
				'title'	: 'Большой конференц-зал'
			}
		],  {
				'centerOnScroll'	: 'true',
				'transitionIn'		: 'fade',
				'transitionOut'		: 'fade',
				'titlePosition' 	: 'over',
				'titleFormat'		: function(title, currentArray, currentIndex, currentOpts) {
					return '<span id="fancybox-title-over">Фотография ' + (currentIndex + 1) + ' / ' + currentArray.length + (title.length ? ' &nbsp; | &nbsp; ' + title : '') + '</span>';
				}
			}
		);
	});

	$(".restaurant").click(function() { //restaurant
		$.fancybox([
			{
				'href'	: 'http://otelpark.ru/images/photos/21.jpg',
				'title'	: 'Ресторан на третьем этаже'
			},
  			{
				'href'	: 'http://otelpark.ru/images/photos/22.jpg',
				'title'	: 'Ресторан на третьем этаже'
			},
			{
				'href'	: 'http://otelpark.ru/images/photos/23.jpg',
				'title'	: 'Ресторан на третьем этаже'
			}
		],  {
				'centerOnScroll'	: 'true',
				'transitionIn'		: 'fade',
				'transitionOut'		: 'fade',
				'titlePosition' 	: 'over',
				'titleFormat'		: function(title, currentArray, currentIndex, currentOpts) {
					return '<span id="fancybox-title-over">Фотография ' + (currentIndex + 1) + ' / ' + currentArray.length + (title.length ? ' &nbsp; | &nbsp; ' + title : '') + '</span>';
				}
			}
		);
	});

});

$(function() {
	$( "input:submit" ).button();
});
