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}, 2000, function() {
	        $active.removeClass('active last-active');
	    });
}

$(document).ready(function() 
{
	setInterval( "slideSwitch()", 8000 );
	
	$("#commentlist>li").each(function (i) {
    i = i+1;
    $(this).prepend('<span class="oln">' + i + '</span>');
    $(this).addClass('nonum');
   });
   
   $("#commentlist>li>ul>li").each(function (i) {
    i = i+1;
    $(this).prepend('<span class="uln"> - </span>');
   });
   $('table.normaltable tr:nth-child(even)').addClass('even');	
});

function submitlogin()
{
	$.post("system/login.php", { login: ""+$('#login').val(), password: $('#password').val()+""},
  			function(data)
  			{
  				
    			$('#loginpanel').replaceWith(data);
    			
  			});
}
function submitlogout()
{
	$.post("system/login.php", { signout: "TRUE"},
  			function(data)
  			{
  				
    			$('#loginpanel').replaceWith(data);
    			
  			});
}
function remindpassword()
{
	$.post("system/login.php", { remind: "TRUE"},
  			function(data)
  			{
  				$('#loginpanel').replaceWith(data);
    		});
}
function submitremind()
{
	$.post("system/login.php", { remind: "TRUE", login: ""+$('#login').val()},
  			function(data)
  			{
  				$('#loginpanel').replaceWith(data);
    		});
}
