slidingNow = 0; resizingArr = Array(); resizingArr['1'] = 0; resizingArr['2'] = 0; function hideIndexBanner(a) { indexBannerHeight = a - 20; if (indexBannerHeight > -1) { document.all.index_banner.style.height = indexBannerHeight; setTimeout('hideIndexBanner(' + indexBannerHeight + ')', '1'); } else { document.all.index_banner.style.height = 0; document.all.index_banner.style.display = 'none'; } } function switchActiveActions() { var liArr = document.all.index_banner_actions.getElementsByTagName('li'); for (var a = 0, b = liArr.length; a < b; a++) { liArr[a].style.display = (liArr[a].style.display == 'none') ? '' : 'none'; } } function checkResize() { if (document.all.slider_2) { if (resizingArr['2'] == 0) { document.all.slider_2.style.width = 1; document.all.slider_2.style.width = document.all.slider_2.parentNode.offsetWidth; resizeSlider(document.all.slider_2, 40, 2); } } if (document.all.slider_1) { if (resizingArr['1'] == 0) { document.all.slider_1.style.width = 1; document.all.slider_1.style.width = document.all.slider_1.parentNode.offsetWidth; resizeSlider(document.all.slider_1, 18, 1); } } } function resizeSlider(obj, min_padding, resizing_arr) { resizingArr[resizing_arr] = 1; var table = obj.getElementsByTagName('table')[0]; var currentAreaWidth = obj.offsetWidth; var availableCellsAmount = 0; var availableCellsWidth = 0; for (var a = 0, b = table.rows[0].cells.length; a < b; a++) { if (availableCellsWidth + table.rows[0].cells[a].offsetWidth + min_padding <= currentAreaWidth) { availableCellsAmount++; availableCellsWidth += (table.rows[0].cells[a].offsetWidth + min_padding); } else { break; } } var availablePadding = Math.ceil(((currentAreaWidth - availableCellsWidth) / availableCellsAmount) + min_padding); for (var a = 0, b = table.rows[0].cells.length; a < b; a++) { table.rows[0].cells[a].style.paddingRight = availablePadding; } resizingArr[resizing_arr] = 0; } function slideArea(obj, direction) { if (slidingNow == 1) { return; } slidingNow = 1; currentSlideObject = document.all[obj].getElementsByTagName('table')[0]; var slideAmount = currentSlideObject.rows[0].cells[0].clientWidth; currentSliderPosition = getStyleSize(currentSlideObject.style.left); nextSliderPosition = (direction == -1) ? currentSliderPosition - slideAmount : currentSliderPosition + slideAmount; currentSliderDirection = direction * 6; var tableWidth = currentSlideObject.clientWidth; var divWidth = document.all[obj].clientWidth; if ((getPlusValue(nextSliderPosition) + divWidth >= tableWidth && direction == -1) || (currentSliderPosition >= 0 && direction == 1)) { slidingNow = 0; return; } slideAreaTurn(); } function slideAreaTurn() { if ((currentSliderDirection < 0 && currentSliderPosition > nextSliderPosition) || (currentSliderDirection > 0 && currentSliderPosition < nextSliderPosition)) { currentSlideObject.style.left = currentSliderPosition; setTimeout('slideAreaTurn()', '20'); currentSliderPosition += currentSliderDirection; } else { slidingNow = 0; } } function getStyleSize(parameter) { return Number(parameter.substring(0, parameter.length - 2)); } function getPlusValue(value) { var value = value + ''; if (value.substring(0, 1) == '-') { return Number(value.substring(1)); } else { return Number(value); } }