$(document).ready(function(){

  $(".topmenu .item").hover(function(){
    $(this).attr("src",$(this).attr("src").replace('_out','_over'));
  },function(){
    if(!$(this).is(".active")) $(this).attr("src",$(this).attr("src").replace('_over','_out'));
  });

  /*$("tr.lower div.content").hoverIntent(function() {
    $(this).find(".box").show("blind", options = {}, 300, function(){});
  }, function() {
    $("tr.lower .box").hide("blind", options = {}, 200, function(){});
  });*/

  $(".carousel a, .colorbox a").colorbox({
    current: "zdjęcie {current} z {total}",
    slideshow: true,
    slideshowSpeed: 5000,
    slideshowAuto: true,
    slideshowStop: "Zatrzymaj pokaz slajdów",
    slideshowStart: "Uruchom pokaz slajdów"
  });

  $('input[name="newsletter[email]"]').defaultValue('Adres E-mail');
  $('#signin_username').defaultValue('Login');
  $('#signin_password').defaultValue('Hasło');
  $('textarea[name="comment[text]"]').defaultValue('Treść komentarza...');
  $('input[name="contact[name]"]').defaultValue('Imię i nazwisko');
  $('input[name="contact[email]"]').defaultValue('Adres E-mail');
  $('textarea[name="contact[text]"]').defaultValue('Treść...');

  $.preloadImages = function()
  {
  	for(var i = 0; i<arguments.length; i++)
  	{
  		jQuery("<img>").attr("src", arguments[i]);
  	}
  }
  $.preloadImages(
    "/images/page/menu/01_over.jpg",
    "/images/page/menu/02_over.jpg",
    "/images/page/menu/03_over.jpg",
    "/images/page/menu/04_over.jpg",
    "/images/page/menu/05_over.jpg",
    "/images/page/menu/06_over.jpg",
    "/images/page/menu/07_over.jpg"
  );

});

function bookmark() {

  var title = document.title;
  var url = window.location;

  if(document.all) { // IE
    window.external.AddFavorite(url, title);
  }
  else if (window.sidebar) { // Mozilla Firefox
    window.sidebar.addPanel(title, url, "");
  }
  else if(window.opera && window.print) { // Opera
    return true;
  }

  return false;
}
