


/*
 * 	Easy Slider 1.5 - jQuery plugin
 *	written by Alen Grakalic	
 *	http://cssglobe.com/post/4004/easy-slider-15-the-easiest-jquery-plugin-for-sliding
 *
 *	Copyright (c) 2009 Alen Grakalic (http://cssglobe.com)
 *	Dual licensed under the MIT (MIT-LICENSE.txt)
 *	and GPL (GPL-LICENSE.txt) licenses.
 *
 *	Built for jQuery library
 *	http://jquery.com
 *
 */
 
/*
 *	markup example for $("#slider").easySlider();
 *	
 * 	<div id="slider">
 *		<ul>
 *			<li><img src="images/01.jpg" alt="" /></li>
 *			<li><img src="images/02.jpg" alt="" /></li>
 *			<li><img src="images/03.jpg" alt="" /></li>
 *			<li><img src="images/04.jpg" alt="" /></li>
 *			<li><img src="images/05.jpg" alt="" /></li>
 *		</ul>
 *	</div>
 *
 */

(function(a){a.fn.easySlider=function(b){var c={prevId:"prevBtn",prevText:"Previous",nextId:"nextBtn",nextText:"Next",controlsShow:true,controlsBefore:"",controlsAfter:"",controlsFade:true,firstId:"firstBtn",firstText:"First",firstShow:false,lastId:"lastBtn",lastText:"Last",lastShow:false,vertical:false,speed:800,auto:false,pause:2000,continuous:false};var b=a.extend(c,b);this.each(function(){var e=a(this);var m=a("li",e).length;var k=a("li",e).width();var f=a("li",e).height();e.width(k);e.height(f);e.css("overflow","hidden");var i=m-1;var l=0;a("ul",e).css("width",m*k);if(!b.vertical){a("li",e).css("float","left")}if(b.controlsShow){var g=b.controlsBefore;if(b.firstShow){g+='<span id="'+b.firstId+'"><a href="javascript:void(0);">'+b.firstText+"</a></span>"}g+=' <span id="'+b.prevId+'"><a href="javascript:void(0);">'+b.prevText+"</a></span>";g+=' <span id="'+b.nextId+'"><a href="javascript:void(0);">'+b.nextText+"</a></span>";if(b.lastShow){g+=' <span id="'+b.lastId+'"><a href="javascript:void(0);">'+b.lastText+"</a></span>"}g+=b.controlsAfter;a(e).after(g)}a("a","#"+b.nextId).click(function(){d("next",true)});a("a","#"+b.prevId).click(function(){d("prev",true)});a("a","#"+b.firstId).click(function(){d("first",true)});a("a","#"+b.lastId).click(function(){d("last",true)});function d(h,n){var o=l;switch(h){case"next":l=(o>=i)?(b.continuous?0:i):l+1;break;case"prev":l=(l<=0)?(b.continuous?i:0):l-1;break;case"first":l=0;break;case"last":l=i;break;default:break}var r=Math.abs(o-l);var q=r*b.speed;if(!b.vertical){p=(l*k*-1);a("ul",e).animate({marginLeft:p},q)}else{p=(l*f*-1);a("ul",e).animate({marginTop:p},q)}if(!b.continuous&&b.controlsFade){if(l==i){a("a","#"+b.nextId).hide();a("a","#"+b.lastId).hide()}else{a("a","#"+b.nextId).show();a("a","#"+b.lastId).show()}if(l==0){a("a","#"+b.prevId).hide();a("a","#"+b.firstId).hide()}else{a("a","#"+b.prevId).show();a("a","#"+b.firstId).show()}}if(n){clearTimeout(j)}if(b.auto&&h=="next"&&!n){j=setTimeout(function(){d("next",false)},r*b.speed+b.pause)}}var j;if(b.auto){j=setTimeout(function(){d("next",false)},b.pause)}if(!b.continuous&&b.controlsFade){a("a","#"+b.prevId).hide();a("a","#"+b.firstId).hide()}})}})(jQuery);



$(function() {
	$('input[name=kniha]').change(function(){
		if($('input[name=kniha]').is(':checked')){
			$('.h').removeClass('h').addClass('u');
		}
		else {
			$('.u').addClass('h').removeClass('u');
			}
	});
});

$(document).ready(function(){	
	$(".activities .slider").easySlider({
		prevText:'UP',
		nextText:'DOWN',
		vertical: true,
		continuous: true

	});
});

$(function(){
	$('.newsletter').slideDown("slow"); 
	
	});
	
$(function(){
	$('a.picasaViewImage').colorbox({current:"Obrázek {current} z {total}"});
	});	
$(function(){
	//$('#wholearticle a img').parent().colorbox({current:"Obrázek {current} z {total}"});
	});		


$().ready(function() {
	// validate the comment form when it is submitted

	$("#commentform").validate({
		rules: {
			author: "required",
			comment: "required",
			url: "required"
		},
		messages: {
			author: "Prosím vložte své jméno",
			url: "Prosím vložte předmět",
			comment: "Prosím vložte komentář"
		
		}
	});
jQuery.validator.addMethod("dflt", function(value, element) { 

	var newsletter = $("#kniha");
	// newsletter topics are optional, hide at first
	var inital = newsletter.is(":checked");
	if(inital==true){
		return this.optional(element) || value != element.defaultValue; 
	} else {
		return true;

	}
}, "You must enter a value");

jQuery.validator.addMethod("psc", function(value, element) { 

	var newsletter = $("#kniha");
	// newsletter topics are optional, hide at first
	var inital = newsletter.is(":checked");
	if(inital==true){
		if(!isNaN(value)){
			return true; 
		}else{
			return false;
		}
	} else {
		return true;

	}
}, "You must enter a value");


	$("#subscribeform").validate({
		rules: {
			ne: {
				required: true,
				email: true
			},
			nn: {
				dflt: "#kniha:checked",
				minlength: 3
			},
			sur: {
				dflt: "#kniha:checked",
				minlength: 3
			},
			street: {
				dflt: "#kniha:checked",
				minlength: 3
			},
			city: {
				dflt: "#kniha:checked",
				minlength: 3
			},
			psc: {
				dflt: "#kniha:checked",
				maxlength: 5,
				psc: true
			}
		},
		messages: {
			ne: "Prosím vložte platný email",
			nn: "Prosím vložte jméno",
			sur: "Prosím vložte druhé jméno",
			street: "Prosím vložte ulicu",
			city: "Prosím vložte Prosím vložte město",
			psc: "Prosím vložte PSČ"

		}
	});


	$("#subscribeform-en").validate({
		rules: {
			ne: {
				required: true,
				email: true
			},
			nn: {
				dflt: "#kniha:checked",
				minlength: 3
			},
			sur: {
				dflt: "#kniha:checked",
				minlength: 3
			},
			street: {
				dflt: "#kniha:checked",
				minlength: 3
			},
			city: {
				dflt: "#kniha:checked",
				minlength: 3
			},
			psc: {
				dflt: "#kniha:checked",
				minlength: 3
			}
		}
	});

});


