
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;

{$(document).ready(function(){
  
  
  $('.energy #sp-main-body').prepend('<p class="inner-page-text">To access the reports, please sign in with your staff ID in the security pop-up.</p>');
  
	//energy change order for filter
  $("body>div:nth-child(3)>ul li:eq(15)").before($("body>div:nth-child(3)>ul li:eq(0)"));
  $("body>div:nth-child(3)>ul li:eq(0)").before($("body>div:nth-child(3)>ul li:eq(15)"));
  $("body>div:nth-child(3)>ul li:eq(14)").before($("body>div:nth-child(3)>ul li:eq(1)"));
  $("body>div:nth-child(3)>ul li:eq(1)").before($("body>div:nth-child(3)>ul li:eq(14)"));
  $("body>div:nth-child(3)>ul li:eq(13)").before($("body>div:nth-child(3)>ul li:eq(2)"));
  $("body>div:nth-child(3)>ul li:eq(2)").before($("body>div:nth-child(3)>ul li:eq(13)"));
  $("body>div:nth-child(3)>ul li:eq(12)").before($("body>div:nth-child(3)>ul li:eq(3)"));
  $("body>div:nth-child(3)>ul li:eq(3)").before($("body>div:nth-child(3)>ul li:eq(12)"));
  $("body>div:nth-child(3)>ul li:eq(11)").before($("body>div:nth-child(3)>ul li:eq(4)"));
  $("body>div:nth-child(3)>ul li:eq(4)").before($("body>div:nth-child(3)>ul li:eq(11)"));
  $("body>div:nth-child(3)>ul li:eq(10)").before($("body>div:nth-child(3)>ul li:eq(5)"));
  $("body>div:nth-child(3)>ul li:eq(5)").before($("body>div:nth-child(3)>ul li:eq(10)"));
  $("body>div:nth-child(3)>ul li:eq(9)").before($("body>div:nth-child(3)>ul li:eq(6)"));
  $("body>div:nth-child(3)>ul li:eq(6)").before($("body>div:nth-child(3)>ul li:eq(9)"));
  $("body>div:nth-child(3)>ul li:eq(8)").before($("body>div:nth-child(3)>ul li:eq(7)"));
  $("body>div:nth-child(3)>ul li:eq(7)").before($("body>div:nth-child(3)>ul li:eq(8)"));

  $("body>div:nth-child(4)>ul li:eq(4)").before($("body>div:nth-child(4)>ul li:eq(0)"));
  $("body>div:nth-child(4)>ul li:eq(0)").before($("body>div:nth-child(4)>ul li:eq(4)"));
  $("body>div:nth-child(4)>ul li:eq(3)").before($("body>div:nth-child(4)>ul li:eq(1)"));
  $("body>div:nth-child(4)>ul li:eq(1)").before($("body>div:nth-child(4)>ul li:eq(3)"));

  $(function(){
    var r= $('<button type="submit"><i class="fas fa-search"></i></button>');
    $(".tree div.k2filter-field-text.k2filter-keyword").append(r);
  });

  $(".main-table").clone(true).appendTo('#table-scroll').addClass('clone');   

  $(".tree .btn.btn-warning.button").prop('value', 'ALL');

  $('.tree .sp-module-title').text('A-Z');

  $('.tree .inputbox').attr('placeholder','Tree Name');

  $('.energy .itemBackToTop a').attr('href','javascript:history.back()');

  $(".tree input.btn.btn-warning").click(function(){
    window.location.href="https://www.cpso.cuhk.edu.hk/en-gb/trees-and-birds-at-cuhk-test/trees-sorting";
  });

  $(".energy input.btn.btn-warning.button.reset").click(function(){
    window.location.href="https://cpso.cuhk.edu.hk/en-gb/energy-test-2";
  });

  $(".tree.bird-sorting input.btn.btn-warning").click(function(){
    window.location.href="https://www.cpso.cuhk.edu.hk/en-gb/trees-and-birds-at-cuhk-test/birds-sorting";
  });


  $(".walk-for-green .walk-scroll-down").on('click',function(){
    window.scrollBy(0, 700);
  });

  $(".walk-for-green .hyperlink .walking-trails").on('click',function(){
    $('html, body').animate({
      scrollTop: $("#walking-trails").offset().top
    }, 1000);
  });

  $(".walk-for-green .hyperlink .card-readers").on('click',function(){
    $('html, body').animate({
      scrollTop: $("#card-readers").offset().top
    }, 1000);
  });

  $(".walk-for-green .hyperlink .walking-journey-points").on('click',function(){
    $('html, body').animate({
      scrollTop: $("#walking-journey-points").offset().top
    }, 1000);
  });

  $('#mod-mls-searchword-mls_mod_278').attr('placeholder','Search building name');

  $(".itemid-429 .ui-multiselect-menu:first-child").addClass("first");

  //var vid = document.getElementsByClassName(".cpso-go .sppb-addon-video-local-source");
  //vid.muted = true;

  $(".cpso-go video.sppb-addon-video-local-source").prop('muted', true); //mute

  //var video = document.getElementsByClassName(".cpso-go .sppb-addon-video-local-source");
  //video.muted= true;

  //side-menu-button-toggler
  $(".cpso-go #sp-left .side-menu-bar-button").on('click',function(){
    $('.cpso-go.checklist #sp-main-body #sp-left .accordeonck .menu.side-menu-go').toggleClass('active');
  });

  //close notification bar
  $(".energy #sp-notification-bar #close").on('click',function(){
    $("#sp-notification-bar").hide();
    $(".energy #sp-top-bar").addClass("move-up");
  });
  $(".itemid-411 #sp-notification-bar #close").on('click',function(){
    $("#sp-notification-bar").hide();
    $(".itemid-411 #sp-top-bar").addClass("move-up");
  });
  $("#sp-notification-bar #close").on('click',function(){
    $("#sp-notification-bar").hide();
  });


  //tabs
  $('#sppb-addon-1575859162191 .sppb-nav.sppb-nav-tabs li a.left').removeAttr('href');
  $('#sppb-addon-1575963489855 .sppb-nav.sppb-nav-tabs li a.left').removeAttr('href');
  $('#sppb-addon-1576031582811 .sppb-nav.sppb-nav-tabs li a.left').removeAttr('href');
  $('#sppb-addon-1575947127626 .sppb-nav.sppb-nav-tabs li a.left').removeAttr('href');

  //$( "ul li:nth-child(2)" ).append( "<span> - 2nd!</span>" );

  $( "ul.sppb-nav.sppb-nav-tabs li:first-child" ).on('click',function(){
    $("#sppb-tab1-1").siblings().removeClass('in');
    $("#sppb-tab1-1").siblings().removeClass('active');
    $('#sppb-tab1-1').addClass('in');
    $('#sppb-tab1-1').addClass('active');
    $("#sppb-tab2-1").siblings().removeClass('in');
    $("#sppb-tab2-1").siblings().removeClass('active');
    $('#sppb-tab2-1').addClass('in');
    $('#sppb-tab2-1').addClass('active');
  });

  $("ul.sppb-nav.sppb-nav-tabs li:nth-child(2)" ).on('click',function(){
    $("#sppb-tab1-2").siblings().removeClass('in');
    $("#sppb-tab1-2").siblings().removeClass('active');
    $('#sppb-tab1-2').addClass('in');
    $('#sppb-tab1-2').addClass('active');
    $("#sppb-tab2-2").siblings().removeClass('in');
    $("#sppb-tab2-2").siblings().removeClass('active');
    $('#sppb-tab2-2').addClass('in');
    $('#sppb-tab2-2').addClass('active');

  });

  $("ul.sppb-nav.sppb-nav-tabs li:nth-child(3)" ).on('click',function(){
    $("#sppb-tab1-3").siblings().removeClass('in');
    $("#sppb-tab1-3").siblings().removeClass('active');
    $('#sppb-tab1-3').addClass('in');
    $('#sppb-tab1-3').addClass('active');
    $("#sppb-tab2-3").siblings().removeClass('in');
    $("#sppb-tab2-3").siblings().removeClass('active');
    $('#sppb-tab2-3').addClass('in');
    $('#sppb-tab2-3').addClass('active');

  });

  $("ul.sppb-nav.sppb-nav-tabs li:nth-child(4)" ).on('click',function(){
    $("#sppb-tab1-4").siblings().removeClass('in');
    $("#sppb-tab1-4").siblings().removeClass('active');
    $('#sppb-tab1-4').addClass('in');
    $('#sppb-tab1-4').addClass('active');
    $("#sppb-tab2-4").siblings().removeClass('in');
    $("#sppb-tab2-4").siblings().removeClass('active');
    $('#sppb-tab2-4').addClass('in');
    $('#sppb-tab2-4').addClass('active');

  });

  $("ul.sppb-nav.sppb-nav-tabs li:nth-child(5)" ).on('click',function(){
    $("#sppb-tab1-5").siblings().removeClass('in');
    $("#sppb-tab1-5").siblings().removeClass('active');
    $('#sppb-tab1-5').addClass('in');
    $('#sppb-tab1-5').addClass('active');
    $("#sppb-tab2-5").siblings().removeClass('in');
    $("#sppb-tab2-5").siblings().removeClass('active');
    $('#sppb-tab2-5').addClass('in');
    $('#sppb-tab2-5').addClass('active');

  });

  $("ul.sppb-nav.sppb-nav-tabs li:nth-child(6)" ).on('click',function(){
    $("#sppb-tab1-6").siblings().removeClass('in');
    $("#sppb-tab1-6").siblings().removeClass('active');
    $('#sppb-tab1-6').addClass('in');
    $('#sppb-tab1-6').addClass('active');
    $("#sppb-tab2-6").siblings().removeClass('in');
    $("#sppb-tab2-6").siblings().removeClass('active');
    $('#sppb-tab2-6').addClass('in');
    $('#sppb-tab2-6').addClass('active');

  });

  $("ul.sppb-nav.sppb-nav-tabs li:nth-child(7)" ).on('click',function(){
    $("#sppb-tab1-7").siblings().removeClass('in');
    $("#sppb-tab1-7").siblings().removeClass('active');
    $('#sppb-tab1-7').addClass('in');
    $('#sppb-tab1-7').addClass('active');
    $("#sppb-tab2-7").siblings().removeClass('in');
    $("#sppb-tab2-7").siblings().removeClass('active');
    $('#sppb-tab2-7').addClass('in');
    $('#sppb-tab2-7').addClass('active');

  });

  $("ul.sppb-nav.sppb-nav-tabs li:last-child" ).on('click',function(){
    $("#sppb-tab1-8").siblings().removeClass('in');
    $("#sppb-tab1-8").siblings().removeClass('active');
    $('#sppb-tab1-8').addClass('in');
    $('#sppb-tab1-8').addClass('active');
    $("#sppb-tab2-8").siblings().removeClass('in');
    $("#sppb-tab2-8").siblings().removeClass('active');
    $('#sppb-tab2-8').addClass('in');
    $('#sppb-tab2-8').addClass('active');

  });


  //accordion
  $(".cpso-go #heading-EC1").on('click',function(){
    $('.cpso-go #collapse-EC1').toggleClass('in');
  });
  $(".cpso-go #heading-EC2").on('click',function(){
    $('.cpso-go #collapse-EC2').toggleClass('in');
  });
  $(".cpso-go #heading-EC3").on('click',function(){
    $('.cpso-go #collapse-EC3').toggleClass('in');
  });
  $(".cpso-go #heading-EC4").on('click',function(){
    $('.cpso-go #collapse-EC4').toggleClass('in');
  });
  $(".cpso-go #heading-EC5").on('click',function(){
    $('.cpso-go #collapse-EC5').toggleClass('in');
  });
  $(".cpso-go #heading-EC6").on('click',function(){
    $('.cpso-go #collapse-EC6').toggleClass('in');
  });
  $(".cpso-go #heading-EC7").on('click',function(){
    $('.cpso-go #collapse-EC7').toggleClass('in');
  });
  $(".cpso-go #heading-EC8").on('click',function(){
    $('.cpso-go #collapse-EC8').toggleClass('in');
  });
  $(".cpso-go #heading-WR1").on('click',function(){
    $('.cpso-go #collapse-WR1').toggleClass('in');
  });
  $(".cpso-go #heading-WR2").on('click',function(){
    $('.cpso-go #collapse-WR2').toggleClass('in');
  });
  $(".cpso-go #heading-WR3").on('click',function(){
    $('.cpso-go #collapse-WR3').toggleClass('in');
  });
  $(".cpso-go #heading-WR4").on('click',function(){
    $('.cpso-go #collapse-WR4').toggleClass('in');
  });
  $(".cpso-go #heading-WR5").on('click',function(){
    $('.cpso-go #collapse-WR5').toggleClass('in');
  });
  $(".cpso-go #heading-PR1").on('click',function(){
    $('.cpso-go #collapse-PR1').toggleClass('in');
  });
  $(".cpso-go #heading-PR2").on('click',function(){
    $('.cpso-go #collapse-PR2').toggleClass('in');
  });
  $(".cpso-go #heading-PR3").on('click',function(){
    $('.cpso-go #collapse-PR3').toggleClass('in');
  });
  $(".cpso-go #heading-PR4").on('click',function(){
    $('.cpso-go #collapse-PR4').toggleClass('in');
  });
  $(".cpso-go #heading-PR5").on('click',function(){
    $('.cpso-go #collapse-PR5').toggleClass('in');
  });
  $(".cpso-go #heading-PR6").on('click',function(){
    $('.cpso-go #collapse-PR6').toggleClass('in');
  });
  $(".cpso-go #heading-GP1").on('click',function(){
    $('.cpso-go #collapse-GP1').toggleClass('in');
  });
  $(".cpso-go #heading-GP2").on('click',function(){
    $('.cpso-go #collapse-GP2').toggleClass('in');
  });
  $(".cpso-go #heading-GP3").on('click',function(){
    $('.cpso-go #collapse-GP3').toggleClass('in');
  });
  $(".cpso-go #heading-GP4").on('click',function(){
    $('.cpso-go #collapse-GP4').toggleClass('in');
  });
  $(".cpso-go #heading-GP5").on('click',function(){
    $('.cpso-go #collapse-GP5').toggleClass('in');
  });
  $(".cpso-go #heading-GE1").on('click',function(){
    $('.cpso-go #collapse-GE1').toggleClass('in');
  });
  $(".cpso-go #heading-GE2").on('click',function(){
    $('.cpso-go #collapse-GE2').toggleClass('in');
  });
  $(".cpso-go #heading-GE3").on('click',function(){
    $('.cpso-go #collapse-GE3').toggleClass('in');
  });
  $(".cpso-go #heading-GE4").on('click',function(){
    $('.cpso-go #collapse-GE4').toggleClass('in');
  });
  $(".cpso-go #heading-GE5").on('click',function(){
    $('.cpso-go #collapse-GE5').toggleClass('in');
  });
  $(".cpso-go #heading-GE6").on('click',function(){
    $('.cpso-go #collapse-GE6').toggleClass('in');
  });
  $(".cpso-go #heading-GE7").on('click',function(){
    $('.cpso-go #collapse-GE7').toggleClass('in');
  });
  $(".cpso-go #heading-AE1").on('click',function(){
    $('.cpso-go #collapse-AE1').toggleClass('in');
  });
  $(".cpso-go #heading-AE2").on('click',function(){
    $('.cpso-go #collapse-AE2').toggleClass('in');
  });
  $(".cpso-go #heading-AE3").on('click',function(){
    $('.cpso-go #collapse-AE3').toggleClass('in');
  });
  $(".cpso-go #heading-AE4").on('click',function(){
    $('.cpso-go #collapse-AE4').toggleClass('in');
  });
  $(".cpso-go #heading-AE5").on('click',function(){
    $('.cpso-go #collapse-AE5').toggleClass('in');
  });
  $(".cpso-go #heading-HW1").on('click',function(){
    $('.cpso-go #collapse-HW1').toggleClass('in');
  });
  $(".cpso-go #heading-HW2").on('click',function(){
    $('.cpso-go #collapse-HW2').toggleClass('in');
  });
  $(".cpso-go #heading-HW3").on('click',function(){
    $('.cpso-go #collapse-HW3').toggleClass('in');
  });
  $(".cpso-go #heading-IN1").on('click',function(){
    $('.cpso-go #collapse-IN1').toggleClass('in');
  });

  //limit the max-height of horizontal images 
  $(".content-table p:has(img:not(.vertical-img))").addClass("equal-height-img");


  //hide empty span when event details are empty
  $('.jevent-event-layout .event-detail-content p span').each(function(){
    var checkText = $(this).contents().filter(function(){
      return this.nodeType == 3 ;
    }).text();
    // console.log(checkText);
    if (checkText == " " || checkText == null || checkText == ""){
      $(this).hide();
    }
  });


  //custom mobile accordion
  var accItem = document.getElementsByClassName('mobile-acc-item');
  var accHD = document.getElementsByClassName('mobile-acc-itemHeading');
  for (i = 0; i < accHD.length; i++) {
    accHD[i].addEventListener('click', toggleItem, false);
  }
  function toggleItem() {
    var itemClass = this.parentNode.className;
    for (i = 0; i < accItem.length; i++) {
      accItem[i].className = 'mobile-acc-item acc-close sppb-panel-modern';
    }
    if (itemClass == 'mobile-acc-item acc-close sppb-panel-modern') {
      this.parentNode.className = 'mobile-acc-item acc-open sppb-panel-modern';
    }
  }

});




var myj = jQuery.noConflict();		
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})
  /*** jevent layout ***/	
  if(jQuery(".jev-port-img").length){
    for(var i = 0 ; i < jQuery(".jev-port-img").length ; i++){
      if(!jQuery(".jev-port-img:eq("+i+")  .jev-port-imgbox").html()){
        var img_code = "<img src='https://images.pexels.com/photos/886521/pexels-photo-886521.jpeg?auto=compress&cs=tinysrgb&dpr=2&h=750&w=1260' alt='image"+(i+1)+"' />" ;
        jQuery(".jev-port-img:eq("+i+")").append(img_code);
      }
      else{
        var text = $(".jev-port-img:eq("+i+")  .jev-port-imgbox").text() ;
        var newtext = "<img src='" + text + "' alt='image" + (i+1) + "'>"  ;
        $(".jev-port-img:eq("+i+") .jev-port-imgbox").html(newtext) ;
      }   
    }	
  }
  if(jQuery(".event-detail-thumb").length){
    if(!jQuery(".event-detail-thumb").html()){
      var img_code = "<img src='https://images.pexels.com/photos/886521/pexels-photo-886521.jpeg?auto=compress&cs=tinysrgb&dpr=2&h=750&w=1260' alt='image"+(i+1)+"' />" ;
      jQuery(".event-detail-thumb").append(img_code);
    }
    else{
      var text = $(".event-detail-thumb").text() ;
      var newtext = "<img src='" + text + "' alt='image" + (i+1) + "'>"  ;
      $(".event-detail-thumb").html(newtext) ;
    }   
  }

  $(".pagination-sec .sppb-col-md-6").addClass("col-xs-6") ;

  $(function(){
    var len = 80; 
    $(".jev-port-title a").each(function(i){
      if($(this).text().length>len){
        $(this).attr("title",$(this).text());
        var text=$(this).text().substring(0,len-1)+"...";
        $(this).text(text);
      }
    });
  });

  $(".jev-port-cat").each(function(i){
    var html = $(this).html();
    var newhtml = html.replace(/,/g, '&nbsp;');
    $(this).html(newhtml);
  });
  $(".jev-detail-cat").each(function(i){
    var html = $(this).html();
    var newhtml = html.replace(/,/g, '&nbsp;');
    $(this).html(newhtml);
  });


  /**************************/ 	

  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

  //enlarge font	 
});

function direct(path){
  var link = window.location.href  ;
  var lang = document.getElementsByTagName("html")[0].getAttribute("lang"); 
  var pos = link.search("en-gb"); 
  if(pos != -1){
    link = link.substring(0,pos) ;
  }
  var pos = link.search("zh-tw"); 
  if(pos != -1){
    link = link.substring(0,pos) ;
  }
  var link = link + path ;
  location.href = link;
}

function searchswitcher()
{
  var box = document.getElementsByClassName("search-box")[0];
  if(box.style.display  != "block" )
    box.style.display = "block";
  else
    box.style.display = "none";	
}

var myj = jQuery.noConflict();		
myj(document).ready(function(){	
  //font adjust
  var fontCount = 0; //to record number of clicks
  var resetCount = 0;
  var noClick = 2; //number of clicks allowed
  var upRatio = 1.05; //ratio of increasing the font size
  var downRatio = 1.05; //ratio of reducing the font size
  var backUp1 = myj('#sp-main-body:first').html();
  var backUp2 = myj('#sp-main-body:last').html();
  //var backUp2 = myj('.item-page:first + .item-page').html();


  setTimeout(function(){ 
    myj('.larger').click(function(){
      fontUp();
      document.getElementById('btn_large').style.color = "#337ab7";
      document.getElementById('btn_middle').style.color= "#333333";
      document.getElementById('btn_small').style.color= "#333333";
    });	
    myj('.smaller').click(function(){
      fontDown();
      document.getElementById('btn_large').style.color = "#333333";
      document.getElementById('btn_middle').style.color = "#333333";
      document.getElementById('btn_small').style.color = "#337ab7";
    });		
    myj('.reset').click(function(){
      fontReset();
      document.getElementById('btn_large').style.color = "#333333";
      document.getElementById('btn_middle').style.color = "#337ab7";
      document.getElementById('btn_small').style.color = "#333333";
    });	
  },500);
  //enlarge font	
  function fontUp() {
    if (fontCount<noClick){
      if (fontCount==0){
        fontReset();
      }
      myj('#sp-main-body').find('*').each(function(){
        var tagCheck = myj(this).prop("tagName");
        switch(tagCheck){
          case 'TABLE':
            var tagOk = 0;
            break;
          case 'TBODY':
            var tagOk = 0;
            break;
          case 'TR':
            var tagOk = 0;
            break;
          case 'TD':
            var tagOk = 0;
            break;
          case 'STRONG':
            var tagOk = 0;
            break;
          default:
            var tagOk = 1;
        }
        var elementFont = myj(this).css('font-size');
        if (elementFont&&tagOk==1) {
          var fontCheck = 'px';
          if (elementFont.indexOf('px')>0) {
            elementFont = elementFont.replace('px','');
          }
          if (elementFont.indexOf('pt')>0) {
            elementFont = elementFont.replace('pt','');
            fontCheck = 'pt';
          }
          var org_style = myj(this).attr('style');
          if (org_style==undefined)
            org_style="";
          myj(this).attr('style',org_style+';font-size:'+elementFont*upRatio+fontCheck+';');
        };
      });
      fontCount++;
    };
    resetCount=0;
  };


  //reduce font
  function fontDown () {
    if (fontCount>(-noClick)){
      if (fontCount==0){
        fontReset();
      }
      myj('#sp-main-body').find('*').each(function(){
        var tagCheck = myj(this).prop("tagName");
        switch(tagCheck){
          case 'TABLE':
            var tagOk = 0;
            break;
          case 'TBODY':
            var tagOk = 0;
            break;
          case 'TR':
            var tagOk = 0;
            break;
          case 'TD':
            var tagOk = 0;
            break;
          case 'STRONG':
            var tagOk = 0;
            break;
          default:
            var tagOk = 1;
        }
        var elementFont = myj(this).css('font-size');
        if (elementFont&&tagOk==1) {
          var fontCheck = 'px';
          if (elementFont.indexOf('px')>0) {
            elementFont = elementFont.replace('px','');
          }
          if (elementFont.indexOf('pt')>0) {
            elementFont = elementFont.replace('pt','');
            fontCheck = 'pt';
          }

          var org_style = myj(this).attr('style');
          if (org_style==undefined)
            org_style="";
          myj(this).attr('style',org_style+';font-size:'+elementFont/downRatio+fontCheck+';');
        };
      });
      fontCount--;
    };
    resetCount=0;
  };


  //reset function
  function fontReset() {
    if (resetCount<1){
      myj('#sp-main-body:first').html(backUp1);
      myj('#sp-main-body:last').html(backUp2);
    }
    resetCount++
    fontCount=0;
  };

});

$(document).ready(function(){
  $('.research-carousel').owlCarousel({
    loop:true,
    margin:10,
    nav:true,
    responsive:{
      0:{
        items:1
      },
      600:{
        items:2
      },
      1000:{
        items:3
      }
    }
  })
});

$(document).ready(function(){
  var but2 = "<div class='jevents_catlog'><div class='log-upcoming'><a href='/get-involved/events/upcoming-event'>Upcoming</a></div><div class='log-archive'><a href='/get-involved/events/archived-event'>Archived</a></div></div>" ;
  $('.events #jevents #jevents_header').after(but2) ;


});

function openTabs(evt, cityName) {
  var i, tabcontent, tablinks;
  tabcontent = document.getElementsByClassName("tabcontent");
  for (i = 0; i < tabcontent.length; i++) {
    tabcontent[i].style.display = "none";
  }
  tablinks = document.getElementsByClassName("tablinks");
  for (i = 0; i < tablinks.length; i++) {
    tablinks[i].className = tablinks[i].className.replace(" active", "");
  }
  document.getElementById(cityName).style.display = "block";
  evt.currentTarget.className += " active";
}


$(document).ready(function(){
  var but2 = "<div class='bar'><div class='barLeft'><div class='barItem building'><h4>Building</h4></div></div><div class='barRight'><div class='barItem year'><h4>Year</h4></div><div class='barItem month'><h4>Month</h4></div><div class='barItem report'><h4>Report</h4></div></div></div>" ;
  $('.view-itemlist .sp-column .genericItemList').before(but2);
  $('.view-itemlist .sp-column .itemList').before(but2);

  var bool = $(".sppb-addon-video-local-source").prop("muted");
  $(".sppb-addon-video-local-source").prop("muted",!bool);
});


$(document).ready(function() {
  if (window.location.href.indexOf("zh-tw") > -1) {
    $("body.walk-for-green").addClass("zh");
  }
});



}}