$(function () { var win = $(window), sLang = $('[http-equiv="content-language"]').attr('content') || 'zh-TW', bEn = sLang === 'en', mobile_menu = $("h4.openMenu"), mobile_submenu = $("ul#menu"), mobile_content = $("footer, header, article"), a_logo = $("#headerWrapper>header>h1>a"), h1_bg = $("#innerTitle.addBG"), menu = $("#left h4"), submenu = $("#left ul"), content = $("#right,h1"), rand_no = Math.floor((Math.random() * 3) + 1),//避免零 paths = window.location.pathname.split(/[\/]/), pname = paths[paths.length - 1].split('.')[0], open = function () { submenu.toggle(200); content.bind("click", close); menu.toggleClass("gray"); win.bind("scroll", close); }, close = function () { submenu.fadeOut(200); content.unbind("click"); menu.removeClass("gray"); win.unbind("scroll"); }, mobile_open = function () { mobile_submenu.toggle(200); mobile_content.bind("click", mobile_close); mobile_menu.toggleClass("changColor"); //win.bind("scroll",close); }, mobile_close = function () { mobile_submenu.fadeOut(200); mobile_content.unbind("click"); mobile_menu.removeClass("changColor"); //win.unbind("scroll"); }, /* * 目的 設置logo */ fnSetLogo = function (org) { g_api.ConnectLite(Service.apiappcom, ComFn.GetFileList, { ParentID: bEn ? org.WebsiteLgoId_EN : org.WebsiteLgoId }, function (res) { if (res.RESULT) { var saRes = res.DATA.rel; if (saRes.length > 0 && saRes[0].FilePath) { a_logo.attr('style', 'background-image: url(' + gServerUrl + '/' + saRes[0].FilePath.replace(/\\/g, "\/") + ');'); } } }); }, /* * 目的 設置菜單 */ fnSetMenu = function (org) { return $.whenArray([ fnGetWebSiteSetting(function (saRes) { var sHtml = $('