function slideshow() {
	var a = parseInt(jQuery('#slideshow').attr('class').replace('a', ''))+1;

	if ( (a === undefined) || (a > 5) || (a < 1) ) {
		a = 1;
	}

	jQuery('#slideshow').attr('class', 'a'+ a);
	jQuery('a.link', '#slideshow').attr('href', jQuery('a.a'+ a, '#slideshow').attr('href'));

	setTimeout('slideshow()', 5000);
}

jQuery(document).ready(function($) {
	$('#user_efekt').click(function(){
		var efekt = this.className;
		$('#efekt').remove();

		$('#box_productfull').append('<div id="efekt" style="position: absolute; z-index: 1000; top: 16px; left: 7px; background-color: #EEE;"><table width="100%">'+
'    <tr>'+
'        <td>'+
'            <a href="#" id="efekt_big_close" style="color: black; font-weight: bold; text-decoration: none; padding: 5px;"><b>Zamknij</b></a>'+
'        </td>'+
'    </tr>'+
'    <tr>'+
'        <td>'+
'                            <object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"'+
'                        codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0"'+
'                        width="760"'+
'                        height="400"'+
'                        id="'+ efekt +'.swf"'+
'                        align="middle">'+
'                    <param name="allowScriptAccess" value="sameDomain" />'+
'                    <param name="allowFullScreen" value="false" />'+
'                    <param name="movie" value="http://www.otoelektro.pl/public/'+ efekt +'.swf" />'+
'                    <param name="quality" value="high" />'+
'                    <param name="wmode" value="transparent" />'+
'                    <embed src="http://www.otoelektro.pl/public/'+ efekt +'.swf"'+
'                           quality="high"'+
'                           wmode="transparent"'+
'                           width="760"'+
'                           height="400"'+
'                           name="image"'+
'                           align="middle"'+
'                           allowScriptAccess="sameDomain"'+
'                           allowFullScreen="false"'+
'                           type="application/x-shockwave-flash"'+
'                           pluginspage="http://www.macromedia.com/go/getflashplayer" />'+
'                </object>'+
'                    </td>'+
'    </tr>'+
'</table></div>');
		var y = self.pageYOffset ? self.pageYOffset : document.documentElement && document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body ? document.body.scrollTop : null;
		$('#efekt').addClass('y'+ y);
		$('html, body').animate({
			scrollTop: $("#efekt").offset().top
		}, 500);
		return false;
	});
	
	$('#efekt_big_close').live('click', function(){
		var y = $('#efekt').attr('class').replace('y', '');
		$('html, body').animate({
			scrollTop: y
		}, 500);
		$('#efekt').remove();
		return false;
	});

	if ( $('#slideshow').length )
		slideshow();
	
	$('span a', '#slideshow').click(function(){
		$('#slideshow').attr('class', 'a'+ $(this).attr('class').replace('a', ''));
		$('a.link', '#slideshow').attr('href', $(this).attr('href'));
		return false;
	})
	
	$('dt', '#faq dl').click(function(){
		var dd = $(this).next();
		$('dd', '#faq dl').not(dd).fadeOut(400, function(){
			dd.fadeIn('fast');
		});
	});
});


