$(document).ready(function(){

	if($('#szyba').length > 0) {
		$("#szyba").showcase({
		    css: { width: "634px", height: "316px" },
		    animation: { interval: 5000,
		                stopOnHover: true,
		                easefunction: "swing",
		                speed: 600,
		                type: "fade" },

		    navigator: {
		        position: "bottom-right",
		        css: { padding:"0px",
		               margin: "0px 20px 20px 0px" },
		        showNumber: true,
		        item: {
		            css: {  height:"16px",
		                    opacity:"0.8",
		                    width:"16px",
		                    "-moz-border-radius": "0px",
		                    "-webkit-border-radius": "0px",
		                    "border-radius": "0px",
		                    backgroundColor: "#000000",
		                    borderColor:"#000000",
		                    margin: "0px",
		                    padding: "3px",
		                    "padding-top":"5px",
		                    "text-align": "center",
		                    "vertical-align": "middle",
		              		color: "#999999",
		              		"font-weight": "bold" },
		            cssHover: {
		                backgroundColor: "#000000",
		                borderColor: "#000000",
		                color: "#ffffff" },
		            cssSelected: {
		                backgroundColor: "#000000",
		                borderColor: "#000000",
		                color: "#ffffff" }
		        }
		    },
		    titleBar: {
		    	enabled: true,
		    	autoHide: false,
		    	css: {
		    		width: "auto",
		    		padding:"5px",
		    		height:"auto",
		    		margin:"0 0 15px 20px",
		    		"font-weight":"normal",
		    		"font-style":"normal",
		    		"max-width":"400px",
		    		opacity:"0.8",
		    		backgroundColor:"transparent"
		    	}
		    }
		});
	}
    
    // autocomplete
    options = {
        serviceUrl:'/wyszukiwarka/frazy',
        minChars:2
//        deferRequestBy: 1000
    };
    a = $('#query').autocomplete(options);

});


$(window).load(function() {
    $('img.movimgs').each(function() {
        image_height = $(this).height();
        margin_top = (130 - image_height) / 2;
        $(this).css('margin-top', margin_top + 'px');
    });
});
