﻿
	var now=0;	var enable=0;
		$(function()
		{
			$('#text').jScrollPane();
			
		});$(function() {		$('#menu').lavaLamp({fx: 'swing', speed: 500});	});
		(function($) {
			$(function() {
				$('#partners').simplyScroll({
					autoMode: 'loop'
				});
			});
		})(jQuery);				function cl() {		$('#adv').fadeOut(500);		}
		function menu(i) {
		if(now != i && enable==0) {
		now=i;		enable=1;
			$('#content').animate({width: '0px', height: '0px'}, 1000, function() {				$('.jScrollPaneContainer').css('visibility', 'hidden');				$('#loader').show(0, function() { 					$('#text').load('inc/page-'+i+'.php', function() {						$('#loader').delay(750).hide(0, function() { 													$('.jScrollPaneContainer').css('visibility', 'visible');							$('#text').jScrollPane({maintainPosition:0});							$('#content').animate({width: '550px', height: '416px'}, 1000, function() {								enable=0;															}); 						});					});
				}); 			});
		}
		}
		

		
			   $(document).ready(
			  
				function(){
					$('#slideshow').innerfade({
						speed: 1000,
						timeout: 5000,
						type: 'random',
						containerheight: '240px'
					});
					
			});
			$(document).ready(
			function() {
				$('#newsletter').focus(function() {
					if($(this).val()=='Adres email...') {
						$(this).css('font-style', 'normal').val('').css('color', '#ffffff');
					}
				});
			
				$('#newsletter').blur(function() {
					if($(this).val()=='') {
						$(this).css('font-style', 'italic').val('Adres email...').css('color', '#6d605f');
					}			
				});

			  });
				function add() {
				$('#status').hide();
					var email=$('#newsletter').val();
			  		$.ajax({  
						type: "POST",  
						url: "php/newsletter.php",  
						data: "add_email="+ email,  
						success: function(msg){ 
							$('#newsletter').fadeOut(500, function() {
								$('#result').html('<p>Twój adres email został dodany do newslettera!</p>');
							});
						}
					});
					}
					
					function remove() {
					$('#status').hide();
			  var email=$('#newsletter').val();
			  				$.ajax({  
						type: "POST",  
						url: "php/newsletter.php",  
						data: "remove_email="+ email,  
						success: function(msg){ 
							$('#newsletter').fadeOut(500, function() {
								$('#result').html('<p>Twój adres email został usunięty z naszej bazy.</p>');
							});
						}
					});
					}

