function showPhotos() {
	$('.productImages').click(function(){
		var imgSrc=$(this).attr("src").replace('/small/','/big/');
		var title=$(this).attr("alt");
		
		$('#productImageBig img').fadeOut(500);

		setTimeout(function() {
			$("#productImageBig img").load(function() {
				$(this).fadeIn(500);
				$("#productImageTitle").html('kolor: ' + title);
			}).attr("src", imgSrc);
		}, 500);
	});
}

function addPreviewImage() {
	$(".divMainBoxImage a img, .productBoxImg a img").thumbPopup({
		imgSmallFlag: '/small/',
		imgLargeFlag: "/big/"
	});
}

function addTooltip() {
	$(function() {
		// if the function argument is given to overlay,
		// it is assumed to be the onBeforeLoad event listener
		$(".divContentInfoBox a,.divContentInfoBoxSmall a").overlay({

			mask: '#949393',
			effect: 'apple',

			onBeforeLoad: function() {
				// grab wrapper element inside content
				var wrap = this.getOverlay().find(".contentWrap").html("");

				// load the page specified in the trigger
				wrap.load(this.getTrigger().attr("href"));
			}

		});
	});
}

$(window).load(function(){
	$('#productImageBig img,.productBoxImg img').each(function(){
		var img = new Image();
		img.src = $(this).attr('src');
		
		$(this).css({
			'position': 'absolute',
			'top': '50%',
			'left': '50%',
			'margin-top': -img.height/2,
			'margin-left': -img.width/2
		});
	});
	
	$('.one-image img').each(function(){
		var img = new Image();
		img.src = $(this).attr('src');
		
		$(this).css({
			'position': 'relative',
			'top': 110-img.height/2
		});
	});
	
	
});

