
  // add here whatever should be done
  // when the new page is loaded via AJAX
  function onPageLoad()
  {
    // force gallery images opening in the new tab 
    jQuery('ul.gallery a').attr('target', '_blank');
  }

 
  function onMouseOverOutMenu() {
    // move "onPageLoad();" to ajax-page-load.js
    onPageLoad();

    jQuery('#header .menu > li').mouseover(function()
    {
      if (jQuery(this).hasClass('current')) return;
        jQuery(this).addClass('hover');
      jQuery('#header .menu > li.current ul').hide();
    });
    jQuery('#header .menu > li').mouseout(function()
    {
      jQuery(this).removeClass('hover');
      jQuery('#header .menu > li.current ul').show();
    });
    jQuery('#footer .menu > li').mouseover(function()
    {
      if (jQuery(this).hasClass('current')) return;
        jQuery(this).addClass('hover');
      jQuery('#footer .menu > li.current ul').hide();
    });
    jQuery('#footer .menu > li').mouseout(function()
    {
      jQuery(this).removeClass('hover');
      jQuery('#footer .menu > li.current ul').show();
    });
  }
  
  function toggleContactPage(showContact)
  {
    if (showContact)
    {
      // hide welcome
      jQuery('#headerWelcome').css('display', 'none');
      // stop and hide slideshow
      jQuery('#bannerpics').cycle('stop');
      jQuery('#bannerpics').empty();
      // now change bg
      jQuery("body").attr("id", "page-contact");
      var mapW = '<img class="i1" id="headerWorld" src="' + dafi_base_url + '/images/header-world.png" alt="" />';
      var mapU = '<img class="i2" id="headerUkraine" src="' + dafi_base_url + '/images/header-ukraine.png" alt="" />';
      var mapWU = '<div id="headerMap">' + mapW + mapU + '</div>';
      jQuery('#forCustomers').replaceWith(mapWU);
      // run map
      setTimeout("b1();", 3000);
    }
    else
    {
      // now body is "index", not wide as "contacts"
      jQuery("body").attr("id", "page-index");
      jQuery('#headerWelcome').css('display', '');
      // restore "for customers" button
      var forCustomers = '<a id="forCustomers" class="but" rel="external" href="http://dafi.ua">for customers</a>';
      jQuery('#headerMap').replaceWith(forCustomers);
      // restore banners for slide-show
      var banners =
        '<a class="b1" ><img src="' + dafi_base_url + '/images/banner/01.jpg" alt="" /></a>' +
        '<a class="b1" ><img src="' + dafi_base_url + '/images/banner/02.jpg" alt="" /></a>' +
        '<a class="b1" ><img src="' + dafi_base_url + '/images/banner/03.jpg" alt="" /></a>' +
        '<a class="b1" ><img src="' + dafi_base_url + '/images/banner/04.jpg" alt="" /></a>' +
        '<a class="b1" ><img src="' + dafi_base_url + '/images/banner/05.jpg" alt="" /></a>' +
        '<a class="b1" ><img src="' + dafi_base_url + '/images/banner/06.jpg" alt="" /></a>' +
        '<a class="b1" ><img src="' + dafi_base_url + '/images/banner/07.jpg" alt="" /></a>';
      jQuery('#bannerpics').append(banners);
      // run slide-show
      jQuery('#bannerpics').cycle({fx: 'fade', timeout: 7000, speed: 2500});
    }
  }

  // for "contacts" page:
  function b1()
  {
      jQuery('#header .i1').fadeOut('slow');
  }
