$(document).ready(function(){

$(".div_reveal").hide(); //Hide all content
$(".tab_content").hide(); //Hide all content
if(location.hash != "") {
var target = "#"+location.hash.split("#")[1]; // need semicolon at end of line
$(location.hash).show(); //Show first tab content
$("ul.tabs li:has(a[href="+target+"])").addClass("active").show(); //need ‘+’ either side of ‘target’
} else {
$("ul.tabs li:first").addClass("active").show(); //Activate first tab
$(".tab_content:first").show(); //Show first tab content
}

//On Click Event
$("ul.tabs li").click(function() {
$("ul.tabs li").removeClass("active"); //Remove any “active” class
$(this).addClass("active"); //Add “active” class to selected tab
$(".tab_content").hide(); //Hide all tab content
var activeTab = $(this).find("a").attr("href"); //Find the href attribute value to identify the active tab content
if($.browser.msie)
{$(activeTab).show();}
else
{$(activeTab).fadeIn();}
return false;
});

	$("#menu li:first").addClass("first");
	// Cenová tabulka
	$("#plany tr:even").addClass("even");
	$("#plany tr:odd").addClass("odd");
	$("#plany tr:last").addClass("last");
  
   var startHeight = $('.obalovaci1').height();
		$('.btn1').click(function() {
		   // find nearby elements
		   var obalovaci1 = $(this).parents().find('.obalovaci1');
		   var vnitrni1 = obalovaci1.children('.vnitrni1');  
		   
		   // collect current heights
		   var vnitrni1H = vnitrni1.height();
		   var obalovaci1H = obalovaci1.height();
		   
		   // calculate new height
		   var newHeight =  + parseInt(vnitrni1H);
	
		   // determines whether to toggle height
		   newHeight = obalovaci1H > startHeight ? startHeight : newHeight;
		   obalovaci1.animate({height:newHeight}, 300);
		   $(this).toggleClass("active");
    });       

    var startHeight = $('.obalovaci2').height();
		$('.btn2').click(function() {
		   // find nearby elements
		   var obalovaci2 = $(this).parents().find('.obalovaci2');
		   var vnitrni2 = obalovaci2.children('.vnitrni2');  
		   
		   // collect current heights
		   var vnitrni2H = vnitrni2.height();
		   var obalovaci2H = obalovaci2.height();
		   
		   // calculate new height
		   var newHeight =  + parseInt(vnitrni2H);
	
		   // determines whether to toggle height
		   newHeight = obalovaci2H > startHeight ? startHeight : newHeight;
		   obalovaci2.animate({height:newHeight}, 300);
		   $(this).toggleClass("active");
    });
    
    var startHeight = $('.obalovaci3').height();
		$('.btn3').click(function() {
		   // find nearby elements
		   var obalovaci3 = $(this).parents().find('.obalovaci3');
		   var vnitrni3 = obalovaci3.children('.vnitrni3');  
		   
		   // collect current heights
		   var vnitrni3H = vnitrni3.height();
		   var obalovaci3H = obalovaci3.height();
		   
		   // calculate new height
		   var newHeight =  + parseInt(vnitrni3H);
	
		   // determines whether to toggle height
		   newHeight = obalovaci3H > startHeight ? startHeight : newHeight;
		   obalovaci3.animate({height:newHeight}, 300);
		   $(this).toggleClass("active");
    });
    
    var startHeight = $('.obalovaci4').height();
		$('.btn4').click(function() {
		   // find nearby elements
		   var obalovaci4 = $(this).parents().find('.obalovaci4');
		   var vnitrni4 = obalovaci4.children('.vnitrni4');  
		   
		   // collect current heights
		   var vnitrni4H = vnitrni4.height();
		   var obalovaci4H = obalovaci4.height();
		   
		   // calculate new height
		   var newHeight =  + parseInt(vnitrni4H);
	
		   // determines whether to toggle height
		   newHeight = obalovaci4H > startHeight ? startHeight : newHeight;
		   obalovaci4.animate({height:newHeight}, 300);
		   $(this).toggleClass("active");
    });
    
    var startHeight = $('.obalovaci5').height();
		$('.btn5').click(function() {
		   // find nearby elements
		   var obalovaci5 = $(this).parents().find('.obalovaci5');
		   var vnitrni5 = obalovaci5.children('.vnitrni5');  
		   
		   // collect current heights
		   var vnitrni5H = vnitrni5.height();
		   var obalovaci5H = obalovaci5.height();
		   
		   // calculate new height
		   var newHeight =  + parseInt(vnitrni5H);
	
		   // determines whether to toggle height
		   newHeight = obalovaci5H > startHeight ? startHeight : newHeight;
		   obalovaci5.animate({height:newHeight}, 300);
		   $(this).toggleClass("active");
    });
  
});

