Ремонт дорожного полотна на главных магистралях города к началу зимнего сезона практически завершен, сообщает var photo_items = document.getElementsByClassName("overlay"); var cnt_items = parseInt(photo_items.length) + 0; var select_img_ix = 0; document.onkeydown = function(evt) { evt = evt || window.event; if (evt.keyCode == 27) { var id_obj = document.getElementsByClassName('overlay-show')[0].id; hide_img(id_obj); } }; function hide_img(id_obj){ document.getElementById(id_obj).className = ""; document.getElementById(id_obj).className = "overlay"; } function show_img(id_obj){ document.getElementById(id_obj).className = ""; document.getElementById(id_obj).className = "overlay-show"; } function rew_img(id_obj){ hide_img(id_obj); num_img = parseInt(id_obj.substring(4)) + 0; select_img_ix = num_img - 1; if (select_img_ix <= 0) { select_img_ix = cnt_items }; show_img('pic-' + select_img_ix); }; function frw_img(id_obj){ hide_img(id_obj); num_img = parseInt(id_obj.substring(4)) + 0; select_img_ix = num_img + 1; if (select_img_ix > cnt_items) { select_img_ix = 1 }; show_img('pic-' + select_img_ix); };