/* Source and licensing information for the line(s) below can be found at https://circuitdigest.com/sites/all/modules/custom_module/welcome_ad.js. */ (function($){Drupal.behaviors.custom_module_2={attach:function(context,settings){$('#popup-announcement').css({padding:'0'});$('#popup-announcement-wrap').css({'border-radius':'0',position:'fixed'});$('#popup-announcement-close').css({top:'4px',right:'150px'});var sec=30,cd_timer=setInterval(function(){$("#popup_cd").html("
"+ sec--+" second(s) left to wait, or skip
");if(sec==-1){$('#popup-announcement-close').trigger('click');clearInterval(cd_timer)}},1e3)}}})(jQuery);; /* Source and licensing information for the above line(s) can be found at https://circuitdigest.com/sites/all/modules/custom_module/welcome_ad.js. */ /* Source and licensing information for the line(s) below can be found at https://circuitdigest.com/sites/all/modules/custom_module/header_sticky.js. */ (function($){Drupal.behaviors.custom_module_3={attach:function(context,settings){var distanceFromTop_3=$('.header-main-inner').offset().top;if($(window).width()>=480)$(window).scroll(function(){var distanceFromTop_4=$(this).scrollTop();if(distanceFromTop_4>distanceFromTop_3){$('.header-main-inner').css({position:"fixed",top:"0"})}else $('.header-main-inner').css({position:"relative"})})}}})(jQuery);; /* Source and licensing information for the above line(s) can be found at https://circuitdigest.com/sites/all/modules/custom_module/header_sticky.js. */ (function($){Drupal.behaviors.image_caption={attach:function(context,settings){$("img.caption:not(.caption-processed)").each(function(i){var imgwidth=$(this).width()?$(this).width():false;var imgheight=$(this).height()?$(this).height():false;var captiontext=$(this).attr('title');if($(this).attr('align')){var alignment=$(this).attr('align');$(this).css({'float':alignment});$(this).removeAttr('align');}else if($(this).css('float')){var alignment=$(this).css('float');}else{var alignment='normal';} var style=$(this).attr('style')?$(this).attr('style'):'';$(this).removeAttr('width');$(this).removeAttr('height');$(this).css('width','');$(this).css('height','');$(this).removeAttr('align');$(this).removeAttr('style');$(this).wrap("");$(this).parent().addClass('image-caption-container-'+alignment);//if(imgwidth){$(this).width(imgwidth);$(this).parent().width(imgwidth);} //if(imgheight){$(this).height(imgheight);} $(this).parent().append(""+captiontext+"");$(this).addClass('caption-processed');});}};})(jQuery);;/**/ /* Source and licensing information for the line(s) below can be found at https://circuitdigest.com/sites/all/themes/gavias_synery/custom_changes/calculators/resistor_calc.js. */ function link_highlight(){if(document.location.href=="https://circuitdigest.com/calculators/resistor-color-code-calculator"){document.getElementById("four_band").style.backgroundColor="#70f380"}else if(document.location.href=="https://circuitdigest.com/calculators/5-band-resistor-color-code-calculator"){document.getElementById("five_band").style.backgroundColor="#70f380"}else if(document.location.href=="https://circuitdigest.com/calculators/6-band-resistor-color-code-calculator")document.getElementById("six_band").style.backgroundColor="#70f380"};window.onload=link_highlight function resistor_calculate(){var first_digit_js=document.getElementsByName("first_digit")[0].value,second_digit_js=document.getElementsByName("second_digit")[0].value,multiplier_js=document.getElementsByName("multiplier")[0].value,tolerance_js=document.getElementsByName("tolerance")[0].value,f=document.getElementById("one");document.getElementById("first_div").style.backgroundColor=f.options[f.selectedIndex].style.backgroundColor;var g=document.getElementById("two");document.getElementById("second_div").style.backgroundColor=g.options[g.selectedIndex].style.backgroundColor;var h=document.getElementById("three");document.getElementById("third_div").style.backgroundColor=h.options[h.selectedIndex].style.backgroundColor;var i=document.getElementById("four");document.getElementById("fourth_div").style.backgroundColor=i.options[i.selectedIndex].style.backgroundColor;var first_two_digit=first_digit_js+second_digit_js,total_res=(first_two_digit*multiplier_js);if(total_res>1e3&&total_res<1e6){total_res=(total_res/1e3)+'K'}else if(total_res>1e6)total_res=(total_res/1e6)+'M';document.getElementsByName('resistance')[0].value=total_res+' Ohms';document.getElementsByName('tolerance_html')[0].value=tolerance_js}; /* Source and licensing information for the above line(s) can be found at https://circuitdigest.com/sites/all/themes/gavias_synery/custom_changes/calculators/resistor_calc.js. */ /* Source and licensing information for the line(s) below can be found at https://circuitdigest.com/sites/all/modules/tb_megamenu/js/tb-megamenu-frontend.js. */ Drupal.TBMegaMenu=Drupal.TBMegaMenu||{};(function($){Drupal.TBMegaMenu.oldWindowWidth=0;Drupal.TBMegaMenu.displayedMenuMobile=false;Drupal.TBMegaMenu.supportedScreens=[980];Drupal.TBMegaMenu.menuResponsive=function(){var windowWidth=window.innerWidth?window.innerWidth:$(window).width(),navCollapse=$('.tb-megamenu').children('.nav-collapse');if(windowWidth li, li.mega').hover(function(event){var $this=$(this);if($this.hasClass('mega')){$this.addClass('animating');clearTimeout($this.data('animatingTimeout'));$this.data('animatingTimeout',setTimeout(function(){$this.removeClass('animating')},mm_timeout));clearTimeout($this.data('hoverTimeout'));$this.data('hoverTimeout',setTimeout(function(){$this.addClass('open')},100))}else{clearTimeout($this.data('hoverTimeout'));$this.data('hoverTimeout',setTimeout(function(){$this.addClass('open')},100))}},function(event){var $this=$(this);if($this.hasClass('mega')){$this.addClass('animating');clearTimeout($this.data('animatingTimeout'));$this.data('animatingTimeout',setTimeout(function(){$this.removeClass('animating')},mm_timeout));clearTimeout($this.data('hoverTimeout'));$this.data('hoverTimeout',setTimeout(function(){$this.removeClass('open')},100))}else{clearTimeout($this.data('hoverTimeout'));$this.data('hoverTimeout',setTimeout(function(){$this.removeClass('open')},100))}})});$(window).resize(function(){var windowWidth=window.innerWidth?window.innerWidth:$(window).width();if(windowWidth!=Drupal.TBMegaMenu.oldWindowWidth){Drupal.TBMegaMenu.oldWindowWidth=windowWidth;Drupal.TBMegaMenu.menuResponsive()}})}}})(jQuery);; /* Source and licensing information for the above line(s) can be found at https://circuitdigest.com/sites/all/modules/tb_megamenu/js/tb-megamenu-frontend.js. */ /* Source and licensing information for the line(s) below can be found at https://circuitdigest.com/sites/all/modules/tb_megamenu/js/tb-megamenu-touch.js. */ Drupal.TBMegaMenu=Drupal.TBMegaMenu||{};(function($){Drupal.TBMegaMenu.createTouchMenu=function(items){items.children('a').each(function(){var $item=$(this),tbitem=$(this).parent();$item.click(function(event){if($item.hasClass('tb-megamenu-clicked')){var $uri=$item.attr('href');window.location.href=$uri}else{event.preventDefault();$item.addClass('tb-megamenu-clicked');if(!tbitem.hasClass('open'))tbitem.addClass('open')}}).closest('li').mouseleave(function(){$item.removeClass('tb-megamenu-clicked');tbitem.removeClass('open')})})};Drupal.TBMegaMenu.eventStopPropagation=function(event){if(event.stopPropagation){event.stopPropagation()}else if(window.event)window.event.cancelBubble=true};Drupal.behaviors.tbMegaMenuTouchAction={attach:function(context){var isTouch='ontouchstart'in window&&!/hp-tablet/gi.test(navigator.appVersion);if(isTouch){$('html').addClass('touch');Drupal.TBMegaMenu.createTouchMenu($('.tb-megamenu ul.nav li.mega').has('.dropdown-menu'))}}}})(jQuery);; /* Source and licensing information for the above line(s) can be found at https://circuitdigest.com/sites/all/modules/tb_megamenu/js/tb-megamenu-touch.js. */ /* (function ($) { Drupal.behaviors.caption = { attach: function(context, settings) { $('.field-name-field-project-image img').addClass('caption'); }}}) (jQuery); */ /**/;/**/ /*! * imagesLoaded PACKAGED v3.1.8 * JavaScript is all like "You images are done yet or what?" * MIT License */ (function(){function e(){}function t(e,t){for(var n=e.length;n--;)if(e[n].listener===t)return n;return-1}function n(e){return function(){return this[e].apply(this,arguments)}}var i=e.prototype,r=this,o=r.EventEmitter;i.getListeners=function(e){var t,n,i=this._getEvents();if("object"==typeof e){t={};for(n in i)i.hasOwnProperty(n)&&e.test(n)&&(t[n]=i[n])}else t=i[e]||(i[e]=[]);return t},i.flattenListeners=function(e){var t,n=[];for(t=0;e.length>t;t+=1)n.push(e[t].listener);return n},i.getListenersAsObject=function(e){var t,n=this.getListeners(e);return n instanceof Array&&(t={},t[e]=n),t||n},i.addListener=function(e,n){var i,r=this.getListenersAsObject(e),o="object"==typeof n;for(i in r)r.hasOwnProperty(i)&&-1===t(r[i],n)&&r[i].push(o?n:{listener:n,once:!1});return this},i.on=n("addListener"),i.addOnceListener=function(e,t){return this.addListener(e,{listener:t,once:!0})},i.once=n("addOnceListener"),i.defineEvent=function(e){return this.getListeners(e),this},i.defineEvents=function(e){for(var t=0;e.length>t;t+=1)this.defineEvent(e[t]);return this},i.removeListener=function(e,n){var i,r,o=this.getListenersAsObject(e);for(r in o)o.hasOwnProperty(r)&&(i=t(o[r],n),-1!==i&&o[r].splice(i,1));return this},i.off=n("removeListener"),i.addListeners=function(e,t){return this.manipulateListeners(!1,e,t)},i.removeListeners=function(e,t){return this.manipulateListeners(!0,e,t)},i.manipulateListeners=function(e,t,n){var i,r,o=e?this.removeListener:this.addListener,s=e?this.removeListeners:this.addListeners;if("object"!=typeof t||t instanceof RegExp)for(i=n.length;i--;)o.call(this,t,n[i]);else for(i in t)t.hasOwnProperty(i)&&(r=t[i])&&("function"==typeof r?o.call(this,i,r):s.call(this,i,r));return this},i.removeEvent=function(e){var t,n=typeof e,i=this._getEvents();if("string"===n)delete i[e];else if("object"===n)for(t in i)i.hasOwnProperty(t)&&e.test(t)&&delete i[t];else delete this._events;return this},i.removeAllListeners=n("removeEvent"),i.emitEvent=function(e,t){var n,i,r,o,s=this.getListenersAsObject(e);for(r in s)if(s.hasOwnProperty(r))for(i=s[r].length;i--;)n=s[r][i],n.once===!0&&this.removeListener(e,n.listener),o=n.listener.apply(this,t||[]),o===this._getOnceReturnValue()&&this.removeListener(e,n.listener);return this},i.trigger=n("emitEvent"),i.emit=function(e){var t=Array.prototype.slice.call(arguments,1);return this.emitEvent(e,t)},i.setOnceReturnValue=function(e){return this._onceReturnValue=e,this},i._getOnceReturnValue=function(){return this.hasOwnProperty("_onceReturnValue")?this._onceReturnValue:!0},i._getEvents=function(){return this._events||(this._events={})},e.noConflict=function(){return r.EventEmitter=o,e},"function"==typeof define&&define.amd?define("eventEmitter/EventEmitter",[],function(){return e}):"object"==typeof module&&module.exports?module.exports=e:this.EventEmitter=e}).call(this),function(e){function t(t){var n=e.event;return n.target=n.target||n.srcElement||t,n}var n=document.documentElement,i=function(){};n.addEventListener?i=function(e,t,n){e.addEventListener(t,n,!1)}:n.attachEvent&&(i=function(e,n,i){e[n+i]=i.handleEvent?function(){var n=t(e);i.handleEvent.call(i,n)}:function(){var n=t(e);i.call(e,n)},e.attachEvent("on"+n,e[n+i])});var r=function(){};n.removeEventListener?r=function(e,t,n){e.removeEventListener(t,n,!1)}:n.detachEvent&&(r=function(e,t,n){e.detachEvent("on"+t,e[t+n]);try{delete e[t+n]}catch(i){e[t+n]=void 0}});var o={bind:i,unbind:r};"function"==typeof define&&define.amd?define("eventie/eventie",o):e.eventie=o}(this),function(e,t){"function"==typeof define&&define.amd?define(["eventEmitter/EventEmitter","eventie/eventie"],function(n,i){return t(e,n,i)}):"object"==typeof exports?module.exports=t(e,require("wolfy87-eventemitter"),require("eventie")):e.imagesLoaded=t(e,e.EventEmitter,e.eventie)}(window,function(e,t,n){function i(e,t){for(var n in t)e[n]=t[n];return e}function r(e){return"[object Array]"===d.call(e)}function o(e){var t=[];if(r(e))t=e;else if("number"==typeof e.length)for(var n=0,i=e.length;i>n;n++)t.push(e[n]);else t.push(e);return t}function s(e,t,n){if(!(this instanceof s))return new s(e,t);"string"==typeof e&&(e=document.querySelectorAll(e)),this.elements=o(e),this.options=i({},this.options),"function"==typeof t?n=t:i(this.options,t),n&&this.on("always",n),this.getImages(),a&&(this.jqDeferred=new a.Deferred);var r=this;setTimeout(function(){r.check()})}function f(e){this.img=e}function c(e){this.src=e,v[e]=this}var a=e.jQuery,u=e.console,h=u!==void 0,d=Object.prototype.toString;s.prototype=new t,s.prototype.options={},s.prototype.getImages=function(){this.images=[];for(var e=0,t=this.elements.length;t>e;e++){var n=this.elements[e];"IMG"===n.nodeName&&this.addImage(n);var i=n.nodeType;if(i&&(1===i||9===i||11===i))for(var r=n.querySelectorAll("img"),o=0,s=r.length;s>o;o++){var f=r[o];this.addImage(f)}}},s.prototype.addImage=function(e){var t=new f(e);this.images.push(t)},s.prototype.check=function(){function e(e,r){return t.options.debug&&h&&u.log("confirm",e,r),t.progress(e),n++,n===i&&t.complete(),!0}var t=this,n=0,i=this.images.length;if(this.hasAnyBroken=!1,!i)return this.complete(),void 0;for(var r=0;i>r;r++){var o=this.images[r];o.on("confirm",e),o.check()}},s.prototype.progress=function(e){this.hasAnyBroken=this.hasAnyBroken||!e.isLoaded;var t=this;setTimeout(function(){t.emit("progress",t,e),t.jqDeferred&&t.jqDeferred.notify&&t.jqDeferred.notify(t,e)})},s.prototype.complete=function(){var e=this.hasAnyBroken?"fail":"done";this.isComplete=!0;var t=this;setTimeout(function(){if(t.emit(e,t),t.emit("always",t),t.jqDeferred){var n=t.hasAnyBroken?"reject":"resolve";t.jqDeferred[n](t)}})},a&&(a.fn.imagesLoaded=function(e,t){var n=new s(this,e,t);return n.jqDeferred.promise(a(this))}),f.prototype=new t,f.prototype.check=function(){var e=v[this.img.src]||new c(this.img.src);if(e.isConfirmed)return this.confirm(e.isLoaded,"cached was confirmed"),void 0;if(this.img.complete&&void 0!==this.img.naturalWidth)return this.confirm(0!==this.img.naturalWidth,"naturalWidth"),void 0;var t=this;e.on("confirm",function(e,n){return t.confirm(e.isLoaded,n),!0}),e.check()},f.prototype.confirm=function(e,t){this.isLoaded=e,this.emit("confirm",this,t)};var v={};return c.prototype=new t,c.prototype.check=function(){if(!this.isChecked){var e=new Image;n.bind(e,"load",this),n.bind(e,"error",this),e.src=this.src,this.isChecked=!0}},c.prototype.handleEvent=function(e){var t="on"+e.type;this[t]&&this[t](e)},c.prototype.onload=function(e){this.confirm(!0,"onload"),this.unbindProxyEvents(e)},c.prototype.onerror=function(e){this.confirm(!1,"onerror"),this.unbindProxyEvents(e)},c.prototype.confirm=function(e,t){this.isConfirmed=!0,this.isLoaded=e,this.emit("confirm",this,t)},c.prototype.unbindProxyEvents=function(e){n.unbind(e.target,"load",this),n.unbind(e.target,"error",this)},s});;/**/ /* Source and licensing information for the line(s) below can be found at https://circuitdigest.com/sites/all/themes/gavias_synery/vendor/jquery.easing.js. */ jQuery.easing['jswing']=jQuery.easing['swing'];jQuery.extend(jQuery.easing,{def:'easeOutQuad',swing:function(x,t,b,c,d){return jQuery.easing[jQuery.easing.def](x,t,b,c,d)},easeInQuad:function(x,t,b,c,d){return c*(t/=d)*t+b},easeOutQuad:function(x,t,b,c,d){return-c*(t/=d)*(t-2)+b},easeInOutQuad:function(x,t,b,c,d){if((t/=d/2)<1)return c/2*t*t+b;return-c/2*((--t)*(t-2)-1)+b},easeInCubic:function(x,t,b,c,d){return c*(t/=d)*t*t+b},easeOutCubic:function(x,t,b,c,d){return c*((t=t/d-1)*t*t+1)+b},easeInOutCubic:function(x,t,b,c,d){if((t/=d/2)<1)return c/2*t*t*t+b;return c/2*((t-=2)*t*t+2)+b},easeInQuart:function(x,t,b,c,d){return c*(t/=d)*t*t*t+b},easeOutQuart:function(x,t,b,c,d){return-c*((t=t/d-1)*t*t*t-1)+b},easeInOutQuart:function(x,t,b,c,d){if((t/=d/2)<1)return c/2*t*t*t*t+b;return-c/2*((t-=2)*t*t*t-2)+b},easeInQuint:function(x,t,b,c,d){return c*(t/=d)*t*t*t*t+b},easeOutQuint:function(x,t,b,c,d){return c*((t=t/d-1)*t*t*t*t+1)+b},easeInOutQuint:function(x,t,b,c,d){if((t/=d/2)<1)return c/2*t*t*t*t*t+b;return c/2*((t-=2)*t*t*t*t+2)+b},easeInSine:function(x,t,b,c,d){return-c*Math.cos(t/d*(Math.PI/2))+c+b},easeOutSine:function(x,t,b,c,d){return c*Math.sin(t/d*(Math.PI/2))+b},easeInOutSine:function(x,t,b,c,d){return-c/2*(Math.cos(Math.PI*t/d)-1)+b},easeInExpo:function(x,t,b,c,d){return(t==0)?b:c*Math.pow(2,10*(t/d-1))+b},easeOutExpo:function(x,t,b,c,d){return(t==d)?b+c:c*(-Math.pow(2,-10*t/d)+1)+b},easeInOutExpo:function(x,t,b,c,d){if(t==0)return b;if(t==d)return b+c;if((t/=d/2)<1)return c/2*Math.pow(2,10*(t-1))+b;return c/2*(-Math.pow(2,-10*--t)+2)+b},easeInCirc:function(x,t,b,c,d){return-c*(Math.sqrt(1-(t/=d)*t)-1)+b},easeOutCirc:function(x,t,b,c,d){return c*Math.sqrt(1-(t=t/d-1)*t)+b},easeInOutCirc:function(x,t,b,c,d){if((t/=d/2)<1)return-c/2*(Math.sqrt(1-t*t)-1)+b;return c/2*(Math.sqrt(1-(t-=2)*t)+1)+b},easeInElastic:function(x,t,b,c,d){var s=1.70158,p=0,a=c;if(t==0)return b;if((t/=d)==1)return b+c;if(!p)p=d*.3;if(a").wrap("
");base.$elem.find(".owl-wrapper").wrap("
");base.wrapperOuter=base.$elem.find(".owl-wrapper-outer");base.$elem.css("display","block")},baseClass:function(){var base=this,hasBaseClass=base.$elem.hasClass(base.options.baseClass),hasThemeClass=base.$elem.hasClass(base.options.theme);if(!hasBaseClass)base.$elem.addClass(base.options.baseClass);if(!hasThemeClass)base.$elem.addClass(base.options.theme)},updateItems:function(){var base=this,width,i;if(base.options.responsive===false)return false;if(base.options.singleItem===true){base.options.items=base.orignalItems=1;base.options.itemsCustom=false;base.options.itemsDesktop=false;base.options.itemsDesktopSmall=false;base.options.itemsTablet=false;base.options.itemsTabletSmall=false;base.options.itemsMobile=false;return false};width=$(base.options.responsiveBaseWidth).width();if(width>(base.options.itemsDesktop[0]||base.orignalItems))base.options.items=base.orignalItems;if(base.options.itemsCustom!==false){base.options.itemsCustom.sort(function(a,b){return a[0]-b[0]});for(i=0;ibase.itemsAmount&&base.options.itemsScaleUp===true)base.options.items=base.itemsAmount},response:function(){var base=this,smallDelay,lastWindowWidth;if(base.options.responsive!==true)return false;lastWindowWidth=$(window).width();base.resizer=function(){if($(window).width()!==lastWindowWidth){if(base.options.autoPlay!==false)window.clearInterval(base.autoPlayInterval);window.clearTimeout(smallDelay);smallDelay=window.setTimeout(function(){lastWindowWidth=$(window).width();base.updateVars()},base.options.responsiveRefreshRate)}};$(window).resize(base.resizer)},updatePosition:function(){var base=this;base.jumpTo(base.currentItem);if(base.options.autoPlay!==false)base.checkAp()},appendItemsSizes:function(){var base=this,roundPages=0,lastItem=base.itemsAmount-base.options.items;base.$owlItems.each(function(index){var $this=$(this);$this.css({width:base.itemWidth}).data("owl-item",Number(index));if(index%base.options.items===0||index===lastItem)if(!(index>lastItem))roundPages+=1;$this.data("owl-roundPages",roundPages)})},appendWrapperSizes:function(){var base=this,width=base.$owlItems.length*base.itemWidth;base.$owlWrapper.css({width:width*2,left:0});base.appendItemsSizes()},calculateAll:function(){var base=this;base.calculateWidth();base.appendWrapperSizes();base.loops();base.max()},calculateWidth:function(){var base=this;base.itemWidth=Math.round(base.$elem.width()/base.options.items)},max:function(){var base=this,maximum=((base.itemsAmount*base.itemWidth)-base.options.items*base.itemWidth)*-1;if(base.options.items>base.itemsAmount){base.maximumItem=0;maximum=0;base.maximumPixels=0}else{base.maximumItem=base.itemsAmount-base.options.items;base.maximumPixels=maximum};return maximum},min:function(){return 0},loops:function(){var base=this,prev=0,elWidth=0,i,item,roundPageNum;base.positionsInArray=[0];base.pagesInArray=[];for(i=0;i").toggleClass("clickable",!base.browser.isTouch).appendTo(base.$elem);if(base.options.pagination===true)base.buildPagination();if(base.options.navigation===true)base.buildButtons()},buildButtons:function(){var base=this,buttonsWrapper=$("
");base.owlControls.append(buttonsWrapper);base.buttonPrev=$("
",{"class":"owl-prev",html:base.options.navigationText[0]||""});base.buttonNext=$("
",{"class":"owl-next",html:base.options.navigationText[1]||""});buttonsWrapper.append(base.buttonPrev).append(base.buttonNext);buttonsWrapper.on("touchstart.owlControls mousedown.owlControls","div[class^=\"owl\"]",function(event){event.preventDefault()});buttonsWrapper.on("touchend.owlControls mouseup.owlControls","div[class^=\"owl\"]",function(event){event.preventDefault();if($(this).hasClass("owl-next")){base.next()}else base.prev()})},buildPagination:function(){var base=this;base.paginationWrapper=$("
");base.owlControls.append(base.paginationWrapper);base.paginationWrapper.on("touchend.owlControls mouseup.owlControls",".owl-page",function(event){event.preventDefault();if(Number($(this).data("owl-page"))!==base.currentItem)base.goTo(Number($(this).data("owl-page")),true)})},updatePagination:function(){var base=this,counter,lastPage,lastItem,i,paginationButton,paginationButtonInner;if(base.options.pagination===false)return false;base.paginationWrapper.html("");counter=0;lastPage=base.itemsAmount-base.itemsAmount%base.options.items;for(i=0;i",{"class":"owl-page"});paginationButtonInner=$("",{text:base.options.paginationNumbers===true?counter:"","class":base.options.paginationNumbers===true?"owl-numbers":""});paginationButton.append(paginationButtonInner);paginationButton.data("owl-page",lastPage===i?lastItem:i);paginationButton.data("owl-roundPages",counter);base.paginationWrapper.append(paginationButton)};base.checkPagination()},checkPagination:function(){var base=this;if(base.options.pagination===false)return false;base.paginationWrapper.find(".owl-page").each(function(){if($(this).data("owl-roundPages")===$(base.$owlItems[base.currentItem]).data("owl-roundPages")){base.paginationWrapper.find(".owl-page").removeClass("active");$(this).addClass("active")}})},checkNavigation:function(){var base=this;if(base.options.navigation===false)return false;if(base.options.rewindNav===false)if(base.currentItem===0&&base.maximumItem===0){base.buttonPrev.addClass("disabled");base.buttonNext.addClass("disabled")}else if(base.currentItem===0&&base.maximumItem!==0){base.buttonPrev.addClass("disabled");base.buttonNext.removeClass("disabled")}else if(base.currentItem===base.maximumItem){base.buttonPrev.removeClass("disabled");base.buttonNext.addClass("disabled")}else if(base.currentItem!==0&&base.currentItem!==base.maximumItem){base.buttonPrev.removeClass("disabled");base.buttonNext.removeClass("disabled")}},updateControls:function(){var base=this;base.updatePagination();base.checkNavigation();if(base.owlControls)if(base.options.items>=base.itemsAmount){base.owlControls.hide()}else base.owlControls.show()},destroyControls:function(){var base=this;if(base.owlControls)base.owlControls.remove()},next:function(speed){var base=this;if(base.isTransition)return false;base.currentItem+=base.options.scrollPerPage===true?base.options.items:1;if(base.currentItem>base.maximumItem+(base.options.scrollPerPage===true?(base.options.items-1):0))if(base.options.rewindNav===true){base.currentItem=0;speed="rewind"}else{base.currentItem=base.maximumItem;return false};base.goTo(base.currentItem,speed)},prev:function(speed){var base=this;if(base.isTransition)return false;if(base.options.scrollPerPage===true&&base.currentItem>0&&base.currentItem=base.maximumItem){position=base.maximumItem}else if(position<=0)position=0;base.currentItem=base.owl.currentItem=position;if(base.options.transitionStyle!==false&&drag!=="drag"&&base.options.items===1&&base.browser.support3d===true){base.swapSpeed(0);if(base.browser.support3d===true){base.transition3d(base.positionsInArray[position])}else base.css2slide(base.positionsInArray[position],1);base.afterGo();base.singleItemTransition();return false};goToPixel=base.positionsInArray[position];if(base.browser.support3d===true){base.isCss3Finish=false;if(speed===true){base.swapSpeed("paginationSpeed");window.setTimeout(function(){base.isCss3Finish=true},base.options.paginationSpeed)}else if(speed==="rewind"){base.swapSpeed(base.options.rewindSpeed);window.setTimeout(function(){base.isCss3Finish=true},base.options.rewindSpeed)}else{base.swapSpeed("slideSpeed");window.setTimeout(function(){base.isCss3Finish=true},base.options.slideSpeed)};base.transition3d(goToPixel)}else if(speed===true){base.css2slide(goToPixel,base.options.paginationSpeed)}else if(speed==="rewind"){base.css2slide(goToPixel,base.options.rewindSpeed)}else base.css2slide(goToPixel,base.options.slideSpeed);base.afterGo()},jumpTo:function(position){var base=this;if(typeof base.options.beforeMove==="function")base.options.beforeMove.apply(this,[base.$elem]);if(position>=base.maximumItem||position===-1){position=base.maximumItem}else if(position<=0)position=0;base.swapSpeed(0);if(base.browser.support3d===true){base.transition3d(base.positionsInArray[position])}else base.css2slide(base.positionsInArray[position],1);base.currentItem=base.owl.currentItem=position;base.afterGo()},afterGo:function(){var base=this;base.prevArr.push(base.currentItem);base.prevItem=base.owl.prevItem=base.prevArr[base.prevArr.length-2];base.prevArr.shift(0);if(base.prevItem!==base.currentItem){base.checkPagination();base.checkNavigation();base.eachMoveUpdate();if(base.options.autoPlay!==false)base.checkAp()};if(typeof base.options.afterMove==="function"&&base.prevItem!==base.currentItem)base.options.afterMove.apply(this,[base.$elem])},stop:function(){var base=this;base.apStatus="stop";window.clearInterval(base.autoPlayInterval)},checkAp:function(){var base=this;if(base.apStatus!=="stop")base.play()},play:function(){var base=this;base.apStatus="play";if(base.options.autoPlay===false)return false;window.clearInterval(base.autoPlayInterval);base.autoPlayInterval=window.setInterval(function(){base.next(true)},base.options.autoPlay)},swapSpeed:function(action){var base=this;if(action==="slideSpeed"){base.$owlWrapper.css(base.addCssSpeed(base.options.slideSpeed))}else if(action==="paginationSpeed"){base.$owlWrapper.css(base.addCssSpeed(base.options.paginationSpeed))}else if(typeof action!=="string")base.$owlWrapper.css(base.addCssSpeed(action))},addCssSpeed:function(speed){return{"-webkit-transition":"all "+speed+"ms ease","-moz-transition":"all "+speed+"ms ease","-o-transition":"all "+speed+"ms ease",transition:"all "+speed+"ms ease"}},removeTransition:function(){return{"-webkit-transition":"","-moz-transition":"","-o-transition":"",transition:""}},doTranslate:function(pixels){return{"-webkit-transform":"translate3d("+pixels+"px, 0px, 0px)","-moz-transform":"translate3d("+pixels+"px, 0px, 0px)","-o-transform":"translate3d("+pixels+"px, 0px, 0px)","-ms-transform":"translate3d("+pixels+"px, 0px, 0px)",transform:"translate3d("+pixels+"px, 0px,0px)"}},transition3d:function(value){var base=this;base.$owlWrapper.css(base.doTranslate(value))},css2move:function(value){var base=this;base.$owlWrapper.css({left:value})},css2slide:function(value,speed){var base=this;base.isCssFinish=false;base.$owlWrapper.stop(true,true).animate({left:value},{duration:speed||base.options.slideSpeed,complete:function(){base.isCssFinish=true}})},checkBrowser:function(){var base=this,translate3D="translate3d(0px, 0px, 0px)",tempElem=document.createElement("div"),regex,asSupport,support3d,isTouch;tempElem.style.cssText=" -moz-transform:"+translate3D+"; -ms-transform:"+translate3D+"; -o-transform:"+translate3D+"; -webkit-transform:"+translate3D+"; transform:"+translate3D;regex=/translate3d\(0px, 0px, 0px\)/g;asSupport=tempElem.style.cssText.match(regex);support3d=(asSupport!==null&&asSupport.length===1);isTouch="ontouchstart"in window||window.navigator.msMaxTouchPoints;base.browser={support3d:support3d,isTouch:isTouch}},moveEvents:function(){var base=this;if(base.options.mouseDrag!==false||base.options.touchDrag!==false){base.gestures();base.disabledEvents()}},eventTypes:function(){var base=this,types=["s","e","x"];base.ev_types={};if(base.options.mouseDrag===true&&base.options.touchDrag===true){types=["touchstart.owl mousedown.owl","touchmove.owl mousemove.owl","touchend.owl touchcancel.owl mouseup.owl"]}else if(base.options.mouseDrag===false&&base.options.touchDrag===true){types=["touchstart.owl","touchmove.owl","touchend.owl touchcancel.owl"]}else if(base.options.mouseDrag===true&&base.options.touchDrag===false)types=["mousedown.owl","mousemove.owl","mouseup.owl"];base.ev_types.start=types[0];base.ev_types.move=types[1];base.ev_types.end=types[2]},disabledEvents:function(){var base=this;base.$elem.on("dragstart.owl",function(event){event.preventDefault()});base.$elem.on("mousedown.disableTextSelect",function(e){return $(e.target).is('input, textarea, select, option')})},gestures:function(){var base=this,locals={offsetX:0,offsetY:0,baseElWidth:0,relativePos:0,position:null,minSwipe:null,maxSwipe:null,sliding:null,dargging:null,targetElement:null};base.isCssFinish=true function getTouches(event){if(event.touches!==undefined)return{x:event.touches[0].pageX,y:event.touches[0].pageY};if(event.touches===undefined){if(event.pageX!==undefined)return{x:event.pageX,y:event.pageY};if(event.pageX===undefined)return{x:event.clientX,y:event.clientY}}} function swapEvents(type){if(type==="on"){$(document).on(base.ev_types.move,dragMove);$(document).on(base.ev_types.end,dragEnd)}else if(type==="off"){$(document).off(base.ev_types.move);$(document).off(base.ev_types.end)}} function dragStart(event){var ev=event.originalEvent||event||window.event,position;if(ev.which===3)return false;if(base.itemsAmount<=base.options.items)return;if(base.isCssFinish===false&&!base.options.dragBeforeAnimFinish)return false;if(base.isCss3Finish===false&&!base.options.dragBeforeAnimFinish)return false;if(base.options.autoPlay!==false)window.clearInterval(base.autoPlayInterval);if(base.browser.isTouch!==true&&!base.$owlWrapper.hasClass("grabbing"))base.$owlWrapper.addClass("grabbing");base.newPosX=0;base.newRelativeX=0;$(this).css(base.removeTransition());position=$(this).position();locals.relativePos=position.left;locals.offsetX=getTouches(ev).x-position.left;locals.offsetY=getTouches(ev).y-position.top;swapEvents("on");locals.sliding=false;locals.targetElement=ev.target||ev.srcElement} function dragMove(event){var ev=event.originalEvent||event||window.event,minSwipe,maxSwipe;base.newPosX=getTouches(ev).x-locals.offsetX;base.newPosY=getTouches(ev).y-locals.offsetY;base.newRelativeX=base.newPosX-locals.relativePos;if(typeof base.options.startDragging==="function"&&locals.dragging!==true&&base.newRelativeX!==0){locals.dragging=true;base.options.startDragging.apply(base,[base.$elem])};if((base.newRelativeX>8||base.newRelativeX<-8)&&(base.browser.isTouch===true)){if(ev.preventDefault!==undefined){ev.preventDefault()}else ev.returnValue=false;locals.sliding=true};if((base.newPosY>10||base.newPosY<-10)&&locals.sliding===false)$(document).off("touchmove.owl");minSwipe=function(){return base.newRelativeX/5};maxSwipe=function(){return base.maximumPixels+base.newRelativeX/5};base.newPosX=Math.max(Math.min(base.newPosX,minSwipe()),maxSwipe());if(base.browser.support3d===true){base.transition3d(base.newPosX)}else base.css2move(base.newPosX)} function dragEnd(event){var ev=event.originalEvent||event||window.event,newPosition,handlers,owlStopEvent;ev.target=ev.target||ev.srcElement;locals.dragging=false;if(base.browser.isTouch!==true)base.$owlWrapper.removeClass("grabbing");if(base.newRelativeX<0){base.dragDirection=base.owl.dragDirection="left"}else base.dragDirection=base.owl.dragDirection="right";if(base.newRelativeX!==0){newPosition=base.getNewPosition();base.goTo(newPosition,false,"drag");if(locals.targetElement===ev.target&&base.browser.isTouch!==true){$(ev.target).on("click.disable",function(ev){ev.stopImmediatePropagation();ev.stopPropagation();ev.preventDefault();$(ev.target).off("click.disable")});handlers=$._data(ev.target,"events").click;owlStopEvent=handlers.pop();handlers.splice(0,0,owlStopEvent)}};swapEvents("off")};base.$elem.on(base.ev_types.start,".owl-wrapper",dragStart)},getNewPosition:function(){var base=this,newPosition=base.closestItem();if(newPosition>base.maximumItem){base.currentItem=base.maximumItem;newPosition=base.maximumItem}else if(base.newPosX>=0){newPosition=0;base.currentItem=0};return newPosition},closestItem:function(){var base=this,array=base.options.scrollPerPage===true?base.pagesInArray:base.positionsInArray,goal=base.newPosX,closest=null;$.each(array,function(i,v){if(goal-(base.itemWidth/20)>array[i+1]&&goal-(base.itemWidth/20)(array[i+1]||array[i]-base.itemWidth)&&base.moveDirection()==="right")if(base.options.scrollPerPage===true){closest=array[i+1]||array[array.length-1];base.currentItem=$.inArray(closest,base.positionsInArray)}else{closest=array[i+1];base.currentItem=i+1}});return base.currentItem},moveDirection:function(){var base=this,direction;if(base.newRelativeX<0){direction="right";base.playDirection="next"}else{direction="left";base.playDirection="prev"};return direction},customEvents:function(){var base=this;base.$elem.on("owl.next",function(){base.next()});base.$elem.on("owl.prev",function(){base.prev()});base.$elem.on("owl.play",function(event,speed){base.options.autoPlay=speed;base.play();base.hoverStatus="play"});base.$elem.on("owl.stop",function(){base.stop();base.hoverStatus="stop"});base.$elem.on("owl.goTo",function(event,item){base.goTo(item)});base.$elem.on("owl.jumpTo",function(event,item){base.jumpTo(item)})},stopOnHover:function(){var base=this;if(base.options.stopOnHover===true&&base.browser.isTouch!==true&&base.options.autoPlay!==false){base.$elem.on("mouseover",function(){base.stop()});base.$elem.on("mouseout",function(){if(base.hoverStatus!=="stop")base.play()})}},lazyLoad:function(){var base=this,i,$item,itemNumber,$lazyImg,follow;if(base.options.lazyLoad===false)return false;for(i=0;i=base.currentItem}else follow=true;if(follow&&itemNumber=base.$userItems.length||position===-1){base.$userItems.eq(-1).after(htmlString)}else base.$userItems.eq(position).before(htmlString);base.setVars()},removeItem:function(targetPosition){var base=this,position;if(base.$elem.children().length===0)return false;if(targetPosition===undefined||targetPosition===-1){position=-1}else position=targetPosition;base.unWrap();base.$userItems.eq(position).remove();base.setVars()}};$.fn.owlCarousel=function(options){return this.each(function(){if($(this).data("owl-init")===true)return false;$(this).data("owl-init",true);var carousel=Object.create(Carousel);carousel.init(options,this);$.data(this,"owlCarousel",carousel)})};$.fn.owlCarousel.options={items:5,itemsCustom:false,itemsDesktop:[1199,4],itemsDesktopSmall:[979,3],itemsTablet:[768,2],itemsTabletSmall:false,itemsMobile:[479,1],singleItem:false,itemsScaleUp:false,slideSpeed:200,paginationSpeed:800,rewindSpeed:1e3,autoPlay:false,stopOnHover:false,navigation:false,navigationText:["prev","next"],rewindNav:true,scrollPerPage:false,pagination:true,paginationNumbers:false,responsive:true,responsiveRefreshRate:200,responsiveBaseWidth:window,baseClass:"owl-carousel",theme:"owl-theme",lazyLoad:false,lazyFollow:true,lazyEffect:"fade",autoHeight:false,jsonPath:false,jsonSuccess:false,dragBeforeAnimFinish:true,mouseDrag:true,touchDrag:true,addClassActive:false,transitionStyle:false,beforeUpdate:false,afterUpdate:false,beforeInit:false,afterInit:false,beforeMove:false,afterMove:false,afterAction:false,startDragging:false,afterLazyLoad:false}}(jQuery,window,document));; /* Source and licensing information for the above line(s) can be found at https://circuitdigest.com/sites/all/themes/gavias_synery/vendor/owl-carousel/owl.carousel.js. */ /* Source and licensing information for the line(s) below can be found at https://circuitdigest.com/sites/all/themes/gavias_synery/js/jquery.cookie.js. */ jQuery.cookie=function(key,value,options){if(arguments.length>1&&(value===null||typeof value!=="object")){options=jQuery.extend({},options);if(value===null)options.expires=-1;if(typeof options.expires==='number'){var days=options.expires,t=options.expires=new Date();t.setDate(t.getDate()+days)};return(document.cookie=[encodeURIComponent(key),'=',options.raw?String(value):encodeURIComponent(String(value)),options.expires?'; expires='+options.expires.toUTCString():'',options.path?'; path='+options.path:'',options.domain?'; domain='+options.domain:'',options.secure?'; secure':''].join(''))};options=value||{};var result,decode=options.raw?function(s){return s}:decodeURIComponent;return(result=new RegExp('(?:^|; )'+encodeURIComponent(key)+'=([^;]*)').exec(document.cookie))?decode(result[1]):null}; /* Source and licensing information for the above line(s) can be found at https://circuitdigest.com/sites/all/themes/gavias_synery/js/jquery.cookie.js. */ /* Source and licensing information for the line(s) below can be found at https://circuitdigest.com/sites/all/themes/gavias_synery/js/theme.plugins.js. */ jQuery(document).ready(function($){"use strict";var Plugins={initialized:false,initialize:function(){if(this.initialized)return;this.initialized=true;this.build()},build:function(){this.wordRotate();this.owlCarousel()},wordRotate:function(){$(".word-rotate").each(function(){var $this=$(this),itemsWrapper=$(this).find(".word-rotate-items"),items=itemsWrapper.find("> span"),firstItem=items.eq(0),firstItemClone=firstItem.clone(),itemHeight=0,currentItem=1,currentTop=0;itemHeight=firstItem.height();itemsWrapper.append(firstItemClone);$this.height(itemHeight).addClass("active");setInterval(function(){currentTop=(currentItem*itemHeight);itemsWrapper.animate({top:-currentTop+"px"},300,"easeOutQuad",function(){currentItem++;if(currentItem>items.length){itemsWrapper.css("top",0);currentItem=1}})},2e3)})},owlCarousel:function(options){var total=$("div.owl-carousel:not(.manual)").length,count=0;$("div.owl-carousel:not(.manual)").each(function(){var slider=$(this),defaults={items:5,itemsCustom:false,itemsDesktop:[1199,4],itemsDesktopSmall:[980,3],itemsTablet:[768,2],itemsTabletSmall:false,itemsMobile:[479,1],singleItem:true,itemsScaleUp:false,slideSpeed:200,paginationSpeed:800,rewindSpeed:1e3,autoPlay:false,stopOnHover:false,navigation:false,navigationText:["",""],rewindNav:true,scrollPerPage:false,pagination:false,paginationNumbers:false,responsive:true,responsiveRefreshRate:200,responsiveBaseWidth:window,baseClass:"owl-carousel",theme:"owl-theme",lazyLoad:false,lazyFollow:true,lazyEffect:"fade",autoHeight:false,jsonPath:false,jsonSuccess:false,dragBeforeAnimFinish:true,mouseDrag:true,touchDrag:true,transitionStyle:false,addClassActive:false,beforeUpdate:false,afterUpdate:false,beforeInit:false,afterInit:false,beforeMove:false,afterMove:false,afterAction:false,startDragging:false,afterLazyLoad:false},config=$.extend({},defaults,options,slider.data("plugin-options"));slider.owlCarousel(config).addClass("owl-carousel-init")})}};Plugins.initialize();$('.gallery-grid .view-list').gridrotator({rows:1,columns:10,w1024:{rows:2,columns:6},w768:{rows:2,columns:5},w480:{rows:2,columns:4},w320:{rows:3,columns:3},w240:{rows:3,columns:2}})});jQuery(document).ready(function($){function groupHeight(){var height=0;if(jQuery(window).width()>996){jQuery('.group-height').each(function(){if(jQuery(this).height()>height)height=jQuery(this).height()});jQuery('.group-height').each(function(){jQuery(this).css('height',height+'px')})}else jQuery('.group-height').each(function(){jQuery(this).css('height','auto')})};jQuery('#content.content-full').css('overflow','visible');jQuery('.sidebar').css('overflow','hidden');jQuery(document).ready(function(){jQuery(window).resize(function(){groupHeight()})})});; /* Source and licensing information for the above line(s) can be found at https://circuitdigest.com/sites/all/themes/gavias_synery/js/theme.plugins.js. */ /* Source and licensing information for the line(s) below can be found at https://circuitdigest.com/sites/all/themes/gavias_synery/js/gavias-custom.js. */ (function($){function css_browser_selector(u){var ua=u.toLowerCase(),is=function(t){return ua.indexOf(t)>-1},g='gecko',w='webkit',s='safari',o='opera',m='mobile',h=document.documentElement,b=[(!(/opera|webtv/i.test(ua))&&/msie\s(\d)/.test(ua))?('ie ie'+RegExp.$1):is('firefox/2')?g+' ff2':is('firefox/3.5')?g+' ff3 ff3_5':is('firefox/3.6')?g+' ff3 ff3_6':is('firefox/3')?g+' ff3':is('gecko/')?g:is('opera')?o+(/version\/(\d+)/.test(ua)?' '+o+RegExp.$1:(/opera(\s|\/)(\d+)/.test(ua)?' '+o+RegExp.$2:'')):is('konqueror')?'konqueror':is('blackberry')?m+' blackberry':is('android')?m+' android':is('chrome')?w+' chrome':is('iron')?w+' iron':is('applewebkit/')?w+' '+s+(/version\/(\d+)/.test(ua)?' '+s+RegExp.$1:''):is('mozilla/')?g:'',is('j2me')?m+' j2me':is('iphone')?m+' iphone':is('ipod')?m+' ipod':is('ipad')?m+' ipad':is('mac')?'mac':is('darwin')?'mac':is('webtv')?'webtv':is('win')?'win'+(is('windows nt 6.0')?' vista':''):is('freebsd')?'freebsd':(is('x11')||is('linux'))?'linux':'','js'];c=b.join(' ');h.className+=' '+c;return c};css_browser_selector(navigator.userAgent)})(jQuery);; /* Source and licensing information for the above line(s) can be found at https://circuitdigest.com/sites/all/themes/gavias_synery/js/gavias-custom.js. */ /* Source and licensing information for the line(s) below can be found at https://circuitdigest.com/sites/all/themes/gavias_synery/js/jquery.gridrotator.js. */ (function($,window,undefined){'use strict';var $event=$.event,$special,resizeTimeout;$special=$event.special.debouncedresize={setup:function(){$(this).on("resize",$special.handler)},teardown:function(){$(this).off("resize",$special.handler)},handler:function(event,execAsap){var context=this,args=arguments,dispatch=function(){event.type="debouncedresize";$event.dispatch.apply(context,args)};if(resizeTimeout)clearTimeout(resizeTimeout);execAsap?dispatch():resizeTimeout=setTimeout(dispatch,$special.threshold)},threshold:100};Array.prototype.shuffle=function(){var i=this.length,p,t;while(i--){p=Math.floor(Math.random()*i);t=this[i];this[i]=this[p];this[p]=t};return this} function getHiddenProp(){var prefixes=['webkit','moz','ms','o'];if('hidden'in document)return'hidden';for(var i=0;i').load(function(){++loaded;$img.parent().css('background-image','url('+src+')');if(loaded===count){$imgs.remove();self.$el.removeClass('ri-grid-loading');self.$items=self.$list.children('li');self.$itemsCache=self.$items.clone();self.itemsTotal=self.$items.length;self.outItems=[];self._layout(function(){self._initEvents()});self._start()}}).attr('src',src)})},_layout:function(callback){var self=this;this._setGridDim();this.$list.empty();this.$items=this.$itemsCache.clone().appendTo(this.$list);var $outItems=this.$items.filter(':gt('+(this.showTotal-1)+')'),$outAItems=$outItems.children('a');this.outItems.length=0;$outAItems.each(function(i){self.outItems.push($(this))});$outItems.remove();var containerWidth=(document.defaultView)?parseInt(document.defaultView.getComputedStyle(this.$el.get(0),null).width):this.$el.width(),itemWidth=Math.floor(containerWidth/this.columns),gapWidth=containerWidth-(this.columns*Math.floor(itemWidth));for(var i=0;iself.showTotal)max=self.showTotal;var nmbOut=step==='random'?Math.floor(Math.random()*max+min):Math.min(Math.abs(step),max),randArr=self._getRandom(nmbOut,self.showTotal);for(var i=0;i").get(0).files!==undefined;feature.formdata=window.FormData!==undefined;var hasProp=!!$.fn.prop;$.fn.attr2=function(){if(!hasProp)return this.attr.apply(this,arguments);var val=this.prop.apply(this,arguments);if((val&&val.jquery)||typeof val==='string')return val;return this.attr.apply(this,arguments)};$.fn.ajaxSubmit=function(options){if(!this.length){log('ajaxSubmit: skipping submit process - no element selected');return this};var method,action,url,$form=this;if(typeof options=='function'){options={success:options}}else if(options===undefined)options={};method=options.type||this.attr2('method');action=options.url||this.attr2('action');url=(typeof action==='string')?$.trim(action):'';url=url||window.location.href||'';if(url)url=(url.match(/^([^#]+)/)||[])[1];options=$.extend(true,{url:url,success:$.ajaxSettings.success,type:method||$.ajaxSettings.type,iframeSrc:/^https/i.test(window.location.href||'')?'javascript:false':'about:blank'},options);var veto={};this.trigger('form-pre-serialize',[this,options,veto]);if(veto.veto){log('ajaxSubmit: submit vetoed via form-pre-serialize trigger');return this};if(options.beforeSerialize&&options.beforeSerialize(this,options)===false){log('ajaxSubmit: submit aborted via beforeSerialize callback');return this};var traditional=options.traditional;if(traditional===undefined)traditional=$.ajaxSettings.traditional;var elements=[],qx,a=this.formToArray(options.semantic,elements);if(options.data){options.extraData=options.data;qx=$.param(options.data,traditional)};if(options.beforeSubmit&&options.beforeSubmit(a,this,options)===false){log('ajaxSubmit: submit aborted via beforeSubmit callback');return this};this.trigger('form-submit-validate',[a,this,options,veto]);if(veto.veto){log('ajaxSubmit: submit vetoed via form-submit-validate trigger');return this};var q=$.param(a,traditional);if(qx)q=(q?(q+'&'+qx):qx);if(options.type.toUpperCase()=='GET'){options.url+=(options.url.indexOf('?')>=0?'&':'?')+q;options.data=null}else options.data=q;var callbacks=[];if(options.resetForm)callbacks.push(function(){$form.resetForm()});if(options.clearForm)callbacks.push(function(){$form.clearForm(options.includeHidden)});if(!options.dataType&&options.target){var oldSuccess=options.success||function(){};callbacks.push(function(data){var fn=options.replaceTarget?'replaceWith':'html';$(options.target)[fn](data).each(oldSuccess,arguments)})}else if(options.success)callbacks.push(options.success);options.success=function(data,status,xhr){var context=options.context||this;for(var i=0,max=callbacks.length;i0,mp='multipart/form-data',multipart=($form.attr('enctype')==mp||$form.attr('encoding')==mp),fileAPI=feature.fileapi&&feature.formdata;log("fileAPI :"+fileAPI);var shouldUseFrame=(hasFileInputs||multipart)&&!fileAPI,jqxhr;if(options.iframe!==false&&(options.iframe||shouldUseFrame)){if(options.closeKeepAlive){$.get(options.closeKeepAlive,function(){jqxhr=fileUploadIframe(a)})}else jqxhr=fileUploadIframe(a)}else if((hasFileInputs||multipart)&&fileAPI){jqxhr=fileUploadXhr(a)}else jqxhr=$.ajax(options);$form.removeData('jqxhr').data('jqxhr',jqxhr);for(var k=0;k');$io.css({position:'absolute',top:'-1000px',left:'-1000px'})};io=$io[0];xhr={aborted:0,responseText:null,responseXML:null,status:0,statusText:'n/a',getAllResponseHeaders:function(){},getResponseHeader:function(){},setRequestHeader:function(){},abort:function(status){var e=(status==='timeout'?'timeout':'aborted');log('aborting upload... '+e);this.aborted=1;try{if(io.contentWindow.document.execCommand)io.contentWindow.document.execCommand('Stop')}catch(ignore){};$io.attr('src',s.iframeSrc);xhr.error=e;if(s.error)s.error.call(s.context,xhr,e,status);if(g)$.event.trigger("ajaxError",[xhr,s,e]);if(s.complete)s.complete.call(s.context,xhr,e)}};g=s.global;if(g&&0===$.active++)$.event.trigger("ajaxStart");if(g)$.event.trigger("ajaxSend",[xhr,s]);if(s.beforeSend&&s.beforeSend.call(s.context,xhr,s)===false){if(s.global)$.active--;deferred.reject();return deferred};if(xhr.aborted){deferred.reject();return deferred};sub=form.clk;if(sub){n=sub.name;if(n&&!sub.disabled){s.extraData=s.extraData||{};s.extraData[n]=sub.value;if(sub.type=="image"){s.extraData[n+'.x']=form.clk_x;s.extraData[n+'.y']=form.clk_y}}};var CLIENT_TIMEOUT_ABORT=1,SERVER_ABORT=2 function getDoc(frame){var doc=null;try{if(frame.contentWindow)doc=frame.contentWindow.document}catch(err){log('cannot get iframe.contentWindow document: '+err)};if(doc)return doc;try{doc=frame.contentDocument?frame.contentDocument:frame.document}catch(err){log('cannot get iframe.contentDocument: '+err);doc=frame.document};return doc};var csrf_token=$('meta[name=csrf-token]').attr('content'),csrf_param=$('meta[name=csrf-param]').attr('content');if(csrf_param&&csrf_token){s.extraData=s.extraData||{};s.extraData[csrf_param]=csrf_token} function doSubmit(){var t=$form.attr2('target'),a=$form.attr2('action'),mp='multipart/form-data',et=$form.attr('enctype')||$form.attr('encoding')||mp;form.setAttribute('target',id);if(!method||/post/i.test(method))form.setAttribute('method','POST');if(a!=s.url)form.setAttribute('action',s.url);if(!s.skipEncodingOverride&&(!method||/post/i.test(method)))$form.attr({encoding:'multipart/form-data',enctype:'multipart/form-data'});if(s.timeout)timeoutHandle=setTimeout(function(){timedOut=true;cb(CLIENT_TIMEOUT_ABORT)},s.timeout) function checkState(){try{var state=getDoc(io).readyState;log('state = '+state);if(state&&state.toLowerCase()=='uninitialized')setTimeout(checkState,50)}catch(e){log('Server abort: ',e,' (',e.name,')');cb(SERVER_ABORT);if(timeoutHandle)clearTimeout(timeoutHandle);timeoutHandle=undefined}};var extraInputs=[];try{if(s.extraData)for(var n in s.extraData)if(s.extraData.hasOwnProperty(n))if($.isPlainObject(s.extraData[n])&&s.extraData[n].hasOwnProperty('name')&&s.extraData[n].hasOwnProperty('value')){extraInputs.push($('').val(s.extraData[n].value).appendTo(form)[0])}else extraInputs.push($('').val(s.extraData[n]).appendTo(form)[0]);if(!s.iframeTarget)$io.appendTo('body');if(io.attachEvent){io.attachEvent('onload',cb)}else io.addEventListener('load',cb,false);setTimeout(checkState,15);try{form.submit()}catch(err){var submitFn=document.createElement('form').submit;submitFn.apply(form)}}finally{form.setAttribute('action',a);form.setAttribute('enctype',et);if(t){form.setAttribute('target',t)}else $form.removeAttr('target');$(extraInputs).remove()}};if(s.forceSync){doSubmit()}else setTimeout(doSubmit,10);var data,doc,domCheckCount=50,callbackProcessed function cb(e){if(xhr.aborted||callbackProcessed)return;doc=getDoc(io);if(!doc){log('cannot access response document');e=SERVER_ABORT};if(e===CLIENT_TIMEOUT_ABORT&&xhr){xhr.abort('timeout');deferred.reject(xhr,'timeout');return}else if(e==SERVER_ABORT&&xhr){xhr.abort('server abort');deferred.reject(xhr,'error','server abort');return};if(!doc||doc.location.href==s.iframeSrc)if(!timedOut)return;if(io.detachEvent){io.detachEvent('onload',cb)}else io.removeEventListener('load',cb,false);var status='success',errMsg;try{if(timedOut)throw'timeout';var isXml=s.dataType=='xml'||doc.XMLDocument||$.isXMLDoc(doc);log('isXml='+isXml);if(!isXml&&window.opera&&(doc.body===null||!doc.body.innerHTML))if(--domCheckCount){log('requeing onLoad callback, DOM not available');setTimeout(cb,250);return};var docRoot=doc.body?doc.body:doc.documentElement;xhr.responseText=docRoot?docRoot.innerHTML:null;xhr.responseXML=doc.XMLDocument?doc.XMLDocument:doc;if(isXml)s.dataType='xml';xhr.getResponseHeader=function(header){var headers={'content-type':s.dataType};return headers[header.toLowerCase()]};if(docRoot){xhr.status=Number(docRoot.getAttribute('status'))||xhr.status;xhr.statusText=docRoot.getAttribute('statusText')||xhr.statusText};var dt=(s.dataType||'').toLowerCase(),scr=/(json|script|text)/.test(dt);if(scr||s.textarea){var ta=doc.getElementsByTagName('textarea')[0];if(ta){xhr.responseText=ta.value;xhr.status=Number(ta.getAttribute('status'))||xhr.status;xhr.statusText=ta.getAttribute('statusText')||xhr.statusText}else if(scr){var pre=doc.getElementsByTagName('pre')[0],b=doc.getElementsByTagName('body')[0];if(pre){xhr.responseText=pre.textContent?pre.textContent:pre.innerText}else if(b)xhr.responseText=b.textContent?b.textContent:b.innerText}}else if(dt=='xml'&&!xhr.responseXML&&xhr.responseText)xhr.responseXML=toXml(xhr.responseText);try{data=httpData(xhr,dt,s)}catch(err){status='parsererror';xhr.error=errMsg=(err||status)}}catch(err){log('error caught: ',err);status='error';xhr.error=errMsg=(err||status)};if(xhr.aborted){log('upload aborted');status=null};if(xhr.status)status=(xhr.status>=200&&xhr.status<300||xhr.status===304)?'success':'error';if(status==='success'){if(s.success)s.success.call(s.context,data,'success',xhr);deferred.resolve(xhr.responseText,'success',xhr);if(g)$.event.trigger("ajaxSuccess",[xhr,s])}else if(status){if(errMsg===undefined)errMsg=xhr.statusText;if(s.error)s.error.call(s.context,xhr,status,errMsg);deferred.reject(xhr,'error',errMsg);if(g)$.event.trigger("ajaxError",[xhr,s,errMsg])};if(g)$.event.trigger("ajaxComplete",[xhr,s]);if(g&&!--$.active)$.event.trigger("ajaxStop");if(s.complete)s.complete.call(s.context,xhr,status);callbackProcessed=true;if(s.timeout)clearTimeout(timeoutHandle);setTimeout(function(){if(!s.iframeTarget){$io.remove()}else $io.attr('src',s.iframeSrc);xhr.responseXML=null},100)};var toXml=$.parseXML||function(s,doc){if(window.ActiveXObject){doc=new ActiveXObject('Microsoft.XMLDOM');doc.async='false';doc.loadXML(s)}else doc=(new DOMParser()).parseFromString(s,'text/xml');return(doc&&doc.documentElement&&doc.documentElement.nodeName!='parsererror')?doc:null},parseJSON=$.parseJSON||function(s){return window['eval']('('+s+')')},httpData=function(xhr,type,s){var ct=xhr.getResponseHeader('content-type')||'',xml=type==='xml'||!type&&ct.indexOf('xml')>=0,data=xml?xhr.responseXML:xhr.responseText;if(xml&&data.documentElement.nodeName==='parsererror')if($.error)$.error('parsererror');if(s&&s.dataFilter)data=s.dataFilter(data,type);if(typeof data==='string')if(type==='json'||!type&&ct.indexOf('json')>=0){data=parseJSON(data)}else if(type==="script"||!type&&ct.indexOf("javascript")>=0)$.globalEval(data);return data};return deferred}};$.fn.ajaxForm=function(options){options=options||{};options.delegation=options.delegation&&$.isFunction($.fn.on);if(!options.delegation&&this.length===0){var o={s:this.selector,c:this.context};if(!$.isReady&&o.s){log('DOM not ready, queuing ajaxForm');$(function(){$(o.s,o.c).ajaxForm(options)});return this};log('terminating; zero elements found by selector'+($.isReady?'':' (DOM not ready)'));return this};if(options.delegation){$(document).off('submit.form-plugin',this.selector,doAjaxSubmit).off('click.form-plugin',this.selector,captureSubmittingElement).on('submit.form-plugin',this.selector,options,doAjaxSubmit).on('click.form-plugin',this.selector,options,captureSubmittingElement);return this};return this.ajaxFormUnbind().bind('submit.form-plugin',options,doAjaxSubmit).bind('click.form-plugin',options,captureSubmittingElement)} function doAjaxSubmit(e){var options=e.data;if(!e.isDefaultPrevented()){e.preventDefault();$(e.target).ajaxSubmit(options)}} function captureSubmittingElement(e){var target=e.target,$el=$(target);if(!($el.is("[type=submit],[type=image]"))){var t=$el.closest('[type=submit]');if(t.length===0)return;target=t[0]};var form=this;form.clk=target;if(target.type=='image')if(e.offsetX!==undefined){form.clk_x=e.offsetX;form.clk_y=e.offsetY}else if(typeof $.fn.offset=='function'){var offset=$el.offset();form.clk_x=e.pageX-offset.left;form.clk_y=e.pageY-offset.top}else{form.clk_x=e.pageX-target.offsetLeft;form.clk_y=e.pageY-target.offsetTop};setTimeout(function(){form.clk=form.clk_x=form.clk_y=null},100)};$.fn.ajaxFormUnbind=function(){return this.unbind('submit.form-plugin click.form-plugin')};$.fn.formToArray=function(semantic,elements){var a=[];if(this.length===0)return a;var form=this[0],formId=this.attr('id'),els=semantic?form.getElementsByTagName('*'):form.elements,els2;if(els&&!/MSIE [678]/.test(navigator.userAgent))els=$(els).get();if(formId){els2=$(':input[form="'+formId+'"]').get();if(els2.length)els=(els||[]).concat(els2)};if(!els||!els.length)return a;var i,j,n,v,el,max,jmax;for(i=0,max=els.length;i