$(document).ready(function(){

	$('ul li:last-child').addClass('last-child');

	$('#header_container a').each(function(){
		if($(this).attr('href') != '#'){
			var local = $(this).attr('href');//.split('/');
			var global = jQuery.url.attr('path');//.split('/');
			if(local == global || global.indexOf(local.replace('.html','')) != -1){ //
				$(this).parents('li').addClass('active');
			}
		}
	});
	$('#left_container a, #right_container a, #footer_container a').each(function(){
		if($(this).attr('href') != '#'){
			var local = $(this).attr('href');//.split('/');
			var global = jQuery.url.attr('path');//.split('/');
			if(local == global || global.indexOf(local) != -1){ //.replace('.html','')
				$(this).parents('li').addClass('active');
			}
		}
	});

	$('a.newtarget, ul._blank a').attr('target', '_blank');
	if($.browser.opera ){
		$('#fb_like_box').css({position:'absolute', top: '100px'})
	}
	var fb_on=0;
	$('#fb_like_box').hover(
		function() {
		  if (fb_on==0) {
			$('#fb_like_box').stop().animate({
				right: '0px'
			}, 'slow');
			fb_on=1;
		  }
		},
		function() {
		    if (fb_on==1) { 
			$('#fb_like_box').stop().animate({
				right: '-237px'
			}, 'slow');
			fb_on=0;
		    }
		}
		);
	
	

	$('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');
		}
	});
});
$(window).load(function () {
	setheight();
});
function setheight(){
	var cch = $('#center_container').height();
	var lch = $('#left_container').height();
	var rch = $('#right_container').height();
	var max = Math.max(cch,lch,rch);
	if(lch < max){
		$('#left_container').css({
			height:max+'px'
		});
	}
	if(rch < max){
		$('#right_container').css({
			height:max+'px'
		});
	}
	if(cch < max){
		$('#center_container').css({
			height:max+'px'
		});
	}
}
// 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>');
}
