function CopyBox() {
	if (document.selection) {
		CopiedTxt = document.selection.createRange();
		CopiedTxt.execCommand("Copy");
	}
}

$(document).ready(function() {
	$("div#slider1").codaSlider();
	$("div#slider2").codaSlider();
	$("div#slider3").codaSlider();
	$("div#slider4").codaSlider();

  // send-mail
  form = $('#send-mail');
  href = $('.send-mail');
  hlaska = document.getElementById('alert');
  if (!hlaska) {
    form.hide();
    href.removeClass('open');
  }
  href.click(function () {
    if (href.hasClass('open')) {
      form.animate({'height': 'toggle'}, 800, 'easeInBack');
      href.removeClass('open');
    }
    else {
      form.animate({'height': 'toggle'}, 800, 'easeOutBack');
      href.addClass('open');
    }
    return false;
  });

  
  $("a[@href^=http]").not('a@[href$=meibes.sk]').each(function() {
    if(this.href.indexOf(location.hostname) == -1) {
      $(this).click(function(){window.open(this.href);return false;});
    }
  });
  $("a[href$=pdf]").click(function(){window.open(this.href);return false;});
  
  // mapa sk
  $('#map-sk').maps();
  
  
  
  
  /* ---------------------------------------------------------------- 
    toggle_container
  ---------------------------------------------------------------- */
	$(".toggle_container").hide();

	 $("h2.h2-crumbs, h3.h3-crumbs, p.crumbs").toggle(function(){
		  $(this).addClass("active"); 
		  }, function () {
		  $(this).removeClass("active");
	 });
	
	 $("h2.h2-crumbs, h3.h3-crumbs, p.crumbs").click(function(){
		  $(this).next(".toggle_container").slideToggle("slow,");
	 });

});
