//统计访问IP
document.write("");
var IPUpdate = /^(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])$/;
function IPCount(){
var IP = returnCitySN.cip;
IP = IP.split(" ").join("");
if(IPUpdate.test(IP)){
$.ajax({
url: '/handlers/cistcIPCount.ashx',
type: 'POST',
dataType: 'json',
data: "IP="+IP,
success: function(){
},
error: function(){
}
})
}else {
return;
}
}
// 根据栏目ID获取子栏目内容
function getTopMenuList(menuid, insertPanelID) {
// 首先验证其是否为空,然后验证其是否为数字
if (!isInteger(menuid)) {
return;
}
$.getJSON('handlers/cistcMenu.ashx', { 'menuid': menuid }, function (pageData) {
var RMenus = pageData.menus;
var Uptd;
if (insertPanelID == "")
Uptd = document.getElementById("topMenu");
else
Uptd = document.getElementById(insertPanelID);
var innerHtml = "";
var columnid = parseInt(GetQueryString("column"));
if (menuid == 247) {
for (var i = 0; i < RMenus.length; i++) {
// 创建li及其样式
var li = document.createElement("li");
var indiv = document.createElement("div");
li.setAttribute("class", "uk-grid-margin uk-width-1-2 uk-width-large-1-3 uk-width-medium-1-2 uk-width-small-1-2");
indiv.setAttribute("class", "uk-panel uk-panel-cistc-ziliao-box");
indiv.innerHTML = "" + RMenus[i].MenuName + "";
li.appendChild(indiv);
if (Uptd != null)
Uptd.appendChild(li);
}
}
else {
for (var i = 0; i < RMenus.length; i++) {
// 创建li及其样式
var li = document.createElement("li");
if (RMenus[i].MenuId == "" || RMenus[i].MenuId == columnid) {
li.setAttribute("class", "uk-open");
}
else {
li.setAttribute("class", "uk-active");
}
li.innerHTML = "" + RMenus[i].MenuName + "";
if (Uptd != null)
Uptd.appendChild(li);
}
}
// Uptd.appendChild(li);
IPCount();
});
}
function getTopMenuListMap(menuid, insertPanelID) {
// 首先验证其是否为空,然后验证其是否为数字
if (!isInteger(menuid)) {
return;
}
$.getJSON('handlers/cistcMenu.ashx', { 'menuid': menuid }, function (pageData) {
var RMenus = pageData.menus;
var Uptd = document.getElementById(insertPanelID);
for (var i = 0; i < RMenus.length; i++) {
// 创建li及其样式
var li = document.createElement("li");
li.setAttribute("class", "uk-width-medium-1-2 uk-width-large-1-4")
li.innerHTML = "" + RMenus[i].MenuName + "";
if (Uptd != null)
Uptd.appendChild(li);
}
});
}
function getTopMenuListMaps(menuid, insertPanelID) {
// 首先验证其是否为空,然后验证其是否为数字
if (!isInteger(menuid)) {
return;
}
$.getJSON('handlers/cistcMenu.ashx', { 'menuid': menuid }, function (pageData) {
var RMenus = pageData.menus;
var Uptd = document.getElementById(insertPanelID);
for (var i = 0; i < RMenus.length; i++) {
// 创建li及其样式
var li = document.createElement("li");
li.setAttribute("class", "uk-width-medium-1-3 uk-width-small-1-2 uk-width-large-1-4 uk-cistc-map-list")
li.innerHTML = "" + RMenus[i].MenuName + "";
if (Uptd != null)
Uptd.appendChild(li);
}
});
}
// 根据栏目ID获取二级栏目名称、地址
function getSecondMenuName(menuid, insertPanelID) {
// 首先验证其是否为空,然后验证其是否为数字
if ( !isInteger(menuid)) {
return;
}
$.getJSON('handlers/cistcMenuName.ashx', { 'menuid': menuid }, function (pageData) {
var RMenus = pageData.menus;
var Uptd = document.getElementById("topMenu");
var innerHtml = "";
var menuid = GetQueryString("column");
if (insertPanelID == "")
Uptd = document.getElementById("topMenu")
else
Uptd = document.getElementById(insertPanelID);
for (var i = 0; i < RMenus.length; i++) {
// 创建li及其样式
var li = document.createElement("li");
if (RMenus[i].MenuId == "" || RMenus[i].MenuId == menuid) {
li.setAttribute("class", "uk-open");
}
else {
li.setAttribute("class", "uk-active");
}
li.innerHTML = "" + RMenus[i].MenuName + "";
if (Uptd != null)
Uptd.appendChild(li);
}
// Uptd.appendChild(li);
});
}
// 根据栏目ID获取子栏目内容
function getTabMenuList(menuid, insertPanelID) {
// 首先验证其是否为空,然后验证其是否为数字
if (!isInteger(menuid)) {
return;
}
$.getJSON('handlers/cistcMenu.ashx', { 'menuid': menuid }, function (pageData) {
var RMenus = pageData.menus;
var Uptd;
var innerHtml = "";
var menuid = GetQueryString("column");
if (insertPanelID == "")
Uptd = document.getElementById("topMenu")
else
Uptd = document.getElementById(insertPanelID);
for (var i = 0; i < RMenus.length; i++) {
// 创建li及其样式
var li = document.createElement("li");
if (i == 0) {
li.setAttribute("class", "uk-active");
}
var clickFun = "ShowMenuInfoByID(205,10,'InfoList0','大事记'," + RMenus[i].MenuName.replace("年", "") + ");"
li.setAttribute("onclick", clickFun);
// li.innerHTML = "";
li.innerHTML = "" + RMenus[i].MenuName + "";
Uptd.appendChild(li);
}
// Uptd.appendChild(li);
});
}
// 获取子栏目并填充
function getInfoMenu(menuid) {
// 首先验证其是否为空,然后验证其是否为数字
if (!isInteger(menuid))
return;
$.getJSON('handlers/cistcMenu.ashx', { 'menuid': menuid }, function (pageData) {
var RMenus = pageData.menus;
for (var i = 0; i < RMenus.length; i++) {
// 创建li及其样式
var Uptd = document.getElementById("column" + RMenus[i].MenuId);
if (Uptd != null) {
var ParentDiv = document.getElementById("div" + RMenus[i].MenuId);
if (ParentDiv != null)
ParentDiv.setAttribute("style", "display:block;");
var href = document.createElement("a");
href.setAttribute("href", RMenus[i].MenuUrl);
href.setAttribute("class", "uk-cistc-panel-title");
href.innerHTML = RMenus[i].MenuName;
Uptd.appendChild(href);
}
}
});
}
// 获取"专题专栏"栏目标题、链接、图片
function getSubjectMenuList(topn, typeid, insertPanelID) {
// 首先验证其是否为空,然后验证其是否为数字
if (!isInteger(topn))
return;
if (!isInteger(typeid))
return;
if (typeid != 0) {
return;
}
$.getJSON('handlers/cistcSubjectList.ashx', { 'n': topn, 'typeid': typeid }, function (pageData) {
var RMenus = pageData.menus;
var Uptd;
if (insertPanelID != "")
Uptd = document.getElementById(insertPanelID);
if (Uptd == null)
return;
for (var i = 0; i < RMenus.length; i++) {
// 创建li及其样式
var panelDiv = document.createElement("div");
panelDiv.setAttribute("class", "uk-width-large-1-5 uk-width-medium-1-4 uk-width-small-1-3");
var imgDiv = document.createElement("div");
imgDiv.setAttribute("class", "uk-panel uk-text-center uk-margin-bottom");
{
// 创建a及其样式
var a = document.createElement("a");
a.setAttribute("class", "uk-thumbnail");
a.setAttribute("href", RMenus[i].MenuUrl);
a.setAttribute("target", "_blank");
var img = document.createElement("img");
img.setAttribute("src", RMenus[i].IconCls);
//img.setAttribute("style", "max-height:138px; max-width:79px");
img.setAttribute("class", " uk-responsive-width");
img.setAttribute("width", "138px");
img.setAttribute("height", "79px");
a.appendChild(img);
var div = document.createElement("div");
div.setAttribute("class", "uk-thumbnail-caption");
div.innerHTML = RMenus[i].MenuName;
a.appendChild(div);
imgDiv.appendChild(a);
}
panelDiv.appendChild(imgDiv);
// panelDiv.innerHTML = "" + RMenus[i].MenuName + "";
Uptd.appendChild(panelDiv);
}
});
}
// 获取指定栏目ID信息
function getMenuById(menuid, insertPanelID) {
// 首先验证其是否为空,然后验证其是否为数字
if (!isInteger(menuid))
return;
$.getJSON('handlers/cistcMenuName.ashx', { 'menuid': menuid }, function (pageData) {
var RMenuList = pageData.menus;
var Uptd = document.getElementById(insertPanelID);
for (var i = 0; i < RMenuList.length; i++) {
// 创建li及其样式
var li = document.createElement("li");
// li.setAttribute("class", "");
li.innerHTML = "" + RMenuList[i].MenuName + "";
if (Uptd != null)
Uptd.appendChild(li);
}
});
}
// 获取url中的参数值
function GetQueryString(name) {
var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
var r = window.location.search.substr(1).match(reg);
if (r != null) return unescape(r[2]); return null;
}
// 获取url中已经被转义成url编码的汉字字符串的参数值
function GetQueryStringunescape(name) {
var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
var r = window.location.search.substr(1).match(reg);
if (r != null) return r[2]; return null;
}
// 判断输入是否为整数
function isInteger(obj) {
return typeof obj === 'number' && obj % 1 === 0
}
// 判断输入是否为正整数
function isABSInteger(obj) {
return Math.floor(obj) === obj
}