1var ww = $(window).width(); 2var map; 3var directionsDisplay = new google.maps.DirectionsRenderer(); 4var directionsService = new google.maps.DirectionsService(); 5function initialize(){ 6 var myLatlng=new google.maps.LatLng(59.955626,30.312451); 7 var myOptions={zoom:16,center:myLatlng,mapTypeId:google.maps.MapTypeId.ROADMAP} 8 map=new google.maps.Map(document.getElementById("map_place"),myOptions); 9 directionsDisplay.setMap(map); 10 directionsDisplay.setOptions( { suppressMarkers: true, suppressInfoWindows: true } ); 11 var contentString='<div id="content">ТÑÑ Ð²ÑÑ Ñо пÑо ÑÑо должно бÑÑÑ ÑаÑÑказано</div>'; 12 var infowindow=new google.maps.InfoWindow({content:contentString}); 13 var markerImage=new google.maps.MarkerImage('../../_html/images/template/marker.png',new google.maps.Size(48,72),new google.maps.Point(0,0),new google.maps.Point(24,72)); 14 var marker=new google.maps.Marker({position:myLatlng,icon:markerImage,map:map,title:'СанкÑ-ÐеÑеÑбÑÑгÑкий ÐланеÑаÑий'}); 15 google.maps.event.addListener(marker,'click',function(){infowindow.open(map,marker);}); 16 google.maps.event.addListener(marker,'click',function(){infowindow.open(map,marker);}); 17 google.maps.event.addListener(map, 'click', function (e) { 18 setWay(new google.maps.LatLng(59.955626,30.312451), e.latLng); 19 }); 20} 21function setWay(start, end) { 22 var start_point = start; 23 var end_point = end; 24 var request = { 25 origin: start_point, 26 destination: end_point, 27 travelMode: google.maps.TravelMode.DRIVING, 28 }; 29 directionsService.route(request, function(result, status) { 30 if (status == google.maps.DirectionsStatus.OK) { 31 directionsDisplay.setDirections(result); 32 } 33 }); 34} 35var data__object = [ 36 [ 37 'stairs1', 'data-stairs', 'ÐеÑÑниÑа 1', 'в ÐбÑеÑваÑоÑÐ¸Ñ ÐланеÑаÑиÑ, Ðал занимаÑелÑнÑÑ Ð¸Ð»Ð»Ñзий, ÐабоÑаÑоÑÐ¸Ñ Ð·Ð°Ð½Ð¸Ð¼Ð°ÑелÑнÑÑ Ð¾Ð¿ÑÑов, на вÑÑÑÐ°Ð²ÐºÑ âÐланеÑа динозавÑовâ', '270', '150' 38 ], 39 [ 40 'stairs2', 'data-stairs', 'ÐеÑÑниÑа 2', 'в ÐбÑеÑваÑоÑÐ¸Ñ ÐланеÑаÑиÑ, Ðал занимаÑелÑнÑÑ Ð¸Ð»Ð»Ñзий, ÐабоÑаÑоÑÐ¸Ñ Ð·Ð°Ð½Ð¸Ð¼Ð°ÑелÑнÑÑ Ð¾Ð¿ÑÑов, на вÑÑÑÐ°Ð²ÐºÑ âÐланеÑа динозавÑовâ', '427', '530' 41 ], 42 [ 43 'stairs3', 'data-stairs', 'ÐеÑÑниÑа 3', 'в ÐбÑеÑваÑоÑÐ¸Ñ ÐланеÑаÑиÑ, Ðал занимаÑелÑнÑÑ Ð¸Ð»Ð»Ñзий, ÐабоÑаÑоÑÐ¸Ñ Ð·Ð°Ð½Ð¸Ð¼Ð°ÑелÑнÑÑ Ð¾Ð¿ÑÑов, на вÑÑÑÐ°Ð²ÐºÑ âÐланеÑа динозавÑовâ', '507', '530' 44 ], 45 [ 46 'stairs4', 'data-stairs', 'ÐеÑÑниÑа 4', 'в ÐбÑеÑваÑоÑÐ¸Ñ ÐланеÑаÑиÑ, Ðал занимаÑелÑнÑÑ Ð¸Ð»Ð»Ñзий, ÐабоÑаÑоÑÐ¸Ñ Ð·Ð°Ð½Ð¸Ð¼Ð°ÑелÑнÑÑ Ð¾Ð¿ÑÑов, на вÑÑÑÐ°Ð²ÐºÑ âÐланеÑа динозавÑовâ', '325', '155' 47 ], 48 [ 49 'stairs5', 'data-stairs', 'ÐеÑÑниÑа 5', 'в ÐбÑеÑваÑоÑÐ¸Ñ ÐланеÑаÑиÑ, Ðал занимаÑелÑнÑÑ Ð¸Ð»Ð»Ñзий, ÐабоÑаÑоÑÐ¸Ñ Ð·Ð°Ð½Ð¸Ð¼Ð°ÑелÑнÑÑ Ð¾Ð¿ÑÑов, на вÑÑÑÐ°Ð²ÐºÑ âÐланеÑа динозавÑовâ', '450', '535' 50 ], 51 [ 52 'stairs6', 'data-stairs', 'ÐеÑÑниÑа 6', 'в ÐбÑеÑваÑоÑÐ¸Ñ ÐланеÑаÑиÑ, Ðал занимаÑелÑнÑÑ Ð¸Ð»Ð»Ñзий, ÐабоÑаÑоÑÐ¸Ñ Ð·Ð°Ð½Ð¸Ð¼Ð°ÑелÑнÑÑ Ð¾Ð¿ÑÑов, на вÑÑÑÐ°Ð²ÐºÑ âÐланеÑа динозавÑовâ', '395', '535' 53 ], 54 [ 55 'object1', 'data-object', 'ÐвезднÑй зал', 'ÐпиÑание', '187', '390' 56 ], 57 [ 58 'object2', 'data-object', 'Ðал коÑмиÑеÑкое пÑÑеÑеÑÑвие', 'ÐпиÑание', '275', '310' 59 ], 60 [ 61 'object3', 'data-object', 'Ðал планеÑка', 'ÐпиÑание', '485', '220' 62 ], 63 [ 64 'object4', 'data-object', 'ÐабоÑаÑоÑÐ¸Ñ Ð·Ð°Ð½Ð¸Ð¼Ð°ÑелÑнÑÑ Ð¾Ð¿ÑÑов', 'ÐпиÑание', '300', '455' 65 ], 66 [ 67 'object5', 'data-object', 'ÐÑ Ð¾Ð´ в ÐбÑеÑваÑоÑÐ¸Ñ Ð¸ зал занимаÑелÑнÑÑ Ð¸Ð»Ð»Ñзий', 'ÐпиÑание', '395', '565' 68 ], 69 [ 70 'object6', 'data-object', 'ÐалеÑÐµÑ âÐланеÑаÑий-ÑаÑиоаÑÑâ', 'ÐпиÑание', '195', '200' 71 ], 72 [ 73 'object7', 'data-object', 'ÐланеÑа динозавÑов', 'ÐпиÑание', '300', '420' 74 ], 75 [ 76 'object8', 'data-object', 'Ðал занимаÑелÑнÑÑ Ð¸Ð»Ð»Ñзий', 'ÐпиÑание', '395', '460' 77 ], 78 [ 79 'object9', 'data-object', 'ÐбÑеÑваÑоÑÐ¸Ñ Ð¿Ð»Ð°Ð½ÐµÑаÑиÑ', 'ÐпиÑание', '470', '575' 80 ] 81]; 82 83/* ÑкÑÑÑие даÑ, коÑоÑÑе не вмеÑаÑÑÑÑ Ð² ÑиÑÐ¸Ð½Ñ Ð±Ð»Ð¾ÐºÐ° */ 84 85function CheckTopMenuDotted(nav_main_collaps) { 86 var nav_main_collapse = nav_main_collaps; 87 88 if (nav_main_collapse.is(':hidden')) { 89 return; 90 } 91
92 var menu = nav_main_collapse.find('nav.mega-menu'); 93 var menuMoreItem = menu.find('td.js-dropdown'); 94 95 if (menu.parents('.collapse').css('display') == 'none') { 96 return false; 97 } 98 99 var block_w = menu.closest('div').width(); // width of closest block menu, without! padding and margin. 100 var menu_w = menu.find('table').outerWidth(true); // width of menu with padding and margin. 101 var afterHide = false; 102 103 var _checker = menu.find('table td').size(); 104 var _i = 0; 105 106 while (menu_w > block_w && _i != _checker) { 107 menuMoreItem.show(); 108 menuItemOldSave = menu.find('td').not('.nosave').last(); 109 menuItemNewSave = '<li class="' + (menuItemOldSave.hasClass('last') ? 'last ' : '') + (menuItemOldSave.hasClass('dropdown') ? 'dropdown-submenu ' : '') + (menuItemOldSave.hasClass('active') ? 'active ' : '') + '" data-hidewidth="' + menu_w + '">' + menuItemOldSave.find('.wrap').html() + '</li>'; 110 menuItemOldSave.remove(); 111 menuMoreItem.find('> .wrap > .dropdown-menu').prepend(menuItemNewSave); 112 menu_w = menu.find('table').outerWidth(true); 113 afterHide = true; 114 _i ++; 115 } 116 117 var _checker = menu.find('table td').size(); 118 var _i = 0; 119 120 if (!afterHide) { 121 do { 122 var menuItemOldSaveCnt = menuMoreItem.find('.dropdown-menu').find('li').length; 123 menuItemOldSave = menuMoreItem.find('.dropdown-menu').find('li').first(); 124 if(!menuItemOldSave.length) { 125 menuMoreItem.hide(); 126 return false; 127 } 128 else { 129 var hideWidth = menuItemOldSave.attr('data-hidewidth'); 130 if(hideWidth > block_w) { 131 return false; 132 } 133 else { 134 menuItemNewSave = '<div class="' + (menuItemOldSave.hasClass('last') ? 'last ' : '') + (menuItemOldSave.hasClass('dropdown-submenu') ? 'dropdown ' : '') + (menuItemOldSave.hasClass('active') ? 'active ' : '') + '" data-hidewidth="' + block_w + '"><div class="wrap">' + menuItemOldSave.html() + '</div></div>'; 135 menuItemOldSave.remove(); 136 $(menuItemNewSave).insertBefore(menu.find('td.js-dropdown')); 137 if(!menuItemOldSaveCnt) { 138 menuMoreItem.hide(); 139 return false; 140 } 141 } 142 } 143 menu_w = menu.find('table').outerWidth(true); 144 _i++; 145 } 146 while(menu_w <= block_w ); 147 } 148 return false; 149} 150 151/* --------------------------------------------------------------------- */ 152 153function resize() { 154 ww = $(window).width(); 155 156 $('.quest__details .info__table-detail').each(function () { 157 var doted = $(this).find('.nav-main-collapse'); 158 CheckTopMenuDotted(doted); 159 }); 160} 161 162/* паÑÐ°Ð»Ð°ÐºÑ ÑÑÑÐµÐºÑ */ 163 164function horizontalparallax() { 165 $('body').mousemove(function (e) { 166 var hp_c = ($('html').width() - $(this).width()) / 2; 167 168 var hw = $('html').width(); 169 var x = hw / 2 - e.pageX; 170 var bodybgPosX = (hw - 2000) / 2; 171 var bodybgPosXS = (hw - 1312) / 2; 172 var cloud__top = (hw - 2556) / 2; 173 var bg_404_top = (hw - 2050) / 2; 174 var earth__top = (hw - 2040) / 2; 175 var slider__main = (hw - 1530) / 2; 176 var hall__planetarium = (hw - 1920) / 2; 177 var cloud__bottom = (hw - 2380) / 2; 178 179 $('.header__top').css('background-position', bodybgPosX + (x / 95) + 'px 0%'); 180 $('.slider__main').css('background-position', bodybgPosX + (x / 95) + 'px bottom'); 181 $('.slider__main-star').css('background-position', slider__main + (x / 95) + 'px 0%'); 182 $('.programs__list-star').css('background-position', bodybgPosXS + (x / 95) + 'px 0%'); 183 $('.hall__planetarium').css('background-position', hall__planetarium + (x / 95) + 'px 123px'); 184 185 $('.cloud__top1').css('background-position', cloud__top - (x / 90) + 'px 0%'); 186 $('.cloud__top2').css('background-position', cloud__top - (x / 80) + 'px 0%'); 187 $('.cloud__top22').css('background-position', cloud__top - (x / 60) + 'px 0%'); 188 $('.cloud__top3').css('background-position', cloud__top - (x / 40) + 'px 0%');
189 $('.cloud__top33').css('background-position', cloud__top - (x / 30) + 'px 0%'); 190 $('.cloud__top4').css('background-position', cloud__top - (x / 20) + 'px 0%'); 191 $('.cloud__top5').css('background-position', cloud__top - (x / 10) + 'px 0%'); 192 193 $('.cloud__bottom1').css('background-position', cloud__top - (x / 90) + 'px 0%'); 194 $('.cloud__bottom3').css('background-position', cloud__top - (x / 40) + 'px 0%'); 195 196 $('.bg_404').css('background-position-x', bg_404_top + (x / 100) + 'px'); 197 $('.earth').css('background-position-x', earth__top - (x / 150) + 'px'); 198 }); 199} 200 201/* --------------------------------------------------------------------- */ 202 203$(document).ready(function () { 204 205 if($("body.kiosk").length > 0){ 206 var checkDomain = function(url) { 207 if ( url.indexOf('//') === 0 ) { url = location.protocol + url; } 208 return url.toLowerCase().replace(/([a-z])?:\/\//,'$1').split('/')[0]; 209 }; 210 if($(".pluso__list").length) { 211 $(".pluso__list").hide(); 212 } 213 if($(".magazine__list").length) { 214 $(".magazine__list a").attr('href', '#'); 215 } 216 var isExternal = function(url) { 217 return ( ( url.indexOf(':') > -1 || url.indexOf('//') > -1 ) && checkDomain(location.href) !== checkDomain(url) ); 218 }; 219 $(document).on("click", "a", function(){ 220 url = $(this).attr("href"); 221 if( isExternal(url) ) { 222 alert("ÐеÑÐµÑ Ð¾Ð´ по внеÑним ÑÑÑлкам запÑеÑен"); 223 return false; 224 } 225 }); 226 } 227 228 $(window).load(function () { 229 230 "use strict"; 231 232 //Plaeholder handler 233 if (!Modernizr.input.placeholder) { 234 $('[placeholder]').focus(function () { 235 var input = $(this); 236 if (input.val() === input.attr('placeholder')) { 237 input.val(''); 238 input.removeClass('placeholder'); 239 } 240 }).blur(function () { 241 var input = $(this); 242 if (input.val() === '' || input.val() === input.attr('placeholder')) { 243 input.addClass('placeholder'); 244 input.val(input.attr('placeholder')); 245 } 246 }).blur(); 247 248 $('[placeholder]').parents('form').submit(function () { 249 $(this).find('[placeholder]').each(function () { 250 var input = $(this); 251 if (input.val() === input.attr('placeholder')) { 252 input.val(''); 253 } 254 }); 255 }); 256 } 257 258 var pgwBrowser = $.pgwBrowser(); 259 $('html').addClass(pgwBrowser.browser.name + ' ' + pgwBrowser.os.name); 260 261 $('input, select').styler(); 262 $(".scrollbar").customScrollbar(); 263 $('.fancybox').fancybox(); 264 265 /* календаÑÑ */ 266 267 Date.prototype.daysInMonth = function() { 268 return 33 - new Date(this.getFullYear(), this.getMonth(), 33).getDate(); 269 }; 270 271 $.getJSON('/ajax/getWeekend.php', {date: dateToString(new Date(), false), count: 90}, function(WeekendsDP){ 272 window.WeekendsDP = WeekendsDP; 273 $( ".datepicker" ).datepicker({ 274 275 onSelect: function(dateText, inst) { 276 var curr_date = inst.selectedDay; 277 var curr_month = inst.selectedMonth; 278 var year = inst.selectedYear; 279 if(curr_month + 1 < 10) { 280 curr_month_zero = '0'+(+curr_month + 1); 281 } else { 282 curr_month_zero = +curr_month + 1; 283 } 284 if((curr_date) < 10) { 285 curr_date_zero = '0'+(curr_date); 286 } else { 287 curr_date_zero = (curr_date); 288 } 289 var date = year + '-' + curr_month_zero + '-' + curr_date_zero; 290 291 var currentDate = $(".days__list .days__list-active").data("date"); 292 if(date != currentDate){ 293 $(".days__list .days__list-active").removeClass("days__list-active"); 294 $(".days__list .days__list__item[data-date='"+date+"']").addClass("days__list-active"); 295 getSchedule(date); 296 } 297 }, 298 onChangeMonthYear: function(year, month, inst){ 299 if(!(--month)){
300 month = 12; 301 year--; 302 } 303 $.getJSON('/ajax/getWeekend.php', {date: year+'-'+month+'-01', count: 90}, function(WeekendsDP){ 304 window.WeekendsDP = WeekendsDP; 305 //$(inst).datepicker( "option", "beforeShowDay", datepickerWeekend); 306 }); 307 }, 308 beforeShowDay: datepickerWeekend 309 310 311 }); 312 console.log('ÐейÑпикеÑ'); 313 }); 314 var monthNames = ['ÑнваÑÑ','ÑевÑалÑ','маÑÑа','апÑелÑ','май','иÑнÑ', 'иÑлÑ','авгÑÑÑа','ÑенÑÑбÑÑ','окÑÑбÑÑ','ноÑбÑÑ','декабÑÑ']; 315 var dayNames = ['воÑкÑеÑенÑе','понеделÑник','вÑоÑник','ÑÑеда','ÑеÑвеÑг','пÑÑниÑа','ÑÑббоÑа']; 316 var dayNamesMin = ['Ðн','ÐÑ','СÑ','ЧÑ','ÐÑ','Сб','ÐÑ']; 317 318 var curentDate = new Date(); 319 var dayDate = new Date(); 320 var curr_date = curentDate.getDate(); 321 var curr_month = curentDate.getMonth(); 322 var curr_year = curentDate.getFullYear(); 323 var monthName = monthNames[curr_month]; 324 var curDay = curentDate.getDay(); 325 var dateText = ''; 326 var curDay2 = curDay - 1; 327 328 /*$('.day__info-date').text(curr_date + ' ' + monthName + ', ' + dayNames[curDay]);*/ 329 $('.days__list .days__list__item').removeClass('days__list-today'); 330 $('.days__list .days__list__item').removeClass('days__list-dissabled'); 331 $('.days__list .days__list__item').removeClass('days__list-free'); 332 $('.days__list .days__list__item').removeClass('days__list-active'); 333 var dayMounthMax = curentDate.daysInMonth(); 334 var curr_month_zero, curr_date_zero; 335 336 337 function createDaysList(Weekend) 338 { 339 var active_date = ""; 340 for (var i = 1; i < 12; i++) { 341 var add_m = 1; 342 var next_date = curr_date + i - 1; 343 if(next_date > dayMounthMax){ 344 next_date-=dayMounthMax; 345 add_m = 2; 346 } 347 348 if(curr_month + add_m > 12){ 349 curr_date = 2 - i; 350 curr_month = 0; 351 add_m = 1; 352 curr_year++; 353 } 354 355 if(curr_month + add_m < 10) { 356 curr_month_zero = '0'+(+curr_month + add_m); 357 } else { 358 curr_month_zero = +curr_month + add_m; 359 } 360 361 if(next_date < 10) { 362 curr_date_zero = '0'+next_date; 363 } else { 364 curr_date_zero = next_date; 365 } 366 367 var item = $('.days__list').find('.days__list__item:nth-child(' + i + ')'); 368 369 if ($.inArray(curr_year+'-'+curr_month_zero+'-'+curr_date_zero,Weekend)==-1){ 370 if(active_date==""){ 371 active_date = curr_year+'-'+curr_month_zero+'-'+curr_date_zero; 372 item.addClass("days__list-active"); 373 } 374 } 375 376 item.attr('data-date', curr_year+'-'+curr_month_zero+'-'+curr_date_zero); 377 curDay2 = curDay2 + 1; 378 if (curDay2 == 8) { 379 curDay2 = 1; 380 } 381 if(curDay2 == 0){ 382 curDay2 = 7; 383 } 384 385 /*if (curDay2 > dayMounthMax - 1) { 386 curDay2 = 1 - i; 387 }*/ 388 389 390 item.find('.days__list-weekday').text(dayNamesMin[curDay2-1]); 391 item.find('.days__list-number').text(next_date); 392 393 if ((curDay2 == 6) || (curDay2 == 7)) { 394 item.addClass('days__list-free'); 395 } 396 397 if (i == 1) { 398 if (curDay2 == 1 && item.hasClass("days__list-weekday")) { 399 $('.days__list').find('.days__list__item:nth-child(' + 2 + ')').addClass('days__list-active'); 400 } else { 401 item.addClass('days__list-active'); 402 } 403 item.addClass('days__list-today'); 404 } 405 406 if (/*curDay2 == 1||*/$.inArray(curr_year+'-'+curr_month_zero+'-'+curr_date_zero,Weekend)!=-1) { 407 item.removeAttr("class"); 408 item.addClass('days__list__item'); 409 //if([5,6,7].indexOf(curr_month_zero) === -1) { 410 //item.addClass('days__list__item days__list-dissabled'); 411 //} 412 } 413 } 414 415 $.getJSON('/ajax/getWeekend.php', {date: dateToString(new Date(), false), count: 90}, function(WeekendsDP){ 416 window.WeekendsDP = WeekendsDP; 417 $( ".datepicker" ).datepicker({ 418 minDate: '0', 419 onSelect: function(dateText, inst) { 420 var day = inst.selectedDay;
421 var month = inst.selectedMonth; 422 var year = inst.selectedYear; 423 var monthName = monthNames[month]; 424 var selectedDate = $(".datepicker").datepicker('getDate'); 425 var curDay = selectedDate.getDay(); 426 dateText = dateText; 427 var curentDate = new Date(); 428 var curr_date = curentDate.getDate(); 429 var curr_month = curentDate.getMonth(); 430 var curr_year = curentDate.getFullYear(); 431 432 $('.day__info-date').text(day + ' ' + monthName + ', ' + dayNames[curDay]); 433 434 if ((day == curr_date) && (month == curr_month) && (year == curr_year)) { 435 $('.day__info-day').hide(); 436 $('.day__info-today').fadeIn('show'); 437 } else { 438 $('.day__info-today').hide(); 439 $('.day__info-day').fadeIn('show'); 440 } 441 442 var curDay1 = curDay - 2; 443 var dayMounthMax = selectedDate.daysInMonth(); 444 445 $('.days__list .days__list__item').removeClass('days__list-today'); 446 $('.days__list .days__list__item').removeClass('days__list-dissabled'); 447 $('.days__list .days__list__item').removeClass('days__list-free'); 448 $('.days__list .days__list__item').removeClass('days__list-active'); 449 450 for (var i = 0; i < 12; i++) { 451 var item = $('.days__list').find('.days__list__item:nth-child(' + i + ')'); 452 453 454 curDay1 = curDay1 + 1; 455 if (curDay1 == 8) { 456 curDay1 = 1; 457 } 458 459 460 461 var newDay = parseInt(day) + i - 1; 462 if (newDay > dayMounthMax - 1) { 463 day = 1 - i; 464 } 465 466 item.find('.days__list-weekday').text(dayNamesMin[curDay1-1]); 467 item.find('.days__list-number').text(newDay); 468 469 /*if (curDay1 == 1) { 470 item.addClass('days__list-dissabled'); 471 }*/ 472 473 if ((curDay1 == 6) || (curDay1 == 7)) { 474 item.addClass('days__list-free'); 475 } 476 477 if (i == 1) { 478 if (curDay1 == 1 && item.hasClass("days__list-weekday")) { 479 $('.days__list').find('.days__list__item:nth-child(' + 2 + ')').addClass('days__list-active'); 480 } else { 481 item.addClass('days__list-active'); 482 } 483 } 484 485 if ((day == curr_date) && (month == curr_month) && (year == curr_year)) { 486 item.addClass('days__list-today'); 487 } 488 } 489 }, 490 onChangeMonthYear: function(year, month, inst){ 491 if(!(--month)){ 492 month = 12; 493 year--; 494 } 495 $.getJSON('/ajax/getWeekend.php', {date: year+'-'+month+'-01', count: 90}, function(WeekendsDP){ 496 window.WeekendsDP = WeekendsDP; 497 //$(inst).datepicker( "option", "beforeShowDay", datepickerWeekend); 498 }); 499 }, 500 beforeShowDay: datepickerWeekend 501 }); 502 }); 503 504 getSchedule(active_date); 505 } 506 if(curr_month + 1 < 10) { 507 var curr_month_cur = '0'+(+curr_month + 1); 508 } else { 509 var curr_month_cur = +curr_month + 1; 510 } 511 if(curr_date < 10) { 512 var curr_date_cur = '0'+curr_date; 513 } else { 514 var curr_date_cur = curr_date; 515 } 516 var date = curr_year+'-'+curr_month_cur+'-'+curr_date_cur; 517 518 getWeekend(date); 519 520 /* --------------------------------------------------------------------- */ 521 522 523 524 525 /* ÑлайдеÑÑ */ 526 527 $('.main__slider').each(function () { 528 if ($(this).hasClass('main__slider_inner')) { 529 $('.main__slider_inner').bxSlider({ 530 controls: true, 531 pager: false, 532 /*auto: true,*/ 533 wrapperClass: 'bx-wrapper main__slider__wrapper main__slider_inner__wrapper', 534 pause: 7000, 535 speed: 500 536 }); 537 } else { 538 $('.main__slider').bxSlider({ 539 controls: true, 540 pager: true, 541 /*auto: true,*/ 542 wrapperClass: 'bx-wrapper main__slider__wrapper', 543 pause: 7000, 544 speed: 500, 545 onSliderLoad: function () { 546 $('.bx-controls').after('<div class="slider__main-star"></div>'); 547 } 548 }); 549 } 550 }); 551 552 if($("ul.people__in__slider li").length>4){ 553 $('.people__in__slider').bxSlider({ 554 controls: true, 555 pager: false, 556 wrapperClass: 'bx-wrapper people__in__slider__wrapper', 557 minSlides: 3, 558 maxSlides: 4, 559 slideWidth: 215, 560 slideMargin: 15 561 });
562 } 563 564 $('.twitter__list').bxSlider({ 565 mode: 'vertical', 566 controls: true, 567 pager: false, 568 minSlides: 5, 569 slideMargin: 17, 570 moveSlides: 1, 571 wrapperClass: 'bx-wrapper vertical__wrapper' 572 }); 573 574 /* --------------------------------------------------------------------- */ 575 576 577 578 /* ÑкÑолл ввеÑÑ Ð¿Ñи клике на ÑÑÑÐµÐ»ÐºÑ */ 579 580 $("#up").click(function() { 581 $("html, body").animate({scrollTop:0},"slow") 582 }); 583 584 $('.a__search').click(function () { 585 if ($(this).hasClass('open')) { 586 $('.search__form').slideUp(300); 587 $(this).removeClass('open'); 588 } else { 589 $('.search__form').slideDown(300); 590 $(this).addClass('open'); 591 } 592 }); 593 594 $('.a__close').click(function () { 595 $(this).parent().slideUp(300); 596 }); 597 598 /* --------------------------------------------------------------------- */ 599 600 601 602 /* ÑабоÑа Ñ Ð¼ÐµÐ½Ñ */ 603 604 /*$('.menu__item-a').click(function () { 605 $('.menu__item').removeClass('selected'); 606 $(this).parent().addClass('selected'); 607 608 var data_submenu = $(this).attr('data-submenu'); 609 610 $('.sub__menu-section').fadeIn('show'); 611 $('.sub__menu-section .sub__menu').hide(); 612 $('.sub__menu-section').find('#' + data_submenu).slideDown(300); 613 });*/ 614 615 /*$('.menu__item .sub__menu_box').mouseleave (function () { 616 $('.menu__item').removeClass('selected'); 617 });*/ 618 619 $(document).mouseup(function (e) { // ÑобÑÑие клика по веб-докÑменÑÑ 620 var div = $(".search__form"); 621 622 if (!div.is(e.target) // еÑли клик бÑл не по наÑÐµÐ¼Ñ Ð±Ð»Ð¾ÐºÑ 623 && div.has(e.target).length === 0) { // и не по его доÑеÑним ÑлеменÑам 624 $('.search__form').slideUp(300); 625 $('.a__search').removeClass('open'); 626 } 627 }); 628 629 /* --------------------------------------------------------------------- */ 630 631 632 633 /* ÑабоÑа Ñ ÑаблиÑами */ 634 635 $('.td__title a').click(function () { 636 var doted = $(this).parents('tr').next().find('.nav-main-collapse'); 637 if ($(this).hasClass('open')) { 638 $(this).parents('tr').next().find('.info__table-detail').slideUp(300); 639 $(this).removeClass('open'); 640 CheckTopMenuDotted(doted); 641 } else { 642 $(this).parents('tr').next().find('.info__table-detail').slideDown(300); 643 $(this).addClass('open'); 644 CheckTopMenuDotted(doted); 645 $(".scrollbar").customScrollbar("resize", true); 646 } 647 }); 648 649 resize(); 650 651 /* --------------------------------------------------------------------- */ 652 653 654 655 /* ÑабоÑа Ñ ÑилÑÑÑом */ 656 657 $('#select__whom').change(function (e) { 658 var data__filter = $(this).val(); 659 if (data__filter == 'ÐеÑÑм') { 660 $('#select__age').removeAttr('disabled').trigger('refresh'); 661 $('#select__amount').attr('disabled', 'disabled').trigger('refresh'); 662 } else if (data__filter == 'ÐÑÑппам') { 663 $('#select__age').removeAttr('disabled').trigger('refresh'); 664 $('#select__amount').removeAttr('disabled').trigger('refresh'); 665 } else { 666 $('#select__age').attr('disabled', 'disabled').trigger('refresh'); 667 $('#select__amount').attr('disabled', 'disabled').trigger('refresh'); 668 } 669 670 e.preventDefault();; 671 }); 672 673 $('#select__hall').change(function (e) { 674 var data__filter = $(this).find('option:selected').attr('data-filter'); 675 $("#hall__filter").text("ÐÑбÑано: "+$(".people__list ."+data__filter).length); 676 $(".people__list .people__list__item").hide(); 677 $(".people__list ."+data__filter).show(); 678 679 e.preventDefault(); 680 }); 681 /*$("#hall__filter").click(function(){ 682 var data__filter = $('#select__hall').find('option:selected').attr('data-filter'); 683 });*/ 684 685 $('#subscriptions__filter').click(function () { 686 var data__type_i = 0; 687 var data__type = []; 688 689 $('.form__item-checkbox label').each(function () { 690 if ($(this).find('.jq-checkbox').hasClass('checked')) { 691 data__type[data__type_i] = $(this).attr('data-type'); 692 data__type_i++; 693 } 694 }); 695 696 $('.form__item-select').each(function () { 697 var data__filter = $(this).find('select option:selected').attr('data-filter'); 698 data__type[data__type_i] = data__filter; 699 data__type_i++; 700 }); 701 }); 702 703 $('.hall-checkbox').unbind('change'); 704 $('[name="whom_select"]').unbind('change'); 705 $('[name="whom_select"]').change(function(){ 706 var whom = $(this).val(); 707 // filterWhom(whom); 708 }); 709 $('.hall-checkbox, .category-checkbox, .filter-input, .amount-filter-input').change(function(){ //console.log($(this).val()); 710 711 var checkboxesVal = []; 712 $('.hall-checkbox, .filter-input, .category-checkbox').each(function(i,e){ 713 if($(e).is('select') && $(e).val()) { 714 checkboxesVal[$(e).attr("name")]=$(e).val(); 715 } else { 716 if (e.checked) { 717 if(typeof(checkboxesVal[$(e).attr("name")])=="undefined"){ 718 checkboxesVal[$(e).attr("name")]=[]; 719 } 720 checkboxesVal[$(e).attr("name")].push($(e).val()); 721 } 722 } 723 }); 724 if($(this).hasClass("amount-filter-input")){ 725 var afi = $(this); 726 }else{ 727 var afi = $("select.amount-filter-input"); 728 } 729 if($(afi).val()!="0"){ 730 var afi_name=$(afi).attr("name"); 731 afi = $(afi).val(); 732 var afiVal = []; 733 if(typeof($("#"+afi).attr("value-min"))!="undefined"){ 734 afiVal["min"]=($("#"+afi).attr("value-min")); 735 } 736 if(typeof($("#"+afi).attr("value-max"))!="undefined"){ 737 afiVal["max"]=($("#"+afi).attr("value-max")); 738 } 739 checkboxesVal[afi_name]=afiVal; 740 } 741 filterCheckbox(checkboxesVal); 742 }); 743 744 $('.days__list__item').click(function () { 745 if ($(this).hasClass('days__list-active')) { 746 747 } else { 748 var date = $(this).data('date'); 749 getSchedule(date); 750 if (!$(this).hasClass('days__list-dissabled')) { 751 $(this).parent().find('.days__list__item').removeClass('days__list-active'); 752 $(this).addClass('days__list-active'); 753 } 754 } 755 }); 756 757 function getSchedule(date){ 758 return 759 if(window.location.pathname.indexOf("schedule/")!=-1){ 760 $('.loader_layout').show() 761 var scheduleDate = new Date(date); 762 763 var schedule_date = scheduleDate.getDate();
764 var schedule_month = scheduleDate.getMonth(); 765 var schedule_year = scheduleDate.getFullYear(); 766 var monthName = monthNames[schedule_month]; 767 var scheduleDay = scheduleDate.getDay(); 768 769 var curentDate = new Date(); 770 var curr_date = curentDate.getDate(); 771 var curr_month = curentDate.getMonth(); 772 var curr_year = curentDate.getFullYear(); 773 774 if(curr_month + 1 < 10) { 775 curr_month_zero = '0'+(+curr_month + 1); 776 } else { 777 curr_month_zero = +curr_month + 1; 778 } 779 if((curr_date) < 10) { 780 curr_date_zero = '0'+(curr_date); 781 } else { 782 curr_date_zero = (curr_date); 783 } 784 785 $('.day__info-date').text(schedule_date + ' ' + monthName + ', ' + dayNames[scheduleDay]); 786 787 if(date === curr_year+"-"+curr_month_zero+"-"+curr_date_zero){ 788 $('.day__info-day').hide(); 789 $('.day__info-today').fadeIn('show'); 790 } else { 791 $('.day__info-today').hide(); 792 $('.day__info-day').fadeIn('show'); 793 } 794 $.post('/ajax/getSchedule1.php', {date: date}, function(data){ 795 data = JSON.parse(data); //console.log(data); 796 $('.schedule-list tbody').html(''); 797 $('#subscriptions__filter').text('ÐÑбÑано: '+data.length); 798 data.forEach(function(element, index, array) { 799 var event, forMan = '', age = '', ages = '', online_show = '', online_alt_href = 'https://bigbilet.ru/place/planetary', online_kassir = 0, online_kassir_href = "", hall = '', hall_url = '', hall_c_from = '', hall_c_to = '', hall_desc = '', hall_picture = '/_html/images/content/img5.jpg', price = '', gid = '', gid_url = '', text = '', priceText = '', picture = "/_html/images/content/img27.jpg"; 800 if(element.event.VALUE != null) { 801 event = element.event.VALUE.NAME; 802 text = element.event.VALUE.PREVIEW_TEXT; 803 if(element.event.VALUE.PREVIEW_PICTURE != null) { 804 picture = element.event.VALUE.PREVIEW_PICTURE; 805 } 806 } else if(element.program.VALUE != null) { 807 event = element.program.VALUE.NAME; 808 text = element.program.VALUE.PREVIEW_TEXT; 809 if(element.program.VALUE.PREVIEW_PICTURE != null) { 810 picture = element.program.VALUE.PREVIEW_PICTURE; 811 } 812 } else if(element.service.VALUE != null) { 813 event = element.service.VALUE.NAME; 814 text = element.service.VALUE.PREVIEW_TEXT; 815 if(element.service.VALUE.PREVIEW_PICTURE != null) { 816 picture = element.service.VALUE.PREVIEW_PICTURE; 817 } 818 } 819 820 if(element.online.VALUE == "Ðа"){ 821 online_show = " a__more__show"; 822 if(element.online_alt_href.VALUE != null && element.online_alt_href.VALUE!=""){ 823 online_alt_href = element.online_alt_href.VALUE; 824 } 825 } 826 if(element.online_kassir.VALUE == "Ðа"){ 827 online_kassir = 1; 828 online_kassir_href = element.online_kassir_href.VALUE; 829 } 830 831 if(element.for.VALUE != null) { 832 forMan = element.for.VALUE.NAME; 833 } 834 if(element.gid.VALUE != null) { 835 gid = ""; 836 gid_url = ""; 837 $.each(element.gid.VALUE,function(index,elem){ 838 gid += '<a href="' + elem.DETAIL_PAGE_URL+ '">' + elem.NAME + '</a>'; 839 if (index != element.gid.VALUE.length - 1){ 840 gid+=", "; 841 } 842 }); 843 } 844 if(element.age.VALUE != null) { 845 age = element.age.VALUE.NAME; 846 ages = element.age.JSON; 847 } 848 if(element.hall.VALUE != null) { 849 hall = element.hall.VALUE.NAME; 850 hall_url = '/group/planetarium-map/' + element.hall.VALUE.CODE; 851 hall_desc = element.hall.VALUE.PROPERTIES.FILTER_TEXT.VALUE; 852 if(element.hall.VALUE.PROPERTIES.CAPACITY_FROM.VALUE!=""){ 853 hall_c_from = "data-c-from='" + element.hall.VALUE.PROPERTIES.CAPACITY_FROM.VALUE + "'"; 854 } 855 if(element.hall.VALUE.PROPERTIES.CAPACITY_TO.VALUE!=""){ 856 hall_c_to = "data-c-to='" + element.hall.VALUE.PROPERTIES.CAPACITY_TO.VALUE + "'"; 857 } 858 if(element.hall.VALUE.PREVIEW_PICTURE != null) { 859 hall_picture = element.hall.VALUE.PREVIEW_PICTURE; 860 } 861 } 862 if(element.price.VALUE != null) { 863 price = element.price.VALUE.NAME; 864 priceText = element.price.VALUE.PREVIEW_TEXT; 865 } 866 var $html = '<tr data-whom="' + forMan + '" data-hall="' + hall + '" ' + hall_c_from + ' ' + hall_c_to + ' data-age=\'' + ages + '\' class="schedule-list-check">'; 867 $html += '<td class="time td__num">' + element.time.VALUE.NAME + '</td>'; 868 $html += '<td class="td__title text-left">'; 869 $html += '<a href="javascript:void(0);">'; 870 $html += event; 871 $html += '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 12" preserveAspectRatio="xMidYMid meet" width="15" height="9">'; 872 $html += '<path class="icon icon__select" d="M 9.996 12.001 C 9.996 12.001 10.042 12.001 9.996 12.001 C 10.268 12.001 10.495 11.908 10.631 11.724 C 10.631 11.724 10.631 11.678 10.677 11.678 C 10.722 11.678 10.722 11.631 10.722 11.631 L 19.658 1.813 C 20.066 1.399 20.112 0.753 19.749 0.292 C 19.386 -0.076 18.796 -0.076 18.434 0.292 C 18.388 0.338 18.388 0.338 18.388 0.384 L 9.996 9.603 L 1.605 0.384 C 1.287 -0.031 0.697 -0.
872076 0.334 0.2 C 0.289 0.2 0.289 0.246 0.244 0.246 C -0.119 0.707 -0.074 1.352 0.334 1.767 L 9.27 11.631 L 9.316 11.678 C 9.316 11.678 9.316 11.724 9.361 11.724 C 9.497 11.908 9.724 12.001 9.996 12.001 C 9.951 12.001 9.996 12.001 9.996 12.001 Z" />'; 873 $html += '</svg>'; 874 $html += '</a>'; 875 $html += '</td>'; 876 $html += '<td>' + forMan + '</td>'; 877 $html += '<td><span class="age-big">' + age + '</span></td>'; 878 $html += '<td class="hall">'; 879 $html += '<div>'; 880 $html += '<a href="' + hall_url + '" class="td__name">' + hall + '</a>'; 881 $html += '</div>'; 882 $html += '<p>'+hall_desc+'</p>'; 883 $html += '</td>'; 884 $html += '<td class="td__cost col12">'; 885 $html += '<p><a href="/group/tickets/">' + price + '<br>ÐодÑобно</a></p>'; 886 $html += '</td>'; 887 $html += '</tr>'; 888 var htmlHide = '<tr class="tr__hide" data-hall="' + hall + '">'; 889 htmlHide += '<td colspan="6">'; 890 htmlHide += '<div class="info__table-detail">'; 891 htmlHide += '<div class="programm__table">'; 892 htmlHide += '<div class="left programm__table-img img__full">'; 893 htmlHide += '<img src="' + picture + '" alt="">'; 894 htmlHide += '</div>'; 895 htmlHide += '<div class="right programm__table-info">'; 896 htmlHide += '<a href="' + hall_url + '" class="table__img-a img__full">'; 897 htmlHide += '<h5>'+ hall +'</h5>'; 898 htmlHide += '<img src="' + hall_picture + '" alt="">'; 899 htmlHide += '</a>'; 900 htmlHide += '<div class="table__img-info bg__orange color__white">'; 901 htmlHide += '<div class="vertical">'; 902 htmlHide += '<p>'; 903 htmlHide += 'ÐÑÑ Ð¿ÑогÑÐ°Ð¼Ð¼Ñ Ð¼Ð¾Ð¶Ð½Ð¾ заказаÑÑ Ð´Ð»Ñ Ð³ÑÑппÑ!'; 904 htmlHide += '</p>'; 905 htmlHide += '<a href="'+ online_alt_href +'" target="_blank" class="a__more a__more__white a__more__auto'+ online_show +'">ÐаказаÑÑ ONLINE</a>'; 906 htmlHide += '<p>'; 907 htmlHide += 'Ðаказ по ÑелеÑонÑ:'; 908 htmlHide += '<br><span class="bold">233 49 56, 233 26 53</span>'; 909 htmlHide += '</p>'; 910 htmlHide += '</div>'; 911 htmlHide += '</div>'; 912 if(online_kassir){ 913 htmlHide += '<a href="'+ online_kassir_href +'" target="_blank" class="online_kassir"><span>Ðаказ билеÑов</span></a>'; 914 } 915 htmlHide += '</div>'; 916 htmlHide += '<div class="programm__table-content">'; 917 htmlHide += '<div class="nav-main-collapse date__block">'; 918 htmlHide += '<nav class="mega-menu">'; 919 htmlHide += '<div class="table-menu">'; 920 htmlHide += '<table>'; 921 htmlHide += '<tbody>'; 922 htmlHide += '<tr>'; 923 for(i=0;i<5;i++){ 924 if(element.NEXT_SCHEDULE !== null && typeof(element.NEXT_SCHEDULE[i])!=="undefined"){ 925 if(i<4){ 926 htmlHide += '<td class="td table-menu__item">'; 927 htmlHide += '<div class="wrap">'; 928 htmlHide += '<a href="#" class="table-menu__item-a">'+element.NEXT_SCHEDULE[i]+'</a>'; 929 htmlHide += '</div>'; 930 htmlHide += '</td>'; 931 } 932 }else{ 933 htmlHide += '<td class="td table-menu__item opacity0">'; 934 htmlHide += '<div class="wrap">'; 935 if(element.NEXT_SCHEDULE !== null){ 936 htmlHide += '<a href="#" class="table-menu__item-a">'+element.NEXT_SCHEDULE[0]+'</a>'; 937 }else{ 938 htmlHide += '<a href="#" class="table-menu__item-a"> </a>'; 939 } 940 htmlHide += '</div>'; 941 htmlHide += '</td>'; 942 } 943 } 944 if(element.NEXT_SCHEDULE !== null && element.NEXT_SCHEDULE.length>4){ 945 for(i=4;i<element.NEXT_SCHEDULE.length;i++){ 946 htmlHide += '<td class="td table-menu__item">'; 947 htmlHide += '<div class="wrap">'; 948 htmlHide += '<a href="#" class="table-menu__item-a">'+element.NEXT_SCHEDULE[i]+'</a>'; 949 htmlHide += '</div>'; 950 htmlHide += '</td>'; 951 } 952 953 htmlHide += '<td class="td table-menu__item dropdown js-dropdown nosave">'; 954 htmlHide += '<div class="wrap">'; 955 htmlHide += '<a class="dropdown-toggle more-items" href="javascript:void(0);">'; 956 htmlHide += '<span>ÐÑÑгие даÑÑ</span>'; 957 htmlHide += '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 12" preserveAspectRatio="xMidYMid meet" width="15" height="9">'; 958 htmlHide += '<path class="icon icon__select-blue" d="M 9.996 12.001 C 9.996 12.001 10.042 12.001 9.996 12.001 C 10.268 12.001 10.495 11.908 10.631 11.724 C 10.631 11.724 10.631 11.678 10.677 11.678 C 10.722 11.678 10.722 11.631 10.722 11.631 L 19.658 1.813 C 20.066 1.399 20.112 0.753 19.749 0.292 C 19.386 -0.076 18.796 -0.076 18.434 0.292 C 18.388 0.338 18.388 0.338 18.388 0.384 L 9.996 9.603 L 1.605 0.384 C 1.287 -0.031 0.697 -0.
958076 0.334 0.2 C 0.289 0.2 0.289 0.246 0.244 0.246 C -0.119 0.707 -0.074 1.352 0.334 1.767 L 9.27 11.631 L 9.316 11.678 C 9.316 11.678 9.316 11.724 9.361 11.724 C 9.497 11.908 9.724 12.001 9.996 12.001 C 9.951 12.001 9.996 12.001 9.996 12.001 Z" />'; 959 htmlHide += '</svg>'; 960 htmlHide += '</a>'; 961 htmlHide += '<span class="close"></span>'; 962 htmlHide += '<ul class="dropdown-menu">'; 963 htmlHide += '</ul>'; 964 htmlHide += '</div>'; 965 htmlHide += '</td>'; 966 } 967 htmlHide += '</tr>'; 968 htmlHide += '</tbody>'; 969 htmlHide += '</table>'; 970 htmlHide += '</div>'; 971 htmlHide += '</nav>'; 972 htmlHide += '</div>'; 973 htmlHide += '<div class="programm__table-text">'; 974 htmlHide += '<div class="scrollbar gray-skin">'; 975 htmlHide += '<p class="mb10">'; 976 htmlHide += text; 977 htmlHide += '</p>'; 978 htmlHide += '<p>'; 979 htmlHide += 'пÑогÑÐ°Ð¼Ð¼Ñ Ð²ÐµÐ´ÐµÑ: '+ gid; 980 htmlHide += '</p>'; 981 htmlHide += '</div>'; 982 /*htmlHide += '<div class="programm__table-cost">'; 983 htmlHide += '<h5 class="color__dark bold">СÑоимоÑÑÑ Ð±Ð¸Ð»ÐµÑов:</h5>'; 984 htmlHide += '<p class="programm__table-p">'; 985 htmlHide += '<span>'+price+'Ñ.</span>' + priceText; 986 htmlHide += '</p>'; 987 htmlHide += '<p class="programm__table-p">'; 988 htmlHide += '<span>350Ñ.</span> - взÑоÑлÑм'; 989 htmlHide += '</p>'; 990 htmlHide += '<p class="programm__table-p">'; 991 htmlHide += '<span>100Ñ.</span> - многодеÑнÑм ÑемÑÑм / инвалидам'; 992 htmlHide += '</p>'; 993 htmlHide += '<p class="programm__table-p">'; 994 htmlHide += '<span>150Ñ.</span> - гÑÑппам из ÐеноблаÑÑи и более 50 Ñеловек'; 995 htmlHide += '</p>'; 996 htmlHide += '<p class="programm__table-p color__red">Ðа каждÑе 10 деÑей - 1 взÑоÑлÑй беÑплаÑно!</p>'; 997 htmlHide += '</div>';*/ 998 htmlHide += '</div>'; 999 htmlHide += '</div>'; 1000 htmlHide += '</div>'; 1001 htmlHide += '</div>'; 1002 htmlHide += '</td>'; 1003 htmlHide += '</tr>'; 1004 $('.schedule-list .firstTbody').append($html); 1005 $('.schedule-list .firstTbody').append(htmlHide); 1006 $('.hall-checkbox, .category-checkbox, .filter-input, .amount-filter-input').trigger("change"); 1007 }); 1008 1009 $('.dropdown-toggle').click(function(){ 1010 if ($(this).parent().hasClass('open')) { 1011 $(this).parent().removeClass('open'); 1012 } else { 1013 $(this).parent().addClass('open'); 1014 } 1015 }); 1016 1017 $('.td__title a').click(function () { 1018 var doted = $(this).parents('tr').next().find('.nav-main-collapse'); 1019 if ($(this).hasClass('open')) { 1020 $(this).parents('tr').next().find('.info__table-detail').slideUp(300); 1021 $(this).removeClass('open'); 1022 CheckTopMenuDotted(doted); 1023 } else { 1024 $(this).parents('tr').next().find('.info__table-detail').slideDown(300); 1025 $(this).addClass('open'); 1026 CheckTopMenuDotted(doted); 1027 $(".scrollbar").customScrollbar("resize", true); 1028 } 1029 }); 1030 resize(); 1031 $(".filter-input.active").trigger("change"); 1032 $('.loader_layout').hide() 1033 }); 1034 } 1035 } 1036 1037 function getWeekend(date){ 1038 $.getJSON('/ajax/getWeekend.php', {date: date}, function(date){ 1039 createDaysList(date); 1040 }); 1041 } 1042 1043 function in_array(needle, haystack, strict) { 1044 1045 var found = false, key, strict = !!strict; 1046 1047 for (key in haystack) { 1048 if ((strict && haystack[key] === needle) || (!strict && haystack[key] == needle)) { 1049 found = true; 1050 break; 1051 } 1052 } 1053 1054 return found; 1055 } 1056 1057 function filterCheckbox(value){ 1058 value.length = Object.keys( value ).length; 1059 var count = 0; 1060 $('.schedule-list-check ,.subscriptions-list-check').each(function(i,e){ 1061 var whomS = "ÐомÑ", hall = $(e).data('hall'), age = $(e).data('age'), category = $(e).data('category'), c_from = $(e).data("c-from"), c_to = $(e).data("c-to"); 1062 try { 1063 var data = $.parseJSON(age); 1064 } catch (e) { 1065 var data = age; 1066 } 1067 age = data; 1068 if($(e).data('whom')) { 1069 whomS = $(e).data('whom'); 1070 } 1071 var show = true; 1072 for(var key in value){ 1073 switch(key){ 1074 case "for":{ 1075 if(whomS.indexOf(value[key])==-1&&value[key]!="ÐомÑ"){ 1076 show = false; 1077 } 1078 }break; 1079 case "hall":{ 1080 if(!in_array(hall, value[key])&&hall != value[key]){ 1081 show = false; 1082 } 1083 }break; 1084 case "age":{ 1085 if(!in_array(value[key],age)&&age != value[key]&&value[key]!="ÐозÑаÑÑ"){ 1086 show = false; 1087 } 1088 }break; 1089 case "category":{ 1090 if(show){ 1091 var local_show = false; 1092 $.each(value[key],function(index,elem){ 1093 if(category.indexOf(elem)!==-1||category==""){ 1094 local_show = true; 1095 } 1096 }); 1097 show = local_show; 1098 } 1099 }break; 1100 case "afi":{ 1101 if(value[key]["min"]<c_from||value[key]["min"]>c_to){ 1102 show = false; 1103 } 1104 if(typeof(value[key]["max"])!="endefined"){ 1105 if(value[key]["max"]>c_to||value[key]["min"]>=c_to){ 1106 show = false; 1107 } 1108 } 1109 }break; 1110 } 1111 } 1112 1113 if(show){ 1114 $(e).show(); 1115 count++; 1116 }else{ 1117 $(e).hide(); 1118 $(e).find('.td__title a').removeClass('open'); 1119 $(e).next().find('.info__table-detail').slideUp(300); 1120 } 1121 }); 1122 $('#subscriptions__filter').text('ÐÑбÑано: '+count); 1123 } 1124 1125 function filterWhom(value){ 1126 $('.schedule-list-check').each(function(i,e){ 1127 if($(e).data('whom') != value) { 1128 $(e).hide(); 1129 } else { 1130 $(e).show(); 1131 } 1132 }); 1133 } 1134 /* --------------------------------------------------------------------- */ 1135 1136 1137 1138 /* ÑабоÑа Ñ input[type=file] */ 1139 1140 $('input[type=file]').each(function (e) { 1141 var value = $(this).attr('placeholder'); 1142 $(this).parents('.jq-file').find('.jq-file__browse').text(value); 1143 }); 1144 1145 /* --------------------------------------------------------------------- */ 1146 1147 1148 1149 /* ÑабоÑа Ñ Ñабами */ 1150 1151 $('.goups__list__tab-a').click(function () { 1152 var data__tab = $(this).attr('data-tab'); 1153 var tabs__content = $(this).parents('.goups__list__tab').next(); 1154 1155 $(this).parents('.goups__list__tab').find('.goups__list__tab__item').removeClass('active__tab'); 1156 $(this).parent().addClass('active__tab'); 1157 1158 tabs__content.find('.tabs__content-info').removeClass('tabs__content-active'); 1159 tabs__content.find('.' + data__tab).addClass('tabs__content-active'); 1160 }); 1161 1162 $('.dropdown-toggle').click(function(){ 1163 if ($(this).parent().hasClass('open')) { 1164 $(this).parent().removeClass('open'); 1165 } else { 1166 $(this).parent().addClass('open'); 1167 } 1168 }); 1169 1170 /* --------------------------------------------------------------------- */ 1171 1172 1173 1174 1175 /* ÑабоÑа Ñ Ð²ÑплÑваÑÑими ÑоÑмами */ 1176 1177 $('.partner__list__item').click(function () { 1178 if ($(this).hasClass('open')) { 1179 $('.partner__list__item').removeClass('open'); 1180 $(this).removeClass('open'); 1181 $(this).find('.partner__list__info').fadeOut('show'); 1182 } else { 1183 $('.partner__list__item').removeClass('open'); 1184 $(this).addClass('open'); 1185 $('.partner__list__info').fadeOut('show'); 1186 $(this).find('.partner__list__info').fadeIn('show'); 1187 } 1188 }); 1189 1190 /* --------------------------------------------------------------------- */ 1191 1192 1193 1194 /* ÑабоÑа Ñ Ð¾ÑкÑÑваÑÑимиÑÑ ÑкÑÑÑÑми обÑекÑами */ 1195 1196 $('.a__detail').click(function () { 1197 if ($(this).hasClass('open')) { 1198 $(this).next().fadeOut('show'); 1199 $(this).removeClass('open'); 1200 } else { 1201 $(this).next().fadeIn('show'); 1202 $(this).addClass('open'); 1203 } 1204 }); 1205 1206 $('.planetarium__img .that__map').mouseover(function () { 1207 $(this).parent().find('.planetarium__img-butt').addClass('hover'); 1208 }).mouseout(function () { 1209 $(this).parent().find('.planetarium__img-butt').removeClass('hover'); 1210 }); 1211 1212 /* --------------------------------------------------------------------- */ 1213 1214 1215 1216 /* ÑабоÑа Ñ ÐºÐ°ÑÑой */ 1217 1218 /*function initialize() { 1219 var myLatlng = new google.maps.LatLng(59.9551,30.3117); 1220 var myOptions = { 1221 zoom: 16, 1222 center: myLatlng, 1223 mapTypeId: google.maps.MapTypeId.ROADMAP 1224 } 1225 var map = new google.maps.Map(document.getElementById("map_place"), myOptions); 1226 1227 var contentString = '<div id="content">ТÑÑ Ð²ÑÑ Ñо пÑо ÑÑо должно бÑÑÑ ÑаÑÑказано</div>'; 1228 var infowindow = new google.maps.InfoWindow({ 1229 content: contentString 1230 }); 1231 1232 var markerImage = new google.maps.MarkerImage( 1233 'images/template/marker.png',
1234 new google.maps.Size(48,72), 1235 new google.maps.Point(0,0), 1236 new google.maps.Point(-11,120) 1237 ); 1238 1239 var marker = new google.maps.Marker({ 1240 position: myLatlng, 1241 icon: markerImage, 1242 map: map, 1243 title: 'СанкÑ-ÐеÑеÑбÑÑгÑкий ÐланеÑаÑий' 1244 }); 1245 1246 google.maps.event.addListener(marker, 'click', function() { 1247 infowindow.open(map,marker); 1248 }); 1249 1250 google.maps.event.addListener(marker, 'click', function() { infowindow.open(map,marker); }); 1251 }*/ 1252 1253 /* --------------------------------------------------------------------- */ 1254 1255 1256 1257 /* ÑабоÑа Ñ ÐºÐ°ÑÑой планиÑаÑиев */ 1258 1259 $('.planetarium__map-a').click(function () { 1260 $('.planetarium__map-a').removeClass('planetarium__map-active'); 1261 $(this).addClass('planetarium__map-active'); 1262 1263 var data_floor = $(this).attr('data-flor'); 1264 $('.planetarium__map-plan').find('.floor').removeClass('floor-active'); 1265 $('.planetarium__map-plan').find('.' + data_floor).addClass('floor-active'); 1266 1267 $('.planetarium__map-plan h2').text('ÐаÑÑа планеÑаÑÐ¸Ñ - ' + $(this).text()); 1268 }); 1269 1270 $('.plan__list-a, .object_map').mouseover(function () { 1271 var data_object = $(this).attr('data-object'); 1272 1273 if ($(this).hasClass('plan__list-a')) { 1274 1275 var floor__menu = $(this).parents('.planetarium__map__item').find('.planetarium__map-a'); 1276 1277 if (!floor__menu.hasClass('planetarium__map-active')) { 1278 $('.planetarium__map-a').removeClass('planetarium__map-active'); 1279 floor__menu.addClass('planetarium__map-active'); 1280 1281 var data_floor = floor__menu.attr('data-flor'); 1282 $('.planetarium__map-plan').find('.floor').removeClass('floor-active'); 1283 $('.planetarium__map-plan').find('.' + data_floor).addClass('floor-active'); 1284 1285 $('.planetarium__map-plan h2').text('ÐаÑÑа планеÑаÑÐ¸Ñ - ' + floor__menu.text()); 1286 } 1287 } 1288 1289 $('.plan__list-a').removeClass('plan__list-active'); 1290 $('.plan__list').find('[data-object = ' + data_object +']').addClass('plan__list-active'); 1291 1292 $('.object_map').attr('data-active', ''); 1293 1294 $('.floor-active').find('[data-object = ' + data_object +']').attr('data-active', 'active'); 1295 $('.floor-active').find('.object_map-text').removeAttr('data-active'); 1296 }); 1297 1298 $('.plan__list-a, .object_map').click(function () { 1299 var data_object = $(this).attr('data-object'); 1300 $('.planetarium__info-object').removeClass('planetarium__info-active'); 1301 $('.planetarium__info').find('.' + data_object).addClass('planetarium__info-active'); 1302 1303 var target = $(this).attr('data-object'); 1304 var target = $(this).attr('data-object').replace(/.+#/g, ''); 1305 var part_top = $('#'+target).offset().top; 1306 $('html, body').animate({scrollTop: part_top + 'px'}, 500); 1307 return false; 1308 }); 1309 1310 if($(".planetarium__map-plan.filter_hall_active").length){ 1311 var active_hall = "."+$(".planetarium__map-plan.filter_hall_active").data("active-hall"); 1312 $(active_hall).trigger("mouseover").trigger("click"); 1313 } 1314 1315 $('.object__stairs').mouseover(function () { 1316 var data_stairs = $(this).attr('data-stairs'); 1317 }); 1318 1319 $('.object_map, .object__stairs').mouseenter(function (e) { 1320 var object__popup = $('.object__popup'); 1321 var name = ''; 1322 var desc = ''; 1323 var data_object = ''; 1324 var left = 0; 1325 var top = 0; 1326 1327 data_object = $(this).attr('data-object'); 1328 1329 var len = data__object.length; 1330 1331 for (var i = 0; i < len; i++) { 1332 if (data_object == data__object[i][0]) { 1333 name = data__object[i][2]; 1334 desc = data__object[i][3]; 1335 left = data__object[i][4]; 1336 top = data__object[i][5]; 1337 break; 1338 } 1339 } 1340 if($(this).attr('class').indexOf("object_map")!=-1){ 1341 name = $("#pl_map_"+data_object).text(); 1342 desc = $("#pl_map_"+data_object).data("desc"); 1343 } 1344 1345 left = parseInt(left); 1346 top = parseInt(top); 1347 1348 if (ww < 1200) { 1349 left = left * 0.771; 1350 top = top * 0.8456; 1351 } 1352 1353 object__popup.find('.object__popup-h4').text(name); 1354 object__popup.find('.object__popup-text').html(desc); 1355 1356 object__popup.css({'left': left + 'px', 'top': top + 'px'}); 1357 1358 object__popup.fadeIn('show'); 1359 }); 1360 1361 $('.object_map, .object__stairs').mouseleave(function () { 1362 var object__popup = $('.object__popup'); 1363 object__popup.hide(); 1364 }); 1365 1366 /* --------------------------------------------------------------------- */ 1367 1368 horizontalparallax();
1369 initialize(); 1370 }); 1371 1372 if($(".vacancies__req").length){ 1373 $(".vacancies__req input:not(.inputfile)").addClass("input"); 1374 $(".vacancies__req textarea").addClass("input textarea"); 1375 } 1376 1377 if($(".sort_btn").length){ 1378 $(".sort_btn").click(function(){ 1379 ds = this; 1380 var ds_class = $(ds).attr("class"); 1381 $(".sort_btn").removeClass("append active"); 1382 $(ds).attr("class",ds_class).addClass("active").toggleClass("append"); 1383 window.first_sort = []; 1384 window.first_sort_time = []; 1385 window.first_sort_time_old = []; 1386 var sortNum = true; 1387 $(".firstTbody .schedule-list-check, .firstTbody .subscriptions-list-check").each(function(index,elem){ 1388 window.first_sort[index] = elem; 1389 sel = $(ds).data("sort"); 1390 if(!isNaN(parseInt($(sel,elem).text()))){ 1391 window.first_sort_time[index] = parseInt($(sel,elem).text()); 1392 window.first_sort_time_old[index] = parseInt($(sel,elem).text()); 1393 }else{ 1394 sortNum = false; 1395 window.first_sort_time[index] = $(sel,elem).text()+"_"+index; 1396 window.first_sort_time_old[index] = $(sel,elem).text()+"_"+index; 1397 } 1398 }); 1399 function sortNumber(a,b) { 1400 return a - b; 1401 } 1402 if(sortNum){ 1403 window.first_sort_time.sort(sortNumber); 1404 }else{ 1405 window.first_sort_time.sort(); 1406 } 1407 $.each(first_sort_time,function(index,elem){ 1408 key = first_sort_time_old.indexOf(elem); 1409 if(key!=-1){ 1410 if($(ds).hasClass("append")){ 1411 next = $(window.first_sort[key]).next(); 1412 $(window.first_sort[key]).appendTo($(".firstTbody")); 1413 $(next).appendTo($(".firstTbody")); 1414 }else{ 1415 next = $(window.first_sort[key]).next(); 1416 $(next).prependTo($(".firstTbody")); 1417 $(window.first_sort[key]).prependTo($(".firstTbody")); 1418 } 1419 } 1420 }) 1421 1422 }); 1423 } 1424 1425 $(window).resize(function () { 1426 resize(); 1427 }); 1428 1429 $('.news__filter input[type="checkbox"]').change(function(){ 1430 if ($(this).val() == 'all') { 1431 $('.news__filter input[type="checkbox"]').each(function(){ 1432 if ($(this).val() != 'all') { 1433 $(this).prop('checked',false).removeAttr('ckecked').trigger('refresh').parents('.news__filter').submit(); 1434 } 1435 }); 1436 } else { 1437 $('.news__filter input[type="checkbox"]').each(function(){ 1438 if ($(this).val() == 'all') { 1439 $(this).prop('checked',false).removeAttr('ckecked').trigger('refresh').parents('.news__filter').submit(); 1440 } 1441 }); 1442 } 1443 1444 }); 1445}); 1446 1447 1448function dateToString(date, day){ 1449 if(typeof(day) == 'undefined'){ 1450 day = true; 1451 } 1452 var curr_date = date.getDate(); 1453 var curr_month = date.getMonth(); 1454 var curr_year = date.getFullYear(); 1455 1456 if(curr_month + 1 < 10) { 1457 var curr_month_cur = '0'+(+curr_month + 1); 1458 } else { 1459 var curr_month_cur = +curr_month + 1; 1460 } 1461 if(day){ 1462 if(curr_date < 10) { 1463 var curr_date_cur = '0'+curr_date; 1464 } else { 1465 var curr_date_cur = curr_date; 1466 } 1467 }else{ 1468 curr_date_cur = "01"; 1469 } 1470 1471 var date = curr_year+'-'+curr_month_cur+'-'+curr_date_cur; 1472 return date; 1473} 1474 1475function datepickerWeekend(cdate) 1476{ 1477 if($.inArray(dateToString(cdate),window.WeekendsDP)!=-1){ 1478 return[false, "", "ÐÑÑ Ð¾Ð´Ð½Ð¾Ð¹"]; 1479 }else{ 1480 return[true, '']; 1481 } 1482}
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.