
$(document).ready(function() {	
	 
   $('#top_topatr_ext').hide(); // Hide even though it's already hidden
   $('#toggle_ta_close').hide(); // Hide even though it's already hidden
      
   $('a#toggle_ta_open').click(function() {
      $('#top_topatr_ext').toggle(); 
      $('#toggle_ta_open').toggle(); 
      $('#toggle_ta_close').toggle();
      return false;
   });
   $('a#toggle_ta_close').click(function() {
      $('#top_topatr_ext').toggle();
      $('#toggle_ta_close').toggle();
      $('#toggle_ta_open').toggle(); 
      return false;
   });
   
  
   //Vice text u letoviska
   $('a#toggle_let_vice').click(function() {
      $('#let_vice').toggle(); 
      $('#let_vice_text').toggle(); 
      $('#let_vice_close').toggle();
      return false;
   });
   $('a#toggle_let_vice_close').click(function() {
      $('#let_vice').toggle();
      $('#let_vice_text').toggle();
      $('#let_vice_close').toggle(); 
      return false;
   });
    //-----------
 
  
  
  //box ubytovani
  $(".pagerNabUbyt").click(function() {	
    id=$(this).attr("href");

    $.get('http://' + baseurl + '/jquery_actions/box_ubytovani.php', 
	      {page: id, add_where: add_where, n_type: n_type, s_tour_id_type: s_tour_id_type, lang_id: lang_id, tour_id: tour_id, order: order, host: host},
	      function(data) {
          $("#nab_ubyt_1").toggle();
          $("#nab_ubyt_1").html(data);
          $("#nab_ubyt_1").slideToggle(2000);
	      }
	    );
    
//		$(".disp").slideToggle(2000);
//		$(".disp").attr("class","actionNab no_disp");
//		$("#nab_ubyt_"+id).slideToggle(2000);
//		$("#nab_ubyt_"+id).attr("class","actionNab disp");
		
		$(".nab_bold").attr("class","pagerNabUbyt");
		$(this).attr("class","pagerNabUbyt nab_bold");
		
		//$("#nab_ubyt_2").slideToggle("slow");
		//$(this).toggleClass("active"); 
		
		return false;
	});
	//box ubytovani
	
	
	
	$(".price_tab_changer_active").click(function() {	
    id=$(this).attr("par");
    ids = id.split("_");
		$(".price_table_cover_" + ids[0]).hide();
    $("#price_table_" + id).show(200);
  	$("#term_act_" + ids[0]).attr("class","price_tab_changer");
		$("#term_act_" + ids[0]).removeAttr("id");
		$(this).attr("id","term_act_" + ids[0]);
	  $(this).attr("class","price_tab_changer_active");
  	return false;
	});
	
	//prepinac cenniku
  $(".price_tab_changer").click(function() {	
    id=$(this).attr("par");
 
    ids = id.split("_");
    $(".price_table_cover_"+ids[0]).hide();
    $("#price_table_" + id).show(200);
  	//$("#price_table_" + id).css("display","table");	
		$("#term_act_" + ids[0]).attr("class","price_tab_changer");
		$("#term_act_" + ids[0]).removeAttr("id");
		$(this).attr("id","term_act_" + ids[0]);
	  $(this).attr("class","price_tab_changer_active");
	  
		return false;
	});
	//prepinac cenniku
	
	
	
	//Dynamicke boxy na HP
   $(".dbox_row").hover(    
      function () { 
          id=$(this).attr("id");
          ids = id.split("_");
         
          $(".dbox_row_act_" + ids[0]).attr("class","dbox_row");
          $('#dbox_row_last_' + ids[0]).attr("class","dbox_row_last");
          $(".dbox_img_" + ids[0]).hide();
          $(".dbrhidden_" + ids[0]).hide();
         
          $(this).attr("class","dbox_row_act_" + ids[0]);
          $('#dbrhidden_' + id).show();
          $('#dbr_img_hidden_' + id).show();   
      }, 
      function () {
       
      }
   );
    
    $(".dlast_row").hover(
      function () {
        id=$(this).attr("id");
        ids = id.split("_");
        
        $(".dbox_row_act_" + ids[0]).attr("class","dbox_row");
          $('#dbox_row_last_' + ids[0]).attr("class","dbox_row_last");
          $(".dbox_img_" + ids[0]).hide();
          $(".dbrhidden_" + ids[0]).hide();
          
        $(this).attr("class","dbox_row_act_" + ids[0] +" dlast_row");
        $('#dbrhidden_' + id).show();
        $('#dbr_img_hidden_' + id).show(); 
          
        $('#dbox_row_last_' + ids[0]).attr("class","dbox_row_last_act");
      }, 
      function () {
      
      }
    );
    
    function act_dbox_change(ob) {
      id=$(ob).attr("id");
      ids = id.split("_");
       
      $(".dbox_row_act_" + ids[0]).attr("class","dbox_row");
      $('#dbox_row_last_' + ids[0]).attr("class","dbox_row_last");
      $(".dbox_img_" + ids[0]).hide();
      $(".dbrhidden_" + ids[0]).hide();
      
      $(ob).attr("class","dbox_row_act_" + ids[0]);
      $('#dbrhidden_' + id).show();
      $('#dbr_img_hidden_' + id).show();
   }
   
   
   $(".dbox_row_act_0").hover(    
      function () { 
        act_dbox_change(this);
      }, 
      function () {
      }
   );
   $(".dbox_row_act_1").hover(    
      function () { 
        act_dbox_change(this);
      }, 
      function () {
      }
   );
   $(".dbox_row_act_2").hover(    
      function () { 
        act_dbox_change(this);
      }, 
      function () {
      }
   );
   $(".dbox_row_act_3").hover(    
      function () { 
        act_dbox_change(this);
      }, 
      function () {
      }
   );
   $(".dbox_row_act_4").hover(    
      function () { 
        act_dbox_change(this);
      }, 
      function () {
      }
   );
   $(".dbox_row_act_5").hover(    
      function () { 
        act_dbox_change(this);
      }, 
      function () {
      }
   );
   // END dynamicke boxy na HP -------------------
  
   //floatdiv slideshow
    $('.slideshow_basic').cycle({
		  fx: 'fade' // choose your transition type, ex: fade, scrollUp, shuffle, etc...    
  	});
  	
		$('#floatdiv').click(function() {
      window.location = 'http://www.domoplan.cz';  
    });
    
   
	

    var $scrollingDiv = $("#floatdiv");
		$(window).scroll(function(){			
			$scrollingDiv.stop().animate({"marginTop": ($(window).scrollTop()) + "px"}, "slow" );			
		});
		
		var $scrollingDiv2 = $("#floatdiv2");
		$(window).scroll(function(){			
			$scrollingDiv2.stop().animate({"marginTop": ($(window).scrollTop()) + "px"}, "slow" );			
		});


  
});

