jQuery.fn.flash = function(file){
  var code = '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" ' +
             'codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" ' +
             'width="630" height="180">' +
             '<param name="movie" value="'+file+'" />' +
             '<param name="quality" value="high" />' +
             '<embed src="'+file+'" quality="high" bgcolor="#000000" ' +
             'width="630" height="180" type="application/x-shockwave-flash" ' +
             'pluginspage="http://www.macromedia.com/go/getflashplayer"></embed></object>';
  jQuery(this).html(code);
}

jQuery(document).ready(function(){
  // we are creating loading...
  jQuery('#loading').css({width: jQuery(window).width(), height: jQuery(window).height()});

  // the content on whole screen
  jQuery('#content').css('min-height', jQuery(window).height() - jQuery('body').height() + jQuery('#content').height() + 100); // dimension plugin

  // MENU
  jQuery('#menu dt.roll a').click(function(){
    jQuery('dd:visible').hide();
    jQuery(this).parent().next('dd:hidden').css({top: (jQuery(this).offset().top + jQuery(this).height()), left: jQuery(this).offset().left});
    jQuery(this).parent().next('dd:hidden').show('slow');
    return false;
  });
  jQuery('#menu dd').hover(function(){}, function(){
    jQuery(this).hide('slow');
  });
});

jQuery('#container').ready(function(){
  jQuery('#loading').hide();
  jQuery('#container').fadeIn('slow');
  jQuery('#top').flash(siteurl + '/media/theme/logo.swf');
});

// gdy klikniemy w link ma sie od razu pojawic monit o ladowanie
jQuery('a').click(function(){
    jQuery('#container').hide();
    jQuery('#loading').show();
});