///////CONSTRUCTION////////
$(window).on('load', function () {
    $('#loader').hide(1200);
    $('main').removeClass('fade-out');
 });
 
 ///////CONTACT////////
$(document).ready(function () {
    $('#menu #soc-contact').click(function () {
        $('#contact_modal').show(400);
        return false;
    });
    $('#foldout #foldout-contact').click(function () {
        $('#contact_modal').show(400);
        return false;
    });
    $('#contact_modal .close-contact a').click(function () {
        $('#contact_modal').hide(400);
        return false;
    });
});

///////MENU////////
$(document).ready(function () {
    $('#menu-icon a').click(function () {
        $('#foldout').toggle(500);
        return false;
    });
    $('#foldout a').click(function () {$('#foldout').hide(500);});
});

///////SCROLL-TO////////
$(function() {
  $("a[href*='#']:not([href='#'])").click(function() {
    if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') && location.hostname == this.hostname) {
      var target = $(this.hash);
      target = target.length ? target : $('[name=' + this.hash.slice(1) +']');
      if (target.length) {
        $('html,body').animate({
          scrollTop: target.offset().top
        }, 1000);
        return false;
      }
    }
  });
});

///////expandable array////////
$(document).ready(function () {
    $('.expander .l1 .open a').click(function (j) {
        j.preventDefault();
        var $puf = '#' + $(this).attr('href');
        $(this).parent().hide(1);
        $(this).parent().next().show(1);
		$($puf).show(400);
    });
    $('.expander .l1 .close a').click(function (k) {
        k.preventDefault();
        var $pux = '#' + $(this).attr('href');
        $(this).parent().hide(1);
        $(this).parent().prev().show(1);
        $($pux).hide(400);
    });
    
});