var bookmarkscroll={setting:{duration:1500,yoffset:0},topkeyword:"#top",scrollTo:function(t,o,e){var s=jQuery,o=o||{},i="string"==typeof t&&t.length>0?t==this.topkeyword?0:s("#"+t):t?s(t):[];if(0===i||1==i.length&&(!o.autorun||o.autorun&&Math.abs(i.offset().top+(o.yoffset||this.setting.yoffset)-s(window).scrollTop())>5)){if(s(window).innerWidth()>767)var n=i.offset().top-65;else var n=i.offset().top-50;this.$body.animate({scrollTop:0===i?0:n+(o.yoffset||this.setting.yoffset)},o.duration||this.setting.duration,function(){0!==i&&e&&(location.hash=e)})}},urlparamselect:function(){var t=window.location.search.match(/scrollto=[\w\-_,]+/i);return t?t[0].split("=")[1]:null},init:function(){jQuery(document).ready(function(t){var o=bookmarkscroll;o.$body=window.opera?"CSS1Compat"==document.compatMode?t("html"):t("body"):t("html,body");var e=o.urlparamselect();e&&setTimeout(function(){o.scrollTo(document.getElementById(e)||t("a[name="+e+"]:eq(0)").get(0),{autorun:!0})},100),t('a[href^="#"]').each(function(){var e=this.getAttribute("href").match(/#\w+$/i);if(e=e?e[0].substring(1):null,this.hash.length>1){var s=t("a[name="+this.hash.substr(1)+"]:eq(0)");(1==s.length||this.hash==o.topkeyword)&&(1!=s.length||document.all||s.html(".").css({position:"absolute",fontSize:1,visibility:"hidden"}),t(this).click(function(t){o.scrollTo(this.hash==o.topkeyword?o.topkeyword:s.get(0),{},this.hash),t.preventDefault()}))}})})}};bookmarkscroll.init();