$(function(){ // Create counters - pass in max var counter = function (max) { "use strict"; var index = 0, /* maxIndex = max, */ getIndex = function () { return index; }, setIndex = function (val) { index = val; return index; }, increment = function () { return index++; }, decrement = function () { return index--; }; return { 'increment' : increment, 'decrement' : decrement, 'getIndex' : getIndex, 'setIndex' : setIndex }; }; function l(o){ console.log(o); } // Splitski $(function(){ var splitski = (function(){ var transitionTime = 300, slideClass = 'splitski-slide', navClass = 'splitski-nav', activeNavClass = 'activeNav', // Do not update below this line // elem = '', delimeter = '', splitPoints = [], slides = [], index = '', getSplitPoints = function(){ splitPoints = $(elem+', '+elem+' *').contents().filter(function(){ if(this.nodeType==8 && (delimeter == this.data.replace(/^\s+|\s+$/g,""))){ return this; } }); }, bubbleSplitPoints = function(){ $(splitPoints).each(function(){ parent = $(this).parent(), i = 0; while($(parent).attr('class')!==$(elem).attr('class') && i<=1000){ i++; $(this).insertAfter(parent); parent = $(this).parent(); } }); }, createSlides = function(){ var slide = $('
').css('display','none').addClass(slideClass); var that = ''; $(elem).contents().each(function(){ that = this; if(this.nodeType==8){ if($(slide).text()){ slides.push(slide); } slide = $('').css('display','none').addClass(slideClass); } else{ $(that).appendTo(slide); } }); $(that).appendTo(slide); if($(slide).text()){ slides.push(slide); } }, updateNav = function(i){ i++; // accomodate for zero index $('.'+activeNavClass).removeClass(activeNavClass); $('.'+navClass).each(function(){ $('li:nth-child('+ i +')',this).addClass(activeNavClass); }); }, updateSlide = function(e){ if(!e){ updateNav(0); $(slides[0]).fadeIn(transitionTime); } else { var curIndex = $(e.currentTarget).attr('data-index'); if(index.getIndex() != curIndex){ $(slides[index.getIndex()]).stop(1,1).fadeOut(transitionTime,function(){ index.setIndex(curIndex); $(slides[curIndex]).stop(1,1).fadeIn(transitionTime); updateNav(index.getIndex()); }); } } }, // Function to create the navigation createNav = function(){ nav = $('Thank you. Your request will be processed shortly.
") .fadeIn(500); } ); // Intel hook: Successful submission- send data to Intel if (blnIntelSubmission) handleIntel(formObj); } else { $(swap) .html(response.errors) .fadeIn(500); } }, error: function (response) { } }); } ); } // Submit sidebox forms function submitIntelForm (formObj, swap, success, blnIntelSubmission) { $(swap).fadeOut(500, function () { $.ajax({ url:"/includes/processIntelforms.php", type:"post", dataType:"json", data:formObj, success: function (response) { $(swap).empty(); if (response.success) { $(success).fadeOut(500, function () { $(swap) .html("Thank you. Your request will be processed shortly.
") .fadeIn(500); } ); // Intel hook: Successful submission- send data to Intel if (blnIntelSubmission) handleIntel(formObj); } else { $(swap) .html(response.errors) .fadeIn(500); } }, error: function (response) { } }); } ); }