$(document).ready(function(){



	// nas kod

//  $("#muj_odstavec").hide(1000);

//  $("#muj_odstavec").show(3000); 

    //var coJeVybrano = $("#item_select option:selected").val();

    //$("p").text(coJeVybrano);

    

    $("#item_select").change(function(){

           var coJeVybrano = $("#item_select option:selected").val();

           $("#hodnota").text(coJeVybrano);

      });

    $("#odkaz").click(function(){

       $("#item_select").addOption("4", "item4", false);

        var $newvyrobce =  $("#novy_vyrobce").val();

        //var $newvyrobce =  $("input[@name=novy_vyrobce]").val(); ma fungovat ale nefuguje:-(

        $.get("/pecha/jquery/ajax/stranka.php",{ vyrobce: $newvyrobce}, function(vystup){

           alert("Soubor vrátil: " + vystup);

          // $("#select").html(vystup);

           //vystup;

            });

      });

      

    $("#odkaz2").click(function(){

       $("#item_select").addOption("4", "item4", false); // pouze přidá položku seznamu viz soubor select.js

      });



    $("#pridej").click(function(){

       $("#vyrobce").html("<input type=\"text\" name=\"novy_vyrobce\" id=\"novy_vyrobce\" />");

      });      

          

});



$(document).ready(function(){

    $("#kpokladne").html("<img src=\"templates/nova/buttons/czech/button_checkout.gif\" />");

    $("#schovany").hide();

    $("#shipping_adress_skryvany").hide();

    $("#acountboxyes").hide();

    

      $("#kpokladne").click(function(){

          $("#schovany").show();

          return false;

      });

      

      

      // zobrazi a skryje tabulku pro zadani jine dodaci adresy

      $("#rad1").click(function(){

          //$("#create_account3_loginbox").toggle(500);

          $("#shipping_adress_skryvany").toggle();

      });

      // zobrazi a skryje pole pro zadání hesla     

      $("#radY").click(function(){      

          $("#acountboxyes").toggle();

      });      

     

    

    if ( $("input[name=shipping]:checked").val() == "flat_flat") {
    //alert("Soubor vrátil: " + $str);
    $("#cod").hide();
    $("#moneyorder").hide();
    $("#cop").show();
    $("#radcop").attr("checked", "checked"); 
    }

        if ( $("input[name=shipping]:checked").val() == "table_table") {
        $("#cod").show();
        $("#moneyorder").show();
        $("#cop").hide();
        $("#radcod").attr("checked", "checked"); 
    }

  $(".shipping").click(function(){
    $str = $("input[name=shipping]:checked").val();
   

    if ( $("input[name=shipping]:checked").val() == "flat_flat") {
    //alert("Soubor vrátil: " + $str);
    $("#cod").hide();
    $("#moneyorder").hide();
    $("#cop").show();
    $("#radcop").attr("checked", "checked"); 
    }

    

    if ( $("input[name=shipping]:checked").val() == "table_table") {
         $("#cod").show();
         $("#moneyorder").show();
         $("#cop").hide();
         $("#radcod").attr("checked", "checked"); 
     }

         if ( $("input[name=shipping]:checked").val() == "ups_ups") {
        $("#cod").show();
        $("#moneyorder").show();
        $("#cop").hide();
        $("#radcod").attr("checked", "checked"); 
    }       

  });

  

     $(".katleft").each(function(){

		var height = 0;			

		$(".pl_li", this).each(function(){

			$(this).css("height", "auto");

			height = this.offsetHeight > height ? this.offsetHeight : height;			

		}).each(function(){

			$(this).css("height", height + "px");

		

		});

	});

/*

     $(".katleft").each(function(){

		var height = 0;			

		$(".pl_img", this).each(function(){

			$(this).css("height", "auto");

			height = this.offsetHeight > height ? this.offsetHeight : height;			

		}).each(function(){

			$(this).css("height", height + "px");

		

		});

	});

*/

  

   $(".katleft").each(function(){

		var height = 0;			

		$(".descript", this).each(function(){

			$(this).css("height", "auto");

			height = this.offsetHeight > height ? this.offsetHeight : height;			

		}).each(function(){

			$(this).css("height", height + "px");

		

		});

	});

  

     $(".katleft").each(function(){

		var height = 0;			

		$(".name", this).each(function(){

			$(this).css("height", "auto");

			height = this.offsetHeight > height ? this.offsetHeight : height;			

		}).each(function(){

			$(this).css("height", height + "px");

		

		});

	}); 

  

  

  /** ---- skrol na vršek stránky -----*/

  $('#a_top').click(function(){

	     $('html').animate({scrollTop:0}, 'slow');

    });

            

  





});
