var scrolltotop={setting:{startline:1e3,scrollto:0,scrollduration:1e3,fadeduration:[500,100]},controlHTML:'<img src="/Assets/img/up.png" style="width:51px; height:42px" alt="back to top"/>',controlattrs:{offsetx:5,offsety:5},anchorkeyword:"#top",state:{isvisible:!1,shouldvisible:!1},scrollup:function(){this.cssfixedsupport||this.$control.css({opacity:0});var n=isNaN(this.setting.scrollto)?this.setting.scrollto:parseInt(this.setting.scrollto);n=typeof n=="string"&&jQuery("#"+n).length==1?jQuery("#"+n).offset().top:0;this.$body.animate({scrollTop:n},this.setting.scrollduration)},keepfixed:function(){var n=jQuery(window),t=n.scrollLeft()+n.width()-this.$control.width()-this.controlattrs.offsetx,i=n.scrollTop()+n.height()-this.$control.height()-this.controlattrs.offsety;this.$control.css({left:t+"px",top:i+"px"})},togglecontrol:function(){var n=jQuery(window).scrollTop();this.cssfixedsupport||this.keepfixed();this.state.shouldvisible=n>=this.setting.startline?!0:!1;this.state.shouldvisible&&!this.state.isvisible?(this.$control.stop().animate({opacity:1},this.setting.fadeduration[0]),this.state.isvisible=!0):this.state.shouldvisible==!1&&this.state.isvisible&&(this.$control.stop().animate({opacity:0},this.setting.fadeduration[1]),this.state.isvisible=!1)},init:function(){jQuery(document).ready(function(n){var t=scrolltotop,i=document.all;t.cssfixedsupport=!i||i&&document.compatMode=="CSS1Compat"&&window.XMLHttpRequest;t.$body=window.opera?document.compatMode=="CSS1Compat"?n("html"):n("body"):n("html,body");t.$control=n('<div id="topcontrol">'+t.controlHTML+"<\/div>").css({position:t.cssfixedsupport?"fixed":"absolute",bottom:t.controlattrs.offsety,right:t.controlattrs.offsetx,opacity:0,cursor:"pointer"}).attr({title:"Scroll Back to Top"}).click(function(){return t.scrollup(),!1}).appendTo("body");document.all&&!window.XMLHttpRequest&&t.$control.text()!=""&&t.$control.css({width:t.$control.width()});t.togglecontrol();n('a[href="'+t.anchorkeyword+'"]').click(function(){return t.scrollup(),!1});n(".sb-toggle-right").click(function(){return t.scrollup(),!1});n(window).bind("scroll resize",function(){t.togglecontrol()})})}};scrolltotop.init()