/*
 * Copyright (c) 2010 Roman Ožana. All rights reserved.
 * @author Roman Ožana <ozana@omdesign.cz>
 * @link www.omdesign.cz
 * @version 12.3.2010
 */

///////////////////////////////////
// Accordion
///////////////////////////////////

jQuery(".accordion h4").wrapInner('<a href="#' + jQuery(".accordion h4").next('div').attr('id') + '" onclick="return false;"></a>');
	
jQuery(".accordion h4").click( function(){
  jQuery(this).next("div").slideToggle("slow").siblings("div:visible").slideUp("slow");
  jQuery(this).toggleClass("active");
  jQuery(this).siblings("h4").removeClass("active");
});

/**
 * Jednoducha tab navigace - staci napsat neco jako tohle :
 * 
 * <div class="idTabs">
 * 	<a href="#tab1">tab1</a>
 * 	<a href="#tab2">tab2</a>
 *  <p id="tab1">tab1</p>
 *  <p id="tab2">tab1</p>
 * </div>
 *
 */
/*
jQuery().ready( function() {
  jQuery(".idTabs").idTabs();
});
*/

///////////////////////////////////
// toggle pro služby
///////////////////////////////////

function serviceToggle(toggleClass)
{		
  jQuery('.' + toggleClass + ' p').slideToggle("slow");
  jQuery('.' + toggleClass + ' > .delsipopis').toggleClass("minus");
  return false;
}

///////////////////////////////////
// dropdown menu
///////////////////////////////////
jQuery(document).ready(function() {
  
  jQuery('ul#nav > li').hover(function() {
    jQuery(this).addClass('hover');
    jQuery('ul:first', this).show();
  },
  function() {
    jQuery('ul:first', this).hide();
    jQuery(this).removeClass('hover');
  });

  jQuery('ul#nav li li').hover(function() {
    jQuery('ul:first', this).each(function() {
      jQuery(this).css('top', $(this).parent().position().top );
      jQuery(this).css('left', $(this).parent().position().left + $(this).parent().width() );
      jQuery(this).show();
    });
  },

  function() {
    jQuery('ul:first', this).hide();
  });

});
///////////////////////////////////
// Cufon
///////////////////////////////////

Cufon('h1')('h2')('h3')('h4')('h5');