//alert: function tkd_alert(){ var args = arguments.length; var argv = new Array(args); for(var i = 0; i < args; i++){ argv[i] = arguments[i]; } if(args == 0){ setTimeout(function(){ asyncbox.error('系统错误!', '错误'); },0); } else if(args == 1){ setTimeout(function(){ asyncbox.alert(argv[0], '提示'); },0); } else if(args == 2){ setTimeout(function(){ asyncbox.alert(argv[0], argv[1]); },0); } else if(args == 3){ setTimeout(function(){ asyncbox.alert(argv[0], argv[1],function(action){ if(argv[2] == "back") history.back(); else if(argv[2] == "reload") location.reload(); else if(argv[2] != "") location.href=argv[2]; }); },0); } } function tkd_alertexec(){ var args = arguments.length; var argv = new Array(args); for(var i = 0; i < args; i++){ argv[i] = arguments[i]; } if(args == 4){ setTimeout(function(){ asyncbox.alert(argv[0], argv[1], function(action){ if(argv[2] == "focus") document.getElementsByName(argv[3])[0].focus(); else if(argv[2] == "location.replace") location.replace(argv[3]); else if(argv[2] == "back") history.back(argv[3]); }); },0); } else if(args == 5){ setTimeout(function(){ asyncbox.alert(argv[0], argv[1], function(action){ //if(argv[2] == "focus") document.getElementsByName(argv[3]).focus(); }); },0); } } function tkd_alertfun(str, tit, callback){ setTimeout(function(){ asyncbox.alert(str, tit, function(action){ callback(); }); },0); } function tkd_error(){ var args = arguments.length; var argv = new Array(args); for(var i = 0; i < args; i++){ argv[i] = arguments[i]; } if(args == 0){ setTimeout(function(){ asyncbox.error('系统错误!', '错误'); },0); } else if(args == 1){ setTimeout(function(){ asyncbox.error(argv[0], '错误'); },0); } } //confirm function tkd_confirm(){ var args = arguments.length; var argv = new Array(args); var rsult = false; for(var i = 0; i < args; i++){ argv[i] = arguments[i]; } if(args == 1){ setTimeout(function(){ asyncbox.confirm(argv[0], "选择", function(action){ if(action == "ok"){ result = true; } else if(action == "cancel"){ result = false; } else if(action == "close"){ result = false; } }); },0); } else if(args == 2){ setTimeout(function(){ asyncbox.confirm(argv[0], argv[1], function(action){ if(action == "ok"){ result = true; } else if(action == "cancel"){ result = false; } else if(action == "close"){ result = false; } }); },0); } else if(args == 3){ setTimeout(function(){ asyncbox.confirm(argv[0], argv[1], function(action){ if(action == "ok"){ if(argv[2] == "back") history.back(); else if(argv[2] != "") location.href=argv[2]; } else if(action == "cancel"){ result = false; } else if(action == "close"){ result = false; } }); },0); } else if(args == 4){ setTimeout(function(){ asyncbox.confirm(argv[0], argv[1], function(action){ if(action == "ok"){ if(argv[2] == "back") history.back(); else if(argv[2] != "") location.href=argv[2]; } else if(action == "cancel"){ if(argv[3] == "back") history.back(); else if(argv[3] != "") location.href=argv[3]; } else if(action == "close"){ if(argv[3] == "back") history.back(); else if(argv[3] != "") location.href=argv[3]; } }); },0); } } function tkd_subfirm(str, tit, formid){ setTimeout(function(){ asyncbox.confirm(str, tit, function(action){ if(action == "ok"){ document.getElementsByName(formid)[0].submit(); } else if(action == "cancel"){ ; } else if(action == "close"){ ; } }); },0); } function tkd_confun(str, tit, callback1, callblack2){ setTimeout(function(){ asyncbox.alert(str, tit, function(action){ if(action == "ok"){ callback1(); } else if(action == "cancel"){ callback2(); } else if(action == "close"){ callback2(); } }); },0); }