PageSourceSearch

http://xmfj.org/skin/system.js

js xmfj.org collected 2026-10-02 17:02:26 UTC 6,072 bytes, 202 lines download raw bytes

1
2
3$(document).ready(function () {
4
5    if ($('#objMenu1')) {
6        var m='';
7        m = m + "<div class='subitem2'><a href='web-fx.html'>佛协简介</a></div>";
8        m = m + "<div class='subitem1'><a href='web-sy.html'>寺院简介</a></div>";
9        m = m + "<div class='subitem2'><a href='web-cs.html'>慈善机构</a></div>";
10        m = m + "<div class='subitem1'><a href='web-view.html?id=16440'>许可证</a></div>";
11        $('#objMenu1').html(m);
12    }
13    if ($('#objMenu2')) {
14        var m = '';
15        m = m + "<div class='subitem2'><a href='web-xw.html'>新闻中心</a></div>";
16        m = m + "<div class='subitem1'><a href='web-list.html?cid=254'>政策法规</a></div>";
17        m = m + "<div class='subitem2'><a href='web-sp.html?cid=19'>佛教视频</a></div>";
18        m = m + "<div class='subitem1'><a href='web-list.html?cid=208'>新闻专题</a></div>";
19        $('#objMenu2').html(m);
20    }
21
22
23    $('#objsearch').bind('keypress', function (event) {
24
25        if (event.keyCode == 13) {
26
27            var s_word = $('#objsearch').val();
28            if (s_word + "#" == "#") {
29                Alert("请输入搜索关键词!");
30                return;
31            }
32            s_word = escape(s_word);
33            window.location.href = "web-search.html?k=" + s_word;
34        }
35
36    });
37
38
39    $('#objsearchbut').click(function () {
40        var s_word = $('#objsearch').val();
41        if (s_word + "#" == "#") {
42            Alert("请输入搜索关键词!");
43            return;
44        }
45        s_word = escape(s_word);
46        window.location.href = "web-search.html?k=" + s_word;
47    });
48
49
50    $('#objsearch').focus(function () {
51        var objkey = $('#objsearch').val();
52        if (objkey == '请输入搜索关键词') {
53            $('#objsearch').val('');
54        }
55    });
56
57
58
59    //返回上一页
60    $('.topbutleft').click(function () {
61        window.history.go(-1);
62        return false;
63    })
64
65    //返回首页
66    $('.topbutright').click(function () {
67        window.location.href = 'index.html?t=' + DateRandom();
68        return false;
69    })
70
71
72    //单击关闭
73    $('#objnavclose').on('click', function () {
74        $('#objnavbg').hide();
75        if (!$('.nav').hasClass('nav-mini')) {
76            $('.nav-item.nav-show').removeClass('nav-show');
77            $('.nav-item').children('ul').removeAttr('style');
78            $('.nav').addClass('nav-mini');
79            //$(document.body).css({ 'overflow-y': 'auto' });
80        } else {
81            $('.nav').removeClass('nav-mini');
82            ///$(document.body).css({ 'overflow-y': 'auto' });
83        }
84    });
85
86
87});
88
89
90//根据生日计算年龄jsGetAge('1980-09-25')
91function jsGetAge(strBirthday) {
92
93    if (strBirthday == '0') return;
94
95    var returnAge;
96    var strBirthdayArr = strBirthday.split('-');
97    var birthYear = strBirthdayArr[0];
98    var birthMonth = strBirthdayArr[1];
99    var birthDay = strBirthdayArr[2];
100
101    d = new Date();
102    var nowYear = d.getFullYear();
103    var nowMonth = d.getMonth() + 1;
104    var nowDay = d.getDate();
105
106    if (nowYear == birthYear) {
107        returnAge = 0;//同年 则为0岁
108    }
109    else {
110        var ageDiff = nowYear - birthYear; //年之差
111        if (ageDiff > 0) {
112            if (nowMonth == birthMonth) {
113                var dayDiff = nowDay - birthDay;//日之差
114                if (dayDiff < 0) {
115                    returnAge = ageDiff - 1;
116                }
117                else {
118                    returnAge = ageDiff;
119                }
120            }
121            else {
122                var monthDiff = nowMonth - birthMonth;//月之差
123                if (monthDiff < 0) {
124                    returnAge = ageDiff - 1;
125                }
126                else {
127                    returnAge = ageDiff;
128                }
129            }
130        }
131        else {
132            returnAge = -1;//返回-1 表示出生日期输入错误 晚于今天
133        }
134    }
135
136    return returnAge;//返回周岁年龄
137
138}
139
140function Alert(s_msg) {
141    Dialog.init(s_msg, { title: '厦门佛教在线微网站', button: { 关闭: function () { Dialog.close(this); } } });
142}
143
144function AlertTheGoTo(s_msg,s_url) {
145    Dialog.init(s_msg, { title: '厦门佛教在线微网站', button: { 关闭: function () { window.location.href = s_url; } } });
146}
147
148//判断是否手机访问网站
149function CheckBrowserRedirect() {
150    var sUserAgent = navigator.userAgent.toLowerCase();
151    var bIsIpad = sUserAgent.match(/ipad/i) == 'ipad';
152    var bIsIphoneOs = sUserAgent.match(/iphone os/i) == 'iphone os';
153    var bIsMidp = sUserAgent.match(/midp/i) == 'midp';
154    var bIsUc7 = sUserAgent.match(/rv:1.2.3.4/i) == 'rv:1.2.3.4';
155    var bIsUc = sUserAgent.match(/ucweb/i) == 'ucweb';
156    var bIsAndroid = sUserAgent.match(/android/i) == 'android';
157    var bIsCE = sUserAgent.match(/windows ce/i) == 'windows ce';
158    var bIsWM = sUserAgent.match(/windows mobile/i) == 'windows mobile';
159    if (bIsIpad || bIsIphoneOs || bIsMidp || bIsUc7 || bIsUc || bIsAndroid || bIsCE || bIsWM) {
160        return 1;
161    } else {
162        return 0
163    }
164}
165
166//跳转
167function GoUrl() {
168    window.location.href = '?t=' + DateRandom();
169}
170
171//生成时间随机字符串
172function DateRandom() {
173    var sTmpDate = new Date();
174    return sTmpDate.getTime();
175}
176
177//获取参数
178function getQueryString(name) {
179    var reg = new RegExp('(^|&)' + name + '=([^&]*)(&|$)', 'i');
180    var r = window.location.search.substr(1).match(reg);
181    if (r != null) return unescape(r[2]);
182    return null;
183}
184
185// true:数值型的,false:非数值型
186function isNum(val) {
187    if (val === "" || val == null) {
188        return false;
189    }
190    if (!isNaN(val)) {
191        //长度验证
192        var s = String(val);
193        if (s.length > 7) {
194            return false;
195        } else {
196            return true;
197        }
198    }
199    else {
200        return false;
201    }
202}

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.