
/**** preloader ****/

if (start) {
	var ima = new Array('colorbox/loading.gif', 'colorbox/border.png', 'colorbox/controls.png', 'colorbox/loading_background.png', 'colorbox/overlay.png');
	for(var i = 0; i < ima.length; ++i) {
		temp = ima[i];
		ima[i] = new Image();
		ima[i].src = base+'tpl/pl/szablon1/img/'+temp;
	}
}

$(document).ready(function() {

	var buff, temp, stop;

	/**** _target="blank" ****/
	buff = $('a').map(function() { return $(this); });
	jQuery.each(buff, function(index, value) {
		temp = value.attr('href');
		if (temp != undefined && (temp.substr(0, 7) == 'http://' || temp.substr(0, 8) == 'https://')) {
			stop = temp;
			temp = temp.replace(/http:\/\//, '');
			if (temp != stop) {
				temp = temp.split('/');
				if (temp[0] != window.location.host) value.attr('target', '_blank');
			}
		}
	});
	stop = false;

	/**** SNAZslider ****/

	$('#slider').SNAZslider({'speed':3000, 'firstSlideSpeed':3000});

	/**** lista ****/

	$(".slist_csz .s_art .w_title a").click(function() {

		$(".s_art_box:visible").slideUp("slow");
		$(".art_zwin").removeClass('art_zwin').addClass('art_rozwin');

		$(this).removeClass('art_rozwin').addClass('art_zwin');
		$(this).parent("div").next("div").slideDown("slow");
	});


});





/***** linki do innych stron *****/

function href(url) {
	window.location.href = url;
}

/***** colorbox *****/

$(".colorbox").colorbox({'title':' '});

$('a').click(function(){
	if (this.href.indexOf('Aktualnosci/2009/') != -1 || this.href.indexOf('Aktualnosci/2010/') != -1 || this.href.indexOf('Aktualnosci/2011/') != -1 || this.href.indexOf('Aktualnosci/2012/') != -1) {
		$.fn.colorbox({href:this.href+',ajax', width:'850px'}); 
		this.blur();
		return false;
	}
});

