var $j = jQuery.noConflict();


$j('ul#main-menu li.first').mouseover(
		function()
		{
			$j("ul#main-menu li.first ul:visible").hide();
			$j(this).children('ul').show();
			return false;
		}
		); 




$j('#carousel ul li').each(
					 function(index)
					 {
						 var text = index + 1
						 $j('<a href="#">' + text + '</a>').appendTo('.carousel-controls');
					 }
					 );

function initHandler(carousel)
{
	$j('.carousel-controls a').bind('click', function()
													  {
														   carousel.scroll($j.jcarousel.intval($j(this).text()));
														   return false;
													  }
													  );
	
	$j('.carousel-controls a').first().addClass('active');
}

function itemFirstInHandler(carousel, item, index, state)
{
	$j('.carousel-controls a').eq(index - 1).addClass('active');
}

function itemFirstOutHandler(carousel, item, index, state)
{
	$j('.carousel-controls a').eq(index - 1).removeClass('active');
}

$j(document).ready(function()
							{
								
							$j("#carousel").jcarousel({
								scroll: 1,
								initCallback: initHandler,
								itemFirstInCallback: itemFirstInHandler,
								itemFirstOutCallback: itemFirstOutHandler,
								buttonNextHTML: null,
								buttonPrevHTML: null
							});
							
							$j('#log-in h1').mouseover(
												   function()
												   {
														$j('#log-in h1').css('background-position', '190px -15px'); 
												   }
												   );
							
							$j('#log-in h1').mouseout(
												   function()
												   {
														$j('#log-in h1').css('background-position', '190px 10px'); 
												   }
												   );
							
							$j('#log-in h1').click(
												   function()
												   {
													    if($j('#log-in div.toggle').css('display') === 'none')
													   {
														   $j('#log-in h1').css('background-image', 'url(fileadmin/templates/gfx/minus.png)');
														   $j('#log-in h1').css('background-color', '#ffffff');
														   $j('#log-in h1').css('background-position', '190px 10px');
														   $j('#log-in h1').css('background-repeat', 'no-repeat');
													   }
													   else
													   {
														   $j('#log-in h1').css('background-image', 'url(fileadmin/templates/gfx/plus.png)');
														   $j('#log-in h1').css('background-color', '#f5f5f5');
														   $j('#log-in h1').css('background-position', '190px 10px');
														   $j('#log-in h1').css('background-repeat', 'no-repeat');
													   }
													   $j('#log-in div.toggle').slideToggle();												
												   }
												   );
							
							}
							);
