// JavaScript Document

$(document).ready(function(){		
	$('#ddt span').corner('top 3px');	
	$('li', '#zmr').corner('top 3px');
	$('li', '#pss').corner('top 3px');
	$('.ds00').corner('top 3px');
	$('.dt').corner('left 3px');
	$('.cg').corner('right 3px');
	$('#zcpt a').corner('bottom 3px');
	$('.hds span, #part h3, #header-podstrona h3, .plan h4').corner('top 4px');
	$('#pisaniepostow a,.odpowiedz, #rightboxpods h3, #rightboxpods2 h3, #addto, .film a, .film, #opiswideo, #komentarze, #leftboxpod .komentarz p, #tagi, #wk ul ').corner('3px');
	$('.odpowiedz div').corner('left 3px');
	$('#progr a, .godz div span, .ot').corner('2px');
	$('.godz:odd').addClass('gr');
	$('.film:even').addClass('bga');
	$('.programy:odd').addClass('wh');
	$('li', '#menu').hover(function(){		
		$('ul', this).slideDown();
		$('a:eq(0)', this).addClass('kl');
	});
	$('li', '#menu').mouseleave(function(){		
		$('ul', this).slideUp();
		$('a:eq(0)', this).removeClass('kl');
	});
	var n_numTabs = $("#partnerzy ul > li").size();
	if(n_numTabs < 11){
		$('#nast, #pop').hide();
	}
	
	$('li', '#wk').click(function(){
		var cl = $('a:first', this).attr('class');
		if(cl != 'zaz'){
			$('li', '#wk').removeClass('frd');		
			$(this).addClass('frd');
			$('ul', '#wk').slideUp('slow');
			$('ul', this).slideDown('slow');
		}
	});
	
	/*$('#fraza').click(function(){	
		var tresc = $(this).attr('value');		
		if(tresc == 'Wpisz szukana fraze') $(this).attr('value', '');
	});
	$('#fraza').blur(function(){	
		var tresc = $(this).attr('value');		
		if(tresc == '') $(this).attr('value', 'Wpisz szukana fraze');
	});*/
	
	/*$('.inptxt').click(function(){	
		var tresc = $(this).attr('value');		
		if(tresc == 'Tutaj wpisz swoj login') $(this).attr('value', '');
	});
	$('.inptxt').blur(function(){	
		var tresc = $(this).attr('value');		
		if(tresc == '') $(this).attr('value', 'Tutaj wpisz swoj login');
	});*/
	
	$('#email').click(function(){	
		var tresc = $(this).attr('value');		
		if(tresc == 'Tutaj wpisz swoj e-mail') $(this).attr('value', '');
	});
	$('#email').blur(function(){	
		var tresc = $(this).attr('value');		
		if(tresc == '') $(this).attr('value', 'Tutaj wpisz swoj e-mail');
	});
	
	$('img', '#lista-newsow').click(function(){
		var idNews = $(this).attr('alt');
		for(i=0; i<100; i++){
			$('#news'+i+'').hide();
		}
		$('#news'+idNews+'').show('slow');
	});
	$("#lista-newsow").jCarouselLite({
        btnNext: "#next",
        btnPrev: "#prev",
		visible: 4,
		speed: 200,
		circular: false
    });
	/*$("#partnerzy").jCarouselLite({
        btnNext: "#nast",
        btnPrev: "#pop",
		visible: 10,
		speed: 200,
		circular: false
    });*/
	var n_numTabs = $("#partnerzy ul li  > a").size();
	$('#partnerzy ul li').css('width', ''+n_numTabs*130+'px');
	
	$("#partnerzy ul").marquee({xScroll: "left"});
	
	$('li', '#zmr').hover(function(){						  
		$(this).addClass('kl');
	});
	
	$('li', '#zmr').mouseout(function(){							  
		$(this).removeClass('kl');
	});
	$('li', '#zmr').click(function(){
        if($(this).hasClass('ds2'))
        {
            return;
        }
        
		var idZkl = $(this).attr('title');
		for(i=0; i<6; i++){
			$('#sl'+i+'').slideUp();
		}	
		$('li', '#zmr').removeClass('ds');	
		$(this).addClass('ds');
		$('#sl'+idZkl+'').slideDown('slow');
	});
	/*$('.video img').hover(function(){
		var img = $(this);
		var newimg = img.attr('title');
		var oldimg = img.attr('src');
		if(newimg != ''){
		img.attr('title', oldimg);
		img.attr('src', newimg);
		}
	});
	$('.video img').mouseout(function(){							  
		var img = $(this);
		var newimg = img.attr('title');
		var oldimg = img.attr('src');
		if(newimg != ''){
		img.attr('title', oldimg);
		img.attr('src', newimg);
		}
	});*/
	/*$('li', '#pss').click(function(){
		var atrTitle = $(this).attr('title');
		$('li', '#pss').removeClass('gh');
		$(this).addClass('gh');
		$('#sdp1').slideUp('slow');
		$('#sdp2').slideUp('slow');
		$('#sdp'+atrTitle+'').slideDown('slow');
	});*/
	$('span', '.ln:even').addClass('pp');
	$('.shout:odd', '#shoutbox').addClass('shout2');
	
	$('#partnerzy img').hover(function(){
		var img = $(this);
		var newimg = img.attr('alt');
		var oldimg = img.attr('src');
		if(newimg != ''){
		img.attr('alt', oldimg);
		img.attr('src', newimg);
		}
	});
	$('#partnerzy img').mouseout(function(){							  
		var img = $(this);
		var newimg = img.attr('alt');
		var oldimg = img.attr('src');
		if(newimg != ''){
		img.attr('alt', oldimg);
		img.attr('src', newimg);
		}
	});
	$('span', '#ss').click(function(){	
		var ff = $(this).attr('title');
		var parDiv = $(this).parents('#leftboxpod');
		$('p', parDiv).attr('font-size:'+ff+'px');
	});
	
	
});
