// Àüü °øÅë document.write(''); document.write(''); document.write(''); // Ç÷¡½Ã ¸µÅ©¿ë jsÀÎŬ·çµå document.write(''); // º¸Çè»êÃâ ó¸® jsÀÎŬ·çµå document.write(''); // ¿À¸¥ÂÊ ¹öư Ŭ¸¯À» ¸øÇÏ°Ô ÇÏ´Â ºÎºÐ if (window.Event) // ³Ý½ºÄÉÀÌÇÁ¿¡¼­¸¸ ´ë¹®ÀÚ E. document.captureEvents(Event.MOUSEUP); // mouse up À̺¥Æ®¸¦ ÀâÀ½ function nocontextmenu() // IE4¿¡¼­¸¸ Àû¿ë, ´Ù¸¥ ºê¶ó¿ìÀú´Â ¹«½Ã { event.cancelBubble = true event.returnValue = false; alert("¸¶¿ì½º ¿À¸¥ÂÊ ¹öư »ç¿ë±ÝÁö"); return false; } function norightclick(e) // ´Ù¸¥ ¸ðµç ºê¶ó¿ìÀú¿¡¼­ ÀÛµ¿ { if (window.Event) // ´Ù½Ã, IE ¶Ç´Â NAV ? { if (e.which == 2 || e.which == 3) return false; } else if (event.button == 2 || event.button == 3) { event.cancelBubble = true event.returnValue = false; return false; } } document.oncontextmenu = nocontextmenu; // IE5+ ¿ë document.onmousedown = norightclick; // ´Ù¸¥ ºê¶ó¿ìÀú ¿ë /******************************************************************************************************** ÆË¾÷â ¿ÀÇ ********************************************************************************************************/ function popOpen(url) { //var positionX = 0; //var positionY = 0; var positionX = (screen.width-400)/2; var positionY = (screen.height-266)/2; window.open(url,"","left="+positionX+",top="+positionY+",width=400,height=266,toolbar=no,scrollbars=no" ); } /****** ÆË¾÷â ¸®»çÀÌÁî **************************************************************/ function popResize() { var thisX = document.getElementById("offsetTable").offsetWidth; var thisY = document.getElementById("offsetTable").offsetHeight; var headerY = document.getElementById("offsetTableHeader").offsetHeight; var footerY = document.getElementById("offsetTableFooter").offsetHeight; var maxThisX = screen.width - 50; var maxThisY = screen.height - 40; if (window.navigator.userAgent.indexOf("SV1") != -1) { //IE6.0 var marginY = headerY + footerY + 58; //¸¶Áö¸· ¼ö´Â »óȲ¿¡µû¶ó ¾Ë¸Â°Ô ³ÖÀ¸¼¼¿ä. (ÅÛÇø´ÀÇ Çì´õ³ôÀÌ + DzÅÍ ³ôÀÌ + ¾ËÆÄ) } else if (window.navigator.userAgent.indexOf("MSIE 7") != -1) { //IE7.0 var marginY = headerY + footerY + 71; } else { var marginY = headerY + footerY + 29; //¸¶Áö¸· ¼ö´Â »óȲ¿¡µû¶ó ¾Ë¸Â°Ô ³ÖÀ¸¼¼¿ä. (ÅÛÇø´ÀÇ Çì´õ³ôÀÌ + DzÅÍ ³ôÀÌ + ¾ËÆÄ) } if (thisX > maxThisX) { window.document.body.scroll = "yes"; thisX = maxThisX; } if (thisY > maxThisY - marginY) { window.document.body.scroll = "yes"; thisY = maxThisY - marginY; window.onunload = function() { window.resizeTo(thisX-10,thisY+marginY); } thisX += 19; } var windowX = (screen.width - (thisX+10))/2; var windowY = (screen.height - (thisY+marginY))/2 - 20; window.moveTo(windowX,windowY); window.resizeTo(thisX+10,thisY+marginY); } /****** ÆË¾÷â ¸®»çÀÌÁî 2009-11-02 Á¤º¸¿µ *********************************************/ function popResize2() { var thisX = document.getElementById("offsetTable").offsetWidth; var thisY = document.getElementById("offsetTable").offsetHeight; var headerY = document.getElementById("offsetTableHeader").offsetHeight; var footerY = document.getElementById("offsetTableFooter").offsetHeight; var maxThisX = screen.width - 50; var maxThisY = screen.height - 40; if (window.navigator.userAgent.indexOf("SV1") != -1) { //IE6.0 var marginY = headerY + footerY + 58; //¸¶Áö¸· ¼ö´Â »óȲ¿¡µû¶ó ¾Ë¸Â°Ô ³ÖÀ¸¼¼¿ä. (ÅÛÇø´ÀÇ Çì´õ³ôÀÌ + DzÅÍ ³ôÀÌ + ¾ËÆÄ) } else if (window.navigator.userAgent.indexOf("MSIE 7") != -1) { //IE7.0 var marginY = headerY + footerY + 71; } else { var marginY = headerY + footerY + 29; //¸¶Áö¸· ¼ö´Â »óȲ¿¡µû¶ó ¾Ë¸Â°Ô ³ÖÀ¸¼¼¿ä. (ÅÛÇø´ÀÇ Çì´õ³ôÀÌ + DzÅÍ ³ôÀÌ + ¾ËÆÄ) } if (thisX > maxThisX) { window.document.body.scroll = "yes"; thisX = maxThisX; } if (thisY > maxThisY - marginY - 346) { window.document.body.scroll = "auto"; thisY = maxThisY - marginY; window.onunload = function() { window.document.body.scroll = "yes"; } } var windowX = (screen.width - (thisX+10))/2; var windowY = (screen.height - (thisY+marginY))/2 - 20; window.moveTo(200,150); window.resizeTo(thisX,600); } /****** ÆË¾÷â ¸®»çÀÌÁî : SecureFrame ÅëÇÑ ¸®»çÀÌÁî**************************************************************/ function popResizeSecure() { var thisX = document.getElementById("offsetTable").offsetWidth; var thisY = document.getElementById("offsetTable").offsetHeight; var headerY = document.getElementById("offsetTableHeader").offsetHeight; var footerY = document.getElementById("offsetTableFooter").offsetHeight; var maxThisX = screen.width - 50; var maxThisY = screen.height - 40; if (window.navigator.userAgent.indexOf("SV1") != -1) { //IE6.0 var marginY = headerY + footerY + 58; //¸¶Áö¸· ¼ö´Â »óȲ¿¡µû¶ó ¾Ë¸Â°Ô ³ÖÀ¸¼¼¿ä. (ÅÛÇø´ÀÇ Çì´õ³ôÀÌ + DzÅÍ ³ôÀÌ + ¾ËÆÄ) } else if (window.navigator.userAgent.indexOf("MSIE 7") != -1) { //IE7.0 var marginY = headerY + footerY + 71; } else { var marginY = headerY + footerY + 29; //¸¶Áö¸· ¼ö´Â »óȲ¿¡µû¶ó ¾Ë¸Â°Ô ³ÖÀ¸¼¼¿ä. (ÅÛÇø´ÀÇ Çì´õ³ôÀÌ + DzÅÍ ³ôÀÌ + ¾ËÆÄ) } if (thisX > maxThisX) { window.document.body.scroll = "yes"; thisX = maxThisX; } if (thisY > maxThisY - marginY) { window.document.body.scroll = "yes"; thisY = maxThisY - marginY; window.onunload = function() { window.resizeTo(thisX-10,thisY+marginY); } thisX += 19; } var windowX = (screen.width - (thisX+10))/2; var windowY = (screen.height - (thisY+marginY))/2 - 20; top.moveTo(windowX,windowY); top.resizeTo(thisX+10,thisY+marginY); } //À©µµ¿ì »õâ ¸µÅ© function popWin(url) { window.open(url,"","" ); } //¿ÜºÎ¸µÅ© ÆË¾÷â ¸µÅ© function popWin_s(url,widthX,heightY) { var positionX = (screen.width-500)/2; var positionY = (screen.height-526)/2; window.open(url,"","left="+positionX+",top="+positionY+",width=" +widthX+ ",height=" +heightY+ ",statusbar=no,toolbar=no,scrollbars=no" ); } //ÆË¾÷³» ¸µÅ© function goWin(url) { window.opener.location.href=url; opener.focus(); // self.close(); } //À̸ÞÀϼ­ºñ½º ÆË¾÷ function popEmail() { var positionX = (screen.width-613)/2; var positionY = (screen.height-587)/2; window.open("/directweb/member/membership/popup_email_type.jsp","Email_Service","left="+positionX+",top="+positionY+",width=613,height=587,toolbar=no,scrollbars=yes" ); } /******************************************************************************************************** Ç÷¡½¬ ********************************************************************************************************/ function Flash_display(sFName, nWidth, nHeight, flashvars, sVName, BGColor, Wmode ){ document.write(''); document.write(''); document.write(''); document.write(''); document.write(''); document.write(''); document.write(''); document.write(' '); document.write(''); } //Àü±¹ ¼­ºñ½º¸Á Ç÷¡½¬ °ü·Ã ¼Ò½º function refreshList(sSido, SKugun){ alert("sSido: "+sSido+" Skugun: "+SKugun); } /******************************************************************************************************** MyÇÏÀÌÄ«´ÙÀÌ·ºÆ® ÇÁ·¹ÀÎ ¸®»çÀÌ¡ ********************************************************************************************************/ function resizeFrameHeight() { var frameName = window.name; var documentHeight = document.body.scrollHeight || document.documentElement.scrollHeight; //alert(documentHeight); try { parent.document.getElementById(frameName).style.height = documentHeight + "px"; } catch(e) { } } /******************************************************************************************************** ·¹ÀÌ¾î ÆË¾÷ ********************************************************************************************************/ document.write(''); document.write(''); function showPopLayer(sMsgPath) { //scrollTo(0,0); var sWindowHeight = document.body.scrollHeight; //var sMsgPath = "employ08"; var sHTML = ''; sHTML += '
\n'; sHTML += '\n'; sHTML += ' '; sHTML += '
'; sHTML += '\n'; sHTML += ' '; sHTML += '
'; sHTML += ' '; sHTML += '
close
'; sHTML += '
'; sHTML += '
'; sHTML += '
'; var sHTML2 = ''; sHTML2 += '
\n'; sHTML2 += '\n'; sHTML2 += ''; sHTML2 += '
'; sHTML2 += '\n'; sHTML2 += ''; sHTML2 += '
'; sHTML2 += '
'; var popBackgroundArea = document.getElementById("popBackgroundArea"); if (popBackgroundArea) popBackgroundArea.innerHTML = sHTML2; var msgArea = document.getElementById("msgArea"); if (msgArea) msgArea.innerHTML = sHTML; } function hidePopLayer() { document.getElementById('popBackgroundArea').style.display="none"; document.getElementById('msgArea').style.display="none"; } /******************************************************************************************************** ¼¿·ºÆ®¹Ú½º ¸Þ´º ¸µÅ© ********************************************************************************************************/ function goto_byselect_new(sel,w_target) { var index = sel.selectedIndex; var selVal = sel.options[index].value; if (selVal == '' ) return; else { if(w_target == "_blank"){ window.open(selVal); } else { location.replace(selVal); } } } /******************************************************************************************************** ÆäÀÌÁö ·Ó¾÷ À̺¥Æ® ¸ðÀ½ ********************************************************************************************************/ //·Î±×ÀÎ ºÒÅõ¸í ·¹À̾î Á¦¾î function changeSH(nidNum){ for (i=1;i<3;i++){ document.getElementById('check' + i).src = "/directweb/images/member/radio_off.gif"; document.getElementById('layer_opacity' + i ).style.visibility="hidden"; document.getElementById('layer_opacity' + i ).style.display="none"; } document.getElementById('check' + nidNum).src = "/directweb/images/member/radio_on.gif"; document.getElementById('layer_opacity' + nidNum ).style.visibility="visible"; document.getElementById('layer_opacity' + nidNum ).style.display=""; } //FAQ List var z=1 function faqList(i) { var answer_i = document.all["answer"+i]; var answer_z = document.all["answer"+z]; if(answer_i.style.display=="") { answer_i.style.display="none" z=1 } else{ if(z != 0){ answer_z.style.display="none" answer_i.style.display="" } answer_i.style.display="" z=i } } //Q&A List var rollFlag=0; function roll_up(img_num) { document.images["qnum" + img_num].src = "/directweb/images/service/q_" + img_num + "_off.gif"; document.all["Q" + img_num].className = "qus_off"; } function roll_down(img_num) { document.images["qnum" + img_num].src = "/directweb/images/service/q_" + img_num + "_on.gif"; document.all["Q" + img_num].className = "qus_on"; } function qna(str) { sub_num = str.substring(str.length - 2); sub_str = str.substring(0, str.length -2); if (document.all[str].style.display=="") { document.all[str].style.display="none"; roll_up(sub_num); rollFlag=0; return; } else { if(rollFlag != 0) { document.all[sub_str+rollFlag].style.display="none"; roll_up(rollFlag); document.all[str].style.display=""; roll_down(sub_num); } document.all[str].style.display=""; roll_down(sub_num); rollFlag=sub_num; } } //À±¸®°­·É function rollMoralSH(nidNum){ for (i=1;i<6;i++){ document.getElementById('subject_tit_sub' + i ).style.visibility="hidden"; document.getElementById('subject_tit_sub' + i ).style.display="none"; } document.getElementById('subject_tit_sub' + nidNum ).style.visibility="visible"; document.getElementById('subject_tit_sub' + nidNum ).style.display=""; } function rollMoralSubSH(nidNum){ for (i=1;i<35;i++){ document.getElementById('morallist' + i).className = "off"; document.getElementById('subject_detail' + i ).style.visibility="hidden"; document.getElementById('subject_detail' + i ).style.display="none"; } document.getElementById('morallist' + nidNum).className = "on"; document.getElementById('subject_detail' + nidNum ).style.visibility="visible"; document.getElementById('subject_detail' + nidNum ).style.display=""; } /******************************************************************************************************** À̺¥Æ® ¹× À̹ÌÁö °ü·Ã ½ºÆ®¸³Æ® ********************************************************************************************************/ //PNG À̹ÌÁö Åõ¸íó¸® function setPng24(obj) { obj.width=obj.height=1; obj.className=obj.className.replace(/\bpng24\b/i,''); obj.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+ obj.src +"',sizingMethod='image');" obj.src=''; return ''; } //À̹ÌÁö ¿À¹ö/¾Æ¿ô function setOver(thisImg, sMode) { var sPath = thisImg.src; var sCommonPath = sPath.substring(0, sPath.lastIndexOf("_") + 1); var sType = sPath.substring(sPath.lastIndexOf("."), sPath.length); //alert(sCommonPath + "on" + sType); thisImg.src = sCommonPath + sMode + sType; } //ÀÚµ¿Â÷»óǰ_Çϴܾà°ü¹è³Ê(·£´ýÀ̹ÌÁö) function randomPRD() { var r = Math.round(Math.random() * 100); if (r >= 0 && r < 25) { document.getElementById("random1").style.display = ""; } else if (r >= 25 && r < 50) { document.getElementById("random2").style.display = ""; //} else if (r >= 50 && r < 75) { // document.getElementById("random3").style.display = ""; } else { document.getElementById("random4").style.display = ""; } } // ÅëÇÕ °Ë»ö¿ë Function function goUnionSearch( param ) { location.replace("/directweb/search/search_resultList.jsp?question="+param); } // ·Î±×ÀÎ Á¤º¸¸¦ °¡Á®¿À±â À§ÇÑ Ajax ÄÚµå ½ÃÀÛ ====================================================== var RIA_TMP_CUST_NO = ""; // RIA¿¡¼­ »ç¿ëÇÏ´Â Àӽà ÁֹιøÈ£ º¯¼ö var RIA_TMP_CUST_NAME = ""; // RIA¿¡¼­ »ç¿ëÇÏ´Â Àӽà À̸§ º¯¼ö var xmlHttp; function getXMLHTTP() { xmlHttp = ""; if (window.XMLHttpRequest) { xmlHttp = new XMLHttpRequest(); } else if (window.ActiveXObject) { xmlHttp = new ActiveXObject("Microsoft.XMLHTTP"); } return xmlHttp; } function initRiaMemberInfo() { xmlHttp = getXMLHTTP(); xmlHttp.open("GET", "/directweb/member/login/flashMemInfo.jsp", true); xmlHttp.onreadystatechange = callbackMemInfo; xmlHttp.send(null); } function callbackMemInfo() { if(xmlHttp.readyState == 4) { if(xmlHttp.status == 200) { var data = xmlHttp.responseText; var memInfos = data.split("&"); var CUST_NAME = memInfos[0].split("=")[1]; var CUST_NO1 = memInfos[1].split("=")[1]; var CUST_NO2 = memInfos[2].split("=")[1]; RIA_TMP_CUST_NAME = CUST_NAME; RIA_TMP_CUST_NO = CUST_NO1 + CUST_NO2; } else { } } } // ¹«Á¶°Ç È£ÃâÇÑ´Ù. //initRiaMemberInfo(); // ·Î±×ÀÎ Á¤º¸¸¦ °¡Á®¿À±â À§ÇÑ Ajax ÄÚµå ³¡ ====================================================== // °øÅ븮¾ÆÈ£Ãâ function openRiaCom(sCustNo, sName, sType){ // ÀÎÀÚ¿¡¼­ ³Ñ¾î¿Â °³ÀÎ Á¤º¸°¡ ¾ø´Â °æ¿ì ·Î±×ÀÎ USERÀÇ Á¤º¸¸¦ °¡Á®¿Â´Ù. if ( sCustNo == "" && sName == "" ) { sCustNo = RIA_CUST_NO; sName = RIA_CUST_NAME; } //sCustNo : ÁֹιøÈ£ //sName : ¼º¸í //sType : Ç÷£ :º£ÀÌÁ÷ 01:¿¡¹ö 02:À§Å© 03:ÆÐ¹Ð¸® var sRiaPath = "A"; var sInsType = "5100"; if(sType =="5200")sInsType = "5200"; var plancd = ""; if(sType == "" ){ sInsType = "5100"; plancd = ""; } else if (sType == "01" ){ sInsType = "5110"; plancd = "01"; } else if (sType == "02" ){ sInsType = "5110"; plancd = "02"; } else if (sType == "03" ){ sInsType = "5110"; plancd = "03"; } /* var f = document.riaDownForm; if (EncForm2(riaDownForm, secureForm)) { secureForm.method = "post"; secureForm.target = "RiafrmHidden"; secureForm.action = "/directweb/common/util/writeLog1.jsp?certYN="+RIA_CERT_YN+ "&sRiaPath="+sRiaPath+ "&sInsType="+sInsType+ "&plancd="+ plancd+"&sCusNo="+ sCustNo + "&sName="+sName + "&RIA_CAMPAIGN_ID=" + RIA_CAMPAIGN_ID + "&RIA_INPATH1=" + RIA_INPATH1 + "&RIA_INPATH2=" + RIA_INPATH2; secureForm.submit(secureForm, "width=0,height=0,motion=no"); } */ openFlashRia("certYN="+RIA_CERT_YN+ "&sRiaPath="+sRiaPath+ "&sInsType="+sInsType+ "&plancd="+ plancd+"&sCusNo="+ sCustNo + "&sName="+sName + "&RIA_CAMPAIGN_ID=" + RIA_CAMPAIGN_ID + "&RIA_INPATH1=" + RIA_INPATH1 + "&RIA_INPATH2=" + RIA_INPATH2 ); } // °øÅë°ßÀû¿¹¾àÈ£Ãâ function openReserveCom(sCustNo, sName, sType){ var sInsrdID = sCustNo; var sInsrdID1 = ""; var sInsrdID2 = ""; if (sInsrdID.length == 13) { sInsrdID1 = sInsrdID.substring(0,6); sInsrdID2 = sInsrdID.substring(6,13); } // secure_include.jsp¿¡ ÇØ´ç form Á¤ÀÇ var f = document.openReserveComForm; f.sInsrdID.value = sInsrdID; f.sInsrdID1.value = sInsrdID1; f.sInsrdID2.value = sInsrdID2; f.sInsrdName.value = sName; f.sType.value = 1; f.sCampaignID.value = RIA_CAMPAIGN_ID; f.sInPath1.value = RIA_INPATH1; f.sInPath2.value = RIA_INPATH2; if (EncForm2(openReserveComForm, secureForm)) { secureForm.method = "post"; secureForm.action = "/directweb/common/reserve/reserve.jsp"; $window.submit(secureForm, "width=311,height=350,motion=no"); return ; } else { //alert("º¸¾È»ó ¹®Á¦°¡ »ý°Ü Àü¼ÛÀÌ Ãë¼Ò µÇ¾ú½À´Ï´Ù."); } //$window.open('/directweb/common/reserve/reserve.jsp?sInsrdID=' + sInsrdID + "&sInsrdID1=" + sInsrdID1 + "&sInsrdID2=" + sInsrdID2 + "&sInsrdName=" + sName + "&sType=" + sType + "&sCampaignID=" + RIA_CAMPAIGN_ID + "&sInPath1=" + RIA_INPATH1 + "&sInPath2=" + RIA_INPATH2 , "" , "width=311,height=350,motion=no"); //sCustNo : ÁֹιøÈ£ //sName : ¼º¸í //sType : 1 MainÀº ±âº» 1¸¸ ÁֽøéµË´Ï´Ù. } // 2008.06.18 - ÀÓÁ¤±Ô // °øÅ븮¾ÆÈ£Ãâ - Á¦È޻翡¼­ »ç¿ë // Àû¿ë Á¦ÈÞ»ç - ·Ôµ¥¸¶Æ®, ·Ôµ¥½´ÆÛ, ¸Þ°¡¸¶Æ®, CJMall, GSMall function openWebbizRiaCom(sGubun, sType){ var f = document.riaWebbizForm; var insrdID = ""; var insrdID1 = ""; var insrdID2 = ""; var insrdName = ""; if ( (typeof f) != 'undefined') { insrdID = f.sInsrdID1.value + f.sInsrdID2.value; insrdID1 = f.sInsrdID1.value; insrdID2 = f.sInsrdID2.value; insrdName = f.sInsrdName.value; if (sGubun == "RESERVE") { openReserveCom(insrdID , insrdName , sType); } else { openRiaCom(insrdID , insrdName , sType); } } else { if (sGubun == "RESERVE") { openReserveCom(insrdID , insrdName , sType); } else { openRiaCom(insrdID , insrdName , sType); } } return; } // leftMenu Ç÷¹½¬ ³ôÀÌÁ¶Àý¿ë // ÀÓÁ¤±Ô - 2008.06.20 function setLeftMenuHeight(h){ document.getElementById("leftMENU").style.height = h; } // ================== ¹è³Ê & À̺¥Æ® ÄíŰ ó¸® ½ÃÀÛ ======================= // SET // type : layer, popup // checked : ¿À´Ã ÇÏ·ç(?) ¿­Áö ¾ÊÀ½ üũ ¿©ºÎ // name : ¹è³Ê ¸í // value : ÄíŰ °ª. // expiredays : ÄíŰ º¸Á¸ÀÏ function setBannerCookie( type, checked, name, value, expiredays ) { if ( checked ) { var todayDate = new Date(); todayDate.setDate( todayDate.getDate() + expiredays ); document.cookie = name + "=" + escape( value ) + "; path=/; expires=" + todayDate.toGMTString() + ";" if (type == "layer") { document.getElementById(name).style.display='none'; } else if ( type == "popup") { self.close(); } } } // GET // name : ¹è³Ê ¸í function getBannerCookie( name ) { var valueOfCookie = ""; var nameOfCookie = name + "="; var x = 0; while ( x <= document.cookie.length ) { var y = (x+nameOfCookie.length); if ( document.cookie.substring( x, y ) == nameOfCookie ) { if ( (endOfCookie=document.cookie.indexOf( ";", y )) == -1 ) endOfCookie = document.cookie.length; valueOfCookie = unescape( document.cookie.substring( y, endOfCookie ) ); } x = document.cookie.indexOf( " ", x ) + 1; if ( x == 0 ) break; } if ( valueOfCookie == "" ) { document.getElementById(name).style.display = "block"; } } // ================== ¹è³Ê & À̺¥Æ® ÄíŰ ó¸® ³¡ ======================= /** * @function openWebZine() * @desc À¥Áø ÆË¾÷ * @param * @return * @history 2008.10.15 **/ function openWebZine() { var url = ""; url = "http://webzine.hicardirect.com"; window.open(url,'','width='+'1080'+',height='+'768'+',scrollbars=no,resized=no'); } /** * @function getManAge() * @desc ¸¸³ªÀÌ ±¸Çϱâ * @param * @return * @history 2009.01.16 **/ function getManAge(realAge){ var d=new Date(); //µ¥ÀÌÆ®°´Ã¼ var curr_yy = d.getYear(); var curr_mm = d.getMonth()+1; var curr_dd = d.getDate(); var birth_yy = '19' + realAge.substr(0,2); var birth_mm = realAge.substr(2,2); var birth_dd = realAge.substr(4,2); var age = Number(curr_yy) - Number(birth_yy); if ( Number(curr_mm) == Number(birth_mm) ){ if ( Number(curr_dd) < Number(birth_dd) ){ age = Number(age) - Number(1); } } else if ( Number(curr_mm) < Number(birth_mm) ){ age = Number(age) - Number(1); } return age; }