ACC SHELL

Path : /srv/www/vhosts/marevva/nadacekrizovatka/js/
File Upload :
Current File : /srv/www/vhosts/marevva/nadacekrizovatka/js/script-all.js

var regEx_email = /^[\ a-z0-9._-]+@[a-z0-9.-]+\.[a-z]{2,6}$/i;

if(typeof String.prototype.trim !== 'function')
{
  String.prototype.trim = function()
  {
    return this.replace(/^\s+|\s+$/g, ''); 
  }
}

$(document).ready(function() {
	
	$(".linkaButtonFixed").delay(1000).fadeIn(1000).delay(3000).animate({right : "-115px"},1500);	
	$(".linkaButtonFixed").hover(
		function()
		{	
			var submenu = $(".linkaButtonFixed");
			if ( submenu.css("right") == "-115px" )
			{
				submenu.animate({right : "0px"}, 350);
			}
		},
		function()
		{
			var submenu = $(".linkaButtonFixed");
			if ( submenu.css("right") == "0px" )
			{
				submenu.animate({right : "-115px"}, 1500);
			}
		}
	);
	
	$("#flexiselDemo3").flexisel({
        visibleItems: 4,
        animationSpeed: 1000,
        autoPlay: true,
        autoPlaySpeed: 4000,            
        pauseOnHover: true,
        enableResponsiveBreakpoints: true,
        responsiveBreakpoints: { 
            portrait: { 
                changePoint:480,
                visibleItems: 1
            }, 
            landscape: { 
                changePoint:640,
                visibleItems: 2
            },
            tablet: { 
                changePoint:768,
                visibleItems: 3
            }
        }
    });
	
	
	$(".CurrentClient").hover(
		function() {
		$("img.BW", this).stop().animate({"opacity": "0"}, "slow");
		$("img.COLOR", this).stop().animate({"opacity": "1"}, "slow");
		},
		function() {
		$("img.BW", this).stop().animate({"opacity": "1"}, "slow");
		$("img.COLOR", this).stop().animate({"opacity": "0"}, "slow");
	});
	
	$(".image-quarter", this).hover(
		function() 
		{
			$(this).append("<div class='hoverClicker'></div>");
			$(".hoverClicker").fadeIn();
		},
		function() 
		{
			$(".hoverClicker").remove();
		}
	);
	
	$(".menuToggler").click(
		function()
		{	
			var submenu = $(".responsive-menu");
			if ( submenu.css("width") == "0px" );
			{
				submenu.animate({width:"100%"});
				$(".responsive-menu-slider").animate({left:"100%"});
			}
		}
	);

	$(".responsiveMenuCloser").click(
		function()
		{	
			var submenu = $(".responsive-menu");
			if ( submenu.css("width") == "100%" );			
			{
				$(".responsive-menu").animate({width:"0px"});
				$(".responsive-menu-slider").animate({left:"0px"});
			}
		}
	);

	$('.fancybox').fancybox({
				padding: 5,
				wrapCSS    : 'fancybox-custom',
				closeClick : true,
				titlePosition 	: 'over',
				openEffect : 'fade',
				loop : false,
				
				helpers : {
					
					overlay : {
						css : {
							'background' : 'rgba(0,0,0,0.33)'
						}
					}
				}
			});

	// left-fixed-menu
    $(".left-contact-fixed").hover(
		function()
		{	
			var submenu = $(this);
			if ( submenu.css("width") == "32px" )
			{
				submenu.animate({width:"144px"});
			}
		},
		function()
		{
			$(this).animate({width:"32px"});
		}
	);
	
	
   
    $(".horizontal-menu-cover", this).hover(
		function()
		{	
			var horizontalSubmenu = $(".horizontal-menu-submenu", this);
			if ( horizontalSubmenu.css("display") == "none" )
			{
				horizontalSubmenu.slideDown(250);
			}
		},
		function()
		
		{	
			var horizontalSubmenu = $(".horizontal-menu-submenu", this);
			horizontalSubmenu.slideUp(50);
		}
	);
	
	
	
	
	$("a.overlayA").overlay({
		mask: {
			color: '#ffffff',
			loadSpeed: 200,
			opacity: 0,
			zIndex: 20000 
		},
		top: 100,
		closeOnClick: false,

		onLoad: function() {
			var wrap = this.getOverlay().find( ".contentWrap" );
			wrap.load( this.getTrigger().attr("href") );
		}
	});
	

	///
	$('#contactFormFooterSubmit').click( function(event)
		{
			// check name
			var login = $('#contactFormFooter #contactFormFooter_name').val();
			if ( login == '' )
			{
				alert( 'Zadejte Vaše jméno.' );
				return false;
			}
			
			// check surname
			var login = $('#contactFormFooter #contactFormFooter_surname').val();
			if ( login == '' )
			{
				alert( 'Zadejte Vaše příjmení.' );
				return false;
			}
			
			// check email
			var email = $('#contactFormFooter #contactFormFooter_email').val();
			if ( email == '' )
			{
				alert( 'Zadejte e-mail.' );
				return false;
			}
			else
			{
				if ( regEx_email.test( email ) == false )
				{
					alert( 'Zadejte spravný e-mail.' );
					return false;
				}
			}
			
			// check text
			var login = $('#contactFormFooter #contactFormFooter_text').val();
			if ( login == '' )
			{
				alert( 'Zadejte dotaz.' );
				return false;
			}
			
			// check gdpr
			var gdpr1 = $('#contactFormFooter #GDPR1_ano').prop("checked");
			var gdpr2 = $('#contactFormFooter #GDPR1_ano').prop("checked");
			var gdpr3 = $('#contactFormFooter #GDPR1_ano').prop("checked");
			if ( !gdpr1 || !gdpr2 || !gdpr3 )
			{
				alert( 'Pro odeslání formuláře je nutný\nsouhlas se zpracováním osobních údajů.' );
				return false;
			}
			
			// check 321
			var login = $('#contactFormFooter #contactFormFooter_22').val();
			if ( ( login != '321' ) && ( login != '3 2 1' ) )
			{
				alert( 'Zadejte spravný kontrolní text.' );
				return false;
			}
						
			//document.forms['contactFormFooter'].submit();
		});


	
	//
	/*$('#addCommentTitle, #newMessagetTitle').blur( function() {
		if ( this.value == '' )
			this.value = 'předmět';
	});
	$('#addCommentTitle, #newMessagetTitle').focus( function() {
		if ( this.value == 'předmět' )
			this.value = '';
	});*/
	
	$('#addCommentNick, #newMessagetNick').blur( function() {
		if ( this.value == '' )
			this.value = 'jméno';
	});
	$('#addCommentNick, #newMessagetNick').focus( function() {
		if ( this.value == 'jméno' )
			this.value = '';
	});
	
	$('#addCommentText, #newMessagetText').blur( function() {
		if ( this.value == '' )
			this.value = 'text';
	});
	$('#addCommentText, #newMessagetText').focus( function() {
		if ( this.value == 'text' )
			this.value = '';
	});
	
	$('#addCommentForm').submit(  function(event) {
		if ( ($('#addCommentNick').val().trim() == 'jméno') || /*($('#addCommentTitle').val().trim() == 'předmět') ||*/ ($('#addCommentText').val().trim() == 'text') )
		{
			event.preventDefault();
			$('#addCommentError').html(' Vyplň jméno a text! ');
			$('#addCommentError').fadeIn('fast').delay(3000).fadeOut('slow');
		}
		
		if ( $('#addCommentCheck').val().trim() != '22' )
		{
			event.preventDefault();
			$('#addCommentError').html(' Vyplň kontrolní text! ');
			$('#addCommentError').fadeIn('fast').delay(3000).fadeOut('slow');
		}
	});
	
	
	//posun obrazku na stred horizontalne
	var ProductImageWidth = 251;
	var ProductDivWidth = $(".product-list-image-small", this).width();
	var ProductImageMoveLeft = -(ProductImageWidth - ProductDivWidth)/2;
	//posun obrazku na stred vertikalne
	var ProductImageHeight = $(".product-list-image-small img", this).height();
	var ProductDivHeight = $(".product-list-image-small", this).height();
	var ProductImageMoveTop = -(ProductImageHeight - ProductDivHeight)/2;
	
	
	$(".product-list-image-small img", this).css({"position" : "absolute" , "top" : "0px" , "left" : ProductImageMoveLeft});
	
});

ACC SHELL 2018