$(function() {
	var theWindow	= $(window),
  aspectRatio   = $("#bg2").width() / $("#bg2").height();

	function resizeBg() {
		$("#bg").css('width',theWindow.width()).css('height',theWindow.height());
  	$("#bg2").css('width',aspectRatio*theWindow.height()).css('height',theWindow.height());
  	$("#bgmenu").css('margin-left',(theWindow.width()-$("#bgmenu").width())/2);
	}

  theWindow.resize(function() {
  	resizeBg();
  }).trigger("resize");


	 window.fbAsyncInit = function() {
	 	FB.init({status: true, cookie: true, xfbml: true});
	 };

	 (function() {
		 var e = document.createElement('script'); e.async = true;
		 e.src = document.location.protocol + '//connect.facebook.net/pl_PL/all.js';
		 document.getElementById('fb-root').appendChild(e);
	 }());

	 $('#fb_like_box').hover(
		 function() {
		 	$(this).stop().animate({left: '0'}, 'slow');
		 },
		 function() {
		 	$(this).stop().animate({left: '-293px'}, 'slow');
		 }
	 );

	resizeBg();
});
