﻿function ChangePageLanguage(a) { if (a == "RU") { $(".LangRU").show(); $(".LangEN").hide() } else { $(".LangRU").hide(); $(".LangEN").show() } } var technologiesArray = new Array(); technologiesArray[0] = [1, 3, 4, 5, 6, 9, 10, 11]; technologiesArray[1] = [1, 8, 11]; technologiesArray[2] = [1, 3, 9, 11]; technologiesArray[3] = [4, 5, 6, 11]; technologiesArray[4] = [3, 4, 5, 6, 9, 11]; technologiesArray[5] = [8, 11]; var currDvPopup; var mCoordX = 0; var allowList = true; function HidePopupDiv(a) { var b = $(".Links ." + a.attr("class").replace("Popup", "")); a.children(".ListLeft, .ListRight").height(0); a.animate({ width: 0, height: 0, top: b.offset().top + b.height() / 2, left: b.offset().left + b.width() / 2, opacity: 0 }, "slow") } function SetActiveAccordion(c, b) { $(".dvInAccordionHead").removeClass("divActive"); $(".dvInAccordionHead:eq(" + c + ")").addClass("divActive"); var a = b.find("li").filter(function () { return $.inArray($(this).attr("id").replace("Image", "") * 1, technologiesArray[c]) != -1 }); $("#ulTechnologies").quicksand(a) } function ListPopupDiv(a, f, e) { var b = a.attr("class").replace("dv", "").replace("Popup", "") * 1; var i = 0; var d = 0; var c = 0; var h = 0; var g = 0; if (f == "Right") { i = b == 5 ? 1 : b + 1; d = $(window).width(); c = 0; h = 0; g = -$(window).width() } else { i = b == 1 ? 5 : b - 1; d = -$(window).width(); c = 0; h = 0; g = $(window).width() } allowList = false; $(".dv" + i + "Popup").css({ opacity: 1, width: $(window).width(), height: $(window).height(), top: 0, left: d }).animate({ left: c }, { queue: false, complete: function () { $(this).children(".ListLeft, .ListRight").height($(window).height()).children().css("opacity", 0.5); if (f == "Left" && e) { $(this).children(".ListLeft").children().css("opacity", 1) } if (f == "Right" && e) { $(this).children(".ListRight").children().css("opacity", 1) } } }); a.css({ left: h }).animate({ left: g }, { queue: false, complete: function () { $(this).css({ height: 0, width: 0, opacity: 0 }); $(this).children(".ListLeft, .ListRight").height(0); allowList = true } }) } function SetContentZoomAndDivMainPos() { $(".Main").css({ top: $(window).height() / 2 - $(".Main").height() / 2, left: $(window).width() / 2 - $(".Main").width() / 2 }); $(".Content").width($(window).width()); var a = Math.round($(window).height() / 100) / 10 + 0.1; $(".Content").children().css({ zoom: a, "-moz-transform": a }); if (window.orientation == 0 || window.orientation == 180) { $(".Content").children().css({ zoom: 0.5 }) } } function ResizeWindow() { $(".Popup").children().filter(function () { return $(this).width() > 0 }).css({ top: 0, left: 0, width: $(window).width(), height: $(window).height() }); $(".btnList").css("margin-top", $(window).height() / 2 - 25); SetContentZoomAndDivMainPos() } $(function () { ChangePageLanguage("RU"); $(".Popup").disableTextSelect(); $(".btnList").css("margin-top", $(window).height() / 2 - 25); SetContentZoomAndDivMainPos(); $(window).resize(function () { ResizeWindow() }); $(document).touchme({ isDetectHorizontalMovement: true, wipeRight: function (b) { if (allowList && $(".Popup").children().filter(function () { return $(this).width() > 0 }).size() > 0) { currDvPopup = $(".Popup").children().filter(function () { return $(this).width() > 0 }); ListPopupDiv(currDvPopup, "Left", false) } }, wipeLeft: function (b) { if (allowList && $(".Popup").children().filter(function () { return $(this).width() > 0 }).size() > 0) { currDvPopup = $(".Popup").children().filter(function () { return $(this).width() > 0 }); ListPopupDiv(currDvPopup, "Right", false) } } }); window.onorientationchange = function () { ResizeWindow() }; var a = $("#ulTechnologies").clone(); $("#dvAccordion").accordion({ autoHeight: false, active: 0, change: function (c, d) { var b = $(this).find("a").index(d.newHeader[0]); SetActiveAccordion(b, a) } }); SetActiveAccordion(0, a); $("#btnLangRU").attr("class", "btnLangRUA").click(function () { if ($(this).attr("class") == "btnLangRU") { $("#btnLangRU").attr("class", "btnLangRUA"); $("#btnLangEN").attr("class", "btnLangEN"); ChangePageLanguage("RU") } }); $("#btnLangEN").attr("class", "btnLangEN").click(function () { if ($(this).attr("class") == "btnLangEN") { $("#btnLangRU").attr("class", "btnLangRU"); $("#btnLangEN").attr("class", "btnLangENA"); ChangePageLanguage("EN") } }); $(".Links .dvLink").mouseover(function () { $(this).dropShadow({ left: 0, top: 0, blur: 4, opacity: 1, color: "#8c8c8c" }) }).mouseout(function () { $(this).removeShadow() }).click(function (c) { var b = $(c.target).attr("class"); if (b == "Padding" || b == "LangRU" || b == "LangEN") { b = $(c.target).parent().attr("class") } b = b.split(" ")[1]; $(".Popup ." + b + "Popup").children(".ListLeft, .ListRight").children().css("opacity", 0.5); $(".Popup ." + b + "Popup").css({ top: $(c.target).offset().top + $(c.target).height() / 2, left: $(c.target).offset().left + $(c.target).width() / 2, opacity: 0 }).animate({ width: $(window).width(), height: $(window).height(), top: 0, left: 0, opacity: 1 }, "slow", function () { $(this).children(".ListLeft, .ListRight").height($(window).height()) }) }); $(".btnList").click(function (c) { var d = $(c.target).parent().parent(); var b = $(c.target).parent().attr("class").replace("List", ""); ListPopupDiv(d, b, true); c.stopPropagation() }); $(".btnClose").click(function (b) { HidePopupDiv($(b.target).parent().parent()); b.stopPropagation() }); $(".ListLeft, .ListRight").children().mouseenter(function () { $(this).animate({ opacity: 1 }, { queue: false, duration: "fast" }) }).mouseleave(function () { $(this).animate({ opacity: 0.5 }, { queue: false, duration: "fast" }) }); $(".btnClose").css("opacity", 0.5); $(".btnClose").mouseenter(function () { $(this).fadeTo("fast", 1) }).mouseleave(function () { $(this).fadeTo("fast", 0.5) }); $(".Popup").children().mousedown(function (c) { if (allowList) { mCoordX = c.pageX; var b = $(c.target); while (b.attr("class").indexOf("Popup") == -1) { b = b.parent() } currDvPopup = b } }); $(document).mouseup(function (c) { var b = c.pageX; if (mCoordX != 0 && Math.abs(b - mCoordX) > 30) { if (b - mCoordX > 0) { ListPopupDiv(currDvPopup, "Left", false) } else { ListPopupDiv(currDvPopup, "Right", false) } } mCoordX = 0 }); $(document).keydown(function (b) { var c; if ($(".Popup").children().filter(function () { return $(this).width() > 0 }).size() > 0) { c = $(".Popup").children().filter(function () { return $(this).width() > 0 }); if (b.which == 27) { HidePopupDiv(c) } else { if (allowList) { if (b.which == 37) { ListPopupDiv(c, "Left", false) } if (b.which == 39) { ListPopupDiv(c, "Right", false) } } } } }) });
