/* Tlačítka - animace */
//"repeated animation" - bounce effect of a button
function animateThisButton(element){
				$(element)
				.animate({paddingLeft:"30px",marginRight:"-7px"}, 250)
				.animate({paddingLeft:"17px",marginRight:"0px"}, 150)
				.animate({paddingLeft:"22px",marginRight:"-3px"}, 100)
				.animate({paddingLeft:"17px",marginRight:"0px"}, 200);
}
$(function(){
				$("#leftHalf .greenBtn span").everyTime(4000, function(){ //every 4s repeat animation 						 
								animateThisButton(this);
				});
				$("#leftHalf .greenBtn span").hover(function(){
								$(this).stop(true).stopTime().animate({paddingLeft:"30px", marginRight:"-7px"}, 150) //on mouse over - make button wider
				}, function(){
							$(this).stop(true).stopTime().animate({paddingLeft:"17px", marginRight:"0px"}, 100) //on mouse out - original size of a button
							$(this).everyTime(4000, function(){animateThisButton(this);}); //start "repeated animation" again
				});
				$("#rightHalf .blueBtn span, #rightHalf .blueBtn span, .footerLine .greenBtn span").hover(function(){
								$(this).stop(true).stopTime().animate({paddingLeft:"30px", marginRight:"-7px"}, 150)
				}, function(){
							$(this).stop(true).stopTime().animate({paddingLeft:"17px", marginRight:"0px"}, 100)
				});
});

/* Content slider - init */
$(function(){
	$('#references').bxSlider({
					mode: 'slide',
					auto: 'true',
					speed: 1000,
					pause: 5500,
					width: 456,
					wrapper_class: 'referencesCont',
					stopOnHover: true,
					cloneContentCount: 2
	});
	$('.slider_prev').hover( function() {
					$(this).stop().animate({left:"6px", width:"46px"},100)
	}, function (){
					$(this).stop().animate({left:"12px", width:"40px"},100)
	});
	$('.slider_next').hover( function() {
					$(this).stop().animate({right:"0px", width:"46px"},100)
	}, function (){
					$(this).stop().animate({right:"6px", width:"40px"},100)
	});
	$('.slider_prev, .slider_next').click( function() {
					$(this).stop().animate({top:"36px"},50).animate({top:"30px"},50)
	});
});
function equalHeight(group) {
    var tallest = 0;
    group.each(function() {
        var thisHeight = $(this).height();
        if(thisHeight > tallest) {
            tallest = thisHeight;
        }
    });
    group.height(tallest);
}
$(document).ready(function() {
    equalHeight($(".blockCont"));
});


