/* slideshow */
$(function() {

$('#slideshow').crossSlide({
  sleep: 4,
  fade: 1,
  shuffle: 1
}, [
  { src: 'http://www.ktm.cz/wp-content/themes/ktm/img/slideshow/1.jpg' },
  { src: 'http://www.ktm.cz/wp-content/themes/ktm/img/slideshow/2.jpg' },
  { src: 'http://www.ktm.cz/wp-content/themes/ktm/img/slideshow/3.jpg' },
  { src: 'http://www.ktm.cz/wp-content/themes/ktm/img/slideshow/4.jpg' },
  { src: 'http://www.ktm.cz/wp-content/themes/ktm/img/slideshow/5.jpg' },
  { src: 'http://www.ktm.cz/wp-content/themes/ktm/img/slideshow/6.jpg' },
  { src: 'http://www.ktm.cz/wp-content/themes/ktm/img/slideshow/7.jpg' },
  { src: 'http://www.ktm.cz/wp-content/themes/ktm/img/slideshow/8.jpg' }
]);

});
/* slideshow */

/* blink */
$(document).ready(function(){
    $("#blink").fadeOut(800).fadeIn(800).fadeOut(400).fadeIn(400)
    .fadeOut(400).fadeIn(400);
    // $("#blink").fadeIn(100).fadeOut(100).fadeIn(100).fadeOut(100).fadeIn(100).fadeOut(100).fadeIn(100);
});
/* /blink */

/* image fade */
/*
$(document).ready(function(){
$(".katalog img").fadeTo("slow", 8.0); // This sets the opacity of the thumbs to fade down to 60% when the page loads

$(".katalog img").hover(function(){
$(this).fadeTo("slow", 100.0); // This should set the opacity to 100% on hover
},function(){
$(this).fadeTo("slow", 0.9); // This should set the opacity back to 60% on mouseout
});
});
*/
$(document).ready(function(){
  $('img.fade').imghover();
});
/* /image-fade */

/* slider */
$(document).ready(function () {

  // find the elements to be eased and hook the hover event
  $('div.slider ul li a').hover(function() {
    
    // if the element is currently being animated (to a easeOut)...
    if ($(this).is(':animated')) {
      $(this).stop().animate({width: "180px"}, {duration: 450, easing:"easeOutQuad"});
    } else {
      // ease in quickly
      $(this).stop().animate({width: "180px"}, {duration: 400, easing:"easeOutQuad"});
    }
  }, function () {
    // on hovering out, ease the element out
    if ($(this).is(':animated')) {
      $(this).stop().animate({width: "20px"}, {duration: 400, easing:"easeInOutQuad"})
    } else {
      // ease out slowly
      $(this).stop('animated:').animate({width: "20px"}, {duration: 450, easing:"easeInOutQuad"});
    }
  });
});
/* /slider */

/* nospam */
function nospamf(box, domain) {
 if(typeof(domain)=="undefined") domain="ktm.cz";
 var proto=String.fromCharCode(109,97,105,108,116,111,58)
 w=window.open(proto+box+String.fromCharCode(64)+domain);
 if (w!=null) w.close(); //FF
}
function nospam(box, domain, attr) {
 if(typeof(domain)=="undefined") domain="ktm.cz";
 if(typeof(attr)=="undefined") attr="";
 document.write("<a href=\"javascript:nospamf('"+box+"', '"+domain+"')\""+(attr.length>0?" ":"")+attr+">"+box+String.fromCharCode(64)+domain+"</a>");
}
function zavinac() {
 document.write(String.fromCharCode(64));
}
/* /nospam */

/* lightbox */

$(document).ready(function() {
	//$('p.p-fotografie a').lightBox();
	//$('div.gallery a').lightBox();
	//$('div.detail-pojem a').lightBox();
	$("a[href$='.jpg']").lightBox();
	$("a[href$='.JPG']").lightBox();
	$("a[href$='.gif']").lightBox();
	$("a[href$='.GIF']").lightBox();
	$("a[href$='.png']").lightBox();
	$("a[href$='.PNG']").lightBox();
	$("a[href$='.jpeg']").lightBox();
	$("a[href$='.JPEG']").lightBox();
	// $('a[rel*=lightbox]').lightBox();
	// $('a').lightBox();
});
/* /lightbox */