///////////////////////////////////////////////////
document.createelement("header");
document.createelement("nav");
document.createelement("article");
document.createelement("footer");
document.createelement("time");
document.createelement("section");
///////////////////////////////////////////////////
var splitdatet = function (t, fmt) {
var t1 = t.split('t')[0];
var t2 = t.split('t')[1];
var t3 = t1.split('-');
var t4 = t2.split(':');
fmt = fmt.replace('yyyy', t3[0]);
fmt = fmt.replace('mm', t3[1]);
fmt = fmt.replace('dd', t3[2]);
fmt = fmt.replace('hh', t4[0]);
fmt = fmt.replace('mm', t4[1]);
fmt = fmt.replace('ss', t4[2]);
return fmt;
}
function eajax(url, data, fun) {
var _datatype = "post";
if (data.datatype && data.datatype == "get") {
return $.get(url, data, function (json, status) {
if (typeof (json) != "string") {
//console.log("success:", json);
if (fun) fun(json);
}
if (json) {
if (fun) fun(json);
}
});
} else {
return $.post(url, data, function (json, status) {
if (typeof (json) != "string") {
//console.log("success:", json);
if (fun) fun(json);
} else if (json) {
if (fun) fun(json);
}
});
}
}
$("")
.attr({ rel: "stylesheet",
type: "text/css",
href: "//at.alicdn.com/t/c/font_1450711_zfhip0izvbk.css"
})
.appendto("head");
/*--------------通用头部、底部--------------*/
$(function () {
$.ajax({ url: "/include/top.html?"+math.random(), success: function (x) { $('.headbox').html(x); } });
$.ajax({ url: "/include/foot.html?"+math.random(), success: function (x) { $('.footbox').html(x); } });
$.ajax({ url: "/include/mobile-menu.html?"+math.random(), success: function (x) { $('.menu-mobile').html(x); } });
//$.ajax({ url: "/include/product-nav.html?"+math.random(), async: false, success: function (x) { $('.product-nav').html(x); } });
});
/*--------------end--------------*/
$(function () {
if (/(ipad)/i.test(navigator.useragent)) {
$(".headbox.mo_undis").css("display","none");
$(".menu-mobile.mo_dis").css("display","block");
}
});
var fn;
function fontzsize(z){
var html = $(".nd-con");
fn = parseint($(".nd-con").css('font-size'));
fn = z ? fn + 2 : fn - 2;
html.find('*').css({"font-size":fn + "px","line-height":"1.7em"});
html.css({"font-size":fn + "px","line-height":"1.7em"});
}
/*--------------gototop--------------*/
$(document).scroll(function(){
var scrolltop = document.documentelement.scrolltop || window.pageyoffset || document.body.scrolltop;
if(scrolltop > 200){
$("#gototop").fadein();
}else{
$("#gototop").fadeout();
}
if(typeof(scrolltopfun)=="function"){
scrolltopfun(scrolltop);
}
})
function gotop(acceleration, time) {
acceleration = acceleration || 0.1;
time = time || 12;
var x1 = 0;
var y1 = 0;
var x2 = 0;
var y2 = 0;
var x3 = 0;
var y3 = 0;
if (document.documentelement) {
x1 = document.documentelement.scrollleft || 0;
y1 = document.documentelement.scrolltop || 0;
}
if (document.body) {
x2 = document.body.scrollleft || 0;
y2 = document.body.scrolltop || 0;
}
var x3 = window.scrollx || 0;
var y3 = window.scrolly || 0;
// 滚动条到页面顶部的水平距离
var x = math.max(x1, math.max(x2, x3));
// 滚动条到页面顶部的垂直距离
var y = math.max(y1, math.max(y2, y3));
// 滚动距离 = 目前距离 / 速度, 因为距离原来越小, 速度是大于 1 的数, 所以滚动距离会越来越小
var speed = 1 + acceleration;
window.scrollto(math.floor(x / speed), math.floor(y / speed));
// 如果距离不为零, 继续调用迭代本函数
if(x > 0 || y > 0) {
var invokefunction = "gotop(" + acceleration + ", " + time + ")";
window.settimeout(invokefunction, time);
}
}
///////////////////////////////////////////////////
// var nurlarrlist=["/news/index.html","/news/group.html","/news/business.html","/ir/notice.html","/join/index.html","/join/social.html","/join/campus.html"];
// var nurlarrlistt=["/","/","/","/","/","/","/"];
// var language = {
// geturlrelativepath: function () {
// var url = document.location.tostring();
// var arrurl = url.split("//")[1];
// var relurl = arrurl.split('/');
// var _relurl = "";
// for (var i = 1; i < relurl.length; i++) {
// _relurl += "/" + relurl[i];
// }
// for(var i=0;i-1){
// return nurlarrlistt[i];
// }
// }
// return _relurl.tolowercase();
// },
// set: function (elms, state) {
// var $this = this;
// elms.bind("click", function () {
// var u = $this.geturlrelativepath();
// u = u.replace("/en/", "");
// u = (state + "/" + u).replace("//", "/");//console.log(u);return;
// window.location = u;
// });
// }
// };
///////////////////////////////////////////////////