function initDropDownMenus(){function mouseenter(){$(this).addClass("hovered")}function mouseleave(){$(this).removeClass("hovered")}var $submenus=$(".footer-menu .nav-1 > li.hasChildren"),config;$submenus.length!=0&&(config={sensitivity:2,interval:100,over:mouseenter,timeout:200,out:mouseleave},$submenus.hoverIntent(config))}function initSideMenu(){var wrapper=$(".side-menu"),triggers,lis;wrapper.length<1||($("li.hasChildren.selected").addClass("expanded").find("> a .js-side-menu-trigger",wrapper).text("-"),triggers=$(".js-side-menu-trigger",wrapper),lis=$(".nav-2 li.hasChildren",wrapper),triggers.click(function(e){e.preventDefault();e.stopPropagation();var $this=$(this),li=$this.closest(".hasChildren");li.hasClass("expanded")?(li.removeClass("expanded"),$this.text("+")):(lis.removeClass("expanded"),triggers.text("+"),li.addClass("expanded"),$this.text("-"))}))}function applyResizeHandler(){$(window).bind("debouncedResize");$(window).resize(function(){initBackToTop();$(window).trigger("debouncedResize")});$(window).on("debouncedResize",$.debounce(300,function(){})).resize()}function applyScrollHandler(){$(window).bind("debouncedScroll");$(window).scroll(function(){initBackToTop();$(window).trigger("debouncedScroll")});$(window).on("debouncedScroll",$.debounce(300,function(){})).scroll()}function initBackToTop(){var backToTop=$(".back-to-top");backToTop.length<1||($(window).scrollTop()>750?backToTop.fadeIn(200):backToTop.fadeOut(200),$(window).scrollTop()+$(window).height()>=$("body").height()-$(".footer-template-one").height()?backToTop.addClass("absolute"):backToTop.removeClass("absolute"),backToTop.css({right:($(window).width()-$(".center-container").width())/2-70}))}function initNewsList(){var triggers=$(".js-news-trigger"),newsboxes;triggers.length<1||(newsboxes=$(".news-box"),triggers.click(function(){var $this=$(this),newsBox=$this.closest(".news-box");newsBox.hasClass("js-open")?newsBox.get(0).close():newsBox.get(0).open()}),$.each(newsboxes,function(i,newsbox){newsbox.open=function(){var $newsbox=$(newsbox);$.each(newsboxes,function(ii,item){item.close();$newsbox.addClass("js-open");$(".description",$newsbox).css({height:"auto"});$(".body-container",$newsbox).show();$(".js-news-trigger",$newsbox).text("-")})};newsbox.close=function(){var $newsbox=$(newsbox);$newsbox.hasClass("js-open")&&($newsbox.removeClass("js-open"),$(".description",$newsbox).css({height:"40px"}),$(".body-container",$newsbox).hide(),$(".js-news-trigger",$newsbox).text("+"))}}),newsboxes.get(0).open())}function initRecipeList(){var list=$(".recipe-list");list.length<1||list.owlCarousel({items:3,itemsDesktop:[1199,3],itemsDesktopSmall:[979,3],itemsTablet:[768,3],itemsMobile:[768,3],pagination:!0,navigation:!0,responsiveRefreshRate:100})}function initSearchList(){var list=$(".search-article-list");list.length<1||list.owlCarousel({items:4,itemsDesktop:[1199,4],itemsDesktopSmall:[979,4],itemsTablet:[768,4],itemsMobile:[768,4],pagination:!0,navigation:!0,responsiveRefreshRate:100})}function UpdateQueryString(key,value,url){var re,separator,hash;return url||(url=window.location.href),re=new RegExp("([?|&])"+key+"=.*?(&|#|$)","gi"),url.match(re)?value?url.replace(re,"$1"+key+"="+value+"$2"):url.replace(re,"$2"):value?(separator=url.indexOf("?")!==-1?"&":"?",hash=url.split("#"),url=hash[0]+separator+key+"="+value,hash[1]&&(url+="#"+hash[1]),url):url}function getQueryStringValueByName(name){name=name.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");var regexS="[\\?&]"+name+"=([^&#]*)",regex=new RegExp(regexS),results=regex.exec(window.location.search);return results==null?"":decodeURIComponent(results[1].replace(/\+/g," "))}function removeValueFromCommaSeparatedString(list,value,separator){var values,i;for(separator=separator||",",values=list.split(separator),i=0;i57)&&event.preventDefault():(event.keyCode<96||event.keyCode>105)&&event.preventDefault())}function preventSpecialCharacter(e){var shiftPressed=e.shiftKey,keyCode=e.keyCode;shiftPressed?(keyCode==188||keyCode==190||keyCode==51||keyCode==55||keyCode==53||keyCode==219||keyCode==221)&&e.preventDefault():(keyCode==191||keyCode==219||keyCode==221||keyCode==111)&&e.preventDefault()}function phoneGROnly(event){numbersOnly(event);$(event.currentTarget).val().length>9&&(event.keyCode==46||event.keyCode==8||event.keyCode==36||event.keyCode==35||event.keyCode==37||event.keyCode==39||event.keyCode==9||event.preventDefault())}function initNewsListFancy(){$(".fancybox-gallery").length>0&&$(".fancybox-button").fancybox({prevEffect:"none",nextEffect:"none",closeBtn:!0,arrows:!1,padding:0,helpers:{title:{type:"inside"},buttons:{}},tpl:{wrap:'
<\/div><\/div><\/div><\/div>'}})}function handleEspaBanner(){function setCookie(cname,cvalue){var d=new Date,expires;d.setTime(d.getTime()+864e5);expires="expires="+d.toUTCString();document.cookie=cname+"="+cvalue+";"+expires+";"}function getCookie(cname){for(var name=cname+"=",decodedCookie=decodeURIComponent(document.cookie),ca=decodedCookie.split(";"),c,i=0;i0?typ.split(","):[];$ub.serviceUrl=$ub.data("serviceurl");$ub.initCallback=function(){};$ub.successCallback=function(){};$ub.failureCallback=function(){};$ub.cancelCallback=function(){};$ub.progressCallback=function(){};$ub.input=$("*[data-input]",$($ub));$ub.remove=$("*[data-remove-button]",$($ub));$ub.isFileSelected=function(){return $ub.input.val().length<1?!1:!0};$ub.isValid=function(){var input,type,found,i;if(!this.isFileSelected())return!0;if(input=$("*[data-input]",$($ub)),type=input.val().substr((~-input.val().lastIndexOf(".")>>>0)+2).toLowerCase(),this.supportedTypes.length>0){for(found=!1,i=0;i>>0)+2).toLowerCase(),this.supportedTypes.length>0){for(found=!1,i=0;i-1&&(mask+="abcdefghijklmnopqrstuvwxyz"),chars.indexOf("A")>-1&&(mask+="ABCDEFGHIJKLMNOPQRSTUVWXYZ"),chars.indexOf("#")>-1&&(mask+="0123456789"),chars.indexOf("!")>-1&&(mask+="~`!@#$%^&*()_+-={}[]:\";'<>?,./|\\"),result="",i=length;i>0;--i)result+=mask[Math.round(Math.random()*(mask.length-1))];return result}function initNormalSliders(){$(".x-control.x-slider").each(function(i,wrapper){var $lazyLoadOptions,defOptions,$options,opts,$list,lazyLoadInit,$listChild;if($(wrapper).data("init")&&($lazyLoadOptions=$('*[data-input="lazy-load-options"]',$(wrapper)),$lazyLoadOptions.length>0&&$lazyLoadOptions.remove(),defOptions={slides:"> *",fx:"scrollHorz",log:!1,prev:$(".prev",$(wrapper)),next:$(".next",$(wrapper)),pager:$(".pager",$(wrapper)),pagerTemplate:"<\/span>",pauseOnHover:!0},$options=$('*[data-input="options"]',$(wrapper)),$options.length!=0)){if(opts={},$.extend(!0,opts,defOptions,JSON.parse($options.val())),$list=$(".x-list",$(wrapper)),lazyLoadInit=$list.data("lazy-load-init"),$list.data("grouping")){if($list.children().length>1&&($list.cycle(opts),lazyLoadInit))$list.on("cycle-after",function(){EventManager.trigger("lazyload")})}else if($listChild=$list.find("> *"),$listChild.children().length>1&&($listChild.cycle(opts),lazyLoadInit))$listChild.on("cycle-after",function(){EventManager.trigger("lazyload")});$options.remove()}})}function initHomeBottomSlider(){$(".home-bottom-slider").each(function(i,wrapper){var $wrapper=$(wrapper);$('*[data-input="options"]',$wrapper).remove();$wrapper.owlCarousel({items:5,itemsDesktop:[1100,4],pagination:!0,navigation:!0,responsiveRefreshRate:100})})}var uploadBoxes;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){return(t/=d/2)<1?c/2*t*t+b:-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){return(t/=d/2)<1?c/2*t*t*t+b: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){return(t/=d/2)<1?c/2*t*t*t*t+b:-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){return(t/=d/2)<1?c/2*t*t*t*t*t+b: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){return t==0?b:t==d?b+c:(t/=d/2)<1?c/2*Math.pow(2,10*(t-1))+b: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){return(t/=d/2)<1?-c/2*(Math.sqrt(1-t*t)-1)+b: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;return t==0?b:(t/=d)==1?b+c:(p||(p=d*.3),a>>0,len===0)||(n=0,arguments.length>0&&(n=Number(arguments[1]),n!==n?n=0:n!==0&&n!==1/0&&n!==-(1/0)&&(n=(n>0||-1)*Math.floor(Math.abs(n)))),n>=len))return-1;for(k=n>=0?n:Math.max(len-Math.abs(n),0);k'+option+"<\/a><\/li>").data({key:key,selected:$(item).is(":selected")}))}function newUlPos(){var containerPosY=$containerDiv.offset().top,docHeight=$(window).height(),scrollTop=$(window).scrollTop();newUlHeight>parseInt(opts.ddMaxHeight)&&(newUlHeight=parseInt(opts.ddMaxHeight));containerPosY=containerPosY-scrollTop;containerPosY+newUlHeight>=docHeight?($newUl.css({height:newUlHeight}),$containerDivWrapper.css({top:"-"+newUlHeight+"px",height:newUlHeight}),$input.onTop=!0):($newUl.css({height:newUlHeight}),$containerDivWrapper.css({top:containerHeight+"px",height:newUlHeight}),$input.onTop=!1)}function positionFix(){$containerDiv.css("position","relative")}function positionHideFix(){$containerDiv.css({position:"static"})}function closeDropDown(fireChange,resetText){fireChange==!0&&(prevIndex=currentIndex,$input.change());resetText==!0&&(currentIndex=prevIndex,navigateList(currentIndex));$containerDivWrapper.hide();positionHideFix()}function navigateList(currentIndex,fireChange){if(currentIndex==-1)$containerDivText.text(opts.defaultText),$newLi.removeClass("hiLite");else{$newLi.removeClass("hiLite").eq(currentIndex).addClass("hiLite");var text=$newLi.eq(currentIndex).text(),val=$newLi.eq(currentIndex).parent().data("key");try{$input.val(val)}catch(ex){$input[0].selectedIndex=currentIndex}if($containerDivText.text(text),fireChange==!0&&(prevIndex=currentIndex,$input.change()),$containerDivWrapper.is(":visible"))try{$newLi.eq(currentIndex).focus()}catch(ex){}}}function keyPress(element){$(element).unbind("keydown.sSelect").bind("keydown.sSelect",function(e){var keycode=e.which,currentKeyIndex;prevented=!0;switch(keycode){case 40:case 39:return incrementList(),!1;case 38:case 37:return decrementList(),!1;case 33:case 36:return gotoFirst(),!1;case 34:case 35:return gotoLast(),!1;case 13:case 27:return closeDropDown(!0),!1;case 9:return closeDropDown(!0),nextFormElement(),!1}return keyPressed=String.fromCharCode(keycode).toLowerCase(),currentKeyIndex=keys.indexOf(keyPressed),typeof currentKeyIndex!="undefined"?(++currentIndex,currentIndex=keys.indexOf(keyPressed,currentIndex),(currentIndex==-1||currentIndex==null||prevKey!=keyPressed)&&(currentIndex=keys.indexOf(keyPressed)),navigateList(currentIndex),prevKey=keyPressed,!1):void 0})}function incrementList(){currentIndex0&&(--currentIndex,navigateList(currentIndex))}function gotoFirst(){currentIndex=0;navigateList(currentIndex)}function gotoLast(){currentIndex=newLiLength-1;navigateList(currentIndex)}function nextFormElement(){var fields=$("body").find("button,input,textarea,select"),index=fields.index($input);return index>-1&&index+1<\/div>'),$containerDiv=$('
<\/div>'),$containerDivWrapper=$('