// JavaScript Document

//* ÆäÀÌÁö ·Îµù½Ã ÆäÀÌÁö ³»¿¡ fnOnload ÇÔ¼ö°¡ Á¤ÀÇµÇ¾î ÀÖÀ¸¸é ÀÚµ¿ ½ÇÇà
//* (onLoad ÀÌº¥Æ® ÁöÁ¤ ¹ÌÇÊ¿ä)
window.onload = function() {
	try {
		fnOnLoad();
	} catch(er) {
	}
}

//* ÆäÀÌÁö ¾ð·Îµù½Ã ÆäÀÌÁö ³»¿¡ fnOnUnload ÇÔ¼ö°¡ Á¤ÀÇµÇ¾î ÀÖÀ¸¸é ÀÚµ¿ ½ÇÇà
//* (onUnLoad ÀÌº¥Æ® ÁöÁ¤ ¹ÌÇÊ¿ä)
window.onunload = function() {
	try {
		fnOnUnLoad();
	} catch(er) {
	}
}

//* ½ºÅ©¸³Æ® ¿¡·¯ Ã³¸®
//* ¿¡·¯¸Þ¼¼Áö¸¦ º¸¿©ÁÖÁö ¾Ê±â À§ÇØ ½ÇÁ¦ Àû¿ë½Ã¿¡´Â Alert ¸Þ¼¼Áö ÁÖ¼®Ã³¸® ¿ä¸Á
window.onerror = function(msg, file_loc, line_no) {
	alert("** "+file_loc+"ÀÇ "+line_no+"Çà¿¡¼­ ´ÙÀ½°ú °°Àº Script ¿À·ù°¡ ¹ß»ýÇÏ¿´½À´Ï´Ù.\n\n¿À·ù³»¿ë :\n"+msg);
	return true; // true¸¦ ¹ÝÈ¯ÇÒ°æ¿ì ¿À·ù¸¦ ¹«½ÃÇÏ°í °è¼Ó ÁøÇà
}

/* URL¿¡¼­ ÆÄ¶ó¸ÞÅÍ¸¦ Á¦¿ÜÇÑ ¼ø¼ö URL¸¸ ¾ò´Â´Ù */
function getPureURL(_URL) {
	var strArry = _URL.split("?");
	strArry = strArry[0].split("#");
	return strArry[0];
}

// Enter Key°¡ ÀÔ·ÂµÇ¾úÀ»¶§ ÁöÁ¤µÈ ÇÔ¼ö¸¦ ½ÇÇà
function isEnterKey(Fnc) {
	if (event.keyCode == 13) {
		eval(Fnc);
		return true;
	}
	return false;
}

/*------------------------------------------------------------------------------
==> String Function
	1. String.trim()
	2. String.getByte()
	3. String.getIntCipher()
------------------------------------------------------------------------------*/
// ¹®ÀÚ¿­ ÁÂ¿ìÃøÀÇ °ø¹é¹®ÀÚ¸¦ Á¦°Å
String.prototype.trim = function() {
	var str;
	str = (this != window) ? this : str;
	if (str == null) str = "";
	return str.replace(/^\s+/g,'').replace(/\s+$/g,'');
}

// ¹®ÀÚ¿­ÀÇ Byte ¼ö ±¸ÇÏ±â
String.prototype.getByte = function() {
	var str;
	var Cnt=0;
	str = this != window ? this : str;
	if (str == null) str = 0;

    for (var i=0;i<str.length;i++) {
		if (escape(str.charAt(i)).length > 4) {
			Cnt += 2;
		} else {
			Cnt++;
		}
	}
	return Cnt;
}

// ¼ýÀÚÀÇ ÀÚ¸®¼ö ¼³Á¤
String.prototype.getIntCipher = function(Cnt) {
	var str;
	var i, ReturnValue="";
	str = this != window ? this : str;
	str = str + "";
	if (str.length < Cnt) {
		for(i=1; i<=Cnt-str.length; i++)
			ReturnValue += "0"		
	}
	return ReturnValue+str;
}

// 
String.prototype.getSplitItem = function(tItemNum, getNum, delim) {
	var str;
	str = this != window ? this : str;
	var tmpArray = str.split(delim);
	if (tmpArray.length != tItemNum) {
		return "";
	}
	return tmpArray[getNum-1].trim();
}


/*------------------------------------------------------------------------------
==> Check Function
	1. String.isBlank()
	2. String.isInspace()
	3. String.isInteger()
	4. String.isNumber()
	5. String.isHangul()
	6. String.validateCipher()
	7. String.validateCipherB()
	8. String.validateJuminNo()
	9. String.validateBizNo()
	10. String.validateEmail()
------------------------------------------------------------------------------*/
// ¹®ÀÚ¿­ÀÌ null ÀÌ°Å³ª Blank("")ÀÎÁö °Ë»ç
String.prototype.isBlank = function() {
	var str;
	str = (this != window ? this : str);
	for(var i=0;i<str.length;i++) {
		if ((str.charAt(i)!=' ')
			&&(str.charAt(i)!="\t")
			&&(str.charAt(i)!="\n")
			&&(str.charAt(i)!="\r")) {
				return false;
		}
	}
	return true;
}

// ¹®ÀÚ¿­¿¡ °ø¹éÀÌ Æ÷ÇÔµÇ¾î ÀÖ´ÂÁö Ã¼Å©
String.prototype.isInSpace = function() {
	var str;
	str = (this != window ? this : str);
	return (str.indexOf(" ")==-1) ? false:true;
}

String.prototype.isDigit = function() {
	var str;
	if (str.length > 1) { return false; }
	var string="1234567890";
	if (string.indexOf(str)!=-1) { return true; }
	return false;
}

String.prototype.isInteger = function(){
	var str;
	if (str.isBlank()) { return false; }
	for (var i=0;i<str.length;i++) {
		if (!isDigit(str.charAt(i))) { return false; }
	}
	return true;
}

// ¼ýÀÚ·Î¸¸ ±¸¼ºµÇ¾î ÀÖ´ÂÁö Ã¼Å©
String.prototype.isNumber = function() {
	var str;
	str = (this != window ? this : str);
	return !isNaN(str);
}

// 2Byte¹®ÀÚ(ÇÑ±Û)ÀÌ Æ÷ÇÔµÇ¾îÀÖ´ÂÁö Ã¼Å©
String.prototype.isHangul = function() {
	var i; 
	var ch;
	var str;
	str = (this != window ? this : str);
	for (i=0;i<str.length;i++) { 
		ch = str.charAt(i);
		if (ch.getByte() > 1) {
			return true;
		}
	}
	return false;
}

// ÀÚ¸®¼ö¸¦ Ã¼Å©
String.prototype.validateCipher = function(minCnt, maxCnt) {
	var str;
	str = (this != window ? this : str);
	if ( (str.length >= minCnt) && (str.length <= maxCnt) ) {
		return true;
	}
	return false;
}

// ÀÚ¸®¼ö¸¦ Ã¼Å©(Byte)
String.prototype.validateCipherB = function(minCnt, maxCnt) {
	var str;
	str = (this != window ? this : str);
	if ( (str.getByte() >= minCnt) && (str.getByte() <= maxCnt) ) {
		return true;
	}
	return false;
}

// ÁÖ¹Îµî·Ï¹øÈ£ Ã¼Å©(¼ýÀÚ·Î¸¸ ±¸¼º)
String.prototype.validateJuminNo = function() {
	var str;
	str = (this != window ? this : str).trim();
	if (!str.isNumber() || !str.validateCipher(13, 13)) return false;
	var i=0;
	var sum=0;
	var birthYear = (str.charAt(6) <= "2") ? "19" : "20"; // »ý³â¿ùÀÏ À¯È¿¼º Ã¼Å©
	birthYear += str.substr(0,2);
	var birthMonth = str.substr(2,2)-1;
	var birthDate = str.substr(4,2);
	var birthDay = new Date(birthYear, birthMonth, birthDate);
	if ( birthDay.getYear() % 100 != str.substr(0,2) || birthDay.getMonth() != birthMonth 
		|| birthDay.getDate() != birthDate ) {
		return false;
	}
	var buf = new Array(12); // Checksum
	for (i=0; i<6; i++) buf[i] = parseInt(str.charAt(i));
	for (i=6; i<13; i++) buf[i] = parseInt(str.charAt(i));
	var multipliers = [2,3,4,5,6,7,8,9,2,3,4,5];
	for (i=0, sum=0; i<12; i++) sum += (buf[i] *= multipliers[i]);
	if ((11-(sum % 11)) % 10 != buf[12]) {
		return false;
	}
	return true;
}

// ¿Ü±¹ÀÎµî·Ï¹øÈ£ Ã¼Å©(¼ýÀÚ·Î¸¸ ±¸¼º)
String.prototype.validateFgnJuminNo = function() {
	var str;
	str = (this != window ? this : str).trim();
	if (!str.isNumber() || !str.validateCipher(13, 13)) return false;
    var sum = 0;
    var odd = 0;
	var buf = new Array(13); // Checksum
    for (i = 0; i < 13; i++) buf[i] = parseInt(str.charAt(i));
    odd = buf[7]*10 + buf[8];
    if (odd%2 != 0) {
      return false;
    }
    if ((buf[11] != 6)&&(buf[11] != 7)&&(buf[11] != 8)&&(buf[11] != 9)) {
      return false;
    }
    multipliers = [2,3,4,5,6,7,8,9,2,3,4,5];
    for (i = 0, sum = 0; i < 12; i++) sum += (buf[i] *= multipliers[i]);
    sum=11-(sum%11);
    if (sum>=10) sum-=10;
    sum += 2;
    if (sum>=10) sum-=10;
    if ( sum != buf[12]) {
        return false;
    }
    else {
        return true;
    }
}

// »ç¾÷ÀÚµî·Ï¹øÈ£ Ã¼Å©(¼ýÀÚ·Î¸¸ ±¸¼º)
String.prototype.validateBizNo = function() {
	var str;
	str = (this != window ? this : str).trim();
	if (!str.isNumber() || !str.validateCipher(10, 10)) return false;
	var i=0;
	var sum=0;
	var buf = new Array(10); // Checksum
	for (i=0; i<10; i++) buf[i] = parseInt(str.charAt(i));
	var multipliers = [0,3,7,0,3,7,0,3,0.5,0];
	for (i=0, sum=0; i<10; i++) {
		if (multipliers[i]==0) {
			sum += buf[i] + multipliers[i];
		} else {
			var tmpI = (buf[i] * multipliers[i]).toString();
			if (tmpI.indexOf(".") != -1) {
				var tmpA = tmpI.split(".");
				sum += parseInt(tmpA[0])+parseInt(tmpA[1]);
			} else {
				sum += parseInt(tmpI);
			}
		}
	}
	if ((sum % 10) != 0) return false;
	return true;
}

// ¹ýÀÎµî·Ï¹øÈ£ Ã¼Å©(¼ýÀÚ·Î¸¸ ±¸¼º)
String.prototype.validateCorpNo = function() {
	var str;
	str = (this != window ? this : str).trim();
	if (!str.isNumber() || !str.validateCipher(13, 13)) return false;
	var i=0;
	var sum=0;
	var buf = new Array(12); // Checksum
	for (i=0; i<6; i++) buf[i] = parseInt(str.charAt(i));
	for (i=6; i<13; i++) buf[i] = parseInt(str.charAt(i));
	var multipliers = [1,2,1,2,1,2,1,2,1,2,1,2];
	for (i=0, sum=0; i<12; i++) sum += (buf[i] *= multipliers[i]);
	if ((10-(sum % 10)) % 10 != buf[12]) {
		return false;
	}
	return true;
}

// ÀÌ¸ÞÀÏ Ã¼Å©
String.prototype.validateEmail = function() {
	str = (this != window ? this : str).trim();
	var pattern = /^[_a-zA-Z0-9-\.]+@[\.a-zA-Z0-9-]+\.[a-zA-Z]+$/;
	return (pattern.test(str)) ? true : false;
}


/*------------------------------------------------------------------------------
==> Popup Window Function
	1. generalOpenPopup(doc, winName, winX, winY, locX, locY, showMenubars, statusBar, showScrollbars)
	2. openPopupCenter(doc, winName, winWidth, winHeight, showScrollbars)
	3. openPopup(doc, winName, winWidth, winHeight, locX, locY, showScrollbars)
	4. closePopup()
------------------------------------------------------------------------------*/
function generalOpenPopup(doc, winName, locX, locY, width, height, showMenubars, statusBar, showScrollbars) {
	var strTmp = ""
	strTmp = "left="+locX+",top="+locY+",width="+width+",height="+height+",menubar="+showMenubars+",status="+statusBar+",scrollbars="+showScrollbars
	if (winName != "") {
		var popupWin = window.open(doc, winName, strTmp);
		popupWin.focus();
	} else {
		window.open(doc, winName, strTmp);
	}
}

/* È­¸é »ó´Ü ÁÂÃø¿¡ ÆË¾÷Ã¢À» ¿¬´Ù. */
function openPopupTL(doc, winName, width, height, showMenubars, statusBar, showScrollbars) {
	generalOpenPopup(doc, winName, 0, 0, width, height, showMenubars, statusBar, showScrollbars);
}

/* È­¸é »ó´Ü Áß¾Ó¿¡ ÆË¾÷Ã¢À» ¿¬´Ù. */
function openPopupTC(doc, winName, width, height, showMenubars, statusBar, showScrollbars) {
	generalOpenPopup(doc, winName, (screen.availWidth)/2-(width/2), 0, width, height, showMenubars, statusBar, showScrollbars);
}

/* È­¸é »ó´Ü ¿ìÃø¿¡ ÆË¾÷Ã¢À» ¿¬´Ù. */
function openPopupTR(doc, winName, width, height, showMenubars, statusBar, showScrollbars) {
	generalOpenPopup(doc, winName, (screen.availWidth)-(width+10), 0, width, height, showMenubars, statusBar, showScrollbars);
}

/* È­¸é ÀüÃ¼ ¿ìÃø¿¡ ÆË¾÷Ã¢À» ¿¬´Ù. */
function openPopupFR(doc, winName, width, height, showMenubars, statusBar, showScrollbars) {
	generalOpenPopup(doc, winName, (screen.availWidth)-(width+10), 0, width, (screen.availHeight-40), showMenubars, statusBar, showScrollbars);
}

/* È­¸é Á¤Áß¾Ó¿¡ ÆË¾÷Ã¢À» ¿¬´Ù. */
function openPopupCC(doc, winName, width, height, showMenubars, statusBar, showScrollbars) {
	generalOpenPopup(doc, winName, (screen.availWidth)/2-(width/2), (screen.availHeight)/2-(height/2), width, height, showMenubars, statusBar, showScrollbars);
}

/* Open Edu Center Popup */
function openEduCenter() { 
	openPopupTL('http://sif.fpsbkorea.org/edu.center.html', 'eduCenter', 685, 700, 'no', 'yes', 'yes');
} 

function openAAMSApply() { 
	openPopupTL('http://www.fpsbkorea.org/SIF/AAMS/index.3rd.html', 'eduCenter', 820, 610, 'no', 'yes', 'yes');
} 

/* Open Edu Center Popup */
function openMapEduCenter() { 
	openPopupCC('http://sif.fpsbkorea.org/edu.center.map.html', 'mapEduCenter', 685, 700, 'no', 'yes', 'yes');
}

/* FPSB Video Popup */
function openFPSBVideo() { 
	openPopupCC('http://www.fpsbkorea.org/video/FPSB.video.html', 'FPSBVideo', 648, 518, 'no', 'no', 'no');
}

/* ÆË¾÷Ã¢À» ´Ý°í ºÎ¸ðÃ¢¿¡ Æ÷Ä¿½Ì */
function closePopup() {
	self.close();
	window.opener.focus()
}

/* ÆË¾÷Ã¢À» ´Ý°í ºÎ¸ðÃ¢À» ¸®·Îµù -- È«Ã¢ÈÆ */
function closeReloding() {
	self.close();
	window.opener.document.location.reload()
}

/* °ø»çÁß ¸Þ¼¼Áö Ç¥½Ã */
function fnConstruction() {
	alert("±â´É ÁØºñÁßÀÔ´Ï´Ù.");
	return false;
}

/* ·£´ýÇÑ ¼ýÀÚ Ãâ·Â */
function fnGetRandomNo(_num) {
	var i = Math.random();
	i = Math.floor(_num*i);
	return i;
}

// JavaScript Document

/********************************************************************************
 * KAS V. 2.0¿¡¼­ »ç¿ëµÇ´Â Popup Function
 *
 * @version     1.0
 *
 * [ Requirement ]
 *   None
 *
 * [ How to ]
 *   None
 ********************************************************************************/
/* APPLICATION Window */
function openApplication(doc, winName) { 
	openPopupTL(doc, winName, 660, 750, 'no', 'yes', 'yes');
}
/* APPLICATION Window */
function openApplication1(doc, winName) { 
	openPopupTL(doc, winName, 510, 350, 'no', 'yes', 'yes');
}
/* TEST PLACE Popup */
function openTestPlace(_code) { 
	openPopupTC('/MyPage/ExamInfo/Popup/ExamPlace.aspx?code=' + _code, 'testPlace', 660, 750, 'no', 'yes', 'yes');
}
/* Input Company Popup */
function inputCompany() { 
	openPopupTC('/MyPage/CompanyFind/Find01.aspx', 'inputCompany1', 660, 750, 'no', 'yes', 'yes');
}
/* Input Address Popup */
function inputAddress() { 
	openPopupTC('input.address.html', 'inputAddress', 660, 500, 'no', 'yes', 'yes');
}
/* Input Photo Popup */
function inputPhoto() { 
	openPopupTC('/MyPage/InputPhoto.aspx', 'inputPhoto', 660, 750, 'no', 'yes', 'yes');
}
/* Temp Company Popup */
function tempCompany(doc) { 
	openPopupTC(doc, 'inputCompany', 660, 750, 'no', 'yes', 'yes');
}

/* ACCOUNT Window */
function openAccount(doc, winName) { 
	openPopupTL(doc, winName, 680, 800, 'no', 'yes', 'yes');
}

/* HISTORY Window */
function openHistory(doc, winName) { 
	openPopupTR(doc, winName, 680, 500, 'no', 'yes', 'yes');
}

/* EXAM Window */
function openEvent(doc, winName) { 
	openPopupTC(doc, winName, 680, 800, 'no', 'yes', 'yes');
}

/* UNIT(Contining Edu) Window */
function openUnit(doc, winName) { 
	openPopupCC(doc, winName, 680, 500, 'no', 'yes', 'yes');
}

/* EDU Window */
function openEdu(doc, winName) { 
	openPopupTC(doc, winName, 680, 800, 'no', 'yes', 'yes');
}

/* POOL Window */
function openPool(doc, winName) { 
	openPopupTR(doc, winName, 680, 600, 'no', 'yes', 'yes');
}

/* WRITE Window */
function openWrite(doc, winName) { 
	openPopupTR(doc, winName, 680, 800, 'no', 'yes', 'yes');
}

/* READ Window */
function openRead(doc, winName) { 
	openPopupTR(doc, winName, 680, 800, 'no', 'yes', 'yes');
}

/* UTILITY Window - Excel, Batch */
function openUtil(doc, winName) { 
	openPopupCC(doc, winName, 680, 600, 'no', 'no', 'yes');
}

/* PRINT Window */
function openPrint(doc, winName) { 
	openPopupTR(doc, winName, 760, 800, 'no', 'no', 'yes');
}

/* STASTICS Window */
function openStat(doc, winName) { 
	openPopupTR(doc, winName, 680, 800, 'no', 'no', 'yes');
}

/* INSPECTION Window */
function openInspect(doc, winName) { 
	openPopupFR(doc, winName, 309, 0, 'no', 'no', 'yes');
}

/* FUNCTION - Confirm & Remarks */
function CnR() { <!-- "prcs()" ¸¦ °ÅÃÄ¼­ "CnR()" -->
	openPopupCC('../util/confirm.n.remarks.html', 'CnR', 370, 210, 'no', 'no', 'no');
}

/* FUNCTION - Processing */
function prcs() { <!-- "prcs()" ¸¦ °ÅÃÄ¼­ "CnR()" -->
	openPopupCC('../util/processing.html', 'processing', 370, 210, 'no', 'no', 'no');
}

/* FUNCTION - upload XLS */
function uploadXLS() { 
	openPopupTR('../util/xls.upload.html', 'uploadXLS', 650, 600, 'no', 'no', 'no');
}

/* FUNCTION - download XLS */
function downloadXLS() { 
	openPopupTR('../util/xls.download.html', 'downloadXLS', 650, 245, 'no', 'no', 'no');
}

/* FUNCTION - edit Photo */
function editPhoto() { 
	openPopupTR('../util/edit.photo.html', 'editPhoto', 650, 600, 'no', 'no', 'no');
}

/* FUNCTION - find Account */
function findAccount() { 
	openPopupCC('../util/find.account.html', 'findAccount', 370, 310, 'no', 'no', 'no');
}

/* FUNCTION - find Trainee CFP */
function findTraineeCFP() { 
	openPopupCC('../util/find.trainee.CFP.html', 'findTraineeCFP', 370, 310, 'no', 'no', 'no');
}

/* FUNCTION - find Trainee AFPK */
function findTraineeAFPK() { 
	openPopupCC('../util/find.trainee.AFPK.html', 'findTraineeAFPK', 370, 310, 'no', 'no', 'no');
}

/* FUNCTION - Find Company */
function findCompany() { 
	openPopupCC('../util/find.company.html', 'findCompany', 370, 280, 'no', 'no', 'no');
}

/* FUNCTION - Find Address */
function findAddress() { 
	openPopupCC('../util/find.address.html', 'findAddress', 370, 280, 'no', 'no', 'no');
}

/* FUNCTION - Change Password */
function changePWD() { 
	openPopupCC('util/change.PWD.html', 'changePWD', 370, 250, 'no', 'no', 'no');
}

/* Temp. ¹öÆ°¸µÅ© */
function goToURL(doc) { 
  var i, args=goToURL.arguments; document.returnValue = false;
  for (i=0; i<(args.length-1); i+=2) eval(args[i]+".location='"+args[i+1]+"'");
}

/* Temp. ¸Þ´º¸µÅ© */
function jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}

/* Temp. ÄÑ±â ²ô±â */
function fnOnObject(_layerNm) {
	var obj, v;
	try {
		obj = document.all[_layerNm];
		if (obj.style) {
			obj=obj.style;
		}
		obj.display="";
	} catch(er) {}
}

function fnOffObject(_layerNm) {
	var obj, v;
	try {
		obj = document.all[_layerNm];
		if (obj.style) {
			obj=obj.style;
		}
		obj.display="none";
	} catch(er) {}
}

function fnOnAllObject(_preLayerNm, _totalLayerCnt) {
	for(var i=1;i <= _totalLayerCnt; i++) {
		fnOnObject(_preLayerNm+i.toString().getIntCipher(2));
	}
}

function fnOffAllObject(_preLayerNm, _totalLayerCnt) {
	for(var i=1;i <= _totalLayerCnt; i++) {
		fnOffObject(_preLayerNm+i.toString().getIntCipher(2));
	}
}

/* ÀÌ´Ï½Ã½º ¿µ¼öÁõ */
function showReceipt(noTid) {
	popupWin = window.open( "https://iniweb.inicis.com/DefaultWebApp/mall/cr/cm/mCmReceipt_head.jsp?noTid=" + noTid+"&noMethod=1","popWinName","menubar=1,toolbar=0,scrollbars=3,width=500,height=680,resize=1,left=252,top=116" )
}




//New function
function check_date (obj, gbn, month_obj, alert_text) 
{
	//obj -> ³â or ¿ù or ÀÏ
	//gbn -> 1 = year, 2 = month, 3 = day
	//pre_obj -> ¿ù¿¡ µû¸¥ ÀÏÀÚ Ã¼Å©
	var nDate = new Date();
	var arDay = new Array(13);
	arDay[1] = 31; 
	arDay[2] = (nDate.getYear % 4 == 0) ? 29 : 28; 
	arDay[3] = 31; 
	arDay[4] = 30; 
	arDay[5] = 31; 
	arDay[6] = 30; 
	arDay[7] = 31;
	arDay[8] = 31;
	arDay[9] = 30;
	arDay[10] = 31;
	arDay[11] = 30; 
	arDay[12] = 31;

	if (gbn == 1) {	
		if (isNaN(obj.value)) {
			alert(alert_text);
			obj.value = "";
			obj.focus();
			return true;
		}
		if (parseInt(obj.value, 10) < 1900 || parseInt(obj.value, 10) > 2079) {
			alert(alert_text);
			obj.value = "";
			obj.focus();
			return true;						
		}
	} else if (gbn == 2) {
		if (isNaN(obj.value)) {
			alert(alert_text);
			obj.value = "";
			obj.focus();
			return true;
		}
		if (parseInt(obj.value, 10) <= 0 || parseInt(obj.value, 10) > 12) {
			alert(alert_text);
			obj.value = "";
			obj.focus();
			return true;						
		}
	} else if (gbn == 3) {
		if (isNaN(obj.value)) {
			alert(alert_text);
			obj.value = "";
			obj.focus();
			return true;
		}
		if (parseInt(obj.value, 10) <= 0 || parseInt(obj.value, 10) > arDay[parseInt(month_obj.value, 10)]) {
			alert(alert_text);
			obj.value = "";
			obj.focus();
			return true;
		}
	}
}