window.jTour=function(n,t){"use strict";function dt(){if(r=$("<div/>",{"class":o+"box"}).hide().appendTo("body"),wt=$("<div/>",{"class":o+"arrow"}).appendTo(r),tt=$("<div/>",{"class":o+"content"}).appendTo(r),$("<div/>",{"class":o+"progress"}).html('<div class="'+o+'progress_bar"><\/div>').appendTo(r),c=r.find("."+o+"progress_bar"),i.showControls&&(h=$("<ul/>",{"class":o+"nav"}).html('<li><a class="'+o+'nav_btn prev" title="previous" data-role="prev">&nbsp;<\/a><\/li><li><a class="'+o+'nav_btn play" title="play" data-role="play">&nbsp;<\/a><\/li><li><a class="'+o+'nav_btn pause" title="pause" data-role="pause">&nbsp;<\/a><\/li><li><a class="'+o+'nav_btn stop" title="stop" data-role="stop">&nbsp;<\/a><\/li><li><a class="'+o+'nav_btn next" title="next" data-role="next">&nbsp;<\/a><\/li><li><a class="'+o+'nav_btn slower" title="slower" data-role="slower">&nbsp;<\/a><\/li><li><a class="'+o+'nav_btn faster" title="faster" data-role="faster">&nbsp;<\/a><\/li>').appendTo(r).delegate("a","click.jTour",function(){s=!0;switch($(this).data("role")){case"next":v();break;case"prev":ft();break;case"slower":s=!1;y(-.25);break;case"faster":s=!1;y(.25);break;case"pause":g();break;case"play":s=!1;nt();r.trigger("mouseleave");break;case"stop":rt()}}),r.addClass("has-controls")),a=$("<div/>",{"class":o+"overlay"}).css("opacity",i.overlayOpacity).hide(),i.showProgress||r.find("."+o+"progress").hide(),i.overlayOpacity!==!1?a.appendTo("body").css("height",$(document).height()):a.remove(),bt=r.attr("class"),$(window).unbind("resize.jTour").bind("resize.jTour",gt).resize(),u.box=r,u.content=tt,u.overlay=a,i.axis=i.axis.split(""),location.hash){var n=location.hash.split("=");if(n[0].match(/jTour/))return location.hash="",it(parseInt(n[1],10)),!1}i.autostart&&it()}function gt(){lt=(window.innerWidth||document.documentElement.clientWidth)/d;at=(window.innerHeight||document.documentElement.clientHeight)/d}function ni(){i.pauseOnHover&&r.bind({"mouseenter.jTour":g,"mouseleave.jTour":nt});i.keyboardNav&&$(document).bind({"keyup.jTour":vt,"keydown.jTour":vt})}function ti(){i.pauseOnHover&&r.unbind(".jTour");i.keyboardNav&&$(document).unbind(".jTour")}function vt(n){switch(n.keyCode){case 37:n.type=="keyup"&&e>0?ft():n.preventDefault();break;case 39:n.type=="keyup"?v():n.preventDefault();break;case 38:n.type=="keyup"?y(.25):n.preventDefault();break;case 40:n.type=="keyup"?y(-.25):n.preventDefault();break;case 32:s=!0;n.type=="keyup"?g(!0):n.preventDefault();break;case 27:n.type=="keyup"?rt():n.preventDefault()}}function it(n){n||(n=e);ht=ht||$(window).scrollTop();ct=ct||$(window).scrollLeft();a.show().fadeIn(function(){ni();b=!1;e=n;i.onStart.call(u,e);et(n)});i.showControls&&(h.find(".play").hide(),h.find(".pause").show())}function rt(){k||(clearTimeout(w),c.clearQueue().stop(),a.hide(),ti(),i.scrollBack?ot(ct,ht,i.scrollDuration,function(){i.onStop.call(u,e)}):i.onStop.call(u,e),f&&f.exposeElement&&f.exposeElement.css(f.exposeElement.data("jTour")).removeData("jTour").removeClass(o+"exposed"),yt(),e=0,i.showControls&&(h.find(".play").show(),h.find(".pause").hide()))}function g(n,t){if(b){if(n===!0){s=!s;nt();return}if(!s)return}t!==!1&&i.onPause.call(u,e);clearTimeout(w);c.clearQueue().stop();i.showControls&&s&&(h.find(".play").show(),h.find(".pause").hide());b=!0}function nt(t){if(b&&!s){t!==!1&&i.onPlay.call(u,e);clearTimeout(w);var f=c.width()/(tt.width()/100)/100,r=n[e].live||kt.live;r-=r*f;c.clearQueue().stop().animate({width:"100%"},{duration:r*(1/i.speed),easing:"linear",step:ut,complete:v});i.showControls&&(h.find(".play").hide(),h.find(".pause").show());b=!1}}function ii(n){yt();e=n||0;it(n)}function v(){if(!k){if(l&&n[e].steps&&(n[e].onStep&&n[e].onStep.call(u,f,100),$.each(l,function(t,i){n[e].steps[l[t]].call(u,f,i)}),l=null),n[e].goTo)return window.location=n[e].goTo+"#jTour="+(e+1),setTimeout(function(){location.reload()},1e3),!1;e+1<st?(clearTimeout(w),c.clearQueue().stop(),et(++e)):(rt(),i.onFinish.call(u,e))}}function ft(){k||e>0&&(clearTimeout(w),c.clearQueue().stop(),et(--e))}function et(t){var e=$.extend({},kt,n[t]),y=e.element=e.element?typeof e.element=="string"?$(e.element):e.element:0,g,nt;if(!y.length){console&&y&&console.log('Element $("'+y.selector+"\") doesn't exist!");st--;v();return}e.live==="auto"&&(g=$("<div>").html(e.html),nt=g.text().length,e.live=n[t].live=Math.max(2500,Math.log(nt/10)*2500+1e3));e.live=Math.abs(e.live);e.isArea=e.element[0].nodeName.toLowerCase()=="area";f?f.onBeforeHide.call(u,f.element):(e.delayOut=0,e.animationOut="hide");k=!0;r[e.animationOut](e.delayOut,function(){r.css({left:0,top:0,"min-width":0});f&&f.onHide.call(u,f.element);w=setTimeout(function(){var n,w,g,rt;if(tt.html(e.html),i.onChange.call(u,t),y[0]===p[0])n={width:lt*d,height:at*d/2-r.outerHeight()/2,x:0,y:0};else if(e.isArea){var nt=y[0].coords.split(","),it=e.exposeElement=$("img[usemap=#"+y.parent().attr("name")+"]"),ft=it.offset(),et={top:parseInt(it.css("paddingTop"),10),left:parseInt(it.css("paddingLeft"),10)},ht={top:parseInt(it.css("borderTopWidth"),10),left:parseInt(it.css("borderLeftWidth"),10)};n={width:nt[2]-nt[0],height:nt[3]-nt[1],x:parseInt(nt[0],10)+ft.left+et.left+ht.left,y:parseInt(nt[1],10)+ft.top+et.top+ht.top}}else n={width:y.outerWidth(),height:y.outerHeight(),x:y.offset().left,y:y.offset().top};w={left:n.x,top:n.y};g={x:0,y:0};switch(e.position){case"ne":isNaN(e.offset)||(e.offset={x:0,y:e.offset});w.top-=r.outerHeight()+e.offset.y;w.left=n.x+n.width-r.outerWidth()+e.offset.x;g.x=n.width/2-+r.outerWidth()/2+e.offset.x;g.y=-n.height/2-r.outerHeight()/2-e.offset.y;break;case"nw":isNaN(e.offset)||(e.offset={x:0,y:e.offset});w.top-=r.outerHeight()+e.offset.y;w.left=n.x-e.offset.x;g.x=-n.width/2+r.outerWidth()/2-e.offset.x;g.y=-n.height/2-r.outerHeight()/2-e.offset.y;break;case"n":isNaN(e.offset)||(e.offset={x:0,y:e.offset});w.top-=r.outerHeight()+e.offset.y;w.left+=(n.width-r.outerWidth())/2+e.offset.x;g.x=e.offset.x;g.y=-n.height/2-r.outerHeight()/2-e.offset.y;break;case"se":isNaN(e.offset)||(e.offset={x:0,y:e.offset});w.top+=n.height+e.offset.y;w.left=n.x+n.width-r.outerWidth()+e.offset.x;g.x=n.width/2-r.outerWidth()/2+e.offset.x;g.y=n.height/2+r.outerHeight()/2+e.offset.y;break;case"sw":isNaN(e.offset)||(e.offset={x:0,y:e.offset});w.top+=n.height+e.offset.y;w.left=n.x-e.offset.x;g.x=-n.width/2+r.outerWidth()/2-e.offset.x;g.y=n.height/2+r.outerHeight()/2+e.offset.y;break;case"s":isNaN(e.offset)||(e.offset={x:0,y:e.offset});w.top+=n.height+e.offset.y;w.left+=(n.width-r.outerWidth())/2+e.offset.x;g.x=e.offset.x;g.y=n.height/2+r.outerHeight()/2+e.offset.y;break;case"w":isNaN(e.offset)||(e.offset={x:e.offset,y:0});w.top-=r.outerHeight()/2-n.height/2-e.offset.y;w.left-=r.outerWidth()+e.offset.x;g.x=-n.width/2+r.outerWidth()/2-e.offset.x;g.y=-e.offset.y;break;case"e":isNaN(e.offset)||(e.offset={x:e.offset,y:0});w.top-=r.outerHeight()/2-n.height/2-e.offset.y;w.left+=n.width+e.offset.x;g.x=n.width/2-r.outerWidth()/2+e.offset.x;g.y=-e.offset.y;break;case"c":isNaN(e.offset)||(e.offset={x:0,y:e.offset});w.top-=r.outerHeight()/2-n.height/2-e.offset.y;w.left+=(n.width-r.outerWidth())/2+e.offset.x;g.x=e.offset.x;g.y=e.offset.y}rt={x:Math.max(0,n.x-(lt*d/2-n.width/2)+g.x),y:Math.max(0,n.y-(at*d/2-n.height/2)+g.y)};f&&f.exposeElement&&!e.isArea&&f.exposeElement.css(f.exposeElement.data("jTour")).removeData("jTour").removeClass(o+"exposed");ot(rt.x,rt.y,i.scrollDuration,function(){if(wt.removeAttr("class").addClass(o+"arrow "+e.position),e.steps?(l=[],$.each(e.steps,function(n){l.push(n)}),ut=function(n){var i,t;if(e.onStep.call(u,y,n),i=l.length,i)for(t=0;t<i;t++)n>=l[t]&&(e.steps[l[t]].call(u,y),l.shift())}):ut=function(n){e.onStep.call(u,y,n)},i.showControls&&(t===0?h.find("a.prev").hide():t==st-1?h.find("a.next").hide():h.find("a.next, a.prev").show()),e.onBeforeShow.call(u,y),c.clearQueue().stop().css({width:"0%"}),w["min-width"]=r.width(),e.expose&&y!=p){var n={position:y.css("position"),zIndex:y.css("zIndex")},d={position:"relative",zIndex:ui+1};e.exposeElement=e.exposeElement||y;typeof e.expose=="object"&&$.each(e.expose,function(t,i){n[t]=y.css(t);d[t]=i});e.exposeElement.data("jTour",n).css(d).addClass(o+"exposed")}f?f.overlayOpacity!=e.overlayOpacity&&a.fadeTo(e.delayIn*2,e.overlayOpacity):a.css({opacity:e.overlayOpacity});r.css(w).attr("class",bt+" step-"+t)[e.animationIn](e.delayIn,function(){k=!1;e.onShow.call(u,y);f=e;i.autoplay&&!b&&(s=!1,c.stop().animate({width:"100%"},{duration:e.live*(1/i.speed),easing:"linear",step:ut,complete:v}))})})},e.wait)})}function yt(){f&&(f.onBeforeHide.call(u,f.element),c.clearQueue().stop(),r.stop(),r[f.animationOut](f.delayOut,function(){tt.empty();f.onHide.call(u,f.element);f=null}))}function y(n){(i.speed=Math.max(.1,i.speed+n),k)||(g(null,!1),nt(!1))}function pt(n,t,i,f){typeof n=="object"&&(f=$.isFunction(t)?t:$.isFunction(i)?i:!1,i=isNaN(t)?0:t,t=n.offset().top,n=n.offset().left);$.isFunction(i)&&(f=i,i=!1);var e={};n!==null&&(e.left=n);t!==null&&(e.top=t);r.animate(e,{duration:i===!1?0:i,complete:f&&function(){f.call(u)}})}function ri(n,t,i,r){pt("+="+n,"+="+t,i,r)}function ot(n,t,r,f){p.scrollTop()==t&&p.scrollLeft()==n&&(r=1);var e={};$.each(i.axis,function(i,r){e[fi[r]]=r=="x"?n:t});p.animate(e,{duration:r||i.scrollDuration,complete:f&&function(){f.call(u)},queue:!0,easing:i.easing})}if(this===window)return new jTour(n,t);if(typeof jQuery!="function"||jQuery.fn.jquery.replace(/\./g,"")<171)return alert("jQuery >=1.7.1 is required for jTour!"),!1;$.isArray(n)||$.error("tourdata must be a valid array");var r,tt,c,wt,h,a,o="jTour_",p=/webkit/i.test(navigator.userAgent)?$("body"):$("html"),e=0,f,st=n.length,w,l,ut,b=!1,s=!1,k=!1,ht,ct,lt,at,ui=2e4,d=2.5,bt,fi={x:"scrollLeft",y:"scrollTop"},ei={speed:1,axis:"xy",autostart:!1,autoplay:!0,pauseOnHover:!0,keyboardNav:!0,showProgress:!0,showControls:!0,scrollBack:!1,scrollDuration:300,easing:"swing",onStart:function(){},onStop:function(){},onPause:function(){},onPlay:function(){},onChange:function(){},onFinish:function(){},position:"c",live:"auto",offset:0,wait:0,expose:!1,overlayOpacity:.2,delayIn:200,delayOut:100,animationIn:"fadeIn",animationOut:"fadeOut",onBeforeShow:function(){},onShow:function(){},onBeforeHide:function(){},onHide:function(){},onStep:function(){}},i=$.extend({},ei,t),kt={position:i.position,live:i.live,offset:i.offset,wait:i.wait,expose:i.expose,overlayOpacity:i.overlayOpacity,delayIn:i.delayIn,delayOut:i.delayOut,animationIn:i.animationIn,animationOut:i.animationOut,onBeforeShow:i.onBeforeShow,onShow:i.onShow,onBeforeHide:i.onBeforeHide,onHide:i.onHide,onStep:i.onStep,element:p,goTo:null},u={start:function(n){it(n)},restart:function(n){ii(n)},pause:function(n){s=!0;g(n)},play:function(){s=!1;nt()},stop:function(){rt()},next:function(){v()},prev:function(){ft()},faster:function(n){y(n||.25)},slower:function(n){y(n||-.25)},moveTo:function(n,t,i,r){pt(n,t,i,r)},offset:function(n,t,i,r){ri(n,t,i,r)},scroll:function(n,t,i,r){ot(n,t,i,r)}};return u.box=u.content=u.overlay=null,u.tourdata=n,dt(),u};var IsynergyTutorial=function(n){var r=new ISynergyLocal("tutorial",$("html").data("user")),t=n.key,i=this;this.GetBDD=function(){return r};this.objTour=n.objTour;this.flagToUpdate=!1;this.setTour=function(u){var f=!1,e;n.hasOwnProperty("key")&&n.hasOwnProperty("autostart")&&(e=r.get(t),f=isNaN(e));n.settings=n.settings?$.extend({},n.settings,{autostart:f,onStart:function(){r.incrementAndSave(t);ga!=undefined&&ga("send",{hitType:"event",eventCategory:"tutorial",eventAction:"click",eventLabel:t,eventValue:1})},onStop:function(){n.onStop},onFinish:function(){ga!=undefined&&ga("send",{hitType:"event",eventCategory:"tutorial",eventAction:"lastStep",eventLabel:t,eventValue:1})}}):{autostart:f,onStart:function(){r.incrementAndSave(t);ga!=undefined&&ga("send",{hitType:"event",eventCategory:"tutorial",eventAction:"click",eventLabel:t,eventValue:1})},onFinish:function(){ga!=undefined&&ga("send",{hitType:"event",eventCategory:"tutorial",eventAction:"lastStep",eventLabel:t,eventValue:1})},onStop:n.onStop};u||(u=i.objTour.compileSteps());i.myTour=jTour(u,n.settings);$("body").has(".modal-popup").length>0&&$("body .jTour_overlay").last().appendTo(".modal-popup")};this.setTour(n.aData);$(n.linkId).on("click.tutorial",function(n){n.preventDefault();i.flagToUpdate&&(i.setTour(),i.flagToUpdate=!1);i.myTour.start()}).tooltip({tooltipClass:"tooltipHint"})}