/Navigate to update-browser if browser not supported*/
var _NavInfo = navigatorInfo().toLowerCase();
if ((_NavInfo.search(\"msie\") >= 0 && parseInt(_NavInfo.replace(\"msie\", \"\")) < 9) // Change IE version here
    || (_NavInfo.search(\"firefox\") >= 0 && parseInt(_NavInfo.replace(\"firefox\", \"\").trim()) < 3) // Change firefox version(3) here 
    || (_NavInfo.search(\"chrome\") >= 0 && parseInt(_NavInfo.replace(\"chrome\", \"\").trim()) < 10) // Change chrome version(10) here 
    || (_NavInfo.search(\"safari\") >= 0 && parseInt(_NavInfo.replace(\"safari\", \"\").split(\' \')[2].trim()) < 2) // Change safari version(2) here 
    || (_NavInfo.search(\"opera\") >= 0 && parseInt(_NavInfo.replace(\"opera\", \"\").split(\' \')[2].trim()) < 10) // Change oprea version(10) here 
    ) {
    window.location = \"update-browser.html\";
}

function navigatorInfo() {
    var ua = navigator.userAgent,
    N = navigator.appName, tem,
    M = ua.match(/(opera|chrome|safari|firefox|msie|trident)\\/?\\s*([\\d\\.]+)/i) || [];
    M = M[2] ? [M[1], M[2]] : [N, navigator.appVersion, \'-?\'];
    if (M && (tem = ua.match(/version\\/([\\.\\d]+)/i)) != null) M[2] = tem[1];
    return M.join(\' \');
}

String.prototype.toFaDigit = function () {
    return this.replace(/\\d+/g, function (digit) {
        var ret = \'\';
        for (var i = 0, len = digit.length; i < len; i++) {
            ret += String.fromCharCode(digit.charCodeAt(i) + 1728);
        }

        return ret;
    });
};
/**
 * jQuery.smartresize
 */
(function(e){function t(e,t){return e.toFixed(t.decimals)}e.fn.countTo=function(t){t=t||{};return e(this).each(function(){function l(){a+=i;u++;c(a);if(typeof n.onUpdate==\"function\"){n.onUpdate.call(s,a)}if(u>=r){o.removeData(\"countTo\");clearInterval(f.interval);a=n.to;if(typeof n.onComplete==\"function\"){n.onComplete.call(s,a)}}}function c(e){var t=n.formatter.call(s,e,n);o.text(t)}var n=e.extend({},e.fn.countTo.defaults,{from:e(this).data(\"from\"),to:e(this).data(\"to\"),speed:e(this).data(\"speed\"),refreshInterval:e(this).data(\"refresh-interval\"),decimals:e(this).data(\"decimals\")},t);var r=Math.ceil(n.speed/n.refreshInterval),i=(n.to-n.from)/r;var s=this,o=e(this),u=0,a=n.from,f=o.data(\"countTo\")||{};o.data(\"countTo\",f);if(f.interval){clearInterval(f.interval)}f.interval=setInterval(l,n.refreshInterval);c(a)})};e.fn.countTo.defaults={from:0,to:0,speed:1e3,refreshInterval:100,decimals:0,formatter:t,onUpdate:null,onComplete:null}})(jQuery);

/**
 * jQuery.appear
 * https://github.com/bas2k/jquery.appear/
 * http://code.google.com/p/jquery-appear/
 * http://bas2k.ru/
 *
 * Copyright (c) 2009 Michael Hixson
 * Copyright (c) 2012-2014 Alexander Brovikov
 * Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
 */
(function(e){e.fn.appear=function(t,n){var r=e.extend({data:undefined,one:true,accX:0,accY:0},n);return this.each(function(){var n=e(this);n.appeared=false;if(!t){n.trigger(\"appear\",r.data);return}var i=e(window);var s=function(){if(!n.is(\":visible\")){n.appeared=false;return}var e=i.scrollLeft();var t=i.scrollTop();var s=n.offset();var o=s.left;var u=s.top;var a=r.accX;var f=r.accY;var l=n.height();var c=i.height();var h=n.width();var p=i.width();if(u+l+f>=t&&u<=t+c+f&&o+h+a>=e&&o<=e+p+a){if(!n.appeared)n.trigger(\"appear\",r.data)}else{n.appeared=false}};var o=function(){n.appeared=true;if(r.one){i.unbind(\"scroll\",s);var o=e.inArray(s,e.fn.appear.checks);if(o>=0)e.fn.appear.checks.splice(o,1)}t.apply(this,arguments)};if(r.one)n.one(\"appear\",r.data,o);else n.bind(\"appear\",r.data,o);i.scroll(s);e.fn.appear.checks.push(s);s()})};e.extend(e.fn.appear,{checks:[],timeout:null,checkAll:function(){var t=e.fn.appear.checks.length;if(t>0)while(t--)e.fn.appear.checks[t]()},run:function(){if(e.fn.appear.timeout)clearTimeout(e.fn.appear.timeout);e.fn.appear.timeout=setTimeout(e.fn.appear.checkAll,20)}});e.each([\"append\",\"prepend\",\"after\",\"before\",\"attr\",\"removeAttr\",\"addClass\",\"removeClass\",\"toggleClass\",\"remove\",\"css\",\"show\",\"hide\"],function(t,n){var r=e.fn[n];if(r){e.fn[n]=function(){var t=r.apply(this,arguments);e.fn.appear.run();return t}}})})(jQuery);


/**
 * Layout elements initialization
 */
(function ($) { \"use strict\";

    // header position
    var duration = 500;
    var offset_stuck = 300;
    var offset_show_down = 520;
    jQuery(window).scroll(function () {
        if (!($(\'body\').hasClass(\'screen-head\'))) {
            if ($(window).width() > 983) {
                if (jQuery(this).scrollTop() > offset_stuck) {
                    jQuery(\'header\').addClass(\'navbar-fixed-top metro-small\');
                    $(\'body\').css(\"margin-top\", \"100px\");
                    jQuery(\'#search\').addClass(\'fixed-top\');

                } else {
                    jQuery(\'header\').removeClass(\'navbar-fixed-top metro-small\');
                    $(\'body\').css(\"margin-top\", \"0\");
                    jQuery(\'#search\').removeClass(\'fixed-top\');

                }
            }
            if (jQuery(this).scrollTop() > offset_show_down) {
                jQuery(\'header\').addClass(\'navbar-show-down\');
                jQuery(\'#search\').addClass(\'show-down\');

            } else {
                jQuery(\'header\').removeClass(\'navbar-show-down\');
                jQuery(\'#search\').removeClass(\'show-down\');
            }
        }
        else {
            if ((jQuery(this).scrollTop() > $(\'.screen-banner\').height()) && ($(window).width() > 1000)) {
                jQuery(\'header\').addClass(\'navbar-fixed-top metro-small\');
                jQuery(\'header\').addClass(\'navbar-show-down\');
                jQuery(\'#search\').addClass(\'fixed-top\');
            }
            else {
                jQuery(\'header\').removeClass(\'navbar-fixed-top\');
                jQuery(\'header\').removeClass(\'navbar-show-down\');
                jQuery(\'#search\').removeClass(\'fixed-top\');
            }
        }
    });

    // totop button
    $(window).scroll(function () {
        if ($(window).scrollTop() > 1000) {
            jQuery(\'#totop\').removeClass(\'collapsed\');
        }
        else {
            jQuery(\'#totop\').addClass(\'collapsed\');
        }
    });

    jQuery(\'#totop\').click(function (event) {
        event.preventDefault();
        jQuery(\'html, body\').animate({ scrollTop: 0 }, duration);
        return false;
    });

    // second level menu items
    $(\".menu-parent\")
        .mouseenter(function () {
            if ($(\'> .dropdown\', this).offset().left + $(\'> .dropdown\', this).width() > $(window).width()) {
                $(\'> .dropdown\', this).addClass(\'repositioned\');

            }
            else {
                $(\'> .dropdown\', this).addClass(\'normal\');
            }
        })
        .mouseleave(function () {
            $(\'> .dropdown\', this).removeClass(\'repositioned\');
            $(\'> .dropdown\', this).removeClass(\'normal\');
        });

    // menu items hover handle
    function expanddrop() {
        $(this).children(\".dropdown-menu\").stop().fadeIn(250);
    }

    function contractdrop() {
        $(this).children(\".dropdown-menu\").stop().fadeOut(400);
    }

    var configdrop = {
        over: expanddrop,
        interval: 100,
        out: contractdrop
    };

    $(\".dropdown\").hoverIntent(configdrop);

    function expanduber() {
        $(this).children(\".uber-menu\").stop().fadeIn(250);
    }

    function contractuber() {
        $(this).children(\".uber-menu\").stop().fadeOut(400);
    }

    var configuber = {
        over: expanduber,
        interval: 100,
        out: contractuber
    };

})(jQuery);



/**
 * Magnific Popup initialization
 */
(function ($) { \"use strict\";

    $(\".certificate-item\").magnificPopup({
        delegate: \'a\',
        type: \'image\',
        gallery: { enabled: true },
        fixedContentPos: true
    });

})(jQuery);

/**
 * Stellar initialization
 */
(function ($) {
    \"use strict\";

    try {
        $.stellar({
            horizontalScrolling: false,
            responsive: true
        });
    }
    catch (err) { }

})(jQuery);



/**
 * Google map initialization
 */
(function ($) { \"use strict\";

    $(\".holo-google-map\").each(function () {

        var _options = $(this).data();

        var _id = $(this).attr(\'id\');
        var _zoom = _options.zoom;
        
        var _center1 = _options.center1.split(\',\');

        var _centerLat1 = parseFloat(_center1[0]);
        var _centerLng1 = parseFloat(_center1[1]);

        
        var _center2 = _options.center2.split(\',\');

        var _centerLat2 = parseFloat(_center2[0]);
        var _centerLng2 = parseFloat(_center2[1]);


        var _center3 = _options.center3.split(\',\');

        var _centerLat3 = parseFloat(_center3[0]);
        var _centerLng3 = parseFloat(_center3[1]);

        var _center4 = _options.center4.split(\',\');

        var _centerLat4 = parseFloat(_center4[0]);
        var _centerLng4 = parseFloat(_center4[1]);

        //console.log(_centerLat + \', \' + _centerLng);
        //
        //var map;
        //function initialize() {
        //    var mapOptions = {
        //        zoom: _zoom,
        //        center: new google.maps.LatLng(_centerLat, _centerLng),
        //        mapTypeId: google.maps.MapTypeId.ROADMAP,
        //        scrollwheel: false
        //    };
        //    map = new google.maps.Map(document.getElementById(_id),
        //        mapOptions);
        //}
        //
        //google.maps.event.addDomListener(window, \'load\', initialize);
        var LatLngCenter = new google.maps.LatLng(24.484044, 22.737473);
        var latlng1 = new google.maps.LatLng(_centerLat1, _centerLng1);
        var latlng2 = new google.maps.LatLng(_centerLat2, _centerLng2);
        var latlng3 = new google.maps.LatLng(_centerLat3, _centerLng3);
        var latlng4 = new google.maps.LatLng(_centerLat4, _centerLng4);

        var myOptions = {
            zoom: _zoom,
            center: LatLngCenter,
            mapTypeId: google.maps.MapTypeId.ROADMAP,
            disableDefaultUI: false,
            scrollwheel: false,
            minZoom: 2,
            styles: [{\"stylers\":[{\"hue\":\"#2c3e50\"},{\"saturation\":250}]},{\"featureType\":\"road\",\"elementType\":\"geometry\",\"stylers\":[{\"lightness\":50},{\"visibility\":\"simplified\"}]},{\"featureType\":\"road\",\"elementType\":\"labels\",\"stylers\":[{\"visibility\":\"off\"}]}]
        };

        var map = new google.maps.Map(document.getElementById(_id), myOptions);

        var image1 = \'../marker1.png\';
        var image2 = \'../marker2.png\';
        var image3 = \'../marker3.png\';
        var image4 = \'../marker4.png\';

        var marker1 = new google.maps.Marker({
            position: latlng1,
            map: map,
            icon: image1
        });

        var marker2 = new google.maps.Marker({
            position: latlng2,
            map: map,
            icon: image2
        });

        var marker3 = new google.maps.Marker({
            position: latlng3,
            map: map,
            icon: image3
        });

        var marker4 = new google.maps.Marker({
            position: latlng4,
            map: map,
            icon: image4
        });
    });

})(jQuery);



/**
 * \"On resize\" changes
 */
(function ($) { \"use strict\";

    jQuery(window).smartresize(function () {

        if ($(window).width() <= 983 && !($(\'body\').hasClass(\'screen-head\'))) {
            $(\'body\').css(\"margin-top\", \"0\");
            jQuery(\'header\').removeClass(\'navbar-fixed-top metro-small\');
            jQuery(\'#nav-shop\').removeClass(\'fixed-top\');
            jQuery(\'#search\').removeClass(\'fixed-top\');
            jQuery(\'.uber-menu\').removeClass(\'fixed-top\');
        }
        $(\".resize-item.screen-banner\").height($(window).height() - $(\"header\").height() - $(\".advertising\").height());

        $(\".constructing .logo\").css(\"padding-top\", ($(window).height() / 4));
        $(\".constructing .main-txt\").css(\"margin-top\", ($(window).height() / 10));
        if ($(window).height() > $(\".constructing .container\").height()) {
            $(\".constructing\").height($(window).height());
        }
        else {
            $(\".constructing\").css(\"height\", \"auto\");
        }
        $(\".masonry-container\").isotope(\'reLayout\');
    });

})(jQuery);

$(function () {
    $(\'html\').click(function () {
        
        $(\"#search\").attr(\"class\", \"panel-collapse collapse\");

    });
    $(\'#search\').click(function (event) {
        
        event.stopPropagation();
    });
});