(function () {
var ie = !!(window.attachEvent && !window.opera);
var wk = /webkit\/(\d+)/i.test(navigator.userAgent) && (RegExp.$1 < 525);
var fn = [];
var run = function () { for (var i = 0; i < fn.length; i++) fn[i](); };
var d = document;
d.ready = function (f) {
if (!ie && !wk && d.addEventListener)
return d.addEventListener('DOMContentLoaded', f, false);
if (fn.push(f) > 1) return;
if (ie)
(function () {
try { d.documentElement.doScroll('left'); run(); }
catch (err) { setTimeout(arguments.callee, 0); }
})();
else if (wk)
var t = setInterval(function () {
if (/^(loaded|complete)$/.test(d.readyState))
clearInterval(t), run();
}, 0);
}
})();
var Lmn = {
'web': {
'path': '/',
'name': '新葡的京集团350vip8888免会员版',
'template': '/template/default/',
'from': ''
},
'temp': [],
'mousewheel': function(){
var framerate = 150;
var animtime = 800;
var stepsize = 80;
var pulseAlgorithm = true;
var pulseScale = 8;
var pulseNormalize = 1;
var acceleration = true;
var accelDelta = 10;
var accelMax = 1;
var keyboardsupport = true;
var disableKeyboard = false;
var arrowscroll = 50;
var exclude = "";
var disabled = false;
var frame = false;
var direction = {
x: 0,
y: 0
};
var initdone = false;
var fixedback = true;
var root = document.documentElement;
var activeElement;
var key = {
left: 37,
up: 38,
right: 39,
down: 40,
spacebar: 32,
pageup: 33,
pagedown: 34,
end: 35,
home: 36
};
function init() {
if (!document.body) return;
var body = document.body;
var html = document.documentElement;
var windowHeight = window.innerHeight;
var scrollHeight = body.scrollHeight;
root = (document.compatMode.indexOf('CSS') >= 0) ? html : body;
activeElement = body;
initdone = true;
if (top != self) {
frame = true;
}
else if (scrollHeight > windowHeight && (body.offsetHeight <= windowHeight || html.offsetHeight <= windowHeight)) {
var pending = false;
var refresh = function() {
if (!pending && html.scrollHeight != document.height) {
pending = true;
setTimeout(function() {
html.style.height = document.height + 'px';
pending = false;
}, 500);
}
};
html.style.height = '';
setTimeout(refresh, 10);
addEvent("DOMNodeInserted", refresh);
addEvent("DOMNodeRemoved", refresh);
if (root.offsetHeight <= windowHeight) {
var underlay = document.createElement("div");
underlay.style.clear = "both";
body.appendChild(underlay);
}
}
if (document.URL.indexOf("mail.google.com") > -1) {
var s = document.createElement("style");
s.innerHTML = ".iu { visibility: hidden }";
(document.getElementsByTagName("head")[0] || html).appendChild(s);
}
if (!fixedback && !disabled) {
body.style.backgroundAttachment = "scroll";
html.style.backgroundAttachment = "scroll";
}
}
var que = [];
var pending = false;
var lastScroll = +new Date;
function scrollArray(elem, left, top, delay) {
delay || (delay = 1000);
directionCheck(left, top);
if (acceleration) {
var now = +new Date;
var elapsed = now - lastScroll;
if (elapsed < accelDelta) {
var factor = (1 + (30 / elapsed)) / 2;
if (factor > 1) {
factor = Math.min(factor, accelMax);
left *= factor;
top *= factor;
}
}
lastScroll = +new Date;
}
que.push({
x: left,
y: top,
lastX: (left < 0) ? 0.99 : -0.99,
lastY: (top < 0) ? 0.99 : -0.99,
start: +new Date
});
if (pending) {
return;
}
var scrollWindow = (elem === document.body);
var step = function() {
var now = +new Date;
var scrollX = 0;
var scrollY = 0;
for (var i = 0; i < que.length; i++) {
var item = que[i];
var elapsed = now - item.start;
var finished = (elapsed >= animtime);
var position = (finished) ? 1 : elapsed / animtime;
if (pulseAlgorithm) {
position = pulse(position);
}
var x = (item.x * position - item.lastX) >> 0;
var y = (item.y * position - item.lastY) >> 0;
scrollX += x;
scrollY += y;
item.lastX += x;
item.lastY += y;
if (finished) {
que.splice(i, 1);
i--;
}
}
if (scrollWindow) {
window.scrollBy(scrollX, scrollY)
} else {
if (scrollX) elem.scrollLeft += scrollX;
if (scrollY) elem.scrollTop += scrollY;
}
if (!left && !top) {
que = [];
}
if (que.length) {
requestFrame(step, elem, (delay / framerate + 1));
} else {
pending = false;
}
}
requestFrame(step, elem, 0);
pending = true;
}
function wheel(event) {
if (!initdone) {
init();
}
var target = event.target;
var overflowing = overflowingAncestor(target);
if (!overflowing || event.defaultPrevented || isNodeName(activeElement, "embed") || (isNodeName(target, "embed") && /\.pdf/i.test(target.src))) {
return true;
}
var deltaX = event.wheelDeltaX || 0;
var deltaY = event.wheelDeltaY || 0;
if (!deltaX && !deltaY) {
deltaY = event.wheelDelta || 0;
}
if (Math.abs(deltaX) > 1.2) {
deltaX *= stepsize / 120;
}
if (Math.abs(deltaY) > 1.2) {
deltaY *= stepsize / 120;
}
scrollArray(overflowing, -deltaX, -deltaY);
// event.preventDefault();
}
function keydown(event) {
var target = event.target;
var modifier = event.ctrlKey || event.altKey || event.metaKey || (event.shiftKey && event.keyCode !== key.spacebar);
if (/input|textarea|select|embed/i.test(target.nodeName) || target.isContentEditable || event.defaultPrevented || modifier) {
return true;
}
if (isNodeName(target, "button") && event.keyCode === key.spacebar) {
return true;
}
var shift, x = 0,
y = 0;
var elem = overflowingAncestor(activeElement);
var clientHeight = elem.clientHeight;
if (elem == document.body) {
clientHeight = window.innerHeight;
}
switch (event.keyCode) {
case key.up:
y = -arrowscroll;
break;
case key.down:
y = arrowscroll;
break;
case key.spacebar:
shift = event.shiftKey ? 1 : -1;
y = -shift * clientHeight * 0.9;
break;
case key.pageup:
y = -clientHeight * 0.9;
break;
case key.pagedown:
y = clientHeight * 0.9;
break;
case key.home:
y = -elem.scrollTop;
break;
case key.end:
var damt = elem.scrollHeight - elem.scrollTop - clientHeight;
y = (damt > 0) ? damt + 10 : 0;
break;
case key.left:
x = -arrowscroll;
break;
case key.right:
x = arrowscroll;
break;
default:
return true;
}
scrollArray(elem, x, y);
event.preventDefault();
}
var cache = {};
setInterval(function() {
cache = {};
}, 10 * 1000);
var uniqueID = (function() {
var i = 0;
return function(el) {
return el.uniqueID || (el.uniqueID = i++);
};
})();
function setCache(elems, overflowing) {
for (var i = elems.length; i--;) cache[uniqueID(elems[i])] = overflowing;
return overflowing;
}
function overflowingAncestor(el) {
var elems = [];
var rootScrollHeight = root.scrollHeight;
do {
var cached = cache[uniqueID(el)];
if (cached) {
return setCache(elems, cached);
}
elems.push(el);
if (rootScrollHeight === el.scrollHeight) {
if (!frame || root.clientHeight + 10 < rootScrollHeight) {
return setCache(elems, document.body);
}
} else if (el.clientHeight + 10 < el.scrollHeight) {
overflow = getComputedStyle(el, "").getPropertyValue("overflow-y");
if (overflow === "scroll" || overflow === "auto") {
return setCache(elems, el);
}
}
} while (el = el.parentNode);
}
function addEvent(type, fn, bubble) {
window.addEventListener(type, fn, (bubble || false));
}
function removeEvent(type, fn, bubble) {
window.removeEventListener(type, fn, (bubble || false));
}
function isNodeName(el, tag) {
return (el.nodeName || "").toLowerCase() === tag.toLowerCase();
}
function directionCheck(x, y) {
x = (x > 0) ? 1 : -1;
y = (y > 0) ? 1 : -1;
if (direction.x !== x || direction.y !== y) {
direction.x = x;
direction.y = y;
que = [];
lastScroll = 0;
}
}
var requestFrame = (function() {
return window.requestAnimationFrame || window.webkitRequestAnimationFrame || function(callback, element, delay) {
window.setTimeout(callback, delay || (1000 / 60));
};
})();
function pulse_(x) {
var val, start, expx;
x = x * pulseScale;
if (x < 1) {
val = x - (1 - Math.exp(-x));
} else {
start = Math.exp(-1);
x -= 1;
expx = 1 - Math.exp(-x);
val = start + (expx * (1 - start));
}
return val * pulseNormalize;
}
function pulse(x) {
if (x >= 1) return 1;
if (x <= 0) return 0;
if (pulseNormalize == 1) {
pulseNormalize /= pulse_(1);
}
return pulse_(x);
}
addEvent("mousewheel", wheel);
},
'empty': function(){
layer.msg('这个页面正在制作中');
},
'ewm': function(img, str){
layer.open({
type: 1,
title: false,
skin: 'layui-layer-demo',
closeBtn: 0,
anim: 2,
shadeClose: true,
content: '
'+str+'
'
});
},
'geturl': function(url){
url = url ? url : '';
if(url.indexOf('from=') != -1){
return Lmn.web.path + (url ? url : '')
}else{
return Lmn.web.path + url + ((url.indexOf('?') != -1) ? '&from=' + (Lmn.web.from ? Lmn.web.from : '') : '?from=' + (Lmn.web.from ? Lmn.web.from : ''))
}
},
'ini': function(){
// 图片延迟加载扩展
(function($){
$.fn.lazyload = function(options) {
var settings = {
threshold: 0,
failurelimit: 0,
event: "scroll",
effect: "show",
container: window
};
if (options) {
$.extend(settings, options);
}
var elements = this;
if ("scroll" == settings.event) {
$(settings.container).bind("scroll", function(event) {
var counter = 0;
elements.each(function() {
if ($.abovethetop(this, settings) || $.leftofbegin(this, settings)) {} else if (!$.belowthefold(this, settings) && !$.rightoffold(this, settings)) {
$(this).trigger("appear");
} else {
if (counter++ > settings.failurelimit) {
return false;
}
}
});
var temp = $.grep(elements, function(element) {
return !element.loaded;
});
elements = $(temp);
});
}
this.each(function() {
var self = this;
if (undefined == $(self).attr("original")) {
$(self).attr("original", $(self).attr("src"));
}
if ("scroll" != settings.event || undefined == $(self).attr("src") || settings.placeholder == $(self).attr("src") || ($.abovethetop(self, settings) || $.leftofbegin(self, settings) || $.belowthefold(self, settings) || $.rightoffold(self, settings))) {
if (settings.placeholder) {
$(self).attr("src", settings.placeholder);
} else {
$(self).removeAttr("src");
}
self.loaded = false;
} else {
self.loaded = true;
}
$(self).one("appear", function() {
if (!this.loaded) {
$("").bind("load", function() {
$(self).hide().attr("src", $(self).attr("original"))[settings.effect](settings.effectspeed);
self.loaded = true;
}).attr("src", $(self).attr("original"));
};
});
if ("scroll" != settings.event) {
$(self).bind(settings.event, function(event) {
if (!self.loaded) {
$(self).trigger("appear");
}
});
}
});
$(settings.container).trigger(settings.event);
return this;
};
$.belowthefold = function(element, settings) {
if (settings.container === undefined || settings.container === window) {
var fold = $(window).height() + $(window).scrollTop();
} else {
var fold = $(settings.container).offset().top + $(settings.container).height();
}
return fold <= $(element).offset().top - settings.threshold;
};
$.rightoffold = function(element, settings) {
if (settings.container === undefined || settings.container === window) {
var fold = $(window).width() + $(window).scrollLeft();
} else {
var fold = $(settings.container).offset().left + $(settings.container).width();
}
return fold <= $(element).offset().left - settings.threshold;
};
$.abovethetop = function(element, settings) {
if (settings.container === undefined || settings.container === window) {
var fold = $(window).scrollTop();
} else {
var fold = $(settings.container).offset().top;
}
return fold >= $(element).offset().top + settings.threshold + $(element).height();
};
$.leftofbegin = function(element, settings) {
if (settings.container === undefined || settings.container === window) {
var fold = $(window).scrollLeft();
} else {
var fold = $(settings.container).offset().left;
}
return fold >= $(element).offset().left + settings.threshold + $(element).width();
};
$.extend($.expr[':'], {
"below-the-fold": "$.belowthefold(a, {threshold : 0, container: window})",
"above-the-fold": "!$.belowthefold(a, {threshold : 0, container: window})",
"right-of-fold": "$.rightoffold(a, {threshold : 0, container: window})",
"left-of-fold": "!$.rightoffold(a, {threshold : 0, container: window})"
});
})(jQuery);
var from = location.href.split('from=');
if(from.length == 2){
Lmn.web.from = from[1].split('&')[0].split('#')[0]
}
// 滚动效果 IE无效
if(-[1,]){this.mousewheel()}
//jQuery缓动扩展
jQuery.easing['jswing'] = jQuery.easing['swing'];
jQuery.extend( jQuery.easing,
{
def: 'easeInOutCirc',
easeInOutCirc: function (x, t, b, c, d) {
if ((t/=d/2) < 1) return -c/2 * (Math.sqrt(1 - t*t) - 1) + b;
return c/2 * (Math.sqrt(1 - (t-=2)*t) + 1) + b;
}
});
// 入口
$(function(){
var $body = $('body');
// 去掉超级链接点击时的虚线边框
$body.delegate('a', 'focus', function(){
this.blur();
});
});
},
'use': function(n, type){
if(typeof(n) == 'object'){
for(i in n){
this.use(n[i], type);
}
}else{
switch(n){
// js
case 'jquery':
(!+[1,]) ? this.js('js/jquery-1.9.0.min.js', type) : this.js('js/jquery-2.1.1.min.js', type);
break;
case 'bootstrap':
this.css('css/bootstrap.min.css', type);
this.js('js/bootstrap.min.js', type);
break;
case 'layer':
this.js('js/layer/layer.js', type);
break;
case 'pace':
this.js('js/pace.min.js', type);
break;
// ajax上传文件
case 'ajaxsubmit':
this.js('js/jquery.form.js', type);
break;
// 编辑器
case 'ueditor':
this.js('editor/ueditor.config.js', type);
this.js('editor/ueditor.all.js', type);
break;
// 地图
case 'map':
this.js('http://api.map.baidu.com/api?v=2.0&ak=tsd4DCaHbPB2faEe7oK8IsETGijMCGAs', type);
break;
// md5
case 'md5':
this.js('js/md5.js', type);
break;
// order
// qrcode
case 'qrcode':
this.js('js/qrcode.js', type);
break;
// css
case 'iconfont':
this.css('https://at.alicdn.com/t/font_2730668_exj89hxlxph.css', type);
break;
case 'animate':
this.css('css/animate.min.css', type);
break;
break;
case 'H-ui':
this.css('css/H-ui.min.css', type);
break;
case 'swiper':
this.css('css/swiper.min.css', type);
this.js('js/swiper.min.js', type);
break;
case 'style':
this.css('images/2021.css?v=2', type);
break;
// 加载完成后进行初始化并加载默认的
case 'default':
this.use(['jquery', 'pace', 'layer', 'iconfont', 'animate', 'style', 'js/2021-public.js']);
document.ready(function(){
Lmn.ini();
});
break;
default:
if(n.indexOf('.js') > 0){
this.js(n, type);
}else{
this.css(n, type);
}
}
}
},
'inihdp': function(selector){
// 幻灯片
var $hdp = $(selector);
hdpwidth = $hdp.find(".pic .hdp:first").width();
var hdpcount = $hdp.find(".pic .hdp").length;
var hdpredirect = "right";
$hdp.find(".pic .hdp").width(hdpwidth);
$hdp.find(".pic").width(hdpwidth * hdpcount);
var itemhtml = '';
for(var i=0; i';
}
$hdp.find(".item").append(itemhtml);
$hdp.find(".item a").click(function(){
var thisindex = $(this).index();
$hdp.find(".item a").stop(true, true).removeClass("hover");
$(this).addClass("hover");
$hdp.find(".pic .hdp").eq(thisindex).find('.hdp-animation:visible').hide();
$hdp.find(".pic").stop(true, true).animate({"left": ( 0 - thisindex * $hdp.width()) + "px"}, 800, "easeInOutCirc", function(){
$hdp.find(".pic .hdp").eq(thisindex).find('.hdp-animation').show();
});
}).eq(0).click();
$hdp.find(".jt a.jt-left").click(function(e){
e.preventDefault();
hdpredirect = "left";
var thisindex = $hdp.find(".item a.hover").index() - 1;
if(thisindex < 0) {thisindex = $hdp.find(".item a").length - 1}
$hdp.find(".item a").eq(thisindex).click();
});
$hdp.find(".jt a.jt-right").click(function(e){
e.preventDefault();
hdpredirect = "right";
var thisindex = $hdp.find(".item a.hover").index() + 1;
if(thisindex > $hdp.find(".item a").length - 1) {thisindex = 0}
$hdp.find(".item a").eq(thisindex).click();
});
var hdpobj = null;
$hdp.mouseleave(function() {
hdpobj = setInterval(function(){
if(hdpredirect == "left") {$hdp.find(".jt a.jt-left").click()}
else{$hdp.find(".jt a.jt-right").click()}
}, 4000)
}).mouseenter(function() {clearInterval(hdpobj)}).mousemove(function() {clearInterval(hdpobj)}).mouseleave();
$(window).resize(function(){
var animatewidth = $hdp.width();
$hdp.find(".pic .hdp").width(animatewidth);
$hdp.find(".pic").width(animatewidth * hdpcount);
$hdp.find(".pic").stop(true, true).animate({"left": ( 0 - $hdp.find(".item a.hover").index() * animatewidth) + "px"}, 0);
});
},
'js': function(n, type, fun){
if(typeof(n) == 'object'){
for(i in n){
this.js(n[i], type, fun);
}
}else{
this.temp['js'] = (this.temp['js'] == undefined) ? '' : this.temp['js'];
if(this.temp['js'].indexOf('|' + n + '|') == -1){
this.temp['js'] += '|' + n + '|';
if(type != undefined){
$.getScript(this.web.template + n, function(){
if(fun){fun()};
});
}else{
document.writeln('');
if(fun){document.writeln('')}
}
}
}
},
'css': function(n, type){
if(typeof(n) == 'object'){
for(i in n){
this.css(n[i], type);
}
}else{
this.temp['css'] = (this.temp['css'] == undefined) ? '' : this.temp['css'];
if(this.temp['css'].indexOf('|' + n + '|') == -1){
this.temp['css'] += '|' + n + '|';
if(type != undefined){
var head = document.getElementsByTagName('head').item(0);
var link = document.createElement('link');
link.rel = 'stylesheet';
link.href = this.web.template + n;
head.appendChild(link);
}else{
document.writeln('');
}
}
}
},
'ajax': function(url, data, isloading, success, error, complete){
if(isloading){var loading}
data = (data == undefined || data == '') ? [] : data;
if(data.length == undefined){
data.isajax = 1;
data.from = Lmn.web.from;
}else{
data.push({'name': 'isajax', 'value': 1});
data.push({'name': 'from', 'value': Lmn.web.from});
}
$.ajax({
url: url,
type: 'post',
data: data,
dataType: 'html',
cache: false,
beforeSend: function(){
if(isloading){loading = Lmn.loading()}
},
success: function(res) {
success && success(res)
},
error: function() {
error && error()
},
complete: function() {
if(isloading){Lmn.close(loading)}
complete && complete();
}
});
},
'qrcode': function(img, str){
layer.open({
type: 1,
title: false,
skin: 'layui-layer-demo',
closeBtn: 0,
anim: 2,
shadeClose: true,
content: ''+(str ? str : '穿越到手机上体验')+'
'
});
},
'mobile': function(mobile, str){
layer.open({
type: 1,
title: false,
skin: 'layui-layer-demo',
closeBtn: 0,
anim: 2,
area: ['500px', '200px'],
shadeClose: true,
content: ''
});
},
// 文件上传
'upload': function(o){
o.ajaxSubmit({
type: 'post',
dataType: 'json',
uploadProgress: function(event, position, total, percentComplete){
o.children('.upload-progress').css('width', percentComplete + '%').show();
},
success: function (res) {
if(res.state == "SUCCESS"){
o.children('.upload-progress').hide();
var path = res.url.replace(Lmn.web.dir, '');
o.find('span:first').html(path);
var $input = o.prev('input');
$input.val(path);
$input.prev('span').find('img').attr('src', res.url);
$input.prev('span').css('display', 'table-cell');
o.find('input').val('');
if($input.attr('cut') != undefined){
Lmn.cut($input.attr('name'), path);
}
}
else{
Lmn.msg('文件上传失败了!', {icon: 5, time: 2500});
}
}
});
},
// 数据提交
'submit': function(action, data, isloading, success_fun, error_fun, complete_fun){
if(success_fun == undefined){
var success = function(res){
try{
res = eval("("+res+")");
switch(res.result){
case 'success':
if(res.msg != undefined && res.msg != ''){
Lmn.msg(res.msg, {'time': 1000, 'icon': 1}, function(){
if(res.eval != undefined && res.eval != ''){
eval(res.eval);
}
});
}else if(res.eval != undefined && res.eval != ''){
eval(res.eval);
}
break;
case 'failed':
if(res.msg != undefined && res.msg != ''){
Lmn.msg(res.msg, {'time': 2500, 'icon': 5}, function(){
if(res.eval != undefined && res.eval != ''){
eval(res.eval);
}
});
}else if(res.eval != undefined && res.eval != ''){
eval(res.eval);
}
break;
}
}catch(e){
Lmn.msg('数据加载失败', {'icon': 7, 'time': 2500});
}
}
}else{
var success = function(res){
try{
res = eval("("+res+")");
success_fun(res);
}catch(e){
Lmn.msg('操作失败了', {'icon': 7, 'time': 2500});
}
}
}
if(error_fun == undefined){
var error = function(){
Lmn.msg('操作失败了', {'icon': 7, 'time': 2500});
}
}else{
var error = error_fun;
}
Lmn.ajax(action, data, isloading, success, error, complete_fun);
},
'msg': function(str, opt, fun){
return layer.msg(str, opt, fun);
},
'showsuccess': function(str){
return Lmn.msg(str ? str : '操作成功', {'icon': 1, 'time': 2500});
},
'showerr': function(str){
return Lmn.msg(str ? str : '操作失败了', {'icon': 5, 'time': 2500});
},
'loading': function(str){
return layer.load(2);
},
'reload': function(){
layer.load(3);
document.location.reload();
},
'close': function(o){
o ? layer.close(o) : layer.closeAll();
},
'go': function(url, time){
if(time){
setTimeout(function(){
location.href = url
}, time);
}else{
location.href = url
}
},
'getCookie': function(n){
var results = document.cookie.match('(^|;) ?' + n + '=([^;]*)(;|$)');
if (results) return (unencodeURIComponent(results[2]));
else return null;
},
'check': function(o, $d){
$d.prop('checked', o.checked);
},
// 页面滚动
'scrollto': function(top, time){
$('html, body').stop(true, true).animate({'scrollTop': top}, ((time ? 800 : (top == 0) ? 0 : 800)));
},
'formatNumber': function(num, precision, separator){
var parts;
if (!isNaN(parseFloat(num)) && isFinite(num)) {
num = Number(num);
num = (typeof precision !== 'undefined' ? num.toFixed(precision) : num).toString();
parts = num.split('.');
parts[0] = parts[0].toString().replace(/(\d)(?=(\d{3})+(?!\d))/g, '$1' + (separator || ','));
return parts.join('.');
}
return NaN;
},
'q': function(sProp){
var re = new RegExp("[&,?]"+sProp + "=([^\\&]*)", "i");
var a = re.exec(document.location.search);
if (a == null){
return "";
}
else{
return a[1];
}
},
'getVal': function(v, d){
if(v == '' || isNaN(v)){
return d;
}else{
return parseFloat(v);
}
},
'getdata': function(item){
if(typeof(localStorage) == "undefined"){
var strCookie = document.cookie;
var arrCookie = strCookie.split("; ");
for(var i=0; i