$(document).ready(function() {		

/**
 * Sticky footer
 *
 * Make footer stick at the bottom of the page
 *
 * @return void
 */

    var wrapperHeight = $('#wrapper')[0].clientHeight;
    var pageHeight = window.innerHeight;
    if (wrapperHeight < pageHeight) {
        var diffHeight = pageHeight - wrapperHeight;
        $('.footer_spacer').css('margin-top', diffHeight+'px');
    }
    
    if ($('#flashMessage').length>0) {
        $('#flashMessage').toggle("slow", function () {
            setTimeout(hide, 7000);
        }); 
        
        function hide() {
            $('#flashMessage').toggle("slow");
        }                              
    }

						    
	$('#footer_bkg').css('opacity', .9);						
	$('.designed_by_klivom').css('opacity', .45);
	$('.designed_by_klivom').hover(
	  function () {
		$(this).css('opacity', 1);
	  }, 
	  function () {
		$(this).css('opacity', .45);
	  }
	);
	
	$('ul.menu > li').hover(
		function () {
		  if ($(this).attr('class') != 'main_current') {
			  $(this).addClass('main_over');
			  $(this).children('a').addClass('main_over');
		  }
		}, 
		function () {
		  if ($(this).attr('class') != 'main_current') {
			  $(this).removeClass('main_over');
			  $(this).children('a').removeClass('main_over');
		  }
		}
	);
	
	$('ul.menu').superfish({ 
		delay:       500,                            // one second delay on mouseout 
		animation:   {opacity:'show',height:'show'},  // fade-in and slide-down animation 
		speed:       'fast',                          // faster animation speed 
		autoArrows:  false,                           // disable generation of arrow mark-up 
		dropShadows: false                            // disable drop shadows 
	});
	
});
