// JavaScript Document by Warski
var idx_auto_warski = 0;
$(document).ready(
function() {

$(".multitabMain dd:odd, .multitabMain dt:odd").addClass("bgGrey");

$(".tabs h4").click(function()
 {

  // pobieramy nazwe identyfikatora
  var elBox =  $(this).parent().parent().attr("id");

  // jezeli nie ma identyfikatora
  if (elBox == "") {  
	//generujemy nazwe identyfikatora inkrementujac parametr globalny
	elBox = "abox_" + ++idx_auto_warski;
	// dodajemy id na nasz element
	$(this).parent().parent().parent().attr("id", elBox);
  }

  $("#" + elBox + " h4").removeClass("active");
  $(this).addClass("active");

  var element_index = $("#" + elBox + " h4").index(this);

   $("#" + elBox + " .content_tab:visible").hide();
   $("#" + elBox + " .content_tab").eq(element_index).show();  
 
  return false;
 });

	
	
	$("#sub_menu_exp span").click(
	function() {
 		$(this).next().toggle();
	}).toggle(function() { $(this).addClass("active"); }, function() { $(this).removeClass("active"); });


$("#menu_level_0 li").hover(function() {

    $("ul:first", this).show();
    $(this).removeClass("menuh");
	  $(this).addClass("menuh");     

  },

  function() {

    $("ul:first", this).hide();
    $(this).removeClass("menuh"); 

  });


$("#menu_level_0 > li > a").wrap("<div><span></span></div>");
 


var width = $("#motto_content").width();
var height = $("#motto_content").height();     
var fix_flash = height + 20;
var minus_height = ("-" + fix_flash);

$("#opacity").css("width", width);
$("#opacity").css("height", fix_flash);

$("#motto_content").css("top",  minus_height + "px");



// page flip
$("#pageflip").hover(function() { //On hover...
	$("#pageflip img, .msg_block").stop()
		.animate({ //Animate and expand the image and the msg_block (Width + height)
		width: '307px',
    height: '319px' 
		}, 500);
	} , function() {
	$("#pageflip img").stop() //On hover out, go back to original size 50x52
		.animate({
			width: '50px',
			height: '52px'
		}, 220);
	$(".msg_block").stop() //On hover out, go back to original size 50x50
		.animate({
			width: '50px',
			height: '50px'
		}, 200); //Note this one retracts a bit faster (to prevent glitching in IE)
});




});
 
$(document).ready(
function() {
$("a[@rel*=lightbox]").lightBox();    	
});
