// Check if users click highlight box from homepage


// Switch language

function returnFilename() {
        var file_name = document.location.href;
        var end = (file_name.indexOf("?") == -1) ? file_name.length : file_name.indexOf("?");
        return file_name.substring(file_name.lastIndexOf("/")+1, end);
    }

 
 function switch_lang(lang) {
 
  var page_name = returnFilename();
  var trad_chinese_page = "http://" + location.host + "/zh-hk/" + page_name;
  var simp_chinese_page = "http://" + location.host + "/zh-cn/" + page_name;
  var english_page = "http://" + location.host + "/" + page_name;
//    var trad_chinese_page = "http://" + location.host + "/test2/zh-hk/" + page_name;
//    var simp_chinese_page = "http://" + location.host + "/test2/zh-cn/" + page_name;
//    var english_page = "http://" + location.host + "/test2/" + page_name;

  if( lang == "zh-hk" ) {
       // Comment the line out below
       window.location = trad_chinese_page;
       // Insert the function that loads the results page below

     }
  else if( lang == "zh-cn" ) {
       // Comment the line out below
       window.location = simp_chinese_page;
       // Insert the function that loads the results page below

     }
   else if( lang == "english" ) {
       // Comment the line out below
       window.location = english_page;
       // Insert the function that loads the results page below

     }
  }
	
// 

