function show(id) 
{
    var e = document.getElementById(id);
    if(e.style.display == 'none')
      e.style.display = 'block';
    else
      e.style.display = 'none';
}
function pokaz_opis(nr)
{
  $(".opis").hide();
  $("#opis"+nr).toggle('drop',{direction: 'right'},500);
  
  
  
  //$.cookie("pnum", null);

  //$.cookie("pnum", nr,{ path: '/'});
  return false;

}
function nazwazakl(x)
{
  var par = x.parent('podzakladki');
  var idpar = par.attr('id');
  addcookie(idpar); 
}
function addcookie(zaklid)
{
  $.cookie("zakladka", null);

  $.cookie("zakladka", zaklid,{ path: '/'});
  
}
function slideShow() {
  
	$('.carousel:first').fadeIn(3000); 
	//$('.carousel').css({opacity: 0.0});
	//$('.carousel:first').css({opacity: 1.0});
	gallery();
	i=setInterval('gallery()',7000);
	
}

function gallery() 
{	
	var current = ($('.carousel.show')?  $('.carousel.show') : $('.carousel:first'));
	var next = ((current.next().length) ? ((current.next().hasClass('caption'))? $('.carousel:first') :current.next()) : $('.carousel:first'));	
	//Set the fade in effect for the next image, show class has higher z-index
	
  //Hide the current image
  current.fadeOut(3000).removeClass('show');
  
  //Set the fade in effect for the next image, show class has higher z-index
  next.fadeIn(3000).addClass('show');
}

$(document).ready(function()
{  
  $('ul.sf-menu').supersubs({
            minWidth:    12,   // minimum width of sub-menus in em units 
            maxWidth:    30,   // maximum width of sub-menus in em units 
            extraWidth:  1     // extra width can ensure lines don't sometimes turn over 
                               // due to slight rounding differences and font-family );
      }).superfish();           // call supersubs first, then superfish, so that subs are 
                                // not display:none when measuring. Call before initialising 
                                // containing tabs for same reason
                                
  slideShow();
  
  $('.rightcol #praw li:first ul').show();
  $('.rightcol #praw>li:last').css('border','none');
  
  /*if( $.cookie("pnum") ) pokaz_opis( $.cookie("pnum") );
  if( $.cookie("zakladka") )
  {
    $('.podzakladki').hide();
    $.cookie("zakladka").show();
  }*/
});

