
var _____WB$wombat$assign$function_____ = function(name) {return (self._wb_wombat && self._wb_wombat.local_init && self._wb_wombat.local_init(name)) || self[name]; };
if (!self.__WB_pmw) { self.__WB_pmw = function(obj) { this.__WB_source = obj; return this; } }
{
let window = _____WB$wombat$assign$function_____("window");
let self = _____WB$wombat$assign$function_____("self");
let document = _____WB$wombat$assign$function_____("document");
let location = _____WB$wombat$assign$function_____("location");
let top = _____WB$wombat$assign$function_____("top");
let parent = _____WB$wombat$assign$function_____("parent");
let frames = _____WB$wombat$assign$function_____("frames");
let opener = _____WB$wombat$assign$function_____("opener");
let arguments;

{jQuery(function ($) {

  //start

  jQuery(".sp-megamenu-parent li a").click(function(){return jQuery("html, body").animate({scrollTop:jQuery(jQuery.attr(this,"href")).offset().top},500),!1})

  
  
  var lookupSpanAndReplace = function(textFrom, textTo) {
    $('span.sppb-articles-scroller-month:contains(' + textFrom + ')').each(function(index, element) { 
      $(element).text($(element).text().replace(textFrom, textTo));
    });
  }

  lookupSpanAndReplace("/ ", "/");


  jQuery.noConflict();
  // smooth anchor scrolling
  jQuery('a[href*="#"]').on('click', function (e) {
    e.preventDefault();
    if(this.hash !== '') {
      if(this.hash !== '' && this.href.replace(this.hash, '') == window.location.href.replace(window.location.hash, '')) {
        var target = jQuery(this.hash);
        if(target.length && this.hash !== '#') {
          jQuery('html, body').stop().animate({
            'scrollTop': target.offset().top
          }, 1000, 'swing', function () {
            if(this.hash !== '#') {
              window.location.hash = target.selector;
            }
          });
        } else {
          if(this.hash !== '#') {
            window.location = jQuery(this).attr('href');
          }
        }
      } else {
        if(this.hash !== '#') {
          window.location = jQuery(this).attr('href');
        }
      }
    }
  });
  //end

  lang = document.getElementById('html').getAttribute('lang');
  if(lang == "zh-tw"){
    $('#jevents_header h2').text('活動日誌');
  }

});
function redirect(){
  link = window.location.href;	
  lang = document.getElementById('html').getAttribute('lang');
  if(lang !="ZH-CN"){
    link = "https://"+link;
    window.location=link;
  }
};
function langselect(lang)
{

  s = window.location.href;	  
  en_gb_id = document.getElementById('html').getAttribute('en_gb_id');
  zh_hk_id = document.getElementById('html').getAttribute('zh_hk_id');
  if (s.indexOf("translate.itsc.cuhk.edu.hk/uniTS/") > 0){
    chs=s;
    cht=s.replace('translate.itsc.cuhk.edu.hk/uniTS/','');
    eng=cht.replace('/zh-hk/','/en-gb/');

    if (zh_hk_id !=0)eng=eng.replace('/'+zh_hk_id+'-','/'+en_gb_id+'-');
  } else {
    eng=s.replace('/zh-hk','/en-gb');
    if (zh_hk_id !=0) eng=eng.replace('/'+zh_hk_id+'-','/'+en_gb_id+'-');
    cht=s.replace('/en-gb','/zh-hk');
    if (en_gb_id !=0) cht=cht.replace('/'+en_gb_id+'-','/'+zh_hk_id+'-');
    chs=cht.replace('https://','http://');
    chs=chs.replace('http://','http://translate.itsc.cuhk.edu.hk/uniTS/');
  }
  if (lang=='eng')
    window.location=eng;
  if (lang=='cht')
    window.location=cht;
  if (lang=='chs')
    window.location=chs;
};




}}