// JavaScript Document
document.write("<style type='text/css'>.hidden{display:none;}<\/style>");
$(document).ready(function(){
		$.fn.colorbox.settings.Opacity = "0.4";
		$("a[rel='gallery']").colorbox({transition:"fade", contentCurrent:"{current}/{total}"});
		$("a.single").colorbox({transition:"fade"});

    $('#slider').s3Slider({
      timeOut: 4000
    });

    $(".comment_submit").click(function(){
      var element = $(this);
      var Id = element.attr("id");
      var item = $("#item"+Id).val();
      var item_typ = $("#item_typ"+Id).val();
      var mnozstvi = $("#mnozstvi"+Id).val();
      var dataString = 'item='+ item + '&item_typ=' + item_typ + '&mnozstvi=' + mnozstvi;
      //if(item=='') { alert("Please Enter Some Text"); }
      //else {
        $("#flash"+Id).show();
        $("#flash"+Id).fadeIn(800).html('<img src="ajax-loader.gif" align="absmiddle"> loading.....');
        $.ajax({
          type: "POST",
          url: "kosik.php",
          data: dataString,
          cache: false,
          success: function(html){
            $("#kosik").html(html);
            $("#flash"+Id).hide();
          }
        });
      //}
      return false;
    });
    
    function formatText(index, panel) {
        return index + "";
    }; 	
    $(function () {  
           $('.anythingSlider').anythingSlider({
                easing: "easeInOutExpo",        // Anything other than "linear" or "swing" requires the easing plugin
                autoPlay: true,                 // This turns off the entire FUNCTIONALY, not just if it starts running or not.
                delay: 5000,                    // How long between slide transitions in AutoPlay mode
                startStopped: false,            // If autoPlay is on, this can force it to start stopped
                animationTime: 600,             // How long the slide transition takes
                hashTags: true,                 // Should links change the hashtag in the URL?
                buildNavigation: true,          // If true, builds and list of anchor links to link to each slide
            		pauseOnHover: true,             // If true, and autoPlay is enabled, the show will pause on hover
            		startText: "Spustit",                // Start text
    		        stopText: "Zastavit",               // Stop text
    		        navigationFormatter: formatText // Details at the top of the file on this use (advanced use)
            });
            
            $("#slide-jump").click(function(){
                $('.anythingSlider').anythingSlider(6);
            });
            
    });        	
});

function showhide(element) {
    var e = document.getElementById(element);
    var display = e.style.display;
    if( display != 'block' ) { e.style.display = 'block'; }
      else { e.style.display = 'none'; }
} 