
$('#content-container').ready(function()
{
//	var height = $(window).height() - $('#header-container').height() - $('#mainmenu-container').height();
//	if($('#content').height() < height)
//	{
//		if($.browser.msie && parseInt($.browser.version) < 7)
//		{
//			$('#content').css({
//				height: height + 'px'
//			});
//		}
//		else
//		{
//			$('#content').css({
//				minHeight: height + 'px'
//			});
//		}
//	}
	
	$('#footer-container').css({top: $('body').height() - 25 + 'px'}).show();
});

$(document).ready(function()
{	
	$('a, input[type=button], input[type=submit], button').focus(function()
	{
		this.blur();
	});
	
	$('#reload-captcha').click(function()
	{
		var tmp = $('#int-captcha').attr('src');
		$('#int-captcha').attr('src', IntLib.getRB() + 'images/ajax-loader-big.gif');
		var cl = $('#int-captcha').clone().attr('src', tmp.replace(/\?reload=.+/i, '?reload=' + Math.random()));
		
		cl.load(function(){
			$('#int-captcha').attr('src', cl.attr('src'));
		});		
		

		return false;
	});
	
	$('#menu-left').find('li:last').css({
		'border-bottom': 'none'
	});
		
	$('#newsletter-form').ajaxForm({
		beforeSubmit: function()
		{
			var span = $('#newsletter-info');
			span.html('Trwa weryfikacja...<br/><br />');
		},
		success: function(html)
		{
			var span = $('#newsletter-info');
			span.html(html + '<br /><br />');
		},
		error: function(e){
		    var span = $('#newsletter-info');
			span.html(e);
		}
	});
	
	$('#newsletter-link').click(function(e){
		e.preventDefault(); 	
		var obj = $(this).parents('.box:first').find('#newsletter-form');
		obj.submit();
		return false;
	});
	
	$('#search-go').click(function(e){
		e.preventDefault(); 	
		var obj = $('#search-form');
		obj.submit();
		return false;
	});
	
	$('#login-up').click(function(e){
		e.preventDefault();
		var form = $('#login-up-form');
		form.submit();
		return false;
	});
	
	/* Polish initialisation for the jQuery UI date picker plugin. */
	/* Written by Jacek Wysocki (jacek.wysocki@gmail.com). */
	$.datepicker.regional['pl'] = {
	        closeText: 'Zamknij',
	        prevText: '&#x3c;Poprzedni',
	        nextText: 'Następny&#x3e;',
	        currentText: 'Dziś',
	        monthNames: ['Styczeń','Luty','Marzec','Kwiecień','Maj','Czerwiec',
	        'Lipiec','Sierpień','Wrzesień','Październik','Listopad','Grudzień'],
	        monthNamesShort: ['Sty','Lu','Mar','Kw','Maj','Cze',
	        'Lip','Sie','Wrz','Pa','Lis','Gru'],
	        dayNames: ['Niedziela','Poniedziałek','Wtorek','Środa','Czwartek','Piątek','Sobota'],
	        dayNamesShort: ['Nie','Pn','Wt','Śr','Czw','Pt','So'],
	        dayNamesMin: ['N','Pn','Wt','Śr','Cz','Pt','So'],
	        weekHeader: 'Tydz',
	        dateFormat: 'yy-mm-dd',
	        firstDay: 1,
	        isRTL: false,
	        showMonthAfterYear: false,
	        yearSuffix: ''};
	$.datepicker.setDefaults($.datepicker.regional['pl']);
});
