function css() {

	/* go on for IE in generall */
	if($.browser.msie){
		
		/* take care IE 6 only */
		if($.browser.version <= 6) {
		
			$('img').css('behavior','url(/pliki/javascript/iepngfix.htc)');
		}
	}

/*	
	$('#last-project').not('#tab-1 #last-project').hover(function(){ 
		$(this).children('.slide-txt').slideDown(); 
	}, function(){ 
		$(this).children('.slide-txt').slideUp(); 
	});
*/
	$('a.cloud, img.cloud').cloud();
	
	$('#tab-0 .content img').wrap('<span class="img"></span>');
  	
	$('#clients-mod ul').unbind().bind('click',function(){
		var address = $(this).attr('title');
		//window.location = location;
		window.open(address);
	});

	$('#nav li a').mouseover(function(){
		var
			a = $(this).parent();
			b = a.siblings();
			c = a.attr('class');
			
			if(!a.is('.act')){
				c = c.split('item-')[1];
				
				b.removeClass('act');
				a.addClass('act');
				
				$('.tab').hide();
				$('.tab').eq(c).show();
				$('.tab').eq(c).find('.content').jScrollPane();
                $.cookie('tab', c, {expire: 365});
			}
	});
	
	if($.cookie('tab')){
        var q = $.cookie('tab');
        $('#nav li').eq(q).addClass('act');
        $('.tab').hide().eq(q).show().find('.content').jScrollPane();
	}
	else{
        $('#nav li').eq(0).addClass('act');
        $('.tab').eq(0).find('.content').jScrollPane();
		$.cookie('tab', 0, {expire: 365});
	}
	
}

$(document).ready(css);

jQuery.fn.slider = function(option) {
	option = jQuery.extend({
		slideAnimate: false,
		slideInterval: 2000
	}, option);	
	
	return this.each(function(i){	

		a = $(this);
		b = a.find('#banner-menu');
		c = b.find('a');
		d = c.size();
		
		e=0;
		
		f = a.find('#banner-show');
		g = f.find('li');
		
		g.hide();
		g.eq(e).show().addClass('act');
		
		e = e+1;
		
		c.each(function(e){
			$(this).click(function(l){
				l.preventDefault();
				i = $(this).attr('href');
				animSlider(e,i);
			});
		});
		
		
		function setAnimation(){
		
			if(e==d)
				e = 0;
				
			i = c.eq(e).attr('href');
			animSlider(e,i);
			
			e++;
		}
				
				
		function animSlider(e,i){
			e = parseInt(e);

			c.removeClass('active');
			c.eq(e).addClass('active');
			

			f.find('.act').hide().removeClass('act');
			g.eq(e).fadeIn().addClass('act');
			
			e++;
			
		} // function
		
		if(option.slideAnimate){
			si = setInterval(setAnimation, option.slideInterval);
		} // if(option.slideAnimate)
		
		if(si){
			a.mouseover(function(){
				clearInterval(si);
			});
			
			a.mouseout(function(){
				si = setInterval(setAnimation, option.slideInterval);
			});
		}// if(si)
	}); // each
}	
jQuery.fn.extend({
	cloud: function() {
		$('body').prepend('<div id="cloud"></div>');
		$(this).mouseover(function(e){
		
			cloudClass = $(this).attr('rel');
			/*
			if($(this).is('.cloud')){
				cloudTitle = $(this).text() || $(this).children().attr('alt');
				cloudTitle = '<strong>'+cloudTitle+'</strong>';
			}
			if($(this).is('.overcloud')){
				cloudTitle = $(this).children('.cloud-desc').text();			
				cloudTitle = '<strong>'+cloudTitle+'</strong>';
			}
			if($(this).is('.clearcloud')){ cloudTitle = ''; }
			*/
			cloudText = $(this).attr('title');
			
			$('#cloud').addClass(cloudClass).html('<p>'+cloudText+'</p>');
			$(this).attr('title','');
			
		});
		$(this).mousemove(function(e){
			var x, y;
			try { x = e.pageX-20; y = e.pageY-30; } // FF
			catch(e) { x = event.clientX-20; y = event.clientY-40; } // IE
		
			y = y+40+'px';
			x = x+40+'px';
			$('#cloud').css({ display: 'block', top: y, left: x})
		});
		
		$(this).mouseout(function(e){ 
			$('#cloud').removeClass().css({ display: 'none'}); 
			cloudText = $('#cloud p').text();
			$(this).attr('title',cloudText);
		});	
	} // cloud()
});		
