

//--------------------- INPUTS HOVER EFFECT ----------------------

$(document).ready(function(){

	$("#formLeft .input-bg").hover(function() {
		$(this).addClass("active");
	}, function() {
		$(this).removeClass("active");
	});

	$("#formLeft input").focus(function() {
		$(this).parent().addClass("active");
	});
	$("#formLeft input").blur(function() {
		$("#formLeft .input-bg").removeClass("active");
	});

	$("#formRight .textarea-bg").hover(function() {
		$(this).addClass("active");
	}, function() {
		$(this).removeClass("active");
	});

	$("#formRight textarea").focus(function() {
		$(this).parent().addClass("active");
	});
	$("#formRight textarea").blur(function() {
		$("#formRight .textarea-bg").removeClass("active");
	});
});


//--------------------- ANYTHING SLIDER ----------------------

function formatText(index, panel) {
		  return "";
	    }
    
        $(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: 3000,                    // 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: "",             // Start text
		        stopText: "",               // Stop text
		        navigationFormatter: formatText       // Details at the top of the file on this use (advanced use)
            });
            
            $("#slide-jump").click(function(){
                $('.anythingSlider').anythingSlider(6);
            });
            
        });


//--------------------- MENU ITEM FADE EFFECT ----------------------

$(function () {
        if ($.browser.msie) return;
        
        $('#navigation li')
            .removeClass('highlight')
            .find('a')
            .append('<span class="hover" />').each(function () {
                    var $span = $('> span.hover', this).css('opacity', 0);
                    $(this).hover(function () {
                        // on hover
                        $span.stop().fadeTo(600, 1);
                    }, function () {
                        // off hover
                        $span.stop().fadeTo(600, 0);
                    });
                });
                
    });

$(function () {
        if ($.browser.msie && $.browser.version < 7) return;
        
        $('#portfolio-menu li')
            .removeClass('highlight')
            .find('a')
            .append('<span class="hover" />').each(function () {
                    var $span = $('> span.hover', this).css('opacity', 0);
                    $(this).hover(function () {
                        // on hover
                        $span.stop().fadeTo(600, 1);
                    }, function () {
                        // off hover
                        $span.stop().fadeTo(600, 0);
                    });
                });
                
    });
    
    
    
//--------------------- ANCHOR SLIDE EFFECT ----------------------

 $(document).ready(function() {
	$("a.anchorLinkPortfolio").anchorAnimate()
});

jQuery.fn.anchorAnimate = function(settings) {

 	settings = jQuery.extend({
		speed : 1100
	}, settings);	
	
	return this.each(function(){
		var caller = this
		$(caller).click(function (event) {	
			event.preventDefault()
			var locationHref = window.location.href
			var elementClick = $(caller).attr("href")
			
			var destination = $(elementClick).offset().top;
			$("html:not(:animated),body:not(:animated)").animate({ scrollTop: destination}, settings.speed, function() {
				window.location.hash = elementClick
			});
		  	return false;
		})
	})
}


//--------------------- BLACK AND WHITE PORTFOLIO EFFECT ----------------------

$(document).ready(function() {
	
	$("ul#works-content li.works").hover(function() { //On hover...
		
		var thumbOver = $(this).find("img").attr("src"); //Get image url and assign it to 'thumbOver'
		
		//Set a background image(thumbOver) on the &lt;a&gt; tag 
		$(this).find("a.thumb").css({'background' : 'url(' + thumbOver + ') no-repeat center bottom'});
		//Fade the image to 0 
		$(this).find("span").stop().fadeTo('normal', 0 , function() {
			$(this).hide() //Hide the image after fade
		}); 
	} , function() { //on hover out...
		//Fade the image to 1 
		$(this).find("span").stop().fadeTo('normal', 1).show();
	});

});




//--------------------- FORM VALIDATION ----------------------

$().ready(function() {
	
	
	// validate signup form on keyup and submit
	$("#contactForm").validate({
		rules: {
			jmeno: "required",
			email: {
				required: true,
				email: true
			},
			telefon: {
				number: true
			},
			projekt: {
				required: true
			}
			
		},
		messages: {
			jmeno: "Jméno musí být vyplněno.",
			email: "Špatná emailová adresa"		}
	});
	
	
});


//------------------BUBBLE TIP ---------------//

$(document).ready(function() {
			$('#show-price').bubbletip($('#pricing'));
		});
		
		

//----------------FADE THIS EFFFET ------------//

$(document).ready(function() {
	// find the div.fade elements and hook the hover event
	$('.fadeThis').hover(function() {
		// on hovering over find the element we want to fade *up*
		var fade = $('> .hover', this);
 
		// if the element is currently being animated (to fadeOut)...
		if (fade.is(':animated')) {
			// ...stop the current animation, and fade it to 1 from current position
			fade.stop().fadeTo(500, 1);
		} else {
			fade.fadeIn(500);
		}
	}, function () {
		var fade = $('> .hover', this);
		if (fade.is(':animated')) {
			fade.stop().fadeTo(500, 0);
		} else {
			fade.fadeOut(500);
		}
	});
 
	// get rid of the text
	$('.fadeThis > .hover').empty();
})



//-------------IE REJECT -------------//

$(document).ready(function() {  
     $.reject(); // Customized Text  
       
     return false;  
 });  







