//form validation function validateName(fld) { var error = ""; if (fld.value === '' || fld.value === 'Nickname' || fld.value === 'First Name') { error = "You didn't enter Your First Name.\n"; } else if ((fld.value.length < 2) || (fld.value.length > 50)) { error = "First Name is the wrong length.\n"; } return error; } function validateEmail(fld) { var error=""; var illegalChars = /^[^@]+@[^@.]+\.[^@]*\w\w$/; if (fld.value === "") { error = "You didn't enter an email address.\n"; } else if ( fld.value.match(illegalChars) === null) { error = "The email address contains illegal characters.\n"; } return error; } function validateMessage(fld) { var error = ""; if (fld.value === '' || fld.value === 'Message') { error = "You didn't enter Your message.\n"; } else if (fld.value.length < 3) { error = "The message is to short.\n"; } return error; } function validateLastname(fld) { var error = ""; if (fld.value === '' || fld.value === 'Nickname' || fld.value === 'Enter Your Name..' || fld.value === 'Your Name..') { error = "You didn't enter Your last name.\n"; } else if ((fld.value.length < 2) || (fld.value.length > 50)) { error = "Last Name is the wrong length.\n"; } return error; } function validatePhone(fld) { var error = ""; var illegalChars = /^\+?s*\d+\s*$/; if (fld.value === '') { error = "You didn't enter Your phone number.\n"; } else if ( fld.value.match(illegalChars) === null) { error = "Please enter a valid phone number.\n"; } return error; } (function($) { 'use strict'; $(document).ready(function(){ /*--------------------------------- Main carousel ---------------------------------*/ $("#main-carousel div.carousel-group").bxSlider({ pause: 2000, // In milisecunds, the duration between each slide transition. speed: 500, // In milisecunds, duration of time slide transitions will occupy. minSlides: 1, maxSlides: 4, slideWidth: 285, slideMargin: 19, prevText: "", nextText: "", adaptiveHeight: false, controls: true, pager: false, auto: false, // true - Start automatically. autoHover: true, onSliderLoad: function(){ $("#main-carousel div.carousel-group").css({ "visibility": "visible", "height": "auto" }); $("#main-carousel").removeClass("bx-loading"); } }); /*--------------------------------- Small carousel ---------------------------------*/ $(".small-carousel div.carousel-group").bxSlider({ pause: 2000, // In milisecunds, the duration between each slide transition. speed: 500, // In milisecunds, duration of time slide transitions will occupy. minSlides: 2, maxSlides: 4, slideWidth: 206, slideMargin: 13, prevText: "", nextText: "", adaptiveHeight: false, controls: true, pager: false, auto: false, // true - Start automatically. autoHover: true, onSliderLoad: function(){ $(".small-carousel div.carousel-group").css({ "visibility": "visible", "height": "auto" }); $(".small-carousel").removeClass("bx-loading"); } }); /*--------------------------------- Slider ---------------------------------*/ $('.slider').bxSlider({ mode: 'horizontal', pause: 6000, // In milisecunds, the duration between each slide transition. speed: 500, // In milisecunds, duration of time slide transitions will occupy. auto: true, // true - Start automatically. autoHover: true, // true, false - if true show will pause on mouseover pager: true, onSliderLoad: function(){ $("#main-slider ul.slider").css({ "visibility": "visible", "height": "auto" }); $("#main-slider").removeClass("bx-loading"); } }); /*--------------------------------- Gallery block ---------------------------------*/ $('.gallery-block ul').bxSlider({ pause: 2000, // In milisecunds, the duration between each slide transition. speed: 500, // In milisecunds, duration of time slide transitions will occupy. mode: 'horizontal', controls: true, auto: true, // true - Start automatically. prevText: "", nextText: "", pager: true, pagerCustom: '.gallery-pager', onSliderLoad: function(){ $(".gallery-block ul").css({ "visibility": "visible", "height": "auto" }); $(".gallery-block").removeClass("bx-loading"); } }); /*--------------------------------- Woocommerce block ---------------------------------*/ $('.woocommerce-block ul').bxSlider({ pause: 2000, // In milisecunds, the duration between each slide transition. speed: 500, // In milisecunds, duration of time slide transitions will occupy. mode: 'fade', controls: false, auto: false, // true - Start automatically. prevText: "", nextText: "", pager: true, adaptiveHeight: true, pagerCustom: '.woocommerce-pager', onSliderLoad: function(){ $(".woocommerce-block ul").css({ "visibility": "visible", "height": "auto" }); $(".woocommerce-block").removeClass("bx-loading"); } }); /*--------------------------------- Related articles ---------------------------------*/ $('.related-articles-group').bxSlider({ mode: 'horizontal', captions: false, pager: false, controls: true, prevText: "", nextText: "", minSlides: 2, maxSlides: 4, slideWidth: 206, slideMargin: 13 }); /*--------------------------------- Widget slider ---------------------------------*/ $('.widget-slider ul').bxSlider({ captions: false, pager: false, controls: true, auto: false, // true - Start automatically. pause: 2000, // In milisecunds, the duration between each slide transition. speed: 500, // In milisecunds, duration of time slide transitions will occupy. prevText: "", nextText: "", onSliderLoad: function(){ $(".widget-slider ul").css({ "visibility": "visible", "height": "auto" }); $(".widget-slider").removeClass("bx-loading"); } }); /*--------------------------------- Breaking news ---------------------------------*/ $("#breaking-news ul").bxSlider({ mode: 'vertical', auto: true, // true - Start automatically. autoHover: true, // true, false - if true show will pause on mouseover pause: 2000, // In milisecunds, the duration between each slide transition. speed: 500, // In milisecunds, duration of time slide transitions will occupy. onSliderLoad: function(){ $("#breaking-news ul").css({ "visibility": "visible", "height": "auto" }); $("#breaking-news").removeClass("bx-loading"); } }); }); })(jQuery);