(function ($) { $(document).ready(function() { $('.numberC').blur(function(){ $(this).numberFormat(); }) $('.numberC').focus(function(){ $(this).removeText(); }) $(".date").datepicker({ dateFormat: 'yy-mm-dd', monthNamesShort: ['1¿ù','2¿ù','3¿ù','4¿ù','5¿ù','6¿ù','7¿ù','8¿ù','9¿ù','10¿ù','11¿ù','12¿ù'], dayNamesMin: ['ÀÏ','¿ù','È­','¼ö','¸ñ','±Ý','Åä'], weekHeader: 'Wk', changeMonth: true, //¿ùº¯°æ°¡´É changeYear: true, //³âº¯°æ°¡´É yearRange:'1990:+2', // ¿¬µµ ¼¿·ºÆ® ¹Ú½º ¹üÀ§(ÇöÀç¿Í °°À¸¸é 1988~ÇöÀç³â) showMonthAfterYear: true, //³â µÚ¿¡ ¿ù Ç¥½Ã buttonImageOnly: true, //À̹ÌÁöÇ¥½Ã buttonText: '³¯Â¥¸¦ ¼±ÅÃÇϼ¼¿ä', autoSize: false, //¿ÀÅ丮»çÀÌÁî(bodyµî »óÀ§Å±×ÀÇ ¼³Á¤¿¡ µû¸¥´Ù) buttonImage: '/images//dot_10.gif', //À̹ÌÁöÁÖ¼Ò /wtm/images/egovframework/wtm2/sub/bull_calendar.gif showOn: "both", //¿¤¸®¸ÕÆ®¿Í À̹ÌÁö µ¿½Ã »ç¿ë showButtonPanel:true, currentText:'¿À´Ã' }); $(".date").attr('readonly','readonly') $(".date").change(function(){ var over_obj = $(this).attr('notover') if(over_obj || $(this).val()){ if($(over_obj).val()>$(this).val()){ $(this).val('') alert('±â°£ ¼³Á¤ÀÌ À߸øµÇ¾ú½À´Ï´Ù.'); $(this).focus(); } } }) $("input.all").click(function(){ var chk = $("input.all").is(':checked'); $('input[name="chk"]').each(function(){ this.checked = chk; }); }) $('input[name="chk"]').click(function(){ $("input.all").each(function(){ this.checked = $('input[name="chk"]').length == $('input[name="chk"]:checked').length; }); }) if($('div.buttonSelect').hasClass('buttonSelect')){ //$('div.buttonSelect').parent().css({position: 'relative',height: 50}); $('div.buttonSelect').prepend("¡å") $('div.buttonSelect').css({width:'180px',overflow: 'hidden','text-align': 'right',position: 'absolute'}); $('div.buttonSelect').find('input[type=button]').css('width','160px'); var temp_height = $('div.buttonSelect').height(); $('div.buttonSelect').css({height:27}); $('span.list','div.buttonSelect').click(function(){ if($('div.buttonSelect').height() != '27'){ $('div.buttonSelect').animate({height:27,queue: true,opacity:1}, {duration:300}, "easeInOutBack"); }else{ $('div.buttonSelect').animate({height:temp_height,queue: true,opacity:1}, {duration:300}, "easeInOutBack"); }; }) $('div.buttonSelect').find('input[type=button]').click(function(){ $('div.buttonSelect').animate({height:25,queue: true,opacity:1}, {duration:300}, "easeInOutBack"); $('.list','div.buttonSelect').after($(this)); }); } //¹ÚÀοø ȸ¿ø °¡ÀÔüũ Ãß°¡... 2013³â 03¿ù 27ÀÏ $('.MemberSubmit').click(function(){ if($('#userID').val() == "" & $('#userID').val().length == 0){ alert('»ç¿ëÀÚ ¾ÆÀ̵𸦠ÀÔ·ÂÇØÁÖ¼¼¿ä!!'); }else if($('#userID').val().length < 4) { alert('»ç¿ëÀÚ ¾ÆÀ̵ð´Â 4ÀÚ ÀÌ»ó 15ÀÌÇÏ ÀÔ´Ï´Ù.'); }else if($('#userPW').val().length == 0 & $('#userPW').val() == "") { alert('ºñ¹Ð¹øÈ£¸¦ ÀÔ·ÂÇØÁÖ¼¼¿ä!'); }else if($('#userPwCheck').val().length == 0 & $('#userPwCheck').val() == "") { alert('È®ÀÎ ºñ¹Ð¹øÈ£¸¦ ÀÔ·ÂÇØÁÖ¼¼¿ä!'); }else if($('#userPW').val() != $('#userPwCheck').val()) { alert('ºñ¹Ð¹øÈ£°¡ ÀÏÄ¡ÇÏÁö ¾Ê½À´Ï´Ù.'); } }); //¹ÚÀοø ȸ¿ø °¡ÀÔüũ Ãß°¡... 2013³â 03¿ù 27ÀÏ $('.dialog-close').css({cursor: 'pointer'}) $('.dialog-close').click(function(e){ $('.ui-dialog-content').dialog('close'); }) }); $.fn.removeText = function(_v){ if (typeof(_v)==="undefined") { $(this).each(function(){ this.value = this.value.replace(/[^0-9]/g,''); }); } else { return _v.replace(/[^0-9]/g,''); } }; $.fn.numberFormat = function(_v){ this.proc = function(_v){ var tmp = '', number = '', cutlen = 3, comma = ',' i = 0, len = _v.length, mod = (len % cutlen), k = cutlen - mod; for (i; i < len; i++) { number = number + _v.charAt(i); if (i < len - 1) { k++; if ((k % cutlen) == 0) { number = number + comma; k = 0; } } } return number; }; var proc = this.proc; if (typeof(_v)==="undefined") { $(this).each(function(){ this.value = proc($(this).removeText(this.value)); }); } else { return proc(_v); } }; $.fn.onlyNumber = function (p) { $(this).each(function(i) { $(this).attr({'style':'text-align:right'}); this.value = $(this).removeText(this.value); this.value = $(this).numberFormat(this.value); $(this).bind('keypress keyup',function(e){ this.value = $(this).removeText(this.value); this.value = $(this).numberFormat(this.value); }); }); }; $.fn.dialogCreat = function (param) { var _this = $('.'+param.className); if(!$(_this).hasClass(param.className)){ var div = document.createElement('div'); $(div).addClass(param.className); $('body').append(div) _this = $(div); } if(param.iframe){ if($(_this).children('iframe').hasClass('dialog-iframe') && $(_this).children('iframe').attr('src') == param.iframe && !param.refresh){ }else{ $(_this).html(''); var iframe = document.createElement('iframe'); $(iframe).attr({'class':'dialog-iframe'}); $(iframe).attr({src:param.iframe, frameborder:"0", scrolling:"no", allowTransparency:true, width:((param.iframe_width)?((param.iframe_width<0)?param.width+param.iframe_width:param.iframe_width):param.width), height:((param.iframe_height)?((param.iframe_height<0)?param.height+param.iframe_height:param.iframe_height):param.height) }) $(_this).append(iframe) } }else if(param.html && $(_this).html() != param.html){ $(_this).html(''); $(_this).append(param.html) } var b1 = ($(_this).parent().hasClass('ui-dialog')) var b2 = ($(_this).parent('.ui-dialog').css('display') == 'block'); var b3 = objToString(param.buttons); if(b1 && b2 && !b3){ $(_this).dialog('close'); }else{ $(_this).dialog(param); } if(param.titleHide){ $(_this).prev('.ui-dialog-titlebar').hide(); }else{ $(_this).prev('.ui-dialog-titlebar').show(); }; if(param.draggable){ $(_this).parent().draggable(); } }; $.fn.pharos_refresh = function(){ var obj_iframe = $(this).children('iframe') $(obj_iframe).attr('src',$(obj_iframe).attr('src')) } })(jQuery); function dateAdd(dday,addDay) { if(dday){ var getDate = new Date(dday.split('-')[0],dday.split('-')[1],dday.split('-')[2]); }else{ var getDate = new Date(); } var addDate = getDate.getTime() + (addDay * 24 * 60 * 60 * 1000); getDate.setTime(addDate); var year = getDate.getFullYear(); var month = getDate.getMonth(); if(month == 0){ month = 1; } var date = getDate.getDate(); if (month < 10) month = "0" + month; if (date < 10) date = "0" + date; return year + "-" + month + "-" + date; } function objToString (obj) { var str = ''; for (var p in obj) { if (obj.hasOwnProperty(p)) { str += p + '::' + obj[p] + '\n'; } } return str; }