var wp3s_prevision_trigger = false; /* Countdown */ jQuery('.wp3s_prevision #countdown_clock').circularCountdown({ strokeDaysBackgroundColor:'rgba(255,255,255,0.5)', strokeDaysColor:'rgba(253,153,30,1)', strokeHoursBackgroundColor:'rgba(255,255,255,0.5)', strokeHoursColor:'rgba(253,153,30,1)', strokeMinutesBackgroundColor:'rgba(255,255,255,0.5)', strokeMinutesColor:'rgba(253,153,30,1)', strokeSecondsBackgroundColor:'rgba(255,255,255,0.5)', strokeSecondsColor:'rgba(253,153,30,1)', strokeWidth:17, strokeBackgroundWidth:17, countdownEasing:'easeOutBounce', countdownTickSpeed:'slow', backgroundShadowColor: 'rgba(0,0,0,0.2)', backgroundShadowBlur: 0, strokeShadowColor: 'rgba(0,0,0,0.2)', strokeShadowBlur: 0 }); function initializePrevision() { wp3s_prevision_trigger = true; if (jQuery('.wp3s_prevision #slides').length != 0) { if (jQuery('.wp3s_prevision #slides li').length < 2) { jQuery('.wp3s_prevision #slides').superslides({ play: false, animation: 'fade', hashchange: false, pagination: false }); } else { jQuery('.wp3s_prevision #slides').superslides({ play: 5000, animation: 'fade', hashchange: false, pagination: false }); } } // MAIN DIMENSION SET WIDTH (function() { function mainInit() { var main = jQuery('.wp3s_prevision #main'), ww = jQuery(window).width(), mainWidth = ww-250; if (ww > 900) { main.css({ width: mainWidth+"px" }); } // center content var mainContent = jQuery('.wp3s_prevision .content .content-inner'), contentHeight = mainContent.height(), parentHeight = main.height(), topMargin = (parentHeight - contentHeight) / 2; mainContent.css({ "padding-top" : topMargin+"px" }); } jQuery(window).on("resize", mainInit); jQuery(document).on("ready", mainInit); })(); // QUOTES if (jQuery('.wp3s_prevision .bxslider li').length < 2) { } else { jQuery('.wp3s_prevision .bxslider').bxSlider({ auto: false, easing: 'ease-in-out', touchEnabled: true, oneToOneTouch: true, pageCustom: '#bx-pager', nextSelector: '#bx-next', prevSelector: '#bx-prev', nextText: 'next', prevText: 'prev', pager: false, speed: 650, pause: 8500 }); } var formShowing = false; jQuery('.wp3s_prevision a.contact-us-trigger, .wp3s_prevision a.menu-close').click(function(e) { e.preventDefault(); if (formShowing == false) { jQuery('.wp3s_prevision #contact-us').animate({ marginLeft: 250 }, 300); formShowing = true; } else { jQuery('.wp3s_prevision #contact-us').animate({ marginLeft: -690 }, 300); formShowing = false; } }); jQuery('.wp3s_prevision #contactform').validate({ rules: { name: { required: true, minlength: 2 }, email: { required: true, email: true }, message: { required: true, minlength: 20 } }, messages: { author: "Please enter your name.", email: "Please enter a valid email address.", comment: "Message box cannot be empty!" }, invalidHandler: function(event, validator) { var errors = validator.numberOfInvalids(); if (errors) { jQuery('#contactFormError').show(); } else { jQuery('#contactFormError').hide(); } }, errorElement: "div", errorPlacement: function(error,element) {}, submitHandler: function(form) { jQuery.post('http://www.wawis.com.mx/wp-content/plugins/prevision/inc/sendmail.php', jQuery('.wp3s_prevision #contactform').serialize(), function(response) { if (response.indexOf("thanks") >= 0) { jQuery('.wp3s_prevision #contactFormSent').show(); jQuery('.wp3s_prevision #contactFormError').hide(); jQuery('.wp3s_prevision #contactFormError2').hide(); } else if (response.indexOf("senderror") >= 0) { jQuery('.wp3s_prevision #contactFormError2').show(); jQuery('.wp3s_prevision #contactFormError').hide(); } else { jQuery('.wp3s_prevision #contactFormError').show(); } }); return false; } }); } // Document Ready jQuery(document).ready(function($){ wp3s_prevision_trigger = true; initializePrevision(); jQuery(window).on("resize", initializePrevision()); }); if (wp3s_prevision_trigger == false) { //setTimeout(initializePrevision, 800); }