$(document).ready(function(){
	$('.categories').dropDownMenu({timer: 1000, parentMO: 'parent-hover', childMO: 'child-hover1'});
	$('input, div, span, p, td').select( function () {
		return false;
	});
	if( $('#advert_area5').length > 0 ) {
		$('#advert_area5').marquee({yScroll: 'bottom'});
	}
	/*
	if( $('#advert_area6').length > 0 ) {
		$('#advert_area6').slideshow({
	        playframe:false,
	        play:true, 
	        width: 536, 
	        height: 150,
	        panel: false
	    });

	}
	*/
	if( $('#advert_area6').length > 0 ) {
		$('#advert_area6').jqFancyTransitions({
			effect: '', // wave, zipper, curtain
			width: 536, // width of panel
			height: 150, // height of panel
			strips: 10, // number of strips
			delay: 5000, // delay between images in ms
			stripDelay: 50, // delay beetwen strips in ms
			titleOpacity: 0.7, // opacity of title
			titleSpeed: 1000, // speed of title appereance in ms
			position: 'alternate', // top, bottom, alternate, curtain
			direction: 'fountainAlternate', // left, right, alternate, random, fountain, fountainAlternate
			navigation: false, // prev and next navigation buttons
			links: true// show images as links
		});  
	}
	
	if( $('.prodlisting').length > 0 ) {
		$('.prodlisting').find('.special-prod').each(function(){
			var color = $(this).css('background-color');
			$(this).parent('td').css('background-color',color);
		});
	}
	
	$('.product-select').change(function(){
		top.location.href = '/index.php?q='+$(this).val()+'&pFrom=&pTo=&_go_search=Szukaj&mod=search_results';
	})
	
	if( $('.otherProducers').length > 0 ) {
		$('.otherProducers').find('div.prod').each(function(){
			var imgHeight = $(this).find('img').css('height');
			imgHeight = imgHeight.substr(0, (imgHeight.length-2));
			var marginTop = ((130-imgHeight)/2);
			$(this).find('img').css('margin-top',marginTop+'px');
		});
	}
	
	$('a[rel="colorbox"], .gallerythumb').colorbox({
		'scalePhotos': true, 
		'maxHeight': 600, 
		'maxWidth': 600
	});
});

