1var Menu = new Array('news', 'afisha', 'services', 'info', 'shop'); 2var tClose; 3 4function addHandler(element,event,action,param){ 5 if(document.addEventListener)element.addEventListener(event,action,param); 6 else if(document.attachEvent)element.attachEvent('on'+event,action); 7 else element['on'+event]=action; 8} 9 10function GetValue(Offset){ 11 var End=document.cookie.indexOf (";", Offset); 12 if (End==-1) 13 End=document.cookie.length; 14 return unescape(document.cookie.substring(Offset, End)); 15} 16 17function GetCookie(Name){ 18 var Len=Name.length; 19 var i=0; 20 while (i<document.cookie.length){ 21 var j=i+Len+1; 22 if (document.cookie.substring(i,j)==(Name+"=")) return GetValue(j); 23 //i=document.cookie.indexOf(" ", 1)+1; 24 i++; 25 if (i==0) return ''; 26 } 27 return ''; 28} 29 30 31function SetCookie(Name,Value,Expire){ 32 var todayDate=new Date(); 33 todayDate.setDate(todayDate.getDate()+Expire); 34 document.cookie=Name+"="+escape(Value)+";path=/;expires="+todayDate.toGMTString(); 35} 36 37 38function show_menu (id) { 39 stop_tClose(); 40 $('#main_menu').removeClass('active-all'); 41 for (var i=0;i<Menu.length;i++) 42 if (! id || id == Menu[i]) {$('#'+Menu[i]).show()} else {$('#'+Menu[i]).hide()}; 43} 44 45function show_all_menu () { 46 $('#main_menu').addClass('active-all'); 47 for (var i=0;i<Menu.length;i++) 48 $('#'+Menu[i]).show(); 49} 50 51function close_menu () { 52 $('#main_menu').removeClass('active-all'); 53 for (var i=0;i<Menu.length;i++) 54 $('#'+Menu[i]).hide(); 55 56} 57 58function is_selected_menu (obj) { 59 if (! obj || ! obj.id) return 0; 60 if (obj.id == 'all') return 1; 61 for (var i=0;i<Menu.length;i++) 62 if (Menu[i] == obj.id && obj.style.display == 'block') { 63 return 1; 64 } 65} 66 67function stop_tClose (id) { 68 if (id && $('#'+id) && ! is_selected_menu(document.getElementById(id))) return; 69 if (tClose) clearTimeout(tClose); 70} 71 72function delay_tClose (id) { 73 if (id && $('#'+id) && ! is_selected_menu(document.getElementById(id))) return; 74 if (tClose) clearTimeout(tClose); 75 tClose = setTimeout("close_menu()",2000); 76} 77 78function closeMenu(e){ 79 e=e||event; 80 var target=e.target||e.srcElement; 81 var obj = target; 82 while(true) { 83 if (obj != document && (!obj.id || (! is_selected_menu(obj) && obj.id != 'menu_link' && ! (obj.id == 'main_menu' && obj.className == 'subnav active-all') ))) { 84 obj = obj.parentNode; 85 } else { 86 if(obj == document) { 87 break; 88 } else { 89 return; 90 } 91 } 92 } 93 try{ 94 close_menu(); 95 } catch(sErr) { 96 97 } 98} 99 100 101addHandler(document,'click',closeMenu,false); 102 103 104function setHeight() { 105 var b1 = document.getElementById('block-one1'); 106 var b2 = document.getElementById('block-two1'); 107 if (!b1 || !b2) return; 108 var h1 = b1.offsetHeight; 109 var h2 = b2.offsetHeight; 110 if (h1 > h2) { 111 b2.style.height = (h1) + 'px'; 112 b1.style.height = (h1) + 'px'; 113 }else if (h1 < h2) { 114 b1.style.height = (h2) + 'px'; 115 b2.style.height = (h2) + 'px'; 116 } 117} 118 119 120function closeAuth(e){ 121 e=e||event; 122 var target=e.target||e.srcElement; 123 var obj = target; 124 while(true) { 125 if (obj != document && (obj.id != "autorization" && obj.className != "autorize-container")) { 126 obj = obj.parentNode; 127 } else { 128 if(obj == document) { 129 break; 130 } else { 131 return; 132 } 133 } 134 } 135 try{ 136 $('#autorize').hide(); 137 $('#autorize_forum').hide(); 138 } catch(sErr) { 139 140 } 141} 142 143addHandler(document,'click',closeAuth,false); 144 145function closePoll(e){ 146 e=e||event; 147 var target=e.target||e.srcElement; 148 var obj = target; 149 while(true) { 150 if (obj != document && (!obj.id || (obj.id != "poll"))) { 151 obj = obj.parentNode; 152 } else { 153 if(obj == document) { 154 break; 155 } else { 156 return; 157 } 158 } 159 } 160 try{ 161 $('#poll_active').hide(); 162 $('#poll_b').css('visibility','visible'); 163 $('#poll_b table.shadow').removeClass('shadow_hide'); 164 } catch(sErr) { 165 166 } 167} 168 169addHandler(document,'click',closePoll,false); 170 171function closeCities(e){ 172 e=e||event; 173 var target=e.target||e.srcElement; 174 var obj = target; 175 while(true) { 176 if (obj != document && (obj.id != "city_select" && obj.className != "city_select")) { 177 obj = obj.parentNode; 178 } else { 179 if(obj == document) { 180 break; 181 } else { 182 return; 183 } 184 } 185 } 186 try{ 187 $('#portal_list').hide(); 188 } catch(sErr) { 189 190 } 191} 192 193addHandler(document,'click',closeCities,false); 194 195 196function calc_textarea_chars(obj, notif_name, max_len){ 197 var message = obj.value; 198 if (message.length > max_len) 199 { 200 obj.value = message.substr(0,max_len); 201 } 202 var ostatok = max_len - message.length; 203 $('#'+notif_name).text((ostatok > 0 ? ostatok : 0)); 204} 205 206function get_ajax(id, url) { 207 url = prefix+url; 208 if ($('#'+id).css('display') == 'none') { 209 $.ajax({ 210 type: "GET", 211 url: url, 212 data: {}, 213 cache: false, 214 success: function(msg){ 215 $('#'+id).html(msg); 216 $('#'+id).show(); 217 $('#'+id +' > :first :input').focus(); 218 } 219 }); 220 } else { 221 $('#'+id).hide(); 222 } 223 return false;
224} 225 226function reget_captcha() { 227 $.ajax({ 228 cache: false, 229 type: "GET", 230 url: prefix+'/cgi-bin/ajax/reget_captcha.cgi', 231 data: {}, 232 success: function(code){ 233 $('.captcha_img').attr('src', prefix+'/pictures/captcha/'+code+'.png'); 234 } 235 }); 236 237} 238 239 240function show_popup(url) { 241 if (! url) return; 242 url = prefix+url+'&'+Math.random(); 243 $('#div_to_popup').load(url); 244 //get_ajax('div_to_popup', url); 245 $('#div_to_popup').dialog({title: "Êàäðèðîâàíèå èçîáðàæåíèÿ", modal: true, width: 1024, height:670, close: function( event, ui ) { 246 if (typeof ias != "undefined") ias.cancelSelection(); 247 $('#div_to_popup').html(''); 248 $('#div_to_popup').hide(); 249 } 250 }); 251} 252 253function register_next_prev(e) { 254 var code; 255 if (!e) var e = window.event; 256 if (e.keyCode) code = e.keyCode; else if (e.which) code = e.which; 257 258 if ((code == 37 || code == 188) && (e.ctrlKey == true)) { 259 var destination = document.getElementById('prev'); 260 if (destination) document.location.href = destination.href; 261 } 262 if ((code == 39 || code == 190) && (e.ctrlKey == true)) { 263 var destination = document.getElementById('next'); 264 if (destination) document.location.href = destination.href; 265 } 266} 267 268 269$(function () { 270 var own_region = false; 271 $('#input_city,#geolog_address_city').autocomplete({ 272 create: function( event, ui ) { 273 own_region = $(this).hasClass('region'); 274 return true; 275 }, 276 source: function(request,response) { 277 $('#log').text(''); 278 $.ajax({ 279 url: prefix+"/cgi-bin/ajax/geobase_cities.cgi", 280 dataType: "json", 281 data: { 282 name: request.term, 283 only_region: own_region 284 }, 285 success: function(data) { 286 if (! data.length) { 287 //$('#log').text('Òàêîãî ãîðîäà íåò â íàøåé áàçå'); 288 //$('#region_id').val(''); 289 } 290 response($.map(data, function(item) { 291 return { 292 label: item.title, 293 value: item.id, 294 text: (item.text ? item.text : item.title), 295 } 296 })); 297 } 298 }); 299 }, 300 focus: function(event, ui) { 301 $(this).val(ui.item.label); 302 $('#input_city_id').val(ui.item.value); 303 return false; 304 }, 305 306 select: function(event,ui) { 307 $(this).val(ui.item.label); 308 $('#input_city_id').val(ui.item.value); 309 return false; 310 } 311 }); 312}); 313 314$(function () { 315 $('#input_street,#geolog_address_street').autocomplete({ 316 source: function(request,response) { 317 $('#log_street').text(''); 318 $.ajax({ 319 url: prefix+"/cgi-bin/ajax/geobase_streets.cgi", 320 dataType: "json", 321 data: { 322 name: request.term, 323 parent: $('#input_city_id').val(), 324 }, 325 success: function(data) { 326 if (! data.length) { 327 //$('#log').text('Òàêîãî ãîðîäà íåò â íàøåé áàçå'); 328 //$('#region_id').val(''); 329 } 330 response($.map(data, function(item) { 331 return { 332 label: item.title, 333 value: item.id, 334 text: (item.text ? item.text : item.title), 335 } 336 })); 337 } 338 }); 339 }, 340 focus: function(event, ui) { 341 $(this).val(ui.item.label); 342 $('#input_street_id').val(ui.item.value); 343 //$('#region_id').val(ui.item.value); 344 return false; 345 }, 346 347 select: function(event,ui) { 348 $(this).val(ui.item.label); 349 $('#input_street_id').val(ui.item.value); 350 //$('#region_id').val(ui.item.value); 351 return false; 352 } 353 }); 354}); 355 356$(function () { 357 358 $('.input_profession').autocomplete({ 359 delay:200, 360 minLength: 1, 361 source: function(request,response) { 362 $('#log_street').text(''); 363 $.ajax({ 364 url: prefix+"/cgi-bin/ajax/professions.cgi", 365 dataType: "json", 366 data: { 367 name: request.term, 368 }, 369 success: function(data) { 370 if (! data.length) { 371 $('.input_profession').addClass('red'); 372 } else { 373 $('.input_profession').removeClass('red'); 374 } 375 response($.map(data, function(item) { 376 return { 377 label: item.title, 378 value: item.id, 379 } 380 })); 381 } 382 }); 383 }, 384 }); 385}); 386 387function show_geolog_form(lat,lng,zoom,no_map,show_info) { 388 if (! no_map) no_map=''; if (! show_info) show_info=''; 389 390 if (! lat && $('#input_lat').val()) lat = $('#input_lat').val(); 391 if (! lng && $('#input_lng').val()) lng = $('#input_lng').val(); 392 if (! zoom && $('#input_zoom').val()) zoom = $('#input_zoom').val(); 393 394 //if (! $('#input_lat').val()) { 395 // if (! lat) lat = GetCookie('GEO_LAT'); 396 // if (! lng) lng = GetCookie('GEO_LNG'); 397 //} 398 399 $('#div_geolog').html(''); 400 401 402 var url = prefix+'/cgi-bin/ajax/show_geolog_form.cgi?lat='+lat+'&lng='+lng+'&zoom='+zoom+'&no_map='+no_map+'&show_info='+show_info+'&rand='+Math.random()+'&dd'; 403 $('#div_geolog').load(url); 404 $('#div_geolog').show(); 405} 406 407/* 408function fix_rambler_position() { 409 if (typeof vk !=="undefined"){ 410 VK.addCallback('onScrollTop', function(scroll){ 411 //alert(scroll); 412 scroll += 300; 413 setTimeout(function() { 414 $('#afishaWidgetContainer').css('top',scroll+'px'); 415 }, 100); 416 }); 417 418 VK.callMethod('scrollTop'); 419 420 } 421 422} 423 424function fix_kinohod_position() { 425 if (typeof vk !=="undefined"){ 426 427 VK.addCallback('onScrollTop', function(scroll){ 428 //alert(scroll); 429 setTimeout(function() {
430 $('#khBoxOffice').css('top',scroll+'px'); 431 }, 100); 432 }); 433 VK.callMethod('scrollTop'); 434 } 435 436} 437*/ 438 439 440function getCoords(elem) { 441 var box = elem.getBoundingClientRect(); 442 443 var body = document.body; 444 var docElem = document.documentElement; 445 446 var scrollTop = window.pageYOffset || docElem.scrollTop || body.scrollTop; 447 var scrollLeft = window.pageXOffset || docElem.scrollLeft || body.scrollLeft; 448 449 var clientTop = docElem.clientTop || body.clientTop || 0; 450 var clientLeft = docElem.clientLeft || body.clientLeft || 0; 451 452 var top = box.top + scrollTop - clientTop; 453 var left = box.left + scrollLeft - clientLeft; 454 455 return { top: Math.round(top), left: Math.round(left) }; 456} 457 458 459function accept_cookies() { 460 if (GetCookie("accept_cookies")) return; 461 462 var $block = $('.cookies_info'); 463 $block.prepend('<button>Ïðèíÿòü</button>').delay( 2000 ).fadeIn(1000); 464 $block.show(); 465 $block.delegate('button', 'click', function() { 466 SetCookie("accept_cookies", 1); 467 $block.fadeOut(1000); 468 }); 469}
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.