﻿(function ($) {
    $(function () {
        PageSize();
        $(window).resize(function () {
            PageSize();
        });
        $(".banner").nivoSlider({
            effect: 'fade',
            controlNav: false,
            pauseOnHover: false,
            directionNav: false,
            directionNavHide: false,
            pauseTime: 5000
        });
        $(".company").css({ backgroundPosition: '30px 5px' });
        $(".services").css({ backgroundPosition: '30px 5px' });
        $(".quotations").css({ backgroundPosition: '30px 5px' });
        $(".trackingCheck").css({ backgroundPosition: '30px 5px' });
        $(".technicalInformation").css({ backgroundPosition: '30px 5px' });
        $(".contactUs").css({ backgroundPosition: '30px 5px' });
        $(".menu li a").mouseenter(function () {
            $(this).stop().animate({ backgroundPosition: "(20px 5px)" }, 200);
        }).mouseleave(function () {
            $(this).stop().animate({ backgroundPosition: "(30px 5px)" }, 200);
        });
        $(".siteMap a").click(function () {
            if ($(".siteMapList").is(":hidden")) {
                $(".siteMapList").slideDown(1, function () {
                    PageSize();
                    $("html, body").animate({ scrollTop: $(document).height() }, 1);
                });
            } else {
                $(".siteMapList").slideUp(1, function () {
                    PageSize();
                    $("html, body").animate({ scrollTop: $(document).height() }, 1);
                });
            }
        });
        var liSoma = 0;
        $(".siteMapList").css("display", "block");
        $(".siteMapList ul li").each(function (index) {
            liSoma += $(this).outerWidth();
        });
        var margin = (parseInt((($(".siteMapList").innerWidth() - liSoma) / $(".siteMapList ul li").length) / 2));
        $(".siteMapList ul li").each(function (index) {
            $(this).css({ 'margin-left': margin + 'px', 'margin-right': margin + 'px' });
        });
        $(".siteMapList").css("display", "none");
    });
})(jQuery);
function PageSize() {
    var h;
    var r = ($("#pageTop").outerHeight(true) + $("#pageBottom").outerHeight(true));
    if (($("#container").outerHeight(true) + r) < $(window).height()) {
        $("#page").height("0px");
        h = ($(window).height() - r) + "px";
        $("#page").height(h);
    }
    else {
        $("#page").height("0px");
        h = ($("#container").height() + "px");
        $("#page").height(h);
    }
}
function getURLRoot() {
    var rootURL = document.location.protocol + "//" + document.location.host
    return rootURL
}
