// JavaScript Document


function showHide(nazwaDIVa){
	if($('#'+nazwaDIVa).css('display')=='none'){
		$('#'+nazwaDIVa).show();
	}
	else{
		$('#'+nazwaDIVa).hide();
	}
}

function zaloguj(){
	$('#loginForm').submit(); 
}

function wyloguj(){
	$('#logoutForm').submit(); 
}


function slideSwitch() {
		var $active = $('#slideshow img.active');

		if ( $active.length == 0 ) $active = $('#slideshow img:last');
	
		var $next =  $active.next().length ? $active.next()
			: $('#slideshow img:first');
	
		$active.addClass('last-active');
	
		$next.css({opacity: 0.0})
			.addClass('active')
			.animate({opacity: 1.0}, 1000, function() {
				$active.removeClass('active last-active');
			});

	}
	


// funkcje do tip boxa
jQuery(document).ready(function(){
								
	
	// do pokazu slajdow
	$(function() {
		setInterval( "slideSwitch()", 5000 );
	});



	


									
	$("body").append('<div id="tipBox" style="z-index:30; position:absolute; border:#999999 1px solid; background:#FFFFFF; padding:5px; display:none;"></div>');
								
	$().mousemove(function(e){
		//$('#tipBox').html('tip');
		$('#tipBox').css({ left:(e.pageX+15) , top:(e.pageY+15) });
		
	}); 
	$(".tip").mouseover(function(e){
		$(this).css("cursor","pointer");
		$('#tipBox').html($(this).attr("tipText"));
		$('#tipBox').show();
		//$('#tipBox').css({ left:(e.pageX+15) , top:(e.pageY+15) });
	});
	$(".tip").mouseout(function(){
		$('#tipBox').html('');
		$('#tipBox').hide();
	});
})












