document.write('
');
document.write('');
/**
* ´Ù±¹¾î alert() ¸Þ¼¼Áö¸¦ Ãâ·Â
* ex : i18nAlert('I18NUtil.getLabel(localeCode, "IBA00001","°³º°1ȸÀÌüÇѵµ±Ý¾×ÀÌ ÃÊ°úÇÏ¿´½À´Ï´Ù.")') (½ºÅ©¸³Æ²¸´ÀÓ.)
* @param msg : ´Ù±¹¾î ¸Þ¼¼Áö
* @return : alert(msg) ¸Þ¼¼Áö
*/
function i18nAlert(msg, form, field, fldClear){
var alertElem = document.createElement("span");
alertElem.innerHTML = msg;
if ("" == alertElem.outerText || null == alertElem.outerText || "undefined" == alertElem.outerText){
uf_alert(msg, 401, 206, form, field, fldClear);
}else{
uf_alert(alertElem.outerText, 401, 206, form, field, fldClear);
}
}
/**
* ´Ù±¹¾î confirm() ¸Þ¼¼Áö¸¦ Ãâ·Â
* ex : i18nConfirm('I18NUtil.getLabel(localeCode, "COA00001","¼öÁ¤ÇϽðڽÀ´Ï±î?")') (½ºÅ©¸³Æ²¸´ÀÓ.)
* @param msg : ´Ù±¹¾î ¸Þ¼¼Áö
* @return : alert(msg) ¸Þ¼¼Áö
*/
function i18nConfirm(msg){
var confirmElem = document.createElement("span");
confirmElem.innerHTML = msg;
if ("" == confirmElem.outerText || null == confirmElem.outerText || "undefined" == confirmElem.outerText){
return confirm(msg);
}else{
return confirm(confirmElem.outerText);
}
}
//----------------------------------- ÆäÀÌÁö initialize °ü·Ã ÇÔ¼ö ½ÃÀÛ ------------------------------------------------//
/**
* html ÆäÀÌÁö ·ÎµùÈÄ ÃÖÃÊ ½ÇÇàÇÏ´Â ½ºÅ©¸³Æ®.
*/
initializeHtmlPage();
/**
* ÃÖÃÊ ·Îµù½Ã ÆäÀÌÁö Ãʱ⠼³Á¤
*/
function initializeHtmlPage()
{
for ( var i = 0 ; i < document.forms.length ; i++)
{
document.forms[i].initialize = initializeHtmlForm;
document.forms[i].initialize();
}
// a ÅÂ±× "#" º¯°æó¸®. 2008.10.30 À¥Äɽà ÀÌÀçÈ£
//var elemLinks = document.all.tags('A');
var elemLinks = $('a');
for (var idxLink=0; idxLink < elemLinks.length; idxLink++) {
var obj = elemLinks[idxLink];
var link = obj.href;
if(link.substring(link.length-1) == "#")
obj.href = "#_dummy";
}
// ¿¹±ÝÆÝµå ±ÝÀ¶»óÇ°¸ô »óÇ°Á¤º¸ÀÇ ÅÂ±× ¾Èº¸ÀÌ°Ô...
/*var caps = document.all.tags('CAPTION');
for(i=0; i < caps.length; i++){
var obj = caps[i];
obj.style.display = 'none';
}*/
}
/**
* È£ÃâµÈ Æû¸¶´Ù ¼ÂÆÃÇϱâ.
*
initialize½Ã ¼ÂÆÃÇÏ´Â Á¤º¸ : Çʼö ¿ä¼Ò(css),mask,letter type
*/
function initializeHtmlForm()
{
//spiderSubmit ÇÒ´ç
//this.spiderSubmit = formSubmitValidation;
this.spiderSubmit = formSubmit;
this.submitstat = "false";
// ÀÔ·ÂÇʵå ÇϳªÀÎ °æ¿ì ¿£ÅÍÅ° ÀԷ½à ¸®·Îµå ¹æÁö
try{
var dummy_e = document.createElement("input");
dummy_e.setAttribute("type", "text");
dummy_e.setAttribute("name", "_DUMMY_INPUT");
dummy_e.setAttribute("title", "_DUMMY_INPUT");
dummy_e.style.display = "none";
this.appendChild(dummy_e);
}catch(e){}
for (var i = 0 ; i < this.elements.length ; i++)
{
if ($(this.elements[i]).is('input'))
{
//mask°¡ ÀÖÀ»°æ¿ì #Àº °ªÀ» ÀǹÌÇÔ.
if (this.elements[i].getAttribute("maskform") != undefined && this.elements[i].getAttribute("maskform") != "")
{
if(this.elements[i].getAttribute("maskform") != "usermask")
initSetMaskUp(this.elements[i]);//mask ŸÀÔ(ex : ####/##/## , ####-##-## , ######-####### , ###-##-##### , ...)
}
//¹®ÀÚ Å¸ÀÔÀÌ ÀÖÀ»°æ¿ì
if (this.elements[i].getAttribute("chartype") != undefined)
{
initSetLetterType(this.elements[i]);//¹®ÀÚ ¼Â(english,korean,english+number, number, floatmoney,int)ŸÀÔ
}
//¼Ó¼ºÀÌ ÀÖÀ»°æ¿ì
if ( this.elements[i].getAttribute("disablecss") != undefined)
{
initSetAttribute(this.elements[i]);
}
//uppercase°¡ ÀÖÀ» °æ¿ì
if (this.elements[i].getAttribute("uppercase") != undefined){
if(this.elements[i].getAttribute("chartype") == undefined){
$(this.elements[i]).bind('keyup', function(){ this.value=this.value.toUpperCase(); });
}
}
//lowercase°¡ ÀÖÀ» °æ¿ì
if (this.elements[i].getAttribute("lowercase") != undefined){
if(this.elements[i].getAttribute("chartype") == undefined){
initSetUpperLower(this.elements[i])
}
}
}
if(this.elements[i].onkeyup == undefined){
this.elements[i].onkeyup = setOverSetFocus;
}
}
}
/**
* uppercase, lowercase ¼³Á¤½Ã keyPress½Ã À̺¥Æ® ¹ß»ý.
*/
function initSetUpperLower(elem) {
/*
if(elem.onkeypress == undefined){
elem.onkeypress = setUpperLowerCase;
}
*/
if($(elem).attr("onkeypress") == undefined){
$(elem).bind('keypress', function(){ setUpperLowerCase(); });
}
}
function setUpperLowerCase() {
var pKey = String.fromCharCode(event.keyCode);
if($(event.srcElement).attr('uppercase') != undefined) {
if(event.keyCode >= 97 && event.keyCode <= 122){
//event.srcElement.value = (event.srcElement.value + pKey).toUpperCase();
event.srcElement.value = event.srcElement.value.toUpperCase();
//event.returnValue=false;
}
}
if($(event.srcElement).attr('lowercase') != undefined) {
if(event.keyCode >= 65 && event.keyCode <= 90){
//event.srcElement.value = (event.srcElement.value + pKey).toLowerCase();
event.srcElement.value = event.srcElement.value.toLowerCase();
//event.returnValue=false;
}
}
}
/**
* maxLength, maxbyte ¼³Á¤½Ã keyUp½Ã À̺¥Æ® ¹ß»ý.
*/
function initSetMaxLength(elem) {
if(elem.onkeyup == undefined){
elem.onkeyup = setOverSetFocus;
}
}
/**
* maxLength, maxbyte ¼³Á¤½Ã ÃÖ´ë°ªº¸´Ù ´õ µé¾î¿ÔÀ»½Ã ÀÚµ¿ Æ÷Ä¿½º À̵¿.
*
ex : setOverSetFocus()
*/
function setOverSetFocus() {
//this °³Ã¼°¡ ¼ÓÇÑ ÆûÀ̸§ °¡Á®¿À±â
var thisFrm = eval(this.parentElement);
while("form" != thisFrm.tagName.toString().toLowerCase())
{
thisFrm = eval(thisFrm.parentElement);
}
var nextFocus = this;
var eleValue = this.value;
//´ÙÀ½ Æ÷Ä¿½º Ÿ°Ù °¡Á®¿À±â.
for (var i = 0 ; i < thisFrm.elements.length ; i++)
{
if ($(this).attr('auto-fcs') != undefined && $(this).attr('auto-fcs')=='no') break;
//ÇöÀç this°ªÀÌ ¼±ÅÃµÈ elementsÀÌ¸é ´ÙÀ½À¸·Î À̵¿µÉ Æ÷Ä¿½º¸¦ °¡Á®¿À±â À§ÇÑ ·ÎÁ÷¼öÇà.
if(this == thisFrm.elements[i])
{
if(thisFrm.elements[i].nextfocus != undefined && thisFrm[thisFrm.elements[i].nextfocus] != undefined) {
//nextfocus ¼Ó¼ºÀÌ ÀÖÀ»°æ¿ì nextfocus°ªÀ» ´ÙÀ½ Æ÷Ä¿½º·Î Àâ´Â´Ù.
nextFocus = thisFrm[thisFrm.elements[i].nextfocus];
break;
}
//elements°¡ undefined µÉ¶§ ±îÁö ¼öÇàÇÔ.
while(thisFrm.elements[++i] != undefined)
{
//ÇöÀç elementsÀÇ ºÎ¸ðÁßÀÇ ¼Ó¼ºÀÌ display = noneÀÌ¸é ´ÙÀ½ Æ÷Ä¿½º Ÿ°ÙÀ» °¡Á®¿Â´Ù.
var targetCursor = eval(thisFrm.elements[i].parentElement);
while("form" != targetCursor.tagName.toString().toLowerCase()) {
if(targetCursor.parentElement.style.display == "none") break;
targetCursor = eval(targetCursor.parentElement);
}
if(targetCursor.parentElement.style.display == "none") continue;
//elementsŸÀÔÀÌ input (text,radio,checkbox), textarea, select ÀÏ°æ¿ì ´ÙÀ½ Æ÷Ä¿½º objÀúÀå.
// /ibs/jsp/common/com_tranpwdreg_i.jsp¿¡¼ ½ÃÅ©¸´Æ® Ä«µå ÀÔ·ÂÇÏ´Â ºÎºÐ¿¡ display°¡ noneÀÎ °æ¿ì Á¦¿Ü (style = "tx h")
if(thisFrm.elements[i].tagName.toString().toLowerCase() == "input" &&
((thisFrm.elements[i].type == "text" && thisFrm.elements[i].className != "tx h" )|| ( thisFrm.elements[i].type == "password" && thisFrm.elements[i].className != "tx h" )) ||
(thisFrm.elements[i].tagName.toString().toLowerCase() == "textarea" && thisFrm.elements[i].className != "tx h" )||
(thisFrm.elements[i].tagName.toString().toLowerCase() == "select" && thisFrm.elements[i].className != "tx h" ))
{
// nextFocus °´Ã¼°¡ È°¼ºÈ µÇÁö ¾ÊÀº »óÅÂÀÌ¸é ´ÙÀ½ °´Ã¼·Î....
if(!(thisFrm.elements[i].disabled==true || thisFrm.elements[i].readonly != undefined || thisFrm.elements[i].style.display == "none")){
nextFocus = thisFrm.elements[i];
break;
}
}
}
}
}
if(nextFocus == this)
this.autoTab = "off";
// ¿£ÅÍÅ° ÀԷ½à ó¸®. ´ÙÀ½Æ÷Ä¿½º·ÎÀ̵¿. ´ÙÀ½ Æ÷Ä¿½º ¾øÀ»°æ¿ì ¼ºê¹Ô.
//Æ÷Ä¿½º À̵¿. maxLength 2147483647Àº maxLengthÀÇ °ªÀ» ÁÖÁö ¾Ê¾ÒÀ»°æ¿ì ±âº»ÀûÀ¸·Î ÁÖ´Â ÃÖ´ë°ª.
if(($(this).attr('maxbyte') != undefined && $(this).attr('maxbyte') != "undefined") && ($(this).attr('maxLength') != undefined && $(this).attr('maxLength') != "undefined") ) {
//1. maxbyte¿Í maxLength¸¦ µÑ´Ù ¼±Åà ÇÏ¿´À»¶§..
if((this.maxLength < this.value.length) || ($(this).attr('maxbyte') < calculate_msglen(this.value)))
{
this.blur();
this.value = "";
this.focus();
this.value = cutStringToByte(eleValue, $(this).attr('maxbyte'));
}
}else if(($(this).attr('maxbyte') == undefined || $(this).attr('maxbyte') == "undefined") && ($(this).attr('maxLength') != undefined && $(this).attr('maxLength') != "undefined")) {
//2. maxLength¸¸ ¼³Á¤ÇßÀ»¶§..
//ÇѱÛÀÌ Æ÷ÇÔµÈ chartype°æ¿ì´Â maxLength-2 °ªÀ» ³Ñ±ä´Ù. 20080721 ±èÀç¹ü Ãß°¡.
if($(this).attr("chartype") == "kor" || $(this).attr("chartype") == "kornum" || $(this).attr("chartype") == "koreng" || $(this).attr("chartype") == "korengnum")
{
var _maxlen = this.maxLength-2;
if(this.getAttribute("fullchar") == "false")
_maxlen = this.maxLength;
if((this.getAttribute("fullchar") == "false" && _maxlen < calculate_msglen(this.value)) || (this.getAttribute("fullchar") != "false" && (_maxlen/2) < this.value.length)){
this.blur();
this.value = "";
this.focus();
if(this.getAttribute("fullchar") == "false")
this.value = cutStringToByte(eleValue, _maxlen);
else
this.value = eleValue.substring(0,(this.maxLength-2)/2);
}
} else if(this.maxLength <= this.value.length)
{
this.value = eleValue.substring(0, this.maxLength);
}
}else if(($(this).attr('maxbyte') != undefined || $(this).attr('maxbyte') != "undefined") && this.maxLength == 2147483647) {
//3. maxByte¸¸ ¼³Á¤ÇßÀ»¶§..
if($(this).attr('maxbyte') < calculate_msglen(this.value) )
{
this.blur();
this.value = "";
this.focus();
this.value = cutStringToByte(eleValue, $(this).attr('maxbyte'));
}
}
if($(this).attr('chartype') == "money")
this.value = changeIntMoneyType(this.value);
if($(this).attr('chartype') == "floatmoney")
this.value = changeIntFloatMoneyType(this.value);
}
/**
* ¹®ÀÚ¿À» Byte±æÀÌ·Î À߶ó¿È.
*
ex : cutStringToByte(form1.name.value, bytelength)
* @param strValue : ¹ÙÀÌÆ® ±æÀÌ·Î ÀÚ¸¦ ¹®ÀÚ¿
* @param cutByte : ¹ÙÀÌÆ® ±æÀÌ
*/
function cutStringToByte(strValue,cutByte)
{
var sumLength = 0;
var resultStr = "";
for(var i= 0;i < strValue.length; i++)
{
if( escape(strValue.charAt(i)).length > 3 ) { strLength = 2; }
else if (strValue.charAt(i) == '<' || strValue.charAt(i) == '>') { strLength = 4; }
else { strLength = 1 ; }
if ( cutByte < (sumLength + strLength) ) { break; }
sumLength += strLength;
resultStr += strValue.charAt(i);
}
return resultStr;
}
/**
* ¼Ó¼º¿¡ µû¸¥ inputâ »óÅ ¼ÂÆÃ.
*
ex : initSetAttribute(form1.name)
* @param elem : À̺¥Æ®¸¦ ¼ÂÆÃÇÒ element
*/
function initSetAttribute(elem)
{
if (elem.disablecss == "true")
{
elem.disabled = true;
if(elem.type.toString().toLowerCase() == "text")
{
elem.className = "frameworkDisabled";
}
}
}
/**
* ¼ýÀÚ¿ ¸¶½ºÅ© ¾º¿ì±â
*
ex : initSetMaskUp(form1.name)
* @param elem : ¸¶½ºÅ©¸¦ ¼ÂÆÃÇÒ element
*/
function initSetMaskUp(elem)
{
elem.onkeypress = setKeyInputNumberOnly;
if(elem.onfocus == undefined) elem.onfocus = filterGetNumberOnly;
if(elem.onblur == undefined) elem.onblur = setInitMaskUp;
}
/**
* ÁֹΠ»ç¾÷ÀÚ ¹øÈ£ onkeyupÀ̺¥Æ®½Ã ¸¶½ºÅ© ¾º¿ì±â
*
ex : psnCrnMaskup(form1.name)
* @param elem : ¸¶½ºÅ©¸¦ ¼ÂÆÃÇÒ element
*/
function psnCrnMaskup(elem)
{
var data = getOnlyNumberFormat(elem.value);
elem.value = data;
if(data.length <= 6)
{
return;
}
else if(data.length > 6 && data.length <= 7)
{
elem.value = data.substr(0,6) + "-" + data.substring(6);
}
else if (data.length > 7 && data.length <= 10)
{
elem.value = data.substr(0,3) + "-" + data.substr(3,2) + "-" + data.substring(5);
} else if (data.length > 10 && data.length <= 13)
{
elem.value = data.substr(0,6) + "-" + data.substring(6);
} else if(data.length > 13) {
elem.value = data.substr(0,6) + "-" + data.substr(6,7);
}
}
/**
* ÆäÀÌÁö ÃʱâȽÿ¡ onfocus À̺¥Æ®¿¡ ÇÒ´çµÇ¸é ÀÌ Elemnent¿¡ ¼ýÀÚ¿ÜÀÇ ¹®ÀÚ("," , "/" , "-")´Â focus½Ã¿¡ Á¦°ÅµÊ
*/
function filterGetNumberOnly()
{
this.value = getOnlyNumberFormat(this.value);
this.select();
}
/**
* ¹®ÀÚ¿¿¡¼ ¼ýÀÚ¸¸ »©¿À±â üũ ·ÎÁ÷
* ex : getOnlyNumberFormat(form1.name.value)
* @param sv : º¯È¯ÇÒ String °ª
*/
function getOnlyNumberFormat(sv)
{
if(sv == null) return;
var temp="";
var ret = "";
for(var index = 0 ; index < sv.length ; index++)
{
temp = parseInt(sv.charAt(index), 10);
if( temp >= 0 || temp <= 9)
{
ret +=temp;
}
}
return ret;
}
/**
* ÆäÀÌÁö ÃʱâȽÿ¡ ¸¶½ºÅ© ¼³Á¤°ª´ë·Î º¯È¯Çϱâ
*/
function setInitMaskUp()
{
var mask = this.maskform;
if(this.value == "")
return;
var inputV = getOnlyNumberFormat(this.value);
for ( var i = 0 ; i < mask.length ; i++)
{
if ( mask.substring(i,i+1) != "#" )
inputV = inputV.substring(0,i) + mask.substring(i,i+1) + inputV.substring(i);
}
this.value = inputV;
}
/**
* ÆäÀÌÁö ÃʱâȽà ¼ýÀÚ¸¸ ÀԷ¹ޱâ
*/
function setKeyInputNumberOnly()
{
if(event.shiftKey == true) event.returnValue = false;
if ( event.keyCode < 48 || event.keyCode > 57 )//¼ýÀÚ Å°Äڵ尪
{
// enter, tab, backspace ¹æÇâÅ°(¾Õ,µÚ)´Â ¿¹¿Üó¸®
if(event.keyCode == 8 || event.keyCode == 9 || event.keyCode == 37 || event.keyCode == 39)
{
return true;
}
event.returnValue = false;
}
var pKey = String.fromCharCode(event.keyCode);
if( event.srcElement.userchar != undefined) {
var userKey = event.srcElement.userchar;
for(i=0;i< userKey.length;i++) {
if(pKey == userKey.charAt(i)) {
event.returnValue=true;
break;
}
}
}
}
/**
* ¼ýÀÚ¸¸ ÀÔ·ÂÇÏ´Â INPUTâ¿¡ ºÙ¿©³Ö±â¸¦ ÇßÀ» °æ¿ì¿¡µµ ¼ýÀÚ¸¸ ÀÔ·Â µÇ°Ô.
*/
function setPasteNumberOnly()
{
var clipdata = window.clipboardData.getData("Text");
clipdata = clipdata.replace(/-/gi,"");
if(clipdata.match(/^\d+$/ig) == null){
//alert("Çü½ÄÀÌ ¸ÂÁö ¾Ê½À´Ï´Ù.");
return false;
}
var element = document.all.tags('INPUT');
for(var idx=0; idx < element.length; idx++){
var obj = element[idx];
if(obj.onpaste && obj == this){
obj.value = clipdata.substring(0,clipdata.length);
}
}
event.returnValue = false;
}
/**
* ÆäÀÌÁö ÃʱâȽÿ¡ ¾ð¾î ¹× ¼ýÀÚÇü ÀÔ·Â ¹× Ç¥Çö ó¸®.
* @param elem : À̺¥Æ®¸¦ ¼ÂÆÃÇÒ element
*/
function initSetLetterType(elem)
{
elem.style.imeMode = "disabled";
if (elem.getAttribute("chartype") == "kor")//Çѱ۸¸
{
elem.style.imeMode = "active";
if(elem.onkeypress == undefined) elem.onkeypress = setLetterKoreanOnly;
} else if (elem.getAttribute("chartype") == "kornum")//ÇѱÛ+¼ýÀÚ
{
elem.style.imeMode = "active";
if(elem.onkeypress == undefined) elem.onkeypress = setLetterKorNumOnly;
} else if (elem.getAttribute("chartype") == "koreng")//ÇѱÛ+¿µ¹®
{
elem.style.imeMode = "active";
if(elem.onkeypress == undefined) elem.onkeypress = setLetterKorEngOnly;
} else if (elem.getAttribute("chartype") == "korengnum")//ÇѱÛ+¿µ¹®+¼ýÀÚ
{
elem.style.imeMode = "active";
if(elem.onkeypress == undefined) elem.onkeypress = setLetterKorEngNumOnly;
} else if (elem.getAttribute("chartype") == "eng")//¿µ¾î¸¸
{
//if(elem.onkeypress == undefined) elem.onkeypress = setLetterEnglishOnly;
if($(elem).attr("onkeypress") == undefined){
$(elem).bind('keypress', function(){ $(this).val($(this).val().replace(/[^a-z]/gi, "")); });
}
} else if (elem.getAttribute("chartype") == "engnum")//¿µ¾î+¼ýÀÚ
{
elem.style.imeMode = "disabled";
//if(elem.onkeypress == undefined) elem.onkeypress = setLetterEngNumOnly;
if($(elem).attr("onkeypress") == undefined){
var _regexpStr = getUserChar($(elem), '^a-z|0-9');
$(elem).bind('keyup', function(){ $(this).val($(this).val().replace(eval('/['+_regexpStr +']/gi'), "")); });
}
} else if (elem.getAttribute("chartype") == "float")//½Ç¼öÇü
{
//if(elem.onkeypress == undefined) elem.onkeypress = setLetterFloatOnly;
if($(elem).attr("onkeypress") == undefined){
$(elem).bind('keyup', function(){ $(this).val($(this).val().replace(/[^0-9\\.\\-]/gi, "")); });
}
} else if (elem.getAttribute("chartype") == "int")//Á¤¼öÇü
{
//if(elem.onkeypress == undefined) elem.onkeypress = setLetterInteger;
if($(elem).attr("onkeypress") == undefined){
$(elem).bind('keyup', function(){ $(this).val($(this).val().replace(/[^0-9\\-]/gi, "")); });
}
} else if (elem.getAttribute("chartype") == "onlynum")//¿ÀÁ÷ ¼ýÀÚ¸¸
{
//if(elem.onkeypress == undefined) elem.onkeypress = setKeyInputNumberOnly;
//if(elem.onpaste == undefined) elem.onpaste = setPasteNumberOnly;
if($(elem).attr("onkeypress") == undefined) $(elem).bind('keyup', function(){ $(this).val($(this).val().replace(/[^0-9]/gi, "")); });
if($(elem).attr("onpaste") == undefined) $(elem).bind('paste', function(){ $(this).val($(this).val().replace(/[^0-9]/gi, "")); });
} else if (elem.getAttribute("chartype") == "money")//Á¤¼ö·Î¸¸ µÈ ¾ÆÁÖ ±âº»ÀûÀÎ ±Ý¾× Ç¥½Ã
{
if($(elem).attr("onkeyup") == undefined){
$(elem).bind('keypress', function(){ $(this).val($(this).val().replace(/[^0-9\\,\\-]/gi, "")); });
}
if($(elem).attr("onblur") == undefined){
$(elem).bind('blur', function(){ $(this).val($(this).val().toString().replace(/(\d)(?=(\d\d\d)+(?!\d))/g, "$1,")); });
}
//$(elem).attr("style", "text-align:right");
elem.style.textAlign="right";
/*
elem.style.textAlign="right";
if(elem.onkeyup == undefined) elem.onkeypress = setKeydownMoney;//Å°°¡ ´·¯Á³À»¶§
if(elem.onkeypress == undefined) elem.onkeyUp = setKeypressMoney;//Å°¸¦ ´·¶´Ù ³õ¾ÒÀ»¶§
if(elem.onblur == undefined) elem.onblur = setKeypressMoney;
*/
} else if (elem.getAttribute("chartype") == "floatmoney")
{
if($(elem).attr("onkeyup") == undefined){
$(elem).bind('keypress', function(){ $(this).val($(this).val().replace(/[^0-9\\.\\,\\-]/gi, "")); });
}
if($(elem).attr("onblur") == undefined){
$(elem).bind('blur', function(){
$(this).val($(this).val().toString().replace(/(\d)(?=(\d\d\d)+(?!\d))/g, "$1,"));
});
}
//$(elem).attr("style", "text-align:right");
elem.style.textAlign="right";
//elem.style.textAlign="right";
//if(elem.onkeyup == undefined) elem.onkeypress = setKeydownFloatMoney;//Å°°¡ ´·¯Á³À»¶§
//if(elem.onkeypress == undefined) elem.onkeypress = setFloatMoney;//Å°¸¦ ´·¶´Ù ³õ¾ÒÀ»¶§
//if(elem.onblur == undefined) elem.onblur = setFloatMoney;
}
}
/**
* µ¿Àû Á¤±Ô½ÄÀ» À§ÇÑ userChar ¸®ÅÏ
*/
function getUserChar(obj, _regexpStr) {
if (obj != undefined && obj.attr("userchar") != undefined && '' != obj.attr("userchar")) {
var _userKey = obj.attr("userchar");
for(i=0;i< _userKey.length;i++) {
_regexpStr += '\\'+_userKey.charAt(i);
}
}
return _regexpStr;
}
/**
* ÆäÀÌÁö ÃʱâȽà -,¼ýÀÚ ÀԷ¹ޱâ( - Å°Äڵ尪 189)
*/
function setKeydownMoney()
{
if(event.shiftKey == true) event.returnValue = false;
if ( event.keyCode < 48 || event.keyCode > 57 ) //¼ýÀÚ Å°Äڵ尪
{
// enter, tab, backspace ¹æÇâÅ°(¾Õ,µÚ),delete´Â ¿¹¿Üó¸®
if(event.keyCode == 8 || event.keyCode == 9 || event.keyCode == 37 || event.keyCode == 39 || event.keyCode == 189 || event.keyCode == 46)
{
return true;
}
event.returnValue = false;
}
}
/**
* ÆäÀÌÁö ÃʱâÈ ½Ã¿¡ ±Ý¾× ÇüÅÂÀÏ °æ¿ì Å° ÀԷ½à ±Ý¾× ÇüÅ·ΠÀüȯ
*/
function setKeypressMoney()
{
var ev = event.srcElement;
var pKey = String.fromCharCode(event.keyCode);
var tempV = ev.value;
if(tempV.length > 0){
var stat = true;
while(stat)
{
if(tempV.length > 0 && tempV.substring(0,1)==0)
{
tempV = tempV.substr(1);
} else {
stat = false;
}
}
}
var moneyReg = new RegExp('(-?[0-9]+)([0-9]{3})');
tempV = tempV;// + pKey;
tempV = tempV.replace(/\,/g, "");
while(moneyReg.test(tempV))
{
tempV = tempV.replace(moneyReg, '$1,$2');
}
ev.value = tempV;
if(event.keyCode == 9){ev.select();}
//event.returnValue=false;
}
/**
* ½ºÆ®¸µ°ªÀ» Á¤¼öÇü ¸Ó´Ï ÇüÅ·Πº¯È¯
*
ex : changeIntMoneyType("1100000") ¸®ÅϵǴ µ¥ÀÌŸ : 1,100,000
* @param data : º¯È¯ÇÒ String µ¥ÀÌŸ
* @return ±Ý¾× ÇüÅ·Πº¯È¯µÈ ½ºÆ®¸µ
*/
function changeIntMoneyType(data)
{
var tempV = data;
var moneyReg = new RegExp('(-?[0-9]+)([0-9]{3})');
tempV = tempV.replace(/\,/g, "");
try{
if(tempV != '')
tempV = parseInt(tempV).toString();
}catch(e){}
while(moneyReg.test(tempV))
{
tempV = tempV.replace(moneyReg, '$1,$2');
}
return (tempV == 'NaN') ? 0 : tempV;
}
function changeIntFloatMoneyType(data)
{
var tempV = data;
var floatnum = ""
if(tempV.indexOf(".") != -1)
{
floatnum = tempV.substring(tempV.indexOf("."));// + pKey;
tempV = tempV.substring(0,tempV.indexOf("."));
} else {
tempV = tempV;// + pKey;
}
var moneyReg = new RegExp('(-?[0-9]+)([0-9]{3})');
tempV = tempV.replace(/\,/g, "");
while(moneyReg.test(tempV))
{
tempV = tempV.replace(moneyReg, '$1,$2');
}
tempV = tempV+floatnum;
return tempV;
}
/**
* ½Ç¼öÇü ±Ý¾× ÀÔ·ÂÁ¦¾î ½ºÅ©¸³Æ®. ¼ýÀÚ , . , - °ª¸¸ ÀԷ¹ÞÀ½. ¼Ò¼öÁ¡ µÎ° ÀÚ¸®±îÁö¸¸ ÀԷµÊ
*/
function setKeydownFloatMoney()
{
if(event.shiftKey == true) event.returnValue = false;
var floatindex = event.srcElement.value.indexOf(".");
if(floatindex != -1)
{
var floatNum = event.srcElement.value.substring(floatindex+1);
if (event.keyCode == 8 )
return;
else if (floatNum.length > 1 )
event.returnValue = false;
}
if ( event.keyCode < 48 || event.keyCode > 57 ) //¼ýÀÚ Å°Äڵ尪
{
if( event.keyCode == 8 || event.keyCode == 9 || event.keyCode == 37 || event.keyCode == 39 || event.keyCode == 189 || event.keyCode == 46)
{
return;
} else if( event.keyCode == 190 && floatindex == -1 )
{
return
}
event.returnValue = false;
}
}
/**
* Å° ÀԷ½à float ŸÀÔÀÇ ±Ý¾× ÇüÅ·ΠÀüȯ
*/
function setFloatMoney()
{
var ev = event.srcElement;
var pKey = String.fromCharCode(event.keyCode);
var tempV = ev.value;
var floatnum = ""
if(tempV.indexOf(".") != -1)
{
floatnum = tempV.substring(tempV.indexOf("."));// + pKey;
tempV = tempV.substring(0,tempV.indexOf("."));
} else {
tempV = tempV;// + pKey;
}
var moneyReg = new RegExp('(-?[0-9]+)([0-9]{3})');
tempV = tempV.replace(/\,/g, "");
while(moneyReg.test(tempV))
{
tempV = tempV.replace(moneyReg, '$1,$2');
}
ev.value = tempV+floatnum;
if(event.keyCode == 9){ev.select();}
event.returnValue=false;
}
/**
* Å° ÀԷ½à Çѱ۸¸ ÀԷ¹ޱâ
*/
function setLetterKoreanOnly()
{
var pKey = String.fromCharCode(event.keyCode);
// ½ºÆäÀ̽º Çã¿ë
if(event.keyCode != 32 && !((pKey.charCodeAt() > 0x3130 && pKey.charCodeAt() < 0x318F) || (pKey.charCodeAt() >= 0xAC00 && pKey.charCodeAt() <= 0xD7A3)))
{
event.returnValue=false;
delete eReg;
}
if( event.srcElement.userchar != undefined) {
var userKey = event.srcElement.userchar;
for(i=0;i< userKey.length;i++) {
if(pKey == userKey.charAt(i)) {
event.returnValue=true;
break;
}
}
}
}
/**
* Å° ÀԷ½à ÇѱÛ,¼ýÀÚ ÀԷ¹ޱâ
*/
function setLetterKorNumOnly()
{
var pKey = String.fromCharCode(event.keyCode);
// ½ºÆäÀ̽º Çã¿ë
if(event.keyCode != 32 && !((pKey.charCodeAt() > 0x3130 && pKey.charCodeAt() < 0x318F) || (pKey.charCodeAt() >= 0xAC00 && pKey.charCodeAt() <= 0xD7A3)
|| !setKeyInputNumberOnly()))
{
event.returnValue=false;
delete eReg;
}
if( event.srcElement.userchar != undefined) {
var userKey = event.srcElement.userchar;
for(i=0;i< userKey.length;i++) {
if(pKey == userKey.charAt(i)) {
event.returnValue=true;
break;
}
}
}
}
/**
* Å° ÀԷ½à ¿µ¹®,¼ýÀÚ ÀԷ¹ޱâ==================================
*/
function setLetterEngNumOnly()
{
var pKey = String.fromCharCode(event.keyCode);
var eReg = /[a-zA-Z]/g;
var intReg = /[0-9\\-]/g;;
// ½ºÆäÀ̽º Çã¿ë
if(event.keyCode != 32 && (pKey!="\r" && !eReg.test(pKey)) && !intReg.test(pKey))
{
event.returnValue=false;
delete eReg;
delete intReg;
}
//alert("event.srcElement.userchar : "+event.srcElement.userchar);
setUpperLowerCase();
if( event.srcElement.userchar != undefined) {
var userKey = event.srcElement.userchar;
for(i=0;i< userKey.length;i++) {
if(pKey == userKey.charAt(i)) {
event.returnValue=true;
break;
}
}
}
}
/**
* Å° ÀԷ½à ÇѱÛ,¿µ¾î¸¸ ÀԷ¹ޱâ
*/
function setLetterKorEngOnly()
{
var pKey = String.fromCharCode(event.keyCode);
var eReg = /[a-zA-Z]/g;
// ½ºÆäÀ̽º Çã¿ë
if(event.keyCode != 32 && !((pKey.charCodeAt() > 0x3130 && pKey.charCodeAt() < 0x318F) || (pKey.charCodeAt() >= 0xAC00 && pKey.charCodeAt() <= 0xD7A3)
|| !(pKey!="\r" && !eReg.test(pKey))))
{
event.returnValue=false;
delete eReg;
}
setUpperLowerCase();
if( event.srcElement.userchar != undefined) {
var userKey = event.srcElement.userchar;
for(i=0;i< userKey.length;i++) {
if(pKey == userKey.charAt(i)) {
event.returnValue=true;
break;
}
}
}
}
/**
* Å° ÀԷ½à ÇѱÛ,¿µ¾î,¼ýÀÚ¸¸ ÀԷ¹ޱâ
*/
function setLetterKorEngNumOnly()
{
var pKey = String.fromCharCode(event.keyCode);
var eReg = /[a-zA-Z]/g;
// ½ºÆäÀ̽º Çã¿ë
if(event.keyCode != 32 && !((pKey.charCodeAt() > 0x3130 && pKey.charCodeAt() < 0x318F) || (pKey.charCodeAt() >= 0xAC00 && pKey.charCodeAt() <= 0xD7A3)
|| !(pKey!="\r" && !eReg.test(pKey)) || !setKeyInputNumberOnly()))
{
event.returnValue=false;
delete eReg;
}
setUpperLowerCase();
if( event.srcElement.userchar != undefined) {
var userKey = event.srcElement.userchar;
for(i=0;i< userKey.length;i++) {
if(pKey == userKey.charAt(i)) {
event.returnValue=true;
break;
}
}
}
}
/**
* Å° ÀԷ½à ¿µ¾î¸¸ ÀԷ¹ޱâ
*/
function setLetterEnglishOnly()
{
var pKey = String.fromCharCode(event.keyCode);
var eReg = /[a-zA-Z]/g;
// ½ºÆäÀ̽º Çã¿ë
if(event.keyCode != 32 && pKey!="\r" && !eReg.test(pKey)) //¿£ÅÍÅ° ¹× regkey°¡ ¾Æ´Ò°æ¿ì ¸®ÅÏ
event.returnValue=false;
delete eReg;
setUpperLowerCase();
if( event.srcElement.userchar != undefined) {
var userKey = event.srcElement.userchar;
for(i=0;i< userKey.length;i++) {
if(pKey == userKey.charAt(i)) {
event.returnValue=true;
break;
}
}
}
}
/**
* Å° ÀԷ½à ¼ýÀÚ,- °ª¸¸ ÀԷ¹ÞÀ½.
*/
function setLetterInteger()
{
var pKey = String.fromCharCode(event.keyCode);
var intReg = /[0-9\\-]/g;
if(pKey!="\r" && !intReg.test(pKey)) //¿£ÅÍÅ° ¹× regkey°¡ ¾Æ´Ò°æ¿ì ¸®ÅÏ
event.returnValue=false;
delete intReg;
if( event.srcElement.userchar != undefined) {
var userKey = event.srcElement.userchar;
for(i=0;i< userKey.length;i++) {
if(pKey == userKey.charAt(i)) {
event.returnValue=true;
break;
}
}
}
}
/**
* Å° ÀԷ½à ¼ýÀÚ , . , - °ª¸¸ ÀԷ¹ÞÀ½.
*/
function setLetterFloatOnly()
{
var pKey = String.fromCharCode(event.keyCode);
var floatReg = /[0-9\\.\\-]/g;
if(pKey!="\r" && !floatReg.test(pKey)) //¿£ÅÍÅ° ¹× regkey°¡ ¾Æ´Ò°æ¿ì ¸®ÅÏ
event.returnValue=false;
delete floatReg;
if( event.srcElement.userchar != undefined) {
var userKey = event.srcElement.userchar;
for(i=0;i< userKey.length;i++) {
if(pKey == userKey.charAt(i)) {
event.returnValue=true;
break;
}
}
}
}
//-----------------------------------------------------------------------------------------------------------------//
//----------------------------------- ÆäÀÌÁö initialize °ü·Ã ÇÔ¼ö ³¡ ------------------------------------------------//
/**
* ÃÖ¼Ò°ª üũ ·ÎÁ÷
*
ex : validationMinimum("100000","10000")
* @param minV : ÁöÁ¤µÈ ÃÖ¼Ò value
* @param inV : ÀÔ·ÂµÈ Value
* @return boolean
*/
function validationMinimum(minV,inV)
{
if (minV == "")
{
i18nAlert("Á¤ÇØÁø ÃÖ¼Ò°ªÀÌ ¾ø½À´Ï´Ù.");
return false;
}
if ( parseFloat(inV) < parseFloat(minV) )
{
return false;
}
return true;
}
/**
* ÃÖ´ë°ª üũ ·ÎÁ÷
*
ex : validationMaximum("100000","10000")
* @param maxV : ÁöÁ¤µÈ ÃÖ´ë value
* @param inV : ÀÔ·ÂµÈ Value
* @return boolean
*/
function validationMaximum(maxV,inV)
{
if (maxV == "")
{
i18nAlert("It decides and there is not a position maximum price");
return false;
}
if ( parseFloat(maxV) < parseFloat(inV) )
{
return false;
}
return true;
}
/**
* ÃÖ´ë btye üũ ·ÎÁ÷
*
ex : validationMaxByte(form1.inputname.value , 10)
* @param textObj : üũÇÒ String value
* @param length_limit : ÃÖ´ë byte
* @return boolean
*/
function validationMaxByte(textObj, length_limit)
{
var length = calculate_msglen(textObj);
var kor_cnt = Math.floor(length_limit/2);
if (length > length_limit) {
return false;
}
return true;
}
/**
* ÃÖ¼Ò btye üũ ·ÎÁ÷
*
ex : validationMaxByte(form1.inputname.value , 10)
* @param textObj : üũÇÒ String value
* @param length_limit : ÃÖ¼Ò byte
* @return boolean
*/
function validationMinByte(textObj, length_limit)
{
var length = calculate_msglen(textObj);
var kor_cnt = Math.floor(length_limit/2);
if (length < length_limit) {
return false;
}
return true;
}
/**
* ÇÑ±Û 2±ÛÀÚ ¿µ¹® 1±ÛÀÚ·Î ±æÀÌ ÃøÁ¤ÇÏ¿© ¹®ÀÚ¿ÀÇ byte ±æÀ̸¦ ¸®ÅÏÇÑ´Ù.
* @param üũÇÒ String value
* @return ÃøÁ¤ÇÑ ÇØ´ç °ªÀÇ byte ±æÀÌ
*/
function calculate_msglen(message)
{
var nbytes = 0;
for (i=0; i 4) {
nbytes += 2;
} else if (ch == '\n') {
if (message.charAt(i-1) != '\r') {
nbytes += 1;
}
} else if (ch == '<' || ch == '>') {
nbytes += 4;
} else {
nbytes += 1;
}
}
return nbytes;
}
/**
* get,put ¸¸ µÇ´Â hash table
*
ex :
*
var temphash = new javascriptHashtable()
*
temphash.put("key1","Åä¿äÀÏ"); °ª ³Ö±â
*
temphash.put("key2","ÀÏ¿äÀÏ");
*
temphash.get("key1"); °ª °¡Á®¿À±â
* @constructor var temp = new javascriptHashtable();
*/
function javascriptHashtable(){
this.hash = new Array();
}
javascriptHashtable.prototype.get = function (key)
{
if(this.hash[key] == undefined)
return "null";
else
return this.hash[key];
}
javascriptHashtable.prototype.put = function (key, value)
{
if (key == null || value == null)
return i18nAlert("key and value do not permit null or blank");
if (this.hash[key] != null)
return i18nAlert("already exist value");
this.hash[key] = value;
}
/**
* ÁßøµÈ css¿¡¼ ÇØ´ç css¸¸ Á¦°Å
*
removeCss(["input1","input2"],"input1")
* @param cssArr : ¼³Á¤µÇ¾î ÀÖ´Â class ¹è¿. (Âü°í·Î css´Â class="input1 input2" ÀÌ·±½ÄÀ¸·Î Áߺ¹µÉ¼ö ÀÖ´Ù.
* @param reAtt : Á¦°ÅÇÒ css¸í
* @return Á¦°ÅÇÒ css°¡ Á¦°ÅµÈ ½ºÆ®¸µ°ª
*/
function removeCss(cssArr,reAtt)
{
var retCss="";
for( var i = 0 ; i < cssArr.length ; i++)
{
if(reAtt != cssArr[i] )
retCss += cssArr[i] + " ";
}
return retCss;
}
/**
* sider FrameWorkÀÇ form submit ÇÔ¼ö
*/
//var tokenValue = "";
function formSubmitValidation()
{
//ÀÌÁß ¼ºê¹Ø ¹æÁö
if(this.submitstat != "false")
{
i18nAlert("¿äûÇϽŠ³»¿ëÀÌ Ã³¸®ÁßÀÔ´Ï´Ù.
È®ÀÎÀ» ´©¸£½Ã°í Àá½Ã ±â´Ù·Á ÁֽʽÿÀ");
return;
}
else
{
this.submitstat = "validating";
//±âº» ¹ë¸®µ¥ÀÌ¼Ç Ã¼Å© ÇÔ¼ö È£Ãâ
if(initBaseValidationCheck(this))
{
this.submitstat = "true";
XecureSubmit(this);
// this.submit();
}
else
{
this.submitstat = "false";
return;
}
}
}
/**
* validation check ·ÎÁ÷À» »« form submitÇÔ¼ö
* º» ÇÔ¼ö¿¡¼´Â Áߺ¹ Submit üũ¸¸ ÇÑÈÄ formÀ» SubmitÇÑ´Ù.
*/
//var tokenValue = "";
function formSubmit() {
//ÀÌÁß ¼ºê¹Ø ¹æÁö
if(this.submitstat != "false")
{
i18nAlert("¿äûÇϽŠ³»¿ëÀÌ Ã³¸®ÁßÀÔ´Ï´Ù.
È®ÀÎÀ» ´©¸£½Ã°í Àá½Ã ±â´Ù·Á ÁֽʽÿÀ");
try {if (document.form1 != undefined) {reset_submit(document.form1);}} catch(e){}
return;
}
else
{
this.submitstat = "true";
//var tokenValue = "";
//tokenValue = "null";
// XSS °ËÁõ
if(xssCheck(this) == false){
reset_submit(this);
return;
}
XecureSubmit(this);
// this.submit();
}
}
function xssCheck(f){
for (var i = 0 ; i < f.elements.length ; i++)
{
if (f.elements[i].tagName.toString().toLowerCase() == "input" )
{
var tmp_val = f.elements[i].value.toUpperCase();
var err_msg = "ÀԷ°ªÀÌ ¿Ã¹Ù¸£Áö ¾Ê½À´Ï´Ù.";
if(tmp_val.indexOf("');
function openFraudPopup() {
}
$(document).ready(function(){
try {
$("input[readonly=true]").on("keydown", function(event) {
if (event.keyCode == 8) {
event.preventDefault();
}
});
$("input[readonly=readonly]").on("keydown", function(event) {
if (event.keyCode == 8) {
event.preventDefault();
}
});
} catch(e) {}
if(navigator.userAgent.indexOf('Firefox') >=0){
(function(){
var events=["mousedown","mouseover","mouseout","mousemove","mousedrag","click","dbclick","keypress","keyup"];
for(var i=0;i 0) {
for(var i = 0; i < _str.length; i++) {
var tmpChar = _str.charAt(i);
var regExp = new RegExp("^[°¡-Èþ]+$", "g");
var matches = regExp.exec(tmpChar);
if (matches != null) {
var isWhanSungHangul = false;
for(var k = 0; k < WHANG_SUNG_HANGUL.length; k++) {
if(WHANG_SUNG_HANGUL[k] == tmpChar) {
isWhanSungHangul = true;
break;
}
}
if(isWhanSungHangul == false) {
return {isWhanSung : false, errorChar : tmpChar};
}
}
}
return {isWhanSung : true};
}
return {isWhanSung : false, errorChar : ''};
}
};
}();
try {if (parent.tokenValue != undefined) {parent.clearFieldWithFrm(parent.document.form1,'HTML_TOKEN_EXCEPT_URL');}} catch(e){}