$(document).ready( function () {
	speed = 800;
/*	$('#main_sercz_normal').css('display','none');
	$('#main_sercz_js').css('display','block');
	$('#opts1').datepicker({
		dateFormat: 'yy-mm-dd'
	});
	$('#var0').hover(
		function() {
			$('#opts0').slideDown( speed );
			$('#but0').attr('value', 'Please Select Location');
		},
		function() {
			$('#opts0').slideUp( speed );
			$('#but0').attr('value', $('#hid0').attr('value'));
		}
	);
	$('#var1').hover(
		function() {
			$('#opts1').fadeIn();
		},
		function() {
			$('#opts1').fadeOut();
		}
	);
	$('#var2').hover(
		function() {
			$('#opts2').slideDown( speed );
			$('#but2').attr('value', 'Please Select Day');
		},
		function() {
			$('#opts2').slideUp( speed );
			$('#but2').attr('value', $('#hid2').attr('value'));
		}
	)
	;
	$('#var1').hover(
		function() {
			$('#opts1').fadeIn();
		},
		function() {
			$('#opts1').fadeOut();
		}
	);
	$('#opts0 li').click( function() {
		$('#opts0').slideUp( speed );
		$('#hid0').attr('value', $(this).text());
		$('#but0').attr('value', $(this).text());
	} );
	$('#opts2 li').click( function() {
		$('#opts2').slideUp( speed );
		$('#hid2').attr('value', $(this).text());
		$('#but2').attr('value', $(this).text());
	} );
*/
	images = new Array(); i=0;
	$('a img').not('#zawartosc a img').not('a.kaps1 img').each( function() {
		images[i] = new Image();
		images[i].src = 'o_'+($(this).attr('src'));
		i++;
	} );
	$('a img').not('#zawartosc a img').not('a.kaps1 img').hover( function() {
			$(this).attr( 'src', 'o_'+($(this).attr('src')) );
		},
		function() {
			if( $(this).attr('src').substr(0,2)=='o_' )
				$(this).attr( 'src', $(this).attr('src').substr(2) );
	} );
	$('img.hover').each( function() {
		images[i] = new Image();
		images[i].src = $(this).attr('src').replace( 'userfiles/image/', 'userfiles/image/o_' );
		i++;
	} );
	$('img.hover').hover( function() {
			$(this).attr( 'src', $(this).attr('src').replace( 'userfiles/image/', 'userfiles/image/o_' ) );
		},
		function() {
			$(this).attr( 'src', $(this).attr('src').replace( 'userfiles/image/o_', 'userfiles/image/' ) );
	} );
	$('input.hover').each( function() {
		images[i] = new Image();
		images[i].src = 'o_'+($(this).attr('src'));
		i++;
	} );
	$('input.hover').hover( function() {
			$(this).attr( 'src', 'o_'+($(this).attr('src')) );
		},
		function() {
			$(this).attr( 'src', $(this).attr('src').substr(2) );
	} );
	$('#loga_dol a.hover_exist').each( function() {
		images[i] = new Image();
		images[i].src = $(this).css('background-image').replace( '/obars/', '/obars/o_' );
		i++;
	} );
	$('#loga_dol a.hover_exist').hover( function() {
			$(this).css( 'background', $(this).css('background').replace( '/obars/', '/obars/o_' ) );
		},
		function() {
			$(this).css( 'background', $(this).css('background').replace( '/obars/o_', '/obars/' ) );
	} );

} );
