JN江南体育
window.__start = +new Date();
var userKey;
//元素是否含有某样式
function hasClass(element,className){
return !!element.className.match(new RegExp('(\\s|^)'+className+'(\\s|$)'));
}
//向元素添加新样式
function addClass(element,className){
if(hasClass(element,className) == false){
element.className += ' '+className;
}
}
//移除元素的指定样式
function removeClass(element,className){
var currentClass = element.className;
if(hasClass(element,className)){
currentClass = currentClass.replace(new RegExp('(\\s|^)'+className+'(\\s|$)'),' ');
//去除空格
currentClass = currentClass.replace(/(^\s*)|(\s*$)/g,'');
element.className = currentClass;
}
}
function toggleClass(element,className){
if(hasClass(element,className)){
removeClass(element,className);
}else{
addClass(element,className);
}
}
(function(){
var attrSplit = ';';
var keySplit = ':';
var utildecode = {
listAna : function(str) {
if (typeof str !== 'string' || !str) {
return;
}
var arr = str.split(attrSplit);
var obj = {};
var attr;
for (var i = 0, l = arr.length; i < l; i++) {
attr = arr[i].split(keySplit);
obj[attr[0]] = attr[1];
}
return obj;
},
decodeUrlParams: function(str) {
if (str.trim() === '') {
return {};
}
var parts = str.split('&');
var paramObj = {};
for (var i = 0, l = parts.length; i < l; i++) {
var keyValueAr = parts[i].split('=');
paramObj[keyValueAr[0]] = decodeURIComponent(keyValueAr[1] || '');
}
return paramObj;
}
};
try {
var params = utildecode.decodeUrlParams(locations.search.slice(1));
var markerObj = utildecode.listAna(params.marker);
document.title = markerObj.title || '腾讯地图';
} catch(e) {
document.title = '腾讯地图';
}
})();
function filterXSS(e) {
if (!e) return e;
for (; e != unescape(e);) e = unescape(e);
for (var r = ["<", ">", "'", '"', "%3c", "%3e", "%27", "%22", "%253c", "%253e", "%2527", "%2522", "javascript", "java", "script", "\\balert\\s*\\\(.*?\\\)", "\\bconfirm\\s*\\\(.*?\\\)", "\\bprompt\\s*\\\(.*?\\\)", "\\bjavascript\\b", "\\bjavascript\\b", "\\bjavascript\\b", "document\\.write", "\\bevals\\b", "\\batob\\b"],
n = ["<", ">", "'", """, "%26%23x3c%3B", "%26%23x3e%3B", "%26%23x27%3B", "%26%23x22%3B", "%2526%2523x3c%253B", "%2526%2523x3e%253B", "%2526%2523x27%253B", "%2526%2523x22%253B", "", "", "", "", "", "", "", "", "", "", "", ""],
a = 0;
a < r.length; a++) {
e = e.replace(new RegExp(r[a], "gi"), n[a]);
}
return e;
};
(function() { //获取key
var query = locations.search.slice(1),
defaultkey = 'VFUBZ-JIR3D-Z2M4H-PPAGG-G5KVQ-S3F2S',
key = defaultkey;
if(query.trim() === '') {
userKey = defaultkey;
return;
}
var splitArr = query.split('&');
for (var i = 0, l = splitArr.length; i < l; i++) {
var keyValueAr = splitArr[i].split('=');
if(keyValueAr[0] == 'key') {
key = keyValueAr[1] || defaultkey;
}
}
key = filterXSS(key) || defaultkey;
userKey = key;
})()JN江南体育