//Camby Liverson @ 2012-09-27 $(document).ready(function(e) { if($("#jalert").length<1) { $('
').appendTo("body"); $('
').appendTo("body"); $('').appendTo("body"); $('').appendTo("body"); } }); function jconfirm(msg,callback) { $("#dialog-confirm").html(msg).dialog({ resizable: false, draggable: false, height:260, width: 330, modal: true, title: '系統訊息', show: { effect: 'fade' }, hide: { effect: 'fade' }, buttons: { "確定": function() { if(!callback()) { $( this ).dialog( "close" ); } }, "取消": function() { $( this ).dialog( "close" ); result = false; } }, zIndex: 100000 }); } function jalert(msg) { $("#dialog").html(msg).dialog({ resizable: false, draggable: false, height:200, modal: true, title: '系統訊息', show: { effect: 'fade' }, hide: { effect: 'fade' }, buttons: { "確定": function() { $( this ).dialog( "close" ); } }, zIndex: 100001 }); } function jalert_c(msg,callback) { $("#dialog").html(msg).dialog({ resizable: false, draggable: false, height:200, modal: true, title: '系統訊息', show: { effect: 'fade' }, hide: { effect: 'fade' }, buttons: { "確定": function() { callback(); } }, zIndex: 100001 }); } function jloading(type) { if(type==1) { $("#loading").dialog({ create: function() { $("#loading").parents(".ui-dialog").find(".ui-dialog-titlebar-close").remove(); }, resizable: false, draggable: false, height: 120, modal: true, show: { effect: 'fade' }, hide: { effect: 'fade' }, zIndex: 10000 }); } else { $("#loading").dialog('close'); } } function toDecimal2(x) { var f = parseFloat(x); if (isNaN(f)) { return false; } var f = Math.round(x*100)/100; var s = f.toString(); var rs = s.indexOf('.'); if (rs < 0) { rs = s.length; s += '.'; } while (s.length <= rs + 2) { s += '0'; } return s; } function checkStr(field,regex) { var str = field.val().split(''); for(i=0;i