jQuery(document).ready(function(){ 
  if(jQuery("ul.dropdown").length){
    jQuery("ul.dropdown").superfish({
      pathLevels:    1,                  // the number of levels of submenus that remain open or are restored using pathClass 
      delay:         500,                // the delay in milliseconds that the mouse can remain outside a submenu without it closing 
      animation:     {height:'toggle'},   // an object equivalent to first parameter of jQuery’s .animate() method 
      speed:         'normal',           // speed of the animation. Equivalent to second parameter of jQuery’s .animate() method 
      autoArrows:    false,               // if true, arrow mark-up generated automatically = cleaner source code at expense of initialisation performance 
      dropShadows:   true,               // completely disable drop shadows by setting this to false 
      disableHI:     false,              // set to true to disable hoverIntent detection 
      onInit:        function(){},       // callback function fires once Superfish is initialised – 'this' is the containing ul 
      onBeforeShow:  function(){},       // callback function fires just before reveal animation begins – 'this' is the ul about to open 
      onShow:        function(){},       // callback function fires once reveal animation completed – 'this' is the opened ul 
      onHide:        function(){}        // callback function fires after a sub-menu has closed – 'this' is the ul that just closed
    });
  }

  Shadowbox.init();

  if(jQuery(".ajax-fc-container").length>0){
    jQuery(".ajax-fc-container").captcha({
      model: "FormResult",
      formId: "FormResultForm",
      captchaDir: "/img/elements/captcha",
      url: "/js/captcha/captcha.php",
      text: "Please drag the following item: <span>scissors</span>!",
      items: Array("pencil", "scissors", "clock", "heart", "note"),
      names: Array("pencil", "scissors", "clock", "heart", "note")
    });
  }

}); 

function openSlide(id){
  div=document.getElementById(''+id+'');
  if(div.style.display=='none'){
    jQuery(document).ready(function(){
      jQuery('#'+id+'').slideDown('slow');
    });
  } else {
    jQuery(document).ready(function(){
      jQuery('#'+id+'').slideUp('slow');
    });
  }
}

jQuery(document).ready(function() {
  jQuery('.hover').hover(
    function(){
      src=jQuery(this).attr('src');
      src=src.replace('.png', '_active.png');
      jQuery(this).attr('src', src);
    },
    function(){
      src=jQuery(this).attr('src');
      src=src.replace('_active.png', '.png');
      jQuery(this).attr('src', src);
    }
  )
});


jQuery(document).ready(function(){
  //jQuery('div#submenu > div > ul > li > ul').hide();
});

function subMenuShowHide(slug){
  //alert(jQuery('ul.'+slug+'').css('display'));
  jQuery('ul.'+slug+'').slideToggle();
}

jQuery(document).ready(function(){
   h=jQuery(document).height();
  //alert(h);
   jQuery('div#left').height(h);
});


function datePicker(field){

	jQuery.tools.dateinput.localize("hu", {
		months: 'Januar,Februar,März,April,Mai,Juni,Juli,August,September,Oktober,November,Dezember',
		shortMonths:  'Jan,Feb,Mar,Apr,Mai,Jun,Jul,Aug,Sept,Okt,Nov,Dez',
		days:         'Sonntag,Montag,Dienstag,Mittwoch,Donnerstag,Freitag,Samstag',
		shortDays:    'So,Mo,Di,Mi,Do,Fr,S'
	});

  jQuery(document).ready(function(){
    jQuery("#"+field).dateinput({
      firstDay: 1,
      format: 'yyyy-mm-dd',
      lang: 'hu',
      selectors: true,
      offset: [-15, -8],
      yearRange: [0, 5],
      min: 0
    })
  });
}
