    _boxHeight = 225;
    _boxWidth = 265;
    _firstElem = 0;
    _timeout = 10000;
    _animation = 1500;

    $(document).ready(function(){
        itemsArr = $('#slideshow div');
        index = 0;
        showOne(index);
		$($('#slideshow div').get(index)).css({'top':'0px', 'left':'0px'});
        
        $('#slideshow div').hover(function(e){
            clearInterval(interval);
        },
        function(e){
            clearInterval(interval);
            interval = setInterval('slideShow();', _timeout);
        });

        //slideShow();
        interval = setInterval('slideShow();', _timeout);
    });

    function slideShow(){
        if(itemsArr.length-1 < ++index)
            index = 0;
        showOne(index);
    }
    function showOne(index)
    {
		var current = $($('#slideshow div').get(index));
		var prev = $($('#slideshow div').get(index - 1));
        _setCenter(index);

		if (index - 1 < 0)
		  prev = $($('#slideshow div').get(itemsArr.length-1));
		prev.fadeOut(_animation);
		current.fadeIn(_animation);
		_setCenter(index);
    }

	function _setCenter(index){
        var height = $($('#slideshow img').get(index)).attr('height');
		var width = $($('#slideshow img').get(index)).attr('width');
		var top = 0, left = 0;
		if (height < _boxHeight && height != 0)
            top = (_boxHeight / 2 - height / 2)
		if (width < _boxWidth && width != 0)
            left = (_boxWidth / 2 - width / 2)
		$('#photo_caption').html($($('#slideshow img').get(index)).attr('alt'));
		$($('#slideshow div').get(index)).css({'top': top + 'px', 'left': left + 'px'});
    }

