ACC SHELL
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() {
$("#flexiselDemo3").flexisel({
visibleItems: 5,
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();
}
);
$('#kosik1Form').submit( function(event) {
if ( $('#souhlas:checked').length == 0 )
{
event.preventDefault();
alert( 'Pro vytvoření objednávky, musíte souhlasit s Obchodními podmínkami.' );
return false;
}
});
$(".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"});
}
}
);
$("#addToCartFormSubmiter").click(
function( event )
{
event.preventDefault();
if ( addToCartFormBeforeSubmit() )
{
var imageOffset = $( ".mainProductImage" ).offset();
var cartOffset = $( ".cart-icon" ).offset();
if ( ( typeof(imageOffset) != "undefined" ) && ( typeof(imageOffset) != "undefined" ) )
{
aTop = cartOffset.top;
aLeft = cartOffset.left;
$( ".mainProductImage" ).clone().appendTo( 'body' ).addClass('mainProductImage-copy').css({position:"absolute", top: imageOffset.top, left: imageOffset.left});
var ImageMovement = $( ".mainProductImage-copy" );
ImageMovement.css({zIndex : 9999999999999}).animate( {top: aTop+"px" , left: aLeft+"px", width: "20px", opacity: 0 }, 666, 'swing', function(){ $("#addToCartForm").submit() } );
}
else
{
$("#addToCartForm").submit();
}
}
}
);
$('.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"});
}
);
// Hidden Cart
var hiddenTopCart = $(".hiddenTopCart");
$(".cart-box").hover(
function()
{
if ( hiddenTopCart.css("display") == "none" )
{
hiddenTopCart.fadeIn();
}
},
function()
{
hiddenTopCart.fadeOut();
}
);
$(".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( 'Zadajte Vaše meno.' );
return false;
}
// check surname
var login = $('#contactFormFooter #contactFormFooter_surname').val();
if ( login == '' )
{
alert( 'Zadajte Vaše priezvisko.' );
return false;
}
// check email
var email = $('#contactFormFooter #contactFormFooter_email').val();
if ( email == '' )
{
alert( 'Zadajte e-mail.' );
return false;
}
else
{
if ( regEx_email.test( email ) == false )
{
alert( 'Zadajte správy e-mail.' );
return false;
}
}
// check text
var login = $('#contactFormFooter #contactFormFooter_text').val();
if ( login == '' )
{
alert( 'Zadajte text správy.' );
return false;
}
// check 321
var login = $('#contactFormFooter #contactFormFooter_22').val();
if ( ( login != '321' ) && ( login != '3 2 1' ) )
{
alert( 'Zadajte správny 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