// javascript document
$(function() {
var data = null;
if (data == null) return;
function popup() {
var strhtml = "";
if (data.url != null && data.url.length > 0 && data.url != "http://") strhtml = "" + strhtml + "";
strhtml += "";
try {
var i = $.layer({
type: 1,
shade: data.shade ? [0.2, '#000', true] : false,
title: false,
closebtn: false,
border: [5, 0.5, '#666', true],
offset: ['', ''],
area: [data.width + 'px', data.height + 'px'],
page: {
html: strhtml
},
success: function() {
if (data.sec > 0) {
window.settimeout("$('.closepopup').trigger('click')", data.sec * 1000);
}
}
});
$(".closepopup").on('click', function() {
layer.close(i);
});
}
catch (err) { }
}
var loaded = false;
var loadfile = "http://" + window.location.host + "/plugin/layer/layer.min.js";
for (var i = 0; i < document.scripts.length; i++) {
if (document.scripts[i].src.indexof(loadfile) == 0) {
loaded = true; break;
}
}
if (!loaded) {
var script = document.createelement('script');
script.src = loadfile;
script.type = "text/javascript";
document.getelementsbytagname('head')[0].appendchild(script);
script.onload = script.onreadystatechange = function() {
popup();
}
}
else popup();
});