var baskettimeout = null;
$(document).ready(function(){

	$('td.pics a, td.miniaturka a, a.fancy').not('.nofancy').fancybox({
		padding: 0,
		titlePosition 	: 'over',
		hideOnContentClick: true
	});

$('#top_container a, #left_container a, #center_container a').not('[href^=http]').not('[href*=#]').not('[href*=@]').each(function(){

	$(this).attr('href',$(this).attr('href')+'#logo');
});

	$("img.rounded10px.size1").each(function() {
		$(this).wrap(function(){
			return '<span class="' + $(this).attr('class') + '" style="background:url(' + $(this).attr('src') + ') no-repeat center center; width: 120px; height: 150px;" />';
		});
		$(this).css("opacity","0");
	});

	$("img.rounded10px.size2").each(function() {
		$(this).wrap(function(){
			return '<span class="' + $(this).attr('class') + '" style="background:url(' + $(this).attr('src') + ') no-repeat center center; width: 240px; height: 300px;" />';
		});
		$(this).css("opacity","0");
	});

	$("img.rounded10px.size3").each(function() {
		$(this).wrap(function(){
			return '<span class="' + $(this).attr('class') + '" style="background:url(' + $(this).attr('src') + ') no-repeat center center; width: 150px; height: 120px;" />';
		});
		$(this).css("opacity","0");
	});

	$("img.rounded10px.size4").each(function() {
		$(this).wrap(function(){
			return '<span class="' + $(this).attr('class') + '" style="background:url(' + $(this).attr('src') + ') no-repeat center center; width: 595px; height: 200px;" />';
		});
		$(this).css("opacity","0");
	});

	$('#left_container>*:first-child').addClass('first-child');
	$('ul li:last-child').addClass('last-child');
	$('p.stronnicowanie a:first-child').each(function(){
		if(isNaN($(this).text())){
			$(this).addClass('prev');
		}
	});
	$('p.stronnicowanie a:last-child').each(function(){
		if(isNaN($(this).text())){
			$(this).addClass('next');
		}
	});

	$('#top_container a').each(function(){
		if($(this).attr('href') != '#'){
			var local = $(this).attr('href').split('/');
			var global = jQuery.url.attr('path').split('/');
			local = local[1].split('.');
			global = global[1].split('.');
			if(local[0] == global[0]){
				$(this).addClass('active'); //.parent()
			}
		}
	});

	$('#left_container').append('<iframe src="http://www.facebook.com/plugins/likebox.php?id=142970909060353&amp;width=295&amp;connections=10&amp;stream=false&amp;header=true&amp;height=287" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:295px; height:287px; background: #FFF; margin-left: -8px;" allowTransparency="true"></iframe>');

});
// taken from Lukasz Lach devblog - http://anakin.us
function om(m){
	t='';
	for(i=m.length-1;i>=0;i--)if(m.charAt(i)=='*')t+='@';else t+=m.charAt(i);document.write('<a href="mailto:'+t+'" title="'+t+'">'+t+'</a>');
}
