function zamknij()
{
  
  document.id('lbCloseLink').fireEvent('click');
  
}
function wyswietlkartke()
{
  Slimbox.open("http://geminidj.pl/images/kartka-studiolights-2011.jpg");
  var t=setTimeout("zamknij()",4000);
}

window.onload = function() {

var menulinks = $$('img.m');
menulinks.forEach(function(el) {
	var source = el.src;
	var split = (source).lastIndexOf(".");
	var sourcea = (source).substring(0, split) + 'a' + (source).substring(split, source.length);
	    el.addEvent('mouseover', function() { this.src = sourcea });
      el.addEvent('mouseout', function() { this.src = source });
  });
var sublinks = $$('a.s');
sublinks.forEach(function(el, index) {
	
	var ind = index;
	var source = '/images/menuimg';
	var split = (source).lastIndexOf(".");
	var path = (source).substring(0, (source).lastIndexOf("/"));
	  var bubbleimage = new Element('img').setProperty('src',source+'/s'+ind+'p.jpg').injectInside('top');
      bubbleimage.setProperty('id', 's'+ind+'p').addClass('sp').addClass('s'+ind+'p').setStyle('opacity',1);
	  var changeOpacity = new Fx.Style('s'+ind+'p', 'top',{
				duration:250, 
				wait:false
	});
	
	var sourcea = (source).substring(0, split) + 'a' + (source).substring(split, source.length);
	  el.addEvent('mouseover', function() { 
										el.src = sourcea;
										changeOpacity.start(227);
					});
      el.addEvent('mouseout', function() { 
									   el.src = source;
									   changeOpacity.start(102);
				});
  });
var posterimg = $$('div.poster img');
posterimg.forEach(function(el) {
	var source = el.src;
	var split = (source).lastIndexOf(".");
	var sourcea = (source).substring(0, split) + 'a' + (source).substring(split, source.length);
	    el.addEvent('mouseover', function() { this.src = sourcea; this.toggleClass('onMouse'); });
      el.addEvent('mouseout', function() { this.src = source; this.toggleClass('onMouse'); });
  });





};

