



jQuery(document).ready(function(){

	//Featured  Sliding
	jQuery('.view-jcarousel-slider .jcarousellite li').hover(function(){
		jQuery(".views-field-field-jcarousel-title-value", this).stop().animate({bottom:'36px'},{queue:false,duration:160});},
	function() {
	jQuery(".views-field-field-jcarousel-title-value", this).stop().animate({bottom:'0px'},{queue:false,duration:160});
		});

	jQuery('.view-jcarousel-slider .jcarousellite li').hover(function(){
		jQuery(".views-field-field-jcarousel-description-value", this).stop().animate({bottom:'0px'},{queue:false,duration:160});},
	function() {
	jQuery(".views-field-field-jcarousel-description-value", this).stop().animate({bottom:'-36px'},{queue:false,duration:160});
		});

	jQuery('#content-inner-inner .node:last').addClass("node-last");

});


jQuery(document).ready(function(){
			jQuery('span[name="dodaj_komentarz_submit"]').click(function(){
			
				var k = jQuery('textarea[name="komentarz"]').val();
				var k_typ = jQuery('input[name="komentarz_typ"]').val();
				var k_wyn = jQuery('input[name="komentarz_wyn"]').val();
				var pliczek = jQuery('input[name="pliczek"]').val();
				var rodzaj_z_bazy = jQuery('input[name="rodzaj_z_bazy"]').val();
				var id_z_bazy = jQuery('input[name="id_z_bazy"]').val();

				jQuery('span[name="dodaj_komentarz_submit"]').hide('fast');
				
				jQuery.ajax({
						type: "POST",
						url: "/class/class.komentarze_wyk.php",
						data: "komentarz="+k+"&pliczek="+pliczek+"&komentarz_typ="+k_typ+"&komentarz_wyn="+k_wyn+"&rodzaj_z_bazy="+rodzaj_z_bazy+"&id_z_bazy="+id_z_bazy,
						success: function(msg) {
  							if (msg == "Brak treści komentarza" || msg == "Nie możesz dodać dwóch komentarzy w tak krótkim odstępie czasie! Zaczekaj 2 minuty")
  							{
  								jQuery('p[name="error_kom"]').html(msg);
  								jQuery('p[name="error_kom"]').show('slow');
  								jQuery('span[name="dodaj_komentarz_submit"]').show('slow');
  							}
  							else if (msg == "Komentarz dodany prawidłowo!")
  							{
  								jQuery('p[name="error_kom"]').html('');
  								jQuery('p[name="error_kom"]').hide();
  								jQuery('div[class="box"]').html('');
  								jQuery('p[name="ok_kom"]').html(msg);
  								jQuery('p[name="ok_kom"]').show('slow');
  							}
  							else 
  							{
  								jQuery('p[name="error_kom"]').html('');
  								jQuery('p[name="error_kom"]').hide();
  								jQuery('p[name="warning_kom"]').html(msg);
  								jQuery('p[name="warning_kom"]').show('slow');
  							}
	 					}
 				});
					
			});
});




jQuery(document).ready(function(){
	jQuery('span[name="thumb_up"]').click(function(){	
		var id_z_bazy = jQuery('span[name="thumb_up"]').attr('class');	
		jQuery.ajax({
			type: "POST",
			url: "/class/class.ocena.php",
			data: "rodzaj=gora&pliczek="+id_z_bazy+"",
			success: function(msg) {
  				if (msg == "ok")
  				{
					var wartosc = jQuery('span[name="ilosc_up"]').attr('class');
					var liczba = parseInt(wartosc);
					liczba = liczba + 1;
					jQuery('span[name="ilosc_up"]').html(""+liczba+"");
  				}
  				else if (msg == "Zaloguj się")
  				{
  					jQuery('span[name="glosowanie"]').html('Zaloguj się');
  				}
			}
 		});
					
	});
	jQuery('span[name="thumb_down"]').click(function(){
		var id_z_bazy = jQuery('span[name="thumb_down"]').attr('class');	
		jQuery.ajax({
			type: "POST",
			url: "/class/class.ocena.php",
			data: "rodzaj=dol&pliczek="+id_z_bazy+"",
			success: function(msg) {
  				if (msg == "ok")
  				{
					var wartosc = jQuery('span[name="ilosc_down"]').attr('class');
					var liczba = parseInt(wartosc);
					liczba = liczba + 1;
					jQuery('span[name="ilosc_down"]').html(""+liczba+"");
  				}
  				else if (msg == "Zaloguj się")
  				{
  					jQuery('span[name="glosowanie"]').html('Zaloguj się');  					
  				}
			}
 		});
					
	});
});





jQuery(document).ready(function(){
	
	jQuery('.spoiler-content').hide();

	jQuery('span[class="spoiler-funkcja"]').click(function(){
		var id = jQuery(this).attr('id');
		var wartosc = jQuery(this).text();
		
		if (wartosc == "Pokaż")
		{
			jQuery(this).text('Ukryj');
			jQuery('div[id="spoiler-content-'+ id +'"]').show('slow');
		}
		else
		{
			jQuery(this).text('Pokaż');			
			jQuery('div[id="spoiler-content-'+ id +'"]').hide('fast');
		}
		  
	});
});


jQuery(document).ready(function(){
	jQuery('img[id="emo"]').click(function(){
		var emoo = jQuery(this).attr('class');
		
		jQuery('textarea[id="edit-comment"]').val(jQuery('textarea[id="edit-comment"]').val()+""+emoo);
	});
});

