function init() {
  $('#sluzba-link').subMenu();

  $('#logo').flashObject({
    swf: baseurl+'/public/logo.swf',
    width: 170,
    height: 110,
    id: 'logo-flash'
  }, {
    wmode: 'transparent'
  },
  {
    url: 'http://mineto.sk'
  });



  $('.box h2').each(function () {
    $(this).html('<span style="float:left">'+$(this).html()+'</span>');
  });
  $('.box h2').append('<a href="javascript:" class="sh"></a>');
  $('.box h2').click(function () {
    var box = $(this).parents('.box');
    if (box.hasClass('closed')) {
      box.removeClass('closed');
      box.find('.content').animate({height: 'show'}, 'slow');
      box.find('.bottom').animate({height: 'show'}, 'slow');
    }
    else {
      box.addClass('closed');
      box.find('.content').animate({height: 'hide'}, 'slow');
      box.find('.bottom').animate({height: 'hide'}, 'slow');
    };
    boxes_check();
  });
  $('.box.closed .content, .box.closed .bottom').css('display', 'none');

  $('#text').dropShadow({top: 1, left: 1, color: '#EEEEEE'});
  $('.box').addClass('png scale');
}


function referencie(a,b,c) {
  $('.referencie .first').flashObject({
    swf: baseurl+'/public/referencie.swf',
    width: 295,
    height: 146,
    id: 'ref1'
  }, null, {
    i: a[0],
    dir: baseurl,
    link: a[1]
  });


  $('.referencie .second').flashObject({
    swf: baseurl+'/public/referencie.swf',
    width: 295,
    height: 146,
    id: 'ref2'
  }, null, {
    i: b[0],
    dir: baseurl,
    link: b[1]
  });


  $('.referencie .third').flashObject({
    swf: baseurl+'/public/referencie.swf',
    width: 295,
    height: 146,
    id: 'ref3'
  }, null, {
    i: c[0],
    dir: baseurl,
    link: c[1]
  });
}



(function($) {
  $.fn.subMenu = function() {
    interval = false;

    $(this).click(function () {
      $('.actSub').removeClass('actSub').children('ul').css('display', 'none');
      $(this).addClass('actSub').children('ul').animate({height: 'show', opacity: 0.9});
    });

	$(this).hover(
	  function() {
        clearInterval(interval);
      },
      function() {
        co = this;
        interval = setInterval(function() {$(co).children('ul').animate({height: 'hide', opacity: 'hide'});}, 1500);
      }
    );
  }
})(jQuery);



function boxes_check(z,s) {
  $('.box.closed a.sh').html(z);
  $('.box:not(.closed) a.sh').html(s);
}
