
var TextBoxCounter = 0;
var TrybJazdy = 2;
var onscreen = new Array();
var MenuReady = false;

function showcomments(nr)
{

$("div#commentslist"+nr).slideToggle("slow");


}

function HideAll()
{
  for(i=1; i<=TextBoxCounter;i++)
  {
    /*
if(TrybJazdy == 1)
	 {
	   $("div#Box"+i).animate({left: parseInt($("div#Box"+i).css('left'),10) == 0 ?
      -$("div#Box"+i).outerWidth() : 0}, 0);
		$("div#Box"+i).hide();
	 }
	 if(TrybJazdy == 2)
	 {
		$("div#Box"+i).animate({"top": "-=320px"}, 0);
	 }
*/
	
    onscreen[i] = false;
  }
	
  if(TrybJazdy == 2)	
	 {
	 	$(".TextBox").animate({"top": "-=320px"}, 2000, 
		function()
		{ 
			for(i=1; i<=TextBoxCounter;i++)
			{
				$("div#Box"+i).show();
				onscreen[i] = false;
  			}
			MenuReady = true;
		} );
	 }
}

function ShowText(nr,Content2)
{
	if(!MenuReady) return;
  speed = 1000;
  for(i=1; i<=TextBoxCounter;i++)
  {
    if(i != nr && onscreen[i])
    {	
		if(TrybJazdy == 1)
	   {
        $("div#Box"+i).animate({left: parseInt($("div#Box"+i).css('left'),10) == 0 ?
        -$("div#Box"+i).outerWidth() : 0}, speed);
			
		  $("div#SlideBox").animate({width:'hide'},speed);	
        $("div#Box"+nr).delay(speed);
		}
		
		if(TrybJazdy == 2)
	   {
        //$("div#Box"+i).slideUp(500);
		  $("div#Box"+i).animate({"top": "-320px"}, speed);	
		  $("div#SlideBox").slideUp(speed);
        $("div#Box"+nr).delay(speed);
		}
		if($("div#Boxb"+i).is(":visible")) $("div#Boxb"+i).slideUp(speed);
		if(Content2) $("div#Boxb"+nr).delay(speed);
      onscreen[i] = false;
      
    }
  }
	
  if(nr == 1)	return;

  if(!onscreen[nr])
  {
    if(TrybJazdy == 1)
	 {	
      $("div#Box"+nr).show();
      $("div#Box"+nr).animate({left: parseInt($("div#Box"+nr).css('left'),10) == 0 ?
      -$("div#Box"+nr).outerWidth() : 0}, speed);
        
      $("div#SlideBox").animate({width:'show'},speed);
	 }
	 
	 if(TrybJazdy == 2)
	 {	
		$("div#Box"+nr).animate({"top": "0px"}, speed);
      $("div#SlideBox").slideDown(speed);
	 }
	 if(Content2) $("div#Boxb"+nr).slideDown(speed);	 
    onscreen[nr] = true;
  }
}

function ShowGallery(PhotosGroup)
{
	$("div#overlay").fadeIn('slow');
	$('.slideshow').cycle('pause');
	$("#windowcontent").load('new_gallery.php?PhotoGroup='+PhotosGroup,function()
	{
		$('.loadertoggler').fadeOut('slow',
		function()
		{
			$('#windowcontent').fadeIn('slow');
		});
	});	
}

function ShowPhoto(PhotosGroup, PhotoID)
{
  //frames['gallery'].location.href = "gallery.php?PhotoGroup="+PhotosGroup+"&PhotoID="+PhotoID;
  ShowGallery(PhotosGroup);	
}
function ShowMovie(MoviesGroup, MovieID)
{
  //frames['gallery'].location.href = "cinema.php?MovieGroup="+MovieGroup+"&MovieID="+MovieID;
  ShowGallery(PhotosGroup);	
}

function HideGallery()
{
  $("div#overlay").fadeOut('slow',
  		function()
  		{
			ShowLoaderToggler();
			$('#windowcontent').hide();
  		}
	);
  $('.slideshow').cycle('resume');	
}

function HideLoaderToggler()
{
	if(!MenuReady) return;
	$(".loadertoggler").fadeOut("slow");
  	$(".loadertogglercontent").fadeIn("slow");
}
function ShowLoaderToggler()
{
	$(".loadertoggler").show();
  	$(".loadertogglercontent").hide();
}

<!--//--><![CDATA[//><!--

sfHover = function() {
	var sfEls = document.getElementById("nav").getElementsByTagName("LI");
	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onmouseover=function() {
			this.className+=" sfhover";
		}
		sfEls[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
		}
	}
}
if (window.attachEvent) window.attachEvent("onload", sfHover);

//--><!]]>
