$(function () {
		$('#js-news').ticker();
	});




/*$(document).ready(function(){
	
				$('#konkurs').flash({ 
					src: 'http://www.osuch.edu.pl/1b.swf',
					width: 728,
					height: 90
				},
				{
					version: 8
				});
			});*/


$(document).ready(function() {
$("#various1").fancybox({
		'titlePosition'		: 'inside',
		'width'		: 640,
		'transitionIn'		: 'none',
		'transitionOut'		: 'none'
	});

			$("a#single_image").fancybox();
	
		$("a#inline").fancybox({
		'hideOnContentClick': true
	});


			$("a.grouped_elements").fancybox({


				'titleFormat':  function(title, currentArray, currentIndex, currentOpts) {

					return  '<table id="fancybox-title-float-wrap" cellpadding="0" cellspacing="0"><tr><td id="fancybox-title-float-left"></td><td id="fancybox-title-float-main">Image ' + (currentIndex + 1) + ' / ' + currentArray.length + (title.length ? ' &nbsp; ' + title : '') + '</td><td id="fancybox-title-float-right"></td></tr></table>';

				},
				

			});

			$("a#tip4").click(function() {
	$.fancybox({
			'padding'		: 0,
			'autoScale'		: false,
			'transitionIn'	: 'none',
			'transitionOut'	: 'none',
			'title'			: this.title,
			'width'		: 640,
			'height'		: 385,
			'href'			: this.href.replace(new RegExp("watch\\?v=", "i"), 'v/'),
			'type'			: 'swf',
			'swf'			: {
			   	 'wmode'		: 'transparent',
				'allowfullscreen'	: 'true'
			}
		});

	return false;
});

			$("a#example1").fancybox();



			$("a#example2").fancybox({

				'overlayShow'	: false,

				'transitionIn'	: 'elastic',

				'transitionOut'	: 'elastic'

			});



			$("a#example3").fancybox({

				'transitionIn'	: 'none',

				'transitionOut'	: 'none'	

			});



			$("a#example4").fancybox({

				'opacity'		: true,

				'overlayShow'	: false,

				'transitionIn'	: 'elastic',

				'transitionOut'	: 'none'

			});



			$("a#example5").fancybox();



			$("a#example6").fancybox({

				'titlePosition'		: 'outside',

				'overlayColor'		: '#000',

				'overlayOpacity'	: 0.9

			});



			$("a#example7").fancybox({

				'titlePosition'	: 'inside'

			});



			$("a#example8").fancybox({

				'titlePosition'	: 'over'

			});



			$("a[rel=example_group]").fancybox({

				'transitionIn'		: 'none',

				'transitionOut'		: 'none',

				'titlePosition' 	: 'over',

				'titleFormat'		: function(title, currentArray, currentIndex, currentOpts) {

					return '<span id="fancybox-title-over">Image ' + (currentIndex + 1) + ' / ' + currentArray.length + (title.length ? ' &nbsp; ' + title : '') + '</span>';

				}

			});


		});


	

	//plugin
$(function(){$.fn.scrollToTop=function(){$(this).hide().removeAttr("href");if($(window).scrollTop()!="0"){$(this).fadeIn("slow")}var scrollDiv=$(this);$(window).scroll(function(){if($(window).scrollTop()=="0"){$(scrollDiv).fadeOut("slow")}else{$(scrollDiv).fadeIn("slow")}});$(this).click(function(){$("html, body").animate({scrollTop:0},"slow")})}});

$(function() {
$("#top-link").scrollToTop();
});	
	

//------------------------------------------------------	
	

	// News
	$( document ).ready(
  	function()
  	{
    	$( '.news' ).not( '#first-news' ).find( '.text' ).hide();
       
    	
	});
		
    // Menu
    
	


	function showMore( id )
	{
  		if( $( id ).parent().parent().children( '.text' ).css( 'display' ) == 'none' )
  		{
    	$( id ).parent().parent().children( '.text' ).slideDown( 'fast' );
  		}
  		else
  		{
    		$( id ).parent().parent().children( '.text' ).slideUp( 'fast' );
  		}
	}

	function makeUrl()
	{
  		value = $( '#year' ).val();
  
  		if( value >= $( '#limit-lower' ).val() && value <= $( '#limit-upper' ).val() )
  		{
    		url = 'absolwenci,' + value + '.html';
    		window.location = url;
  		}
  		else
  		{
    		alert( 'Dostępne są roczniki od ' + $( '#limit-lower' ).val() + ' do ' + $( '#limit-upper' ).val() );
  		}
  
  		return false;
	}
	
//SNOW
$(document).ready(function(){
			//Start the snow default options you can also make it snow in certain elements, etc.
			$(document).snowfall('clear');
				$(document).snowfall({round : true, minSize: 5, maxSize:8});
			
			$("#clear").click(function(){
				$(document).snowfall('clear'); // How you clear
			});
			
			$("#round").click(function(){
				$('body').css({'backgroundColor' : '#666'});
				$(document).snowfall('clear');
				$(document).snowfall({round : true, minSize: 5, maxSize:8}); // add rounded
			});
			
			$("#shadows").click(function(){
				$('body').css({'backgroundColor' : '#ccc'});
				$(document).snowfall('clear');
				
				
				$(document).snowfall({shadow : true, flakeCount:200}); // add shadows
			});

			$("#roundshadows").click(function(){
				$('body').css({'backgroundColor' : '#ccc'});
				$(document).snowfall('clear');
				$(document).snowfall({shadow : true, round : true,  minSize: 5, maxSize:8}); // add shadows
			});
			
			$("#collection").click(function(){
				$('body').css({'backgroundColor' : '#666'});
				$(document).snowfall('clear');
				
				
				$(document).snowfall({collection : '.collectonme', flakeCount : 250});
			});
		});	
	
