
/* jQuery */

jQuery(document).ready(function(){
    initSmoothScroll();
    initPrintLink();
    if (top.location != location) {
        top.location.href = document.location.href;
    }
});


function initPrintLink() {
    jQuery('#printLink a').click(function(event) {
        event.preventDefault();
        var url = jQuery(this).attr('href');
        window.open(url,"print","menubar=1,resizable=1,scrollbars=1,width=600,height=600");
    });
}


function initSmoothScroll() { 

    jQuery('a[href*=#]').click(function() {
      if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'')
      && location.hostname == this.hostname) {
        var target = jQuery(this.hash);
        target = target.length && target
        || jQuery('[name=' + this.hash.slice(1) +']');
        if (target.length) {
          var targetOffset = target.offset().top;
          jQuery('html,body')
          .animate({scrollTop: targetOffset}, 1000);
         return false;
        }
      }
    });


}


