(function(a){a.fn.supposition=function(){var f=a(window),d=function(g){return window[g=="y"?"pageYOffset":"pageXOffset"]||document.documentElement&&document.documentElement[g=="y"?"scrollTop":"scrollLeft"]||document.body[g=="y"?"scrollTop":"scrollLeft"]},e=function(){$topNav=a("li",this);var g=parseInt($topNav.css("z-index"))+$topNav.length;$topNav.each(function(){a(this).css({zIndex:--g})})},c=function(){this.css({marginTop:"",marginLeft:""})},b=function(){this.each(function(){var l=a(this);l.css("display","block");var m=l.width(),p=l.parents("ul").width(),i=f.width()+d("x"),k=l.offset().left+m;if(k>i){l.css("margin-left",(l.parents("ul").length===1?i-k:-(m+p))+"px")}var g=f.height(),h=l.offset().top,j=l.height(),o=g+d("y");var n=(h+j>o);if(n){l.css("margin-top",o-(j+h))}l.css("display","none")})};return this.each(function(){var j=a(this),k=j.data("sf-options");var g=k.onInit,h=k.onBeforeShow,i=k.onHide;a.extend(j.data("sf-options"),{onInit:function(){e.call(this);g.call(this)},onBeforeShow:function(){b.call(this);h.call(this)},onHide:function(){c.call(this);i.call(this)}})})}})(jQuery);(function(a){a(document).ready(function(){a("html").addClass("js");var d=a("#ut-top-header").outerHeight();function n(){if(!a("#ut-top-header-placeholder").length){a("
",{id:"ut-top-header-placeholder",}).css({width:"100%",height:d+"px",position:"fixed",top:"0px","z-index":10}).insertBefore(a("#header-section"))}}function j(){a("#ut-top-header-placeholder").remove()}function l(){return window.pageYOffset||document.documentElement.scrollTop}function q(){var r=l();if(a("body").hasClass("ut-has-top-header")){if(r>=1){a("#header-section").removeClass("bordered-top");n()}else{a("#header-section").not(".ha-header-hide").addClass("bordered-top");j()}}}a(window).scroll(function(){q()});q();var i=a("img.utlazy");i.lazyload({effect:"fadeIn",effectspeed:"200",event:"scroll",load:function(){a.waypoints("refresh")},failure_limit:Math.max(i.length-1,0)});a("#navigation ul.menu").find(".current-menu-ancestor").each(function(){a(this).find("a").first().addClass("active")}).end().find(".current_page_parent").each(function(){a(this).find("a").first().addClass("active")}).end().superfish({autoArrows:true}).supposition();a("#ut-mobile-menu").find(".current-menu-ancestor").each(function(){a(this).find("a").first().addClass("active")}).end().find(".current_page_parent").each(function(){a(this).find("a").first().addClass("active")});a("#ut-mobile-menu .sub-menu li:last-child").addClass("last");a("#ut-mobile-menu li:last-child").addClass("last");function c(){var r=a(window).width(),s=a(window).outerHeight();a("#ut-mobile-nav").width(r).height(s);a(".ut-scroll-pane").width(r+17).height(s)}function p(){if((a(window).width()>979)){a("#ut-mobile-nav").hide()}}a(".ut-mm-trigger").click(function(r){a(this).toggleClass("active").next().slideToggle(500);a("body").toggleClass("ut-mobile-menu-open");c();r.preventDefault()});var h;a(window).utresize(function(){clearTimeout(h);h=setTimeout(p,100);c()});a(".ut-scroll-pane").on("touchstart",function(){});a(".ut-tablet-nav li a").click(function(s){var r=a(this).parent().index();a(".ut-tablet-nav li").removeClass("selected");a(this).parent().addClass("selected");a(".ut-tablet").children().hide().removeClass("show");a(".ut-tablet").children().eq(r).fadeIn("fast").addClass("show");s.preventDefault()});var g=a("#header-section").outerHeight();if(a("#header-section").hasClass("ut-header-has-border")){g--}var f=a("body").data("scrolleffect"),o=a("body").data("scrollspeed");a('.logo a[href*="#"]').click(function(r){r.preventDefault();a.scrollTo(a(this).attr("href"),o,{easing:f,offset:-g,axis:"y"})});a(".toTop").click(function(r){r.preventDefault();a.scrollTo(a(this).attr("href"),o,{easing:f,offset:-g,axis:"y"})});a('.hero-second-btn[href^="#"], .hero-btn[href^="#"], .hero-down-arrow a[href^="#"]').click(function(r){r.preventDefault();var s=a(this).attr("href");if(s==="#ut-to-first-section"){a.scrollTo(a(".wrap"),o,{easing:f,offset:-g,axis:"y"})}else{a.scrollTo(s,o,{easing:f,offset:0,axis:"y"})}});a('.hero-slider-button[href^="#"]').click(function(r){r.preventDefault();var s=a(this).attr("href");if(s==="#ut-to-first-section"){a.scrollTo(a(".wrap"),o,{easing:f,offset:-g,axis:"y"})}else{a.scrollTo(a(this).attr("href"),o,{easing:f,offset:0,axis:"y"})}});a('.ut-fancy-image-wrap a[href^="#"]').click(function(r){r.preventDefault();var s=a(this).attr("href");if(s==="#ut-to-first-section"){a.scrollTo(a(".wrap"),o,{easing:f,offset:-g,axis:"y"})}else{a.scrollTo(a(this).attr("href"),o,{easing:f,offset:0,axis:"y"})}});a(window).load(function(){if(window.location.hash){setTimeout(function(){a.scrollTo(window.location.hash,o,{easing:f,offset:0,axis:"y"})},400)}});a("#navigation a").click(function(r){if(this.hash&&!a(this).hasClass("external")){a.scrollTo(this.hash,o,{easing:f,offset:0,axis:"y"});r.preventDefault()}else{if(this.hash&&a(this).parent().hasClass("contact-us")){a.scrollTo(this.hash,o,{easing:f,offset:0,axis:"y"});r.preventDefault()}}});var k=k();function k(){var r=new RegExp("IEMobile","i");return navigator.userAgent.match(r)}a("#ut-mobile-menu a").click(function(s){if(this.hash&&!a(this).hasClass("external")){if(!k){a.scrollTo(this.hash,o,{easing:f,offset:0,axis:"y"})}else{var r=this.hash;a("html, body").animate({scrollTop:a(r).offset().top},o)}s.preventDefault()}a("#ut-mobile-nav").slideToggle(500)});a(".ut-offset-anchor").each(function(){a(this).waypoint(function(s){if(s==="down"&&a(this).attr("id")!=="to-main-content"){var r=a(this).attr("id");if(a(this).data("parent")){r=a(this).data("parent")}a("#navigation a").removeClass("selected");a('#navigation a[href*="#'+r+'"]').addClass("selected")}if(s==="up"&&a(this).attr("id")==="to-main-content"){a("#navigation a").removeClass("selected");a(".ut-home-link a").addClass("selected")}},{offset:g+1+"px"})});a(".ut-scroll-up-waypoint").each(function(){a(this).waypoint(function(s){if(s==="up"){var r=a(this).data("section");if(a(this).data("parent")){r=a(this).data("parent")}a("#navigation a").removeClass("selected");a('#navigation a[href*="#'+r+'"]').addClass("selected")}},{offset:g+10+"px"})});a("iframe").each(function(){var s=a(this).attr("src");if(s!=undefined){var t=s.search("youtube"),r=s.split("?");if(t>0&&r[1]){a(this).attr("src",s+"&wmode=transparent")}if(t>0&&!r[1]){a(this).attr("src",s+"?wmode=transparent")}}});var m=null;a(".ut-show-member-details").click(function(r){r.preventDefault();a(".ut-overlay").addClass("ut-overlay-show");a("#member_"+a(this).data("member")).addClass("ut-box-show").animate({top:"15%",opacity:1},1000,"easeInOutExpo",function(){var s=a(this).offset().top,t=a(this).data("id");a(this).clone().attr("id",t).css({position:"absolute",top:s,"padding-top":0}).appendTo("body").addClass("member-clone");a(this).removeClass("ut-box-show").css({top:"30%",opacity:"0"})})});a(document).on("click",".ut-hide-member-details, body",function(r){if(!a(r.target).is(".member-social, .member-social *, .ut-btn, .member-box a")){if(a(".ut-modal-box.member-clone").length){r.preventDefault()}a(".ut-modal-box.member-clone").animate({top:"0%",opacity:0},600,"easeInOutExpo",function(){a(this).remove();a(".ut-overlay").removeClass("ut-overlay-show")})}});a(document).on("click",".ut-overlay",function(r){r.preventDefault();a(".ut-modal-box.member-clone").animate({top:"0%",opacity:0},600,"easeInOutExpo",function(){a(this).remove();a(".ut-overlay").removeClass("ut-overlay-show")})});if(!a("html").hasClass("no-touchevents")){var b;a(document).on("touchend",".member-photo",function(){var r=a(this);if(b!==true){if(r.hasClass("ut-touch-event")){r.toggleClass("cs-hover")}}}).on("touchmove",function(){b=true}).on("touchstart",function(){b=false})}a(".ut-video, .entry-content").fitVids();a(window).load(function(){a(".ut-split-screen-poster").each(function(){var s=a(this).data("posterparent"),r=a("#"+s).height();a(this).height(r)})});a('.ut-btn[href^="#"], .cta-btn a[href^="#"]').click(function(r){a.scrollTo(a(this).attr("href"),o,{easing:f,offset:-g,axis:"y"});r.preventDefault()});if(a().lightGallery){a(".entry-content").lightGallery({selector:".ut-vc-images-lightbox",hash:false});a(document).ajaxComplete(function(){a(".vc_media_grid").lightGallery({selector:".ut-vc-ajax-images-lightbox",exThumbImage:"data-exthumbimage",hash:false})})}a(".nivoSlider").hover(function(){var r=a(this);r.find(".nivo-directionNav .nivo-prevNav").html("");r.find(".nivo-directionNav .nivo-nextNav").html("")});if(window.devicePixelRatio>1||/chrom(e|ium)/.test(navigator.userAgent.toLowerCase())){a.fn.redraw=function(){return this.stop(true,true).hide(0,function(){a(this).show()})};a("#main-content section").each(function(){if(a(this).css("background-attachment")==="fixed"){a(this).addClass("ut-has-fixed-background")}});var e=a(document);e.scroll(function(){e.find(".ut-has-fixed-background").redraw()})}})})(jQuery); !function(a,b){"use strict";function c(){if(!e){e=!0;var a,c,d,f,g=-1!==navigator.appVersion.indexOf("MSIE 10"),h=!!navigator.userAgent.match(/Trident.*rv:11\./),i=b.querySelectorAll("iframe.wp-embedded-content");for(c=0;c1e3)g=1e3;else if(~~g<200)g=200;f.height=g}if("link"===d.message)if(h=b.createElement("a"),i=b.createElement("a"),h.href=f.getAttribute("src"),i.href=d.value,i.host===h.host)if(b.activeElement===f)a.top.location.href=d.value}else;}},d)a.addEventListener("message",a.wp.receiveEmbedMessage,!1),b.addEventListener("DOMContentLoaded",c,!1),a.addEventListener("load",c,!1)}(window,document); function SGExitIntnetPopup(){ this.exitIntntType; this.expireTime; this.sgPopupObj=new SGPopup(); this.alertText; } SGExitIntnetPopup.prototype.setType=function(type){ this.exitIntntType=type; } SGExitIntnetPopup.prototype.getType=function(){ return this.exitIntntType; } SGExitIntnetPopup.prototype.setExpireTime=function(time){ this.expireTime=time; } SGExitIntnetPopup.prototype.getExpireTime=function(){ return this.expireTime; } SGExitIntnetPopup.prototype.setAlertText=function(text){ this.alertText=text; } SGExitIntnetPopup.prototype.getAlertText=function(){ return this.alertText; } SGExitIntnetPopup.prototype.buildExitIntent=function(id){ var type=this.getType(); var that=this; if(type=="soft"){ this.softMode(id); } else if(type=="aggressive"){ this.aggressiveMode(id); } else if(type=="softAndAgressive"){ this.softAndAgressiveMode(id); } else if(type=="agresiveWithoutPopup"){ this.aggressiveMode(id); }} SGExitIntnetPopup.prototype.softMode=function(id){ var that=this; document.addEventListener("mouseout", function(event){ if(event.toElement==null&&event.relatedTarget==null){ var result=that.canOpen(id, 'soft'); if(result){ return; } if(jQuery("#sgcolorbox").css("display")!=="block"){ that.sgPopupObj.showPopup(id, false); }} }); } SGExitIntnetPopup.prototype.aggressiveMode=function(id){ var that=this; sgAddEvent(window, "beforeunload", function (e){ var result=that.canOpen(id, 'aggressive'); if(result){ return; } (e||window.event).returnValue=that.triggerOpenPopup(id); e.returnValue=that.triggerOpenPopup(id); }); } SGExitIntnetPopup.prototype.softAndAgressiveMode=function(id){ this.softMode(id); this.aggressiveMode(id); } SGExitIntnetPopup.prototype.triggerOpenPopup=function(id){ if(this.getType()!=='agresiveWithoutPopup'){ this.sgPopupObj.showPopup(id, false); } return this.getAlertText(); } SGExitIntnetPopup.prototype.canOpen=function(id, type){ if(!jQuery.cookie('SGExitIntnetPopup'+id+type)){ this.setCookies(id, type); return false; } return true; } SGExitIntnetPopup.prototype.setCookies=function(id, type){ var that=this; var date=new Date(); var minutes=this.getExpireTime(); date.setTime(date.getTime() + (minutes * 60 * 1000)); jQuery(document).ready(function(){ jQuery('#sgcolorbox').on('sgPopupClose', function(e){ if(that.getExpireTime()!=='always'){ jQuery.cookie('SGExitIntnetPopup'+id+type,id, { expires: date}); if(that.getExpireTime()=='perSesion'){ jQuery.cookie('SGExitIntnetPopup'+id,id); }} }); }); }; SGExitIntnetPopup.prototype.init=function(id){ var data=SG_POPUP_DATA[id]; var exitIntentOptions=JSON.parse(data['exitIntentOptions']); var exitIntentType=exitIntentOptions['exit-intent-type']; var expireTime=exitIntentOptions['exit-intent-expire-time']; var exitIntentAlert=exitIntentOptions['exit-intent-alert']; this.setExpireTime(expireTime); this.setType(exitIntentType); this.setAlertText(exitIntentAlert); this.buildExitIntent(id); }; function SGPopup(){ this.positionLeft=''; this.positionTop=''; this.positionBottom=''; this.positionRight=''; this.initialPositionTop=''; this.initialPositionLeft=''; this.isOnLoad=''; this.openOnce=''; this.numberLimit=''; this.popupData=new Array(); this.popupEscKey=true; this.popupOverlayClose=true; this.popupContentClick=false; this.popupCloseButton=true; this.sgTrapFocus=true; } SGPopup.prototype.popupOpenById=function(popupId){ sgOnScrolling=(SG_POPUP_DATA [popupId]['onScrolling']) ? SG_POPUP_DATA [popupId]['onScrolling']: ''; sgInActivity=(SG_POPUP_DATA [popupId]['inActivityStatus']) ? SG_POPUP_DATA [popupId]['inActivityStatus']: ''; ; beforeScrolingPrsent=(SG_POPUP_DATA [popupId]['onScrolling']) ? SG_POPUP_DATA [popupId]['beforeScrolingPrsent']: ''; autoClosePopup=(SG_POPUP_DATA [popupId]['autoClosePopup']) ? SG_POPUP_DATA [popupId]['autoClosePopup']: ''; popupClosingTimer=(SG_POPUP_DATA [popupId]['popupClosingTimer']) ? SG_POPUP_DATA [popupId]['popupClosingTimer']: ''; sgPoupFrontendObj=new SGPopup(); if(sgOnScrolling){ sgPoupFrontendObj.onScrolling(popupId); } else if(sgInActivity){ sgPoupFrontendObj.showPopupAfterInactivity(popupId); }else{ sgPoupFrontendObj.showPopup(popupId,true); }} SGPopup.getCookie=function(cname){ var name=cname + "="; var ca=document.cookie.split(';'); for(var i=0; i 1){ return; } var sgPopupID=jQuery(this).attr("data-sgpopupid"); that.showPopup(sgPopupID,false); }); }); jQuery("[class*='sg-popup-id-']").each(function(){ jQuery(this).bind("click", function(){ var className=jQuery(this).attr("class"); var sgPopupId=that.findPopupIdFromClassNames(className, "sg-popup-id-"); that.showPopup(sgPopupId,false); }) }); jQuery("[class*='sg-iframe-popup-']").each(function(){ var currentLink=jQuery(this); jQuery(this).bind("click", function(e){ e.preventDefault(); var className=jQuery(this).attr("class"); var sgPopupId=that.findPopupIdFromClassNames(className, "sg-iframe-popup-"); SG_POPUP_DATA[sgPopupId]['iframe']=currentLink.attr("href"); that.showPopup(sgPopupId,false); }) }); jQuery("[class*='sg-confirm-popup-']").each(function(){ jQuery(this).bind("click", function(e){ e.preventDefault(); var currentLink=jQuery(this); var className=jQuery(this).attr("class"); var sgPopupId=that.findPopupIdFromClassNames(className, "sg-confirm-popup-"); jQuery('#sgcolorbox').bind("sgPopupClose", function(){ var target=currentLink.attr("target"); if(typeof target=='undefined'){ target="self"; } var href=currentLink.attr("href"); if(target=="_blank"){ window.open(href); }else{ window.location.href=href; }}); that.showPopup(sgPopupId,false); }) }); } SGPopup.prototype.popupOpenByCookie=function(){ var popupId=SGPopup.getCookie("sgSubmitReloadingForm"); popupId=parseInt(popupId); if(typeof popupId=='number'){ this.showPopup(popupId,false); }} SGPopup.prototype.findPopupIdFromClassNames=function(className, classKey){ var classSplitArray=className.split(classKey); var classIdString=classSplitArray['1']; var popupId=classIdString.match(/^\d+/); return popupId; } SGPopup.prototype.sgCustomizeThemes=function(popupId){ var popupData=SG_POPUP_DATA[popupId]; var borderRadiues=popupData['sg3ThemeBorderRadiues']; if(popupData['theme']=="colorbox3.css"){ var borderColor=popupData['sgTheme3BorderColor']; var borderRadiues=popupData['sgTheme3BorderRadius']; jQuery("#sgcboxLoadedContent").css({'border-color': borderColor}) jQuery("#sgcboxLoadedContent").css({'border-radius': borderRadiues+"%"}) jQuery("#sgcboxContent").css({'border-radius': borderRadiues+"%"}) }} SGPopup.prototype.onCompleate=function(){ jQuery("#sgcolorbox").bind("sgColorboxOnCompleate", function(){ jQuery('#sgcboxLoadedContent').isolatedScroll(); }); this.isolatedScroll(); } SGPopup.prototype.isolatedScroll=function(){ jQuery.fn.isolatedScroll=function(){ this.bind('mousewheel DOMMouseScroll', function (e){ var delta=e.wheelDelta||(e.originalEvent&&e.originalEvent.wheelDelta)||-e.detail, bottomOverflow=this.scrollTop + jQuery(this).outerHeight() - this.scrollHeight >=0, topOverflow=this.scrollTop <=0; if((delta < 0&&bottomOverflow)||(delta > 0&&topOverflow)){ e.preventDefault(); }}); return this; };} SGPopup.prototype.sgPopupScalingDimensions=function(){ var popupWrapper=jQuery("#sgcboxWrapper").outerWidth(); var screenWidth=jQuery(window).width(); if(popupWrapper > screenWidth&&popupWrapper!=9999){ var scaleDegree=screenWidth/popupWrapper; jQuery("#sgcboxWrapper").css({ "transform-origin":"0 0", 'transform': "scale("+scaleDegree+", 1)" }) popupWrapper=0; }else{ jQuery("#sgcboxWrapper").css({ "transform-origin":"0 0", 'transform': "scale(1, 1)" }) }} SGPopup.prototype.sgPopupScaling=function(){ var that=this; jQuery("#sgcolorbox").bind("sgColorboxOnCompleate", function(){ that.sgPopupScalingDimensions(); }); jQuery(window).resize(function(){ setTimeout(function(){ that.sgPopupScalingDimensions(); }, 1000); }); } SGPopup.prototype.varToBool=function(optionName){ returnValue=(optionName) ? true:false; return returnValue; } SGPopup.prototype.canOpenPopup=function(id, openOnce, isOnLoad){ if(!isOnLoad){ return true; } if(typeof jQuery.cookie!='undefined'){ if(jQuery.cookie("subscription"+id)){ return false; }} if(openOnce&&typeof jQuery.cookie('sgPopupDetails'+id)!='undefined'){ return this.canOpenOnce(id); } return true; } SGPopup.prototype.setFixedPosition=function(sgPositionLeft, sgPositionTop, sgPositionBottom, sgPositionRight, sgFixedPositionTop, sgFixedPositionLeft){ this.positionLeft=sgPositionLeft; this.positionTop=sgPositionTop; this.positionBottom=sgPositionBottom; this.positionRight=sgPositionRight; this.initialPositionTop=sgFixedPositionTop; this.initialPositionLeft=sgFixedPositionLeft; } SGPopup.prototype.percentToPx=function(percentDimention, screenDimension){ var dimension=parseInt(percentDimention)*screenDimension/100; return dimension; } SGPopup.prototype.getPositionPercent=function(needPercent, screenDimension, dimension){ var sgPosition=(((this.percentToPx(needPercent,screenDimension)-dimension/2)/screenDimension)*100)+"%"; return sgPosition; } SGPopup.prototype.showPopup=function(id, isOnLoad){ var that=this; if(!id){ return; } this.popupData=SG_POPUP_DATA[id]; if(typeof this.popupData=="undefined"){ return; } this.isOnLoad=isOnLoad; this.openOnce=this.varToBool(this.popupData['repeatPopup']); this.numberLimit=this.popupData['popup-appear-number-limit']; if(typeof that.removeCookie!=='undefined'){ that.removeCookie(this.openOnce); } if(!this.canOpenPopup(this.popupData['id'], this.openOnce, isOnLoad)){ return; } popupColorboxUrl=SG_APP_POPUP_URL+'/style/sgcolorbox/'+this.popupData['theme']; jQuery('[id=sg_colorbox_theme-css]').remove(); head=document.getElementsByTagName('head')[0]; link=document.createElement('link') link.type="text/css"; link.id="sg_colorbox_theme-css"; link.rel="stylesheet" link.href=popupColorboxUrl; document.getElementsByTagName('head')[0].appendChild(link); var img=document.createElement('img'); sgAddEvent(img, "error", function(){ that.sgShowColorboxWithOptions(); }); setTimeout(function(){img.src=popupColorboxUrl;},0); } SGPopup.prototype.sgShowColorboxWithOptions=function(){ var that=this; setTimeout(function(){ sgPopupFixed=that.varToBool(that.popupData['popupFixed']); that.popupOverlayClose=that.varToBool(that.popupData['overlayClose']); that.popupContentClick=that.varToBool(that.popupData['contentClick']); var popupReposition=that.varToBool(that.popupData['reposition']); var popupScrolling=that.varToBool(that.popupData['scrolling']); var popupScaling=that.varToBool(that.popupData['scaling']); that.popupEscKey=that.varToBool(that.popupData['escKey']); that.popupCloseButton=that.varToBool(that.popupData['closeButton']); var countryStatus=that.varToBool(that.popupData['countryStatus']); var popupForMobile=that.varToBool(that.popupData['forMobile']); var onlyMobile=that.varToBool(that.popupData['openMobile']); var popupCantClose=that.varToBool(that.popupData['disablePopup']); var disablePopupOverlay=that.varToBool(that.popupData['disablePopupOverlay']); var popupAutoClosePopup=that.varToBool(that.popupData['autoClosePopup']); var saveCookiePageLevel=that.varToBool(that.popupData['save-cookie-page-level']); popupClosingTimer=that.popupData['popupClosingTimer']; if(popupScaling){ that.sgPopupScaling(); } if(popupCantClose){ that.cantPopupClose(); } var popupPosition=that.popupData['fixedPostion']; var popupHtml=(that.popupData['html']=='') ? ' ':that.popupData['html']; var popupImage=that.popupData['image']; var popupIframeUrl=that.popupData['iframe']; var popupShortCode=that.popupData['shortcode']; var popupVideo=that.popupData['video']; var popupOverlayColor=that.popupData['sgOverlayColor']; var contentBackgroundColor=that.popupData['sg-content-background-color']; var popupWidth=that.popupData['width']; var popupHeight=that.popupData['height']; var popupOpacity=that.popupData['opacity']; var popupMaxWidth=that.popupData['maxWidth']; var popupMaxHeight=that.popupData['maxHeight']; var popupInitialWidth=that.popupData['initialWidth']; var popupInitialHeight=that.popupData['initialHeight']; var popupEffectDuration=that.popupData['duration']; var popupEffect=that.popupData['effect']; var contentClickBehavior=that.popupData['content-click-behavior']; var clickRedirectToUrl=that.popupData['click-redirect-to-url']; var redirectToNewTab=that.popupData['redirect-to-new-tab']; var pushToBottom=that.popupData['pushToBottom']; var onceExpiresTime=parseInt(that.popupData['onceExpiresTime']); var sgType=that.popupData['type']; var overlayCustomClass=that.popupData['sgOverlayCustomClasss']; var contentCustomClass=that.popupData['sgContentCustomClasss']; var popupTheme=that.popupData['theme']; var themeStringLength=popupTheme.length; var customClassName=popupTheme.substring(0, themeStringLength-4); var closeButtonText=that.popupData['theme-close-text']; popupHtml=(popupHtml) ? popupHtml:false; var popupIframe=(popupIframeUrl) ? true: false; popupVideo=(popupVideo) ? popupVideo:false; popupImage=(popupImage) ? popupImage:false; var popupPhoto=(popupImage) ? true:false; popupShortCode=(popupShortCode) ? popupShortCode:false; if(popupShortCode&&popupHtml==false){ popupHtml=popupShortCode; } if(popupHtml!=' '){ popupHtml=popupHtml; } if(popupHtml&&popupWidth==''&&popupHeight==''&&popupMaxWidth==''&&popupMaxHeight==''){ jQuery(popupHtml).find('img:first').attr('onload', 'jQuery.sgcolorbox.resize();'); } if(popupIframeUrl){ popupImage=popupIframeUrl; } if(popupVideo){ if(popupWidth==''){ popupWidth='50%'; } if(popupHeight==''){ popupHeight='50%'; } popupIframe=true; popupImage=popupVideo; } var sgScreenWidth=jQuery(window).width(); var sgScreenHeight=jQuery(window).height(); var sgIsWidthInPercent=popupWidth.indexOf("%"); var sgIsHeightInPercent=popupHeight.indexOf("%"); var sgPopupHeightPx=popupHeight; var sgPopupWidthPx=popupWidth; if(sgIsWidthInPercent!=-1){ sgPopupWidthPx=that.percentToPx(popupWidth, sgScreenWidth); } if(sgIsHeightInPercent!=-1){ sgPopupHeightPx=that.percentToPx(popupHeight, sgScreenHeight); } sgPopupWidthPx=parseInt(sgPopupWidthPx); sgPopupHeightPx=parseInt(sgPopupHeightPx); popupPositionTop=that.getPositionPercent("50%", sgScreenHeight, sgPopupHeightPx); popupPositionLeft=that.getPositionPercent("50%", sgScreenWidth, sgPopupWidthPx); if(popupPosition==1){ that.setFixedPosition('0%','3%', false, false, 0, 0); } else if(popupPosition==2){ that.setFixedPosition(popupPositionLeft,'3%', false, false, 0, 50); } else if(popupPosition==3){ that.setFixedPosition(false,'3%', false, '0%', 0, 90); } else if(popupPosition==4){ that.setFixedPosition('0%', popupPositionTop, false, false, popupPositionTop, 0); } else if(popupPosition==5){ sgPopupFixed=true; that.setFixedPosition(false, false, false, false, 50, 50); } else if(popupPosition==6){ that.setFixedPosition('0%', popupPositionTop, false,'0%', 50, 90); } else if(popupPosition==7){ that.setFixedPosition('0%', false, '0%', false, 90, 0); } else if(popupPosition==8){ that.setFixedPosition(popupPositionLeft, false, '0%', false, 90, 50); } else if(popupPosition==9){ that.setFixedPosition(false, false, '0%', '0%', 90, 90); } if(!sgPopupFixed){ that.setFixedPosition(false, false, false, false, 50, 50); } var userDevice=false; if(popupForMobile){ userDevice=that.forMobile(); } if(popupAutoClosePopup){ setTimeout(that.autoClosePopup, popupClosingTimer*1000); } if(disablePopupOverlay){ that.sgTrapFocus=false; that.disablePopupOverlay(); } if(onlyMobile){ openOnlyMobile=false; openOnlyMobile=that.forMobile(); if(openOnlyMobile==false){ return; }} if(userDevice){ return; } SG_POPUP_SETTINGS={ width: popupWidth, height: popupHeight, className: customClassName, close: closeButtonText, overlayCutsomClassName: overlayCustomClass, contentCustomClassName: contentCustomClass, onOpen:function(){ jQuery('#sgcolorbox').removeAttr('style'); jQuery('#sgcolorbox').removeAttr('left'); jQuery('#sgcolorbox').css('top',''+that.initialPositionTop+'%'); jQuery('#sgcolorbox').css('left',''+that.initialPositionLeft+'%'); jQuery('#sgcolorbox').css('animation-duration', popupEffectDuration+"s"); jQuery('#sgcolorbox').css('-webkit-animation-duration', popupEffectDuration+"s"); jQuery("#sgcolorbox").addClass('sg-animated '+popupEffect+''); jQuery("#sgcboxOverlay").addClass("sgcboxOverlayBg"); jQuery("#sgcboxOverlay").removeAttr('style'); if(popupOverlayColor){ jQuery("#sgcboxOverlay").css({'background':'none', 'background-color':popupOverlayColor}); } jQuery('#sgcolorbox').trigger("sgColorboxOnOpen", []); that.sgCustomizeThemes(that.popupData['id']); }, onLoad: function(){ }, onComplete: function(){ if(contentBackgroundColor){ jQuery("#sgcboxLoadedContent").css({'background-color':contentBackgroundColor}) } jQuery("#sgcboxLoadedContent").addClass("sg-current-popup-"+that.popupData['id']) jQuery('#sgcolorbox').trigger("sgColorboxOnCompleate", [pushToBottom]); if(popupWidth==''&&popupHeight==''){ jQuery.sgcolorbox.resize(); } var sgpopupInit=new SgPopupInit(that.popupData); sgpopupInit.overallInit(); sgpopupInit.initByPopupType(); that.sgCustomizeThemes(that.popupData['id']); }, onCleanup: function(){ jQuery('#sgcolorbox').trigger("sgPopupCleanup", []); }, onClosed: function(){ jQuery("#sgcboxLoadedContent").removeClass("sg-current-popup-"+that.popupData['id']) jQuery('#sgcolorbox').trigger("sgPopupClose", []); }, trapFocus: that.sgTrapFocus, html: popupHtml, photo: popupPhoto, iframe: popupIframe, href: popupImage, opacity: popupOpacity, escKey: that.popupEscKey, closeButton: that.popupCloseButton, fixed: sgPopupFixed, top: that.positionTop, bottom: that.positionBottom, left: that.positionLeft, right: that.positionRight, scrolling: popupScrolling, reposition: popupReposition, overlayClose: that.popupOverlayClose, maxWidth: popupMaxWidth, maxHeight: popupMaxHeight, initialWidth: popupInitialWidth, initialHeight: popupInitialHeight }; jQuery.sgcolorbox(SG_POPUP_SETTINGS); if(countryStatus==true&&typeof SgUserData!="undefined"){ jQuery.cookie("SG_POPUP_USER_COUNTRY_NAME", SgUserData.countryIsoName, { expires: 365}); } if(that.popupData['id']&&that.isOnLoad==true&&that.openOnce!=''&&that.popupData['type']!="ageRestriction"){ sgCookieData=''; if(!saveCookiePageLevel){ jQuery.cookie.defaults={path:'/'};} var currentCookie=jQuery.cookie('sgPopupDetails'+that.popupData['id']); if(typeof currentCookie=='undefined'){ openCounter=1; }else{ var currentCookie=JSON.parse(jQuery.cookie('sgPopupDetails'+that.popupData['id'])); openCounter=currentCookie.openCounter+=1; } sgCookieData={ 'popupId': that.popupData['id'], 'openCounter': openCounter, 'openLimit': that.numberLimit } jQuery.cookie("sgPopupDetails"+that.popupData['id'],JSON.stringify(sgCookieData), { expires: onceExpiresTime}); } if(that.popupContentClick){ jQuery("#sgcolorbox").bind("sgColorboxOnCompleate", function(){ if((contentClickBehavior!=='close'||clickRedirectToUrl!=='')&&typeof contentClickBehavior!=='undefined'){ jQuery('#sgcolorbox').css({ "cursor": 'pointer' }); } jQuery(".sg-current-popup-"+that.popupData['id']).bind('click',function(){ if(contentClickBehavior=='close'||clickRedirectToUrl==''||typeof contentClickBehavior=='undefined'){ jQuery.sgcolorbox.close(); }else{ if(!redirectToNewTab){ window.location=clickRedirectToUrl; }else{ window.open(clickRedirectToUrl); }} }); }); } jQuery('#sgcolorbox').bind('sgPopupClose', function(e){ sgEventExecuteCount=0; jQuery('#sgcolorbox').removeClass(customClassName); jQuery('#sgcboxOverlay').removeClass(customClassName); jQuery('#sgcolorbox').removeClass(popupEffect); }); },this.popupData['delay']*1000); } jQuery(document).ready(function($){ var popupObj=new SGPopup(); popupObj.init(); }); function SgPopupInit(popupData){ this.popupData=popupData; this.cloneToHtmlPopup(); this.reopenPopupAfterSubmission(); } SgPopupInit.prototype.cloneToHtmlPopup=function(){ var currentPopupId=this.popupData['id']; if(jQuery("#sgpb-all-content-"+currentPopupId).length==0){ return; } jQuery("#sgpb-all-content-"+currentPopupId).appendTo(jQuery('.sg-current-popup-'+currentPopupId)); this.popupResizing(currentPopupId); jQuery('#sgcolorbox').bind('sgPopupCleanup', function(){ jQuery('#sgpb-all-content-'+currentPopupId).appendTo(jQuery("#sg-popup-content-"+currentPopupId)); }); this.shortcodeInPopupContent(); } SgPopupInit.prototype.reopenPopupAfterSubmission=function(){ var reopenSubmission=this.popupData['reopenAfterSubmission']; var currentPopupId=this.popupData['id']; SGPopup.setCookie('sgSubmitReloadingForm', currentPopupId, -10); var that=this; if(reopenSubmission){ jQuery("#sgcboxLoadedContent form").submit(function(){ SGPopup.setCookie('sgSubmitReloadingForm', currentPopupId); }); }} SgPopupInit.prototype.popupResizing=function(currentPopupId){ var width=this.popupData['width']; var height=this.popupData['height']; var maxWidth=this.popupData['maxWidth']; var maxHeight=this.popupData['maxHeight']; if(maxWidth==''&&maxHeight==''){ jQuery.sgcolorbox.resize({'width': width, 'height': height}); }} SgPopupInit.prototype.shortcodeInPopupContent=function(){ jQuery(".sg-show-popup").bind('click',function(){ var sgPopupID=jQuery(this).attr("data-sgpopupid"); var sgInsidePopup=jQuery(this).attr("insidepopup"); if(typeof sgInsidePopup=='undefined'||sgInsidePopup!='on'){ return false; } jQuery.sgcolorbox.close(); jQuery('#sgcolorbox').bind("sgPopupClose", function(){ if(sgPopupID==''){ return; } sgPoupFrontendObj=new SGPopup(); sgPoupFrontendObj.showPopup(sgPopupID,false); sgPopupID=''; }); }); } SgPopupInit.prototype.overallInit=function(){ jQuery('.sg-popup-close').bind('click', function(){ jQuery.sgcolorbox.close(); }); if(jQuery('#sg-facebook-like').length&&typeof FB!=='undefined'){ FB.XFBML.parse(); }} SgPopupInit.prototype.initByPopupType=function(){ var data=this.popupData; var popupObj={}; var popupType=data['type']; var popupId=data['id']; switch(popupType){ case 'countdown': var popupObj=new SGCountdown(); popupObj.init(); break; case 'contactForm': popupObj=new SgContactForm(); popupObj.buildStyle(); break; case 'social': popupObj=new SgSocialFront(); popupObj.init(); break; case 'subscription': popupObj=new SgSubscription(); popupObj.init(); break; case 'ageRestriction': popupObj=new SGAgeRestriction(); popupObj.setPopupId(popupId); popupObj.init(); break; } return popupObj; }; (function ($, document, window){ var defaults={ html: false, photo: false, iframe: false, inline: false, transition: "elastic", speed: 300, fadeOut: 300, width: false, initialWidth: "600", innerWidth: false, maxWidth: false, height: false, initialHeight: "450", innerHeight: false, maxHeight: false, scalePhotos: true, scrolling: true, opacity: 0.9, preloading: true, className: false, overlayClose: true, escKey: true, arrowKey: true, top: false, bottom: false, left: false, right: false, fixed: false, data: undefined, closeButton: true, fastIframe: true, open: false, reposition: true, loop: true, slideshow: false, slideshowAuto: true, slideshowSpeed: 2500, slideshowStart: "start slideshow", slideshowStop: "stop slideshow", photoRegex: /\.(gif|png|jp(e|g|eg)|bmp|ico|webp|jxr|svg)((#|\?).*)?$/i, customClass: 'colorbox1', retinaImage: false, retinaUrl: false, retinaSuffix: '@2x.$1', current: "image {current} of {total}", previous: "previous", next: "next", close: "close", xhrError: "This content failed to load.", imgError: "This image failed to load.", contentCustomClassName: "sg-popup-content", overlayCutsomClassName: "sg-popup-overlay", returnFocus: true, trapFocus: true, onOpen: false, onLoad: false, onComplete: false, onCleanup: false, onClosed: false, rel: function (){ return this.rel; }, href: function (){ return $(this).attr('href'); }, title: function (){ return this.title; }, createImg: function (){ var img=new Image(); var attrs=$(this).data('cbox-img-attrs'); if(typeof attrs==='object'){ $.each(attrs, function (key, val){ img[key]=val; }); } return img; }, createIframe: function (){ var iframe=document.createElement('iframe'); var attrs=$(this).data('cbox-iframe-attrs'); if(typeof attrs==='object'){ $.each(attrs, function (key, val){ iframe[key]=val; }); } if('frameBorder' in iframe){ iframe.frameBorder=0; } if('allowTransparency' in iframe){ iframe.allowTransparency="true"; } iframe.name=(new Date()).getTime(); iframe.allowFullscreen=true; return iframe; }}, colorbox='sgcolorbox', prefix='sgcbox', boxElement=prefix + 'Element', event_open=prefix + '_open', event_load=prefix + '_load', event_complete=prefix + '_complete', event_cleanup=prefix + '_cleanup', event_closed=prefix + '_closed', event_purge=prefix + '_purge', $overlay, $box, $wrap, $content, $topBorder, $leftBorder, $rightBorder, $bottomBorder, $related, $window, $loaded, $loadingBay, $loadingOverlay, $title, $current, $slideshow, $next, $prev, $close, $groupControls, $events=$(''), settings, interfaceHeight, interfaceWidth, loadedHeight, loadedWidth, index, photo, open, active, closing, loadingTimer, publicMethod, div="div", requests=0, previousCSS={}, init; function $tag(tag, id, css){ var element=document.createElement(tag); if(id){ element.id=prefix + id; } if(css){ element.style.cssText=css; } return $(element); } function winheight(){ return window.innerHeight ? window.innerHeight:$(window).height(); } function Settings(element, options){ if(options!==Object(options)){ options={};} this.cache={}; this.el=element; this.value=function (key){ var dataAttr; if(this.cache[key]===undefined){ dataAttr=$(this.el).attr('data-cbox-' + key); if(dataAttr!==undefined){ this.cache[key]=dataAttr; }else if(options[key]!==undefined){ this.cache[key]=options[key]; }else if(defaults[key]!==undefined){ this.cache[key]=defaults[key]; }} return this.cache[key]; }; this.get=function (key){ var value=this.value(key); return $.isFunction(value) ? value.call(this.el, this):value; };} function getIndex(increment){ var max=$related.length, newIndex=(index + increment) % max; return (newIndex < 0) ? max + newIndex:newIndex; } function setSize(size, dimension){ return Math.round((/%/.test(size) ? ((dimension==='x' ? $window.width():winheight()) / 100):1) * parseInt(size, 10)); } function isImage(settings, url){ return settings.get('photo')||settings.get('photoRegex').test(url); } function retinaUrl(settings, url){ return settings.get('retinaUrl')&&window.devicePixelRatio > 1 ? url.replace(settings.get('photoRegex'), settings.get('retinaSuffix')):url; } function trapFocus(e){ if('contains' in $box[0]&&!$box[0].contains(e.target)&&e.target!==$overlay[0]){ e.stopPropagation(); $box.focus(); }} function setClass(str){ if(setClass.str!==str){ $box.add($overlay).removeClass(setClass.str).addClass(str); setClass.str=str; }} function getRelated(rel){ index=0; if(rel&&rel!==false&&rel!=='nofollow'){ $related=$('.' + boxElement).filter(function (){ var options=$.data(this, colorbox); var settings=new Settings(this, options); return (settings.get('rel')===rel); }); index=$related.index(settings.el); if(index===-1){ $related=$related.add(settings.el); index=$related.length - 1; }}else{ $related=$(settings.el); }} function trigger(event){ $(document).trigger(event); $events.triggerHandler(event); } var slideshow=(function (){ var active, className=prefix + "Slideshow_", click="click." + prefix, timeOut; function clear(){ clearTimeout(timeOut); } function set(){ if(settings.get('loop')||$related[index + 1]){ clear(); timeOut=setTimeout(publicMethod.next, settings.get('slideshowSpeed')); }} function start(){ $slideshow .html(settings.get('slideshowStop')) .unbind(click) .one(click, stop); $events .bind(event_complete, set) .bind(event_load, clear); $box.removeClass(className + "off").addClass(className + "on"); } function stop(){ clear(); $events .unbind(event_complete, set) .unbind(event_load, clear); $slideshow .html(settings.get('slideshowStart')) .unbind(click) .one(click, function (){ publicMethod.next(); start(); }); $box.removeClass(className + "on").addClass(className + "off"); } function reset(){ active=false; $slideshow.hide(); clear(); $events .unbind(event_complete, set) .unbind(event_load, clear); $box.removeClass(className + "off " + className + "on"); } return function (){ if(active){ if(!settings.get('slideshow')){ $events.unbind(event_cleanup, reset); reset(); }}else{ if(settings.get('slideshow')&&$related[1]){ active=true; $events.one(event_cleanup, reset); if(settings.get('slideshowAuto')){ start(); }else{ stop(); } $slideshow.show(); }} };}()); function launch(element){ var options; if(!closing){ options=$(element).data(colorbox); settings=new Settings(element, options); getRelated(settings.get('rel')); if(!open){ open=active=true; setClass(settings.get('className')); $box.css({visibility: 'hidden', display: 'block', opacity: ''}); $loaded=$tag(div, 'LoadedContent', 'width:0; height:0; overflow:hidden; visibility:hidden'); $content.css({width: '', height: ''}).append($loaded); interfaceHeight=$topBorder.height() + $bottomBorder.height() + $content.outerHeight(true) - $content.height(); interfaceWidth=$leftBorder.width() + $rightBorder.width() + $content.outerWidth(true) - $content.width(); loadedHeight=$loaded.outerHeight(true); loadedWidth=$loaded.outerWidth(true); var initialWidth=setSize(settings.get('initialWidth'), 'x'); var initialHeight=setSize(settings.get('initialHeight'), 'y'); var maxWidth=settings.get('maxWidth'); var maxHeight=settings.get('maxHeight'); settings.w=Math.max((maxWidth!==false ? Math.min(initialWidth, setSize(maxWidth, 'x')):initialWidth) - loadedWidth - interfaceWidth, 0); settings.h=Math.max((maxHeight!==false ? Math.min(initialHeight, setSize(maxHeight, 'y')):initialHeight) - loadedHeight - interfaceHeight, 0); $loaded.css({width: '', height: settings.h}); publicMethod.position(); trigger(event_open); settings.get('onOpen'); $groupControls.add($title).hide(); if(settings.get('trapFocus')){ if(document.addEventListener){ document.addEventListener('focus', trapFocus, true); $events.one(event_closed, function (){ document.removeEventListener('focus', trapFocus, true); }); }} if(settings.get('returnFocus')){ $events.one(event_closed, function (){ $(settings.el).focus(); }); }} var opacity=parseFloat(settings.get('opacity')); $overlay.css({ opacity: opacity===opacity ? opacity:'', cursor: settings.get('overlayClose') ? 'pointer':'', visibility: 'visible' }).show(); if(settings.get('closeButton')){ $close.html(settings.get('close')).appendTo($content); }else{ $close.appendTo('
'); } load(); }} function appendHTML(options){ if(!$box){ init=false; $window=$(window); $box=$tag(div).attr({ id: colorbox, 'class': $.support.opacity===false ? prefix + 'IE':'', role: 'dialog', tabindex: '-1' }).hide(); $overlay=$tag(div, "Overlay").hide(); $loadingOverlay=$([$tag(div, "LoadingOverlay")[0], $tag(div, "LoadingGraphic")[0]]); $wrap=$tag(div, "Wrapper"); $content=$tag(div, "Content").append($title=$tag(div, "Title"), $current=$tag(div, "Current"), $prev=$('