
//$(function() {
	$(document).ready(function(){
        $('a[rel=lightbox]').lightBox(); //$('.galeriazdjec a').lightBox();
	});
        //$('#lewa a').lightBox();
       // $('a[@rel*=lightbox]').lightBox();
  //  });
	
	
/*$(function(){
	if(!($.browser.msie)){

	
	$("img").lazyload({ 
		placeholder : "http://alive.wroclaw.pl/newalive/images/white.gif", 
    	effect : "fadeIn"
	});
	}
});*/
	

$(document).ready(function() {
	
	$("#newslettersmsmini").hover(function(){
		$("#newslettersms").show();
	}, function(){
		$("#newslettersms").hover(function(){
			//
		}, function(){
				$("#newslettersms").hide();
		});

	});
	
	


 $("#alive").hover(
  function () {
    var src = ($(this).attr("src") === "http://alive.wroclaw.pl/newalive/images/menu/01_01.png")
                    ? "http://alive.wroclaw.pl/newalive/images/menu/02_01.png" 
                    : "http://alive.wroclaw.pl/newalive/images/menu/01_01.png";
      $(this).attr("src", src);
  });
  
  $("#news").hover(
  function () {
    var src = ($(this).attr("src") === "http://alive.wroclaw.pl/newalive/images/menu/01_02.png")
                    ? "http://alive.wroclaw.pl/newalive/images/menu/02_02.png" 
                    : "http://alive.wroclaw.pl/newalive/images/menu/01_02.png";
      $(this).attr("src", src);
  });
  
  $("#terminarz").hover(
  function () {
    var src = ($(this).attr("src") === "http://alive.wroclaw.pl/newalive/images/menu/01_03.png")
                    ? "http://alive.wroclaw.pl/newalive/images/menu/02_03.png" 
                    : "http://alive.wroclaw.pl/newalive/images/menu/01_03.png";
      $(this).attr("src", src);
  });
  
  $("#galeria").hover(
  function () {
    var src = ($(this).attr("src") === "http://alive.wroclaw.pl/newalive/images/menu/01_04.png")
                    ? "http://alive.wroclaw.pl/newalive/images/menu/02_04.png" 
                    : "http://alive.wroclaw.pl/newalive/images/menu/01_04.png";
      $(this).attr("src", src);
  });
  
  $("#download").hover(
  function () {
    var src = ($(this).attr("src") === "http://alive.wroclaw.pl/newalive/images/menu/01_05.png")
                    ? "http://alive.wroclaw.pl/newalive/images/menu/02_05.png" 
                    : "http://alive.wroclaw.pl/newalive/images/menu/01_05.png";
      $(this).attr("src", src);
  });
  
  $("#forum").hover(
  function () {
    var src = ($(this).attr("src") === "http://alive.wroclaw.pl/newalive/images/menu/01_06.png")
                    ? "http://alive.wroclaw.pl/newalive/images/menu/02_06.png" 
                    : "http://alive.wroclaw.pl/newalive/images/menu/01_06.png";
      $(this).attr("src", src);
  });
  
  $("#sklep").hover(
  function () {
    var src = ($(this).attr("src") === "http://alive.wroclaw.pl/newalive/images/menu/01_07.png")
                    ? "http://alive.wroclaw.pl/newalive/images/menu/02_07.png" 
                    : "http://alive.wroclaw.pl/newalive/images/menu/01_07.png";
      $(this).attr("src", src);
  });
  
  $("#linki").hover(
  function () {
    var src = ($(this).attr("src") === "http://alive.wroclaw.pl/newalive/images/menu/01_08.png")
                    ? "http://alive.wroclaw.pl/newalive/images/menu/02_08.png" 
                    : "http://alive.wroclaw.pl/newalive/images/menu/01_08.png";
      $(this).attr("src", src);
  });
  
  // zmaiana wysokosci 
  
  $("#galeriakrecha").height($("#maintext").height());
  
  var offset =  $("#leftfooter").offset();
  $("#rightfooter").offset({top: + offset.top});
  
  $("#prawawypelnienie").height($("#prawakolumna").height()-390);
 
 
 /*  $(".terminarz").hover(
  function () {
	  var background = ($(this).attr("background") === "transparent")
					?  "#f9e3c7"
					:  "transparent";
    $(this).css("background", background);
  });*/
  
  
  $(".terminarz").hover(
  function () {
    $(this).addClass("hoverterminarz");
  },
  function () {
    $(this).removeClass("hoverterminarz");
  }
);

  $(".czterynewsyinfo").hover(
  function () {
    $(this).addClass("hoverterminarz");
  },
  function () {
    $(this).removeClass("hoverterminarz");
  }
);

	$(".terminarz").click(function(){
		location.href = "?d=readterminarz&t=" + $(this).attr("rel");
	});
	
	$(".czterynewsyinfo").click(function(){
		location.href = "?d=readterminarz&t=" + $(this).attr("rel");
	});
	
});

(function($) {
  var cache = [];
  // Arguments are image paths relative to the current page.
  $.preLoadImages = function() {
    var args_len = arguments.length;
    for (var i = args_len; i--;) {
      var cacheImage = document.createElement('img');
      cacheImage.src = arguments[i];
      cache.push(cacheImage);
    }
  }
})(jQuery)



$.fn.imagesLoaded = function(callback){
  var elems = this.filter('img'),
      len   = elems.length;
      
  elems.bind('load',function(){
      if (--len <= 0){ callback.call(elems,this); }
  }).each(function(){
     // cached images don't fire load sometimes, so we reset src.
     if (this.complete || this.complete === undefined){
        var src = this.src;
        // webkit hack from http://groups.google.com/group/jquery-dev/browse_thread/thread/eee6ab7b2da50e1f
        // data uri bypasses webkit log warning (thx doug jones)
        this.src = "data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///ywAAAAAAQABAAACAUwAOw==";
        this.src = src;
     }  
  }); 

  return this;
};


// Google Analitics
 
 var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-17618861-1']);
  _gaq.push(['_trackPageview']);

  (function() {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
    (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(ga);
  })();
  
  



