$(document).ready(function() {
	$('.img_change').hover(
		function() {
			this.src = this.src.replace(/\.gif/, '-over.gif');
		},
		function() {
			this.src = this.src.replace(/-over\.gif/, '.gif');
		}
	);
//do obslugi hover'a nad obrazkami menu na glownej
	$('div.glowna_prod_box a img').hover(
		function() {
			$(this).addClass('podswietl');

		},
		function() {
			$('.glowna_prod_box a img').removeClass('podswietl');
		}
	);
//do obslugi podswietlenia aktywnego przycisku menu danej sekcji
	$('div#menu_top a.onas').click(
		function() {
			$('div#menu_top a').removeClass('onas_clicked')
			$(this).addClass('onas_clicked');

		},
		function() {
			$('.glowna_prod_box a img').removeClass('podswietl');
		}
	);
	
	
	
});

function toggle(id) {
	$('#K' + id).toggle();
	if ($('#K' + id).css('display') == 'block') {
		$('#I' + id).attr('src', 'images/menu_d.gif');
	} else {
		$('#I' + id).attr('src', 'images/menu_e.gif');
	}
}

function prev(id) {
	$('.prev').hide();
	if (id) {
		$('#P' + id).show();
		$('#P' + id).css({'top' : '-' + ($('#P' + id).height() / 2 - $('#O' + id).height() / 2) + 'px'});
	}
}



function preloadImages() {
  var d = document;
  if(document.images) {
  	if(!document.pImages)
  		document.pImages = new Array();
  	var i, j = document.pImages.length, a = arguments;
  	for(i = 0; i < a.length; i++)
  		if(a[i].indexOf("#") != 0) {
  			document.pImages[j] = new Image;
  			document.pImages[j++].src=a[i];
  		}
  }
} // preloadimages()



function changeImages() {
	if (document.images) {
		for (var i=0; i<changeImages.arguments.length; i+=2) {
			document[changeImages.arguments[i]].src = changeImages.arguments[i+1];
		}
	}
}

