// Zmiany Fotek
var photo="";
var newphoto="";
var pics=1;

jQuery.fn.exists = function(){return jQuery(this).length>0;}

function bla() {
  //alert(photos[pics]);
  $('#fotografia').ImageSwitch( {NewImage:"/img/gallery/"+photos[pics]} );
  pics++;
  if (pics==maxpics) { pics=1; }
}

setInterval(bla, 7000);

$(document).ready(function() {
      $(".change").mouseover(function() {
        photo = $(this).attr('src');
        newphoto = photo.replace( 'bw_', '');
        $(this).attr('src', newphoto);
      }).mouseout(function() {
        $(this).attr('src', photo);
      });

    if( $(".stay").exists() ) {
      stayphoto = $(".stay").attr('src').replace( 'bw_', '');
      $(".stay").attr('src', stayphoto);
    }
    if( $(".stay2").exists() ) {
      stayphoto2 = $(".stay2").attr('src').replace( 'bw_', '');
      $(".stay2").attr('src', stayphoto2);
    }
});


$(document).ready(function() {

     //this one line will disable the right mouse click menu
     $(document)[0].oncontextmenu = function() {return false;}

});

