var Index = {

	index: function() {

		// Animacja Flash.
		if ($.browser.mobile === false) {
			if (parseInt(swfobject.getFlashPlayerVersion().major) > 0) {
				swfobject.embedSWF(Core.webView + 'flash/background.swf', 'dynamicFlash', '100%', '100%', '9.0.0', 'expressInstall.swf',
					{ plik: IndexBanner },
					{ menu: false, scale: 'noscale', salign: 'lt', wmode: 'opaque', devicefont: false, loop: true, play: true }, { }
				);
			}
			else {
				$('#dynamicFlash img').show();
			}
		}
		else {
			$('#dynamicFlash img').show();
		}


		// Rozszerzanie logotypów nad menu.
		if ($('#footer .logos').length > 0) {
			var timeout = setTimeout('Index._resize();', 100),
				width = $(window).width();

			$(window).resize(function(){

				// Hack na IE, bez tego przeglądarka wykonuje zdarzenia w pętli.
				var newWidth = $(window).width();

				if (width !== newWidth) {
					width = newWidth;

					if (timeout) {
						clearTimeout(timeout);
					}

					timeout = setTimeout('Index._resize();', 100);
				}
			});
		}
	},

	_resize: function() {
		var width = $(window).width(), img = $('#footer .logos img'), imgWidth = 0;

		$('#footer .logos img').each(function(){
			imgWidth += $(this).width();
		});

		var margin = parseInt((width - imgWidth) / img.length / 2 - 10);

		if (margin < 0) {
			margin = 0;
		}

		img.css('margin', '0 ' + margin + 'px');
	}

}

