//getquerystring方法 function getquerystring(name) { var reg = new regexp("(^|&)" + name + "=([^&]*)(&|$)","i"); var r = window.location.search.substr(1).match(reg); if (r!=null) return (r[2]); return null; } //收藏 function addfavorite(surl, stitle) { try { window.external.addfavorite(surl, stitle) } catch (e) { try { window.sidebar.addpanel(stitle, surl, "") } catch (e) { alert("加入收藏失败,请使用ctrl+d进行添加") } } } // 设置为主页 function sethome(obj, vrl) { try { obj.style.behavior = 'url(#default#homepage)'; obj.sethomepage(vrl); } catch (e) { if (window.netscape) { try { netscape.security.privilegemanager.enableprivilege("universalxpconnect"); } catch (e) { alert("此操作被浏览器拒绝!\n请在浏览器地址栏输入“about:config”并回车\n然后将 [signed.applets.codebase_principal_support]的值设置为'true',双击即可。"); } var prefs = components.classes['@mozilla.org/preferences-service;1'].getservice(components.interfaces.nsiprefbranch); prefs.setcharpref('browser.startup.homepage', vrl); } else { alert("您的浏览器不支持,请按照下面步骤操作:1.打开浏览器设置。2.点击设置网页。3.输入:" + vrl + "点击确定。"); } } } //返回顶部 $(function() { $.fn.manhuatotop = function(options) { var defaults = { showheight: 150, speed: 1000 }; var options = $.extend(defaults, options); $("#totop").prepend(""); var $totop = $(this); var $top = $("#totop"); var $ta = $("#totop a"); $totop.scroll(function() { var scrolltop = $(this).scrolltop(); if(scrolltop >= options.showheight) { $top.show(); }else { $top.hide(); } }); $ta.hover(function() { $(this).addclass("cur"); }, function() { $(this).removeclass("cur"); }); $top.click(function() { $("html,body").animate({ scrolltop: 0 }, options.speed); }); } }); //返回顶部 function getbacktop(){ $('body,html').animate({scrolltop: 0},1000); } $(function() { $(window).manhuatotop({ showheight: 100, //设置滚动高度时显示 speed: 500 //返回顶部的速度以毫秒为单位 }); }); //微信 function alertwx(){ var imgs = "/material/zwwx.jpg"; layer.open({ type: 1, area: ['400px', '403px'], title: false, //不显示标题 shadeclose: true, content: '' }); } //微博 function alertwb(){ var imgs = "/material/zwwb.jpg"; layer.open({ type: 1, area: ['400px', '403px'], title: false, //不显示标题 shadeclose: true, content: '' }); } //外链跳转提示 //$(function () { // for (var i = 0; i < document.links.length; i++) { // var url = document.links[i].href.tolowercase(); // if (url.indexof("http://localhost") == -1 && url.indexof("2020.gzqz.gov.cn") == -1 && url.indexof("www.gzqz.gov.cn") == -1&& url.indexof("http://58.16.66.204:147/")== -1 && url.indexof("qzszf.bohoog.com") == -1 && url.indexof("javascript:") == -1 && url != "#" && !document.links[i].onclick) { // document.links[i].onclick = function () { // return confirm("您即将访问其他站点,是否继续?") // }; // } // } //}); //全站检索 function refocus6() { var getquery = document.getelementbyid("keyword"); getquery.value = ""; getquery.autocomplete = "off"; getquery.focus(); } function reblur6() { var getquery = document.getelementbyid("keyword"); if (getquery.value == "") { getquery.value = "请输入搜索关键字"; } } string.prototype.trim = function () { return this.replace(/(^\s*)|(\s*$)/g, ""); } function sub6() { //必需,先将文本转换为utf-8 document.charset = "utf-8"; var fixvalue = document.getelementbyid("keyword").value; fixvalue = fixvalue.replace(/\~|\!|\*|\?|\^|\\|\(|\)|\[|\]|\+|\-|\:|\{|\}|\"/g, ""); if (fixvalue.trim() == "") { document.getelementbyid("keyword").value = ""; alert("关键字不能为空!"); return false; } else { window.open('/search.html?siteid=806&keyword=' + encodeuri(fixvalue)); } return false; } function sub7() { //必需,先将文本转换为utf-8 document.charset = "utf-8"; var fixvalue = document.getelementbyid("keyword").value; fixvalue = fixvalue.replace(/\~|\!|\*|\?|\^|\\|\(|\)|\[|\]|\+|\-|\:|\{|\}|\"/g, ""); if (fixvalue.trim() == "") { document.getelementbyid("keyword").value = ""; alert("关键字不能为空!"); return false; } else { window.open('/search.html?siteid=567&keyword=' + encodeuri(fixvalue)); } return false; } //回车提交方法 function entersub6() { var len = arguments.length; var event; if (len == 1) { event = arguments[0]; } var evt = event ? event : (window.event ? window.event : null); if (evt.keycode == 13) { //必需,先将文本转换为utf-8 document.charset = "utf-8"; var fixvalue = document.getelementbyid("keyword").value; fixvalue = fixvalue.replace(/\~|\!|\*|\?|\^|\\|\(|\)|\[|\]|\+|\-|\:|\{|\}|\"/g, ""); if (fixvalue.trim() == "") { document.getelementbyid("keyword").value = ""; alert("关键字不能为空!"); return false; } else { window.open('/search.html?siteid=806&keyword=' + encodeuri(fixvalue)); } return false; } } /*顶部日历*/ //var sweek = new array("星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六"); var sweek = new array("日", "一", "二", "三", "四", "五", "六"); var dnow = new date(); var calendardata = new array(100); var madd = new array(12); var tgstring = "甲乙丙丁戊己庚辛壬癸"; var dzstring = "子丑寅卯辰巳午未申酉戌亥"; var numstring = "一二三四五六七八九十"; var monstring = "正二三四五六七八九十冬腊"; var weekstring = "日一二三四五六"; var sx = "鼠牛虎兔龙蛇马羊猴鸡狗猪"; var cyear, cmonth, cday, thedate; calendardata = new array(0xa4b, 0x5164b, 0x6a5, 0x6d4, 0x415b5, 0x2b6, 0x957, 0x2092f, 0x497, 0x60c96, 0xd4a, 0xea5, 0x50da9, 0x5ad, 0x2b6, 0x3126e, 0x92e, 0x7192d, 0xc95, 0xd4a, 0x61b4a, 0xb55, 0x56a, 0x4155b, 0x25d, 0x92d, 0x2192b, 0xa95, 0x71695, 0x6ca, 0xb55, 0x50ab5, 0x4da, 0xa5b, 0x30a57, 0x52b, 0x8152a, 0xe95, 0x6aa, 0x615aa, 0xab5, 0x4b6, 0x414ae, 0xa57, 0x526, 0x31d26, 0xd95, 0x70b55, 0x56a, 0x96d, 0x5095d, 0x4ad, 0xa4d, 0x41a4d, 0xd25, 0x81aa5, 0xb54, 0xb6a, 0x612da, 0x95b, 0x49b, 0x41497, 0xa4b, 0xa164b, 0x6a5, 0x6d4, 0x615b4, 0xab6, 0x957, 0x5092f, 0x497, 0x64b, 0x30d4a, 0xea5, 0x80d65, 0x5ac, 0xab6, 0x5126d, 0x92e, 0xc96, 0x41a95, 0xd4a, 0xda5, 0x20b55, 0x56a, 0x7155b, 0x25d, 0x92d, 0x5192b, 0xa95, 0xb4a, 0x416aa, 0xad5, 0x90ab5, 0x4ba, 0xa5b, 0x60a57, 0x52b, 0xa93, 0x40e95); madd[0] = 0; madd[1] = 31; madd[2] = 59; madd[3] = 90; madd[4] = 120; madd[5] = 151; madd[6] = 181; madd[7] = 212; madd[8] = 243; madd[9] = 273; madd[10] = 304; madd[11] = 334; function getbit(m, n) { return (m >> n) & 1; } function e2c() { thedate = (arguments.length != 3) ? new date() : new date(arguments[0], arguments[1], arguments[2]); var total, m, n, k; var isend = false; var tmp = thedate.getfullyear(); total = (tmp - 1921) * 365 + math.floor((tmp - 1921) / 4) + madd[thedate.getmonth()] + thedate.getdate() - 38; if (thedate.getyear() % 4 == 0 && thedate.getmonth() > 1) { total++; } for (m = 0;; m++) { k = (calendardata[m] < 0xfff) ? 11 : 12; for (n = k; n >= 0; n--) { if (total <= 29 + getbit(calendardata[m], n)) { isend = true; break; } total = total - 29 - getbit(calendardata[m], n); } if (isend) break; } cyear = 1921 + m; cmonth = k - n + 1; cday = total; if (k == 12) { if (cmonth == math.floor(calendardata[m] / 0x10000) + 1) { cmonth = 1 - cmonth; } if (cmonth > math.floor(calendardata[m] / 0x10000) + 1) { cmonth--; } } } function getcdatestring() { var tmp = ""; tmp += tgstring.charat((cyear - 4) % 10); tmp += dzstring.charat((cyear - 4) % 12); tmp += "年 "; if (cmonth < 1) { tmp += "(闰)"; tmp += monstring.charat(-cmonth - 1); } else { tmp += monstring.charat(cmonth - 1); } tmp += "月"; tmp += (cday < 11) ? "初" : ((cday < 20) ? "十" : ((cday < 30) ? "廿" : "三十")); if (cday % 10 != 0 || cday == 10) { tmp += numstring.charat((cday - 1) % 10); } return tmp; } function getlunarday(solaryear, solarmonth, solarday) { if (solaryear < 1921 || solaryear > 2020) { return ""; } else { solarmonth = (parseint(solarmonth) > 0) ? (solarmonth - 1) : 11; e2c(solaryear, solarmonth, solarday); return getcdatestring(); } } var d = new date(); var yy = d.getfullyear(); var mm = d.getmonth() + 1; var dd = d.getdate(); var ww = d.getday(); var ss = parseint(d.gettime() / 1000); function getfullyear(d) { // 修正firefox下year错误 yr = d.getyear(); if (yr < 1000) yr += 1900; return yr; } function getnewnowtimes(){ //var initializationtime=(new date()).gettime(); window.onload=function showtime(){ var today = new date(); var hour = today.gethours(); var minutes = today.getminutes(); var seconds = today.getseconds(); var nowtimes = ''; /*时*/ nowtimes+=hour; /*分*/ if(minutes<10){ nowtimes+=":0"+minutes }else{ nowtimes+=":"+minutes } /*秒*/ if(seconds<10){ nowtimes+=":0"+seconds }else{ nowtimes+=":"+seconds } //document.getelementbyid("nowtimes").innerhtml = nowtimes; settimeout(showtime,1000); } } function showdate() { var svalue = "今天是:"+getfullyear(dnow)+"年"+(dnow.getmonth() + 1)+"月"+dnow.getdate() +"日"+" "+"星期"+sweek[ww]; //var svalue ="今天是:" + getfullyear(dnow) + "年" + (dnow.getmonth() + 1) + "月" + dnow.getdate() + "日" + " " + " " +getlunarday(yy, mm, dd); document.getelementbyid("times").innerhtml = svalue; getnewnowtimes(); }; /*顶部日历结束*/