var _alert_iconcss = tipmsg_icoinfo;
var _confirm_iconcss = tipmsg_icoconfirm;
var _error_iconcss = tipmsg_icoerror;
var _warning_iconcss = tipmsg_icowarning;
function dialoginit(type, msg) {
var iconcss = ;
switch (type) {
case confirm : iconcss = _confirm_iconcss; break;
case error : iconcss = _error_iconcss; break;
case warning : iconcss = _warning_iconcss; break;
default : iconcss = _alert_iconcss; break;
}
var htmlstr = + msg +
;
return htmlstr;
}
function alert(msg, okcallback) {
var title = 提示;
var type = alert;
var html = dialoginit(type, msg);
var div = $(body).find(#+type+div);
div.remove();
$('body').append($(html));
var buttons = {确定 : function () {
if(okcallback) okcallback();
$(this).dialog(close);
}
};
$(#+type+div).dialog({
modal : true,
title : title,
buttons : buttons
});
}
function confirm(msg, okcallback, cancelcallback) {
var title = 确认;
var type = confirm;
var html = dialoginit(type, msg);
var div = $(body).find(#+type+div);
div.remove();
$('body').append($(html));
var buttons = {确定 : function () {
if(okcallback) okcallback();
$(this).dialog(close);
},
取消 : function () {
if(cancelcallback) cancelcallback();
$(this).dialog(close);
}
};
$(#+type+div).dialog({
modal : true,
title : title,
buttons : buttons
});
}
function error(msg, okcallback) {
var title = 错误;
var type = error;
var html = dialoginit(type, msg);
var div = $(body).find(#+type+div);
div.remove();
$('body').append($(html));
var buttons = {确定 : function () {
if(okcallback) okcallback();
$(this).dialog(close);
}
};
$(#+type+div).dialog({
modal : true,
title : title,
buttons : buttons
});
}
function warning(msg, okcallback) {
var title = 警告;
var type = warning;
var html = dialoginit(type, msg);
var div = $(body).find(#+type+div);
div.remove();
$('body').append($(html));
var buttons = {确定 : function () {
if(okcallback) okcallback();
$(this).dialog(close);
}
};
$(#+type+div).dialog({
modal : true,
title : title,
buttons : buttons
});
}
