jQuery(document).ready(function () {
//
var aMonth = ['январь','февраль','март','апрель','май','июнь','июль','август','сентябрь','откябрь','ноябрь','декабрь'];
var nCurrentMonth = current_month;
var nCurrentYear = current_year;
jQuery('a.month').click(function () {
var months = jQuery(this).next();
if (months.css('display') == 'block')
{
months.css('display','none');
}
else
{
months.css('display','block');
}
return false;
});
jQuery('div.mchoose a').click(function () {
nCurrentMonth = jQuery(this).prevAll('a').length + 1;
reloadCalendar();
jQuery('div.mch').css('display','none');
return false;
});
jQuery('a.year').click(function () {
var years = jQuery(this).next();
if (years.css('display') == 'block')
{
years.css('display','none');
}
else
{
years.css('display','block');
}
return false;
});
jQuery('div.ych a').click(function () {
nCurrentYear = parseInt(jQuery(this).html());
reloadCalendar();
jQuery('div.ych').css('display','none');
return false;
});
jQuery('a.calendar_left').click(function () {
nCurrentMonth--;
if (nCurrentMonth < 1)
{
nCurrentMonth = 12;
nCurrentYear--;
}
reloadCalendar();
return false;
});
jQuery('a.calendar_right').click(function () {
nCurrentMonth++;
if (nCurrentMonth > 12)
{
nCurrentMonth = 1;
nCurrentYear++;
}
reloadCalendar();
return false;
});
function reloadCalendar()
{
jQuery('a.month').html(aMonth[nCurrentMonth - 1]);
jQuery('a.year').html(nCurrentYear);
jQuery.get('/get_calendar.php',{
'date' : nCurrentYear + '-' + (nCurrentMonth < 10 ? ('0' + nCurrentMonth) : nCurrentMonth)+ '-01'
},function (szCode) {
jQuery('#table_calendar').remove();
$('table.table_god').after(szCode);
});
}
});
var current_letter = '';
jQuery(document).ready(function () {
$('table.table_abv a').click(function () {
var self = this;
$('div.alph').remove();
$.getJSON('/get_placement.php',{
letter : $(this).attr('rel')
},function (aCode) {
if (current_letter == $(self).attr('rel'))
{
return false;
}
current_letter = $(self).attr('rel');
var szHTML =
'
'+
'
'+
'
'+
'
'+
'
'+
'
'+
'
'+
'
'+
'
'+
'
';
$(self).after(szHTML);
for (var i =0; i < aCode.length; i++ )
{
var li = $(' '), a = $(' ');
a.attr('href',aCode[i]['full_url']);
a.html(aCode[i]['name']);
li.append(a);
$('div.alph div.cont ul').append(li);
}
});
return false;
});
$('a.eventclose').live('click',function () {
current_letter = '';
$('div.alph').remove();
return false;
});
});
jQuery(document).ready(function () {
// Грузим данные
jQuery.getJSON('/get_showcase.php',{},function(aData) {
// Запускаем таймер
var position = 0;
window.setInterval(function () {
jQuery('div.sr_baner a').fadeOut('slow',function () {
position++;
if (position >= aData.length)
{
position = 0;
}
var link = jQuery(' ');
link.attr('href',aData[position]['link']);
var image = jQuery(' ');
image.attr('src',aData[position]['image']['_base_src']);
image.attr('alt',aData[position]['title'])
.appendTo(link);
$('div.sr_baner a').remove();
$('div.sr_baner').append(link);
});
},5000);
});
});
// Логин
jQuery(document).ready(function () {
// Подключаем ajax на форму отсылки пароля
$('div.forgotform form').submit(function () {
$.post('/users_forgot.php',{
ajax : 1,
email : $('div.forgotform form input[name=email]').val()
},function (szResult) {
if (szResult == 'Ok')
{
$('div.forgotform').css('display','none');
$('div.forgotform').after(''
+'данные успешно высланы '
+' '
+'
');
$('div.sended input[type=image]').click(function () {
$('div.top_menu a.li_1').click();
$('div.sended').remove();
return false;
});
}
else
{
alert('E-mail не найден');
}
})
return false;
});
jQuery('div.top_menu a.li_1').click(function () {
// Если пользователь авторизирован, то ссылка указывает на профиль
// поэтому функция вывода формы логина не нужна
if (jQuery(this).attr('href').length > 1)
{
return true;
}
var loginForm = jQuery(this).parent().parent().next();
if (jQuery('div.forgotform').css('display') == 'block')
{
return false;
}
if (loginForm.css('display') == 'block')
{
loginForm.css('display','none');
}
else
{
loginForm.css('display','block');
}
return false;
});
$('div.loginform a').click(function () {
jQuery('div.loginform').css('display','none');
jQuery('div.forgotform').css('display','block');
});
$('div.forgotform a').click(function () {
jQuery('div.loginform').css('display','block');
jQuery('div.forgotform').css('display','none');
});
});
jQuery(document).ready(function ( ) {
var aCheck = { rules :{
email : {
required : true,
email : true
},
agree : {
required : 1
},
name : {
required : 1
},
surname : {
required : 1
},
phone : {
required : 1
},
kcaptcha : {
required : 1
}
},
messages : {
confirm_password : {
equalTo : 'Пароли не совпадают'
},
email : {
required : 'Вы не ввели Ваш email',
email : 'Неправильный формат ввода email'
},
aggree : {
required : 'Вы не согласились с условиями регистрации'
},
name : {
required : 'Вы не ввели Ваше имя'
},
surname : {
required : 'Вы не ввели Вашу фамилию'
},
phone : {
required : 'Вы не ввели телефон'
},
kcaptcha : {
required : 'Вы не ввели код защиты от роботов'
}
},
errorPlacement : function (error) {
error.appendTo('#error-layer');
}
};
jQuery('#signup-form').each(function () {
aCheck['messages']['login'] = {
minlength: 'Минимальная длина 4 символа',
required : 'Обязательное поле'
};
aCheck['rules']['login'] = {
minlength: 4,
required : true
};
aCheck['messages']['password'] = {
minlength: 'Минимальная длина 6 символов',
required : 'Вы не ввели пароль'
};
aCheck['rules']['password'] = {
minlength: 6,
required : true
};
aCheck['rules']['confirm_password'] = {
equalTo : '#signup-form input[name=password]'
};
$('#signup-form').validate(aCheck);
});
jQuery('#profile-form').each(function () {
$('#profile-form').validate(aCheck);
aCheck['rules']['confirm_password'] = {
equalTo : '#profile-form input[name=password]'
};
});
});
$(document).ready(function () {
// Проверяем есть ли массив prices?
if (window.prices )
{
// Скрываем форму выбора билета
$('div.shch').css('display','none');
// Объявляем объект работы с билетами
ts = {
placement_id : 0,
date : 0,
all_dates : [],
all_placements : [],
clearTickets: function ()
{
var tblock = $('table.table_for:eq(0);');
tblock.find('tr').remove();
},
// Отображает списки билетов
showTickets : function ()
{
var tickets = [];
var placement = ts.getPlacement();
var date = ts.getDateByPlacement(placement);
// Есть массив билетов?
// Да
if (date.children)
{
// Получаем массв на вывод
tickets = date.children;
}
else
{
// Нет
// Значит берем цены у самого первого сеанса
tickets = placement.children[0].children;
}
// Выводим
// 1. Сначала киляем все ряды таблицы
ts.clearTickets();
var tblock = $('table.table_for');
for (var i =0 ; i < tickets.length ; i++ )
{
var row = tickets[i];
var tr = $(' ');
tr
//.append('места ')
.append('' + row.name + ' ' + row.price + ' - ' + row.price2 + ' ') // Подпись к типу билетов !!!!! ОБЪЕДИНИЛ ДВА АППЕНДА!!!!!
.append(' шт.
') // Блок количества
.appendTo(tblock.find('tbody')); // Добавляем в таблицу последним рядом
}
// Добавляем кнопку "Заказать"
tblock.find('tbody').append(
''
+''
+'
'
+' '
+' ') // !!!!COLSPAN СДЕЛАЛ 3!!!!
},
selectTicket : function () {
// Удаляем блоки выбора
$('div.shch').remove();
// Добавляем новый
$(this.parentNode).after(
''
+ '
'
+ '
'
+ '
'
+ '
'
+ '
0 '
+ '
1 '
+ '
2 '
+ '
3 '
+ '
4 '
+ '
5 '
+ '
6 '
+ '
7 '
+ '
8 '
+ '
9 '
+ '
'
+ '
'
+ '
'
+ '
'
+ '
'
+ '
'
);
$('div.shch a').click(function () {
// Прописываем реакцию на кнопки
var nCount = $(this).html();
$('div.shch').prev().children('a').html(nCount + ' шт.');
$('div.shch').remove();
return false;
})
return false;
},
/**
* Проводит реакцию на нажатие кнопки "Заказать". При этом создает форму (