var curClickMenu = null; var curImage = null; function MM_swapImgRestore() { //v3.0 var i,x,a=document.MM_sr; for(i=0;a&&i0&&parent.frames.length) { d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);} if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i '9') { return false; } } return true; } /*±¸ºÐ°ª[M:ÇÚµåÆùüũÁ¤»ó,T:ÀϹÝÀüȭüũÁ¤»ó,E:ºñÁ¤»ó] */ function checkAllPhoneNo(phone){ var phone_no = phone; var check = "E"; var m = "010,011,013,016,017,018,019,0130"; var t = "02,031,032,033,041,042,043,051,052,053,054,055,061,063,062,064,0502,0505,0506,070"; if(phone_no.length > 2 || phone_no == "02") { if(m.indexOf(phone_no) != -1) check = "M"; if(t.indexOf(phone_no) != -1) check = "T"; } return check; } /* ÀüÈ­¹øÈ£ üũ */ function checkTelNo(carform,no1,no2,no3,tel_gubun) { var t_no1 = no1.value; var t_no2 = no2.value; var t_no3 = no3.value; if(tel_gubun == "M" ) { if( t_no1.length > 4){ alert("ù¹øÂ° ÀüÈ­¹øÈ£¸¦ È®ÀÎÇØ ÁֽʽÿÀ"); no1.focus(); return false; } if(tel_gubun != checkAllPhoneNo(t_no1)){ alert("ù¹øÂ° ÀüÈ­¹øÈ£¸¦ È®ÀÎÇØ ÁֽʽÿÀ"); no1.focus(); return false; } }else if(tel_gubun == "T" ) { if( t_no1.length < 2 || t_no1.length > 4){ alert("ù¹øÂ° ÀüÈ­¹øÈ£¸¦ È®ÀÎÇØ ÁֽʽÿÀ"); no1.focus(); return false; } if(tel_gubun != checkAllPhoneNo(t_no1)){ alert("ù¹øÂ° ÀüÈ­¹øÈ£¸¦ È®ÀÎÇØ ÁֽʽÿÀ"); no1.focus(); return false; } }else { if( t_no1.length < 2 || t_no1.length > 4){ alert("ù¹øÂ° ÀüÈ­¹øÈ£¸¦ È®ÀÎÇØ ÁֽʽÿÀ"); no1.focus(); return false; } if(checkAllPhoneNo(t_no1) == "E" ){ alert("ù¹øÂ° ÀüÈ­¹øÈ£¸¦ È®ÀÎÇØ ÁֽʽÿÀ"); no1.focus(); return false; } } if( t_no2.length < 3 || t_no2.length > 4){ alert("µÎ¹øÂ° ÀüÈ­¹øÈ£ È®ÀÎÇØ ÁֽʽÿÀ"); no2.focus(); return false; } if( t_no3.length < 3 || t_no3.length > 4){ alert("¼¼¹øÂ° ÀüÈ­¹øÈ£¸¦ È®ÀÎÇØ ÁֽʽÿÀ"); no3.focus(); return false; } //ÀüÈ­¹øÈ£¼ýÀÚ Ã¼Å© if(!checkNum(t_no1)) { alert("ù¹øÂ° ÀüÈ­¹øÈ£¸¦ ¼ýÀÚ·Î ÀÔ·ÂÇØ Áֽʽÿä"); no1.focus(); return false; } if(!checkNum(t_no2)) { alert("µÎ¹øÂ° ÀüÈ­¹øÈ£¸¦ ¼ýÀÚ·Î ÀÔ·ÂÇØ Áֽʽÿä"); no2.focus(); return false; } if(!checkNum(t_no3)) { alert("¼¼¹øÂ° ÀüÈ­¹øÈ£¸¦ ¼ýÀÚ·Î ÀÔ·ÂÇØ Áֽʽÿä"); no3.focus(); return false; } return true; } /* ÀüÈ­¹øÈ£ üũ */ function checkTelNo(carform,no1,no2,no3,tel_gubun,alert_yn) { var t_no1 = no1.value; var t_no2 = no2.value; var t_no3 = no3.value; if(tel_gubun == "M" ) { if( t_no1.length > 4){ if(alert_yn == 'Y') { alert("ÀüÈ­¹øÈ£¸¦ È®ÀÎÇØ ÁֽʽÿÀ"); no1.focus();} return false; } if(tel_gubun != checkAllPhoneNo(t_no1)){ if(alert_yn == 'Y') { alert("ÀüÈ­¹øÈ£¸¦ È®ÀÎÇØ ÁֽʽÿÀ"); no1.focus();} return false; } }else if(tel_gubun == "T" ) { if( t_no1.length < 2 || t_no1.length > 4){ if(alert_yn == 'Y') { alert("ÀüÈ­¹øÈ£¸¦ È®ÀÎÇØ ÁֽʽÿÀ"); no1.focus();} return false; } if(tel_gubun != checkAllPhoneNo(t_no1)){ if(alert_yn == 'Y') { alert("ÀüÈ­¹øÈ£¸¦ È®ÀÎÇØ ÁֽʽÿÀ"); no1.focus();} return false; } }else { if( t_no1.length < 2 || t_no1.length > 4){ if(alert_yn == 'Y') { alert("ÀüÈ­¹øÈ£¸¦ È®ÀÎÇØ ÁֽʽÿÀ"); no1.focus();} return false; } if(checkAllPhoneNo(t_no1) == "E" ){ if(alert_yn == 'Y') { alert("ÀüÈ­¹øÈ£¸¦ È®ÀÎÇØ ÁֽʽÿÀ"); no1.focus();} return false; } } if( t_no2.length < 3 || t_no2.length > 4){ if(alert_yn == 'Y') { alert("ÀüÈ­¹øÈ£¸¦ È®ÀÎÇØ ÁֽʽÿÀ"); no2.focus();} return false; } if( t_no3.length < 3 || t_no3.length > 4){ if(alert_yn == 'Y') { alert("ÀüÈ­¹øÈ£¸¦ È®ÀÎÇØ ÁֽʽÿÀ"); no3.focus();} return false; } //ÀüÈ­¹øÈ£¼ýÀÚ Ã¼Å© if(!checkNum(t_no1)) { if(alert_yn == 'Y') { alert("ÀüÈ­¹øÈ£¸¦ ¼ýÀÚ·Î ÀÔ·ÂÇØ Áֽʽÿä"); no1.focus();} return false; } if(!checkNum(t_no2)) { if(alert_yn == 'Y') { alert("ÀüÈ­¹øÈ£¸¦ ¼ýÀÚ·Î ÀÔ·ÂÇØ Áֽʽÿä"); no2.focus();} return false; } if(!checkNum(t_no3)) { if(alert_yn == 'Y') { alert("ÀüÈ­¹øÈ£¸¦ ¼ýÀÚ·Î ÀÔ·ÂÇØ Áֽʽÿä"); no3.focus();} return false; } return true; } function checkEmail1(carform, mail1,mail2) { var email1 = mail1.value; var email2 = mail2.value; var str = email1+"@"+email2; if(email1 == '') { alert("emailÀ» ÀÔ·ÂÇØ ÁֽʽÿÀ."); if(mail1.type == 'text') { mail1.focus(); } else { openEventPop('Y','N'); } return false; } if(email2 == '') { alert("emailÀ» ÀÔ·ÂÇØ ÁֽʽÿÀ."); if(mail2.type == 'text') { mail2.focus(); } else { openEventPop('Y','N'); } return false; } ind_str = "1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ@.-_"; var chr; if(str.length < 6){ alert("emailÀ» ÀÔ·ÂÇØ ÁֽʽÿÀ."); return false; } if(str.charAt(0) == '@' || str.charAt(0) == '.') { alert("emailÀ» ÀÔ·ÂÇØ ÁֽʽÿÀ."); return false; } if(str.indexOf('@') == -1 || str.indexOf('.') == -1) { alert("emailÀ» ÀÔ·ÂÇØ ÁֽʽÿÀ."); return false; } if(Math.abs(str.indexOf('@') - str.indexOf('.')) == 1) { alert("emailÀ» ÀÔ·ÂÇØ ÁֽʽÿÀ."); return false; } for(x=0;x yearData)?year:yearData; var yyyy = data.substring(0,4); var mm = data.substring(4,6); var yy = parseInt(yyyy); var year = ""; var yearValue = ""; if ( yyyy >= 2009 ) { for(i=0;i < 25; i++){ year = yy; if(i==0){ year = "-----"; yearValue = ""; } if(mm > 6 ){ if(i==1){ year = yy + "A" ; yy++; }else if(i==2){ year = yy + "B" ; } }else{ if(i==2){ year = yy + "A" ; yy++; }else if(i==3){ year = yy + "B" ; } } if(i==24) year = yy + " ÀÌÀü" ; yearValue = year.length > 4?year.substring(0,5):year; if(i==24) yearValue = yearValue.substring(0,4); if(i==0){ form.car_made_year.options[i] = new Option(year,yearValue,true,true); }else{ form.car_made_year.options[i] = new Option(year,yearValue); } if(i != 0) yy--; } } else { for(i=0;i < 24; i++){ year = yy; if(i==0){ year = "-----"; yearValue = ""; } if(mm > 6 ){ if(i==1){ year = yy + "A" ; yy++; }else if(i==2){ year = yy + "B" ; } }else{ if(i==2){ year = yy + "A" ; yy++; }else if(i==3){ year = yy + "B" ; } } if(i==23) year = yy + " ÀÌÀü" ; yearValue = year.length > 4?year.substring(0,5):year; if(i==23) yearValue = yearValue.substring(0,4); if(i==0){ form.car_made_year.options[i] = new Option(year,yearValue,true,true); }else{ form.car_made_year.options[i] = new Option(year,yearValue); } if(i != 0) yy--; } } } function changeOptionTM2(){ var form = document.carform; // var yearData = form.c_start_yy.value + form.c_start_mm.value + form.c_start_dd.value; var yearData = form.contract_start_date.value; var data = yearData; var yyyy = data.substring(0,4); var mm = data.substring(4,6); var yy = parseInt(yyyy); var year = ""; var yearValue = ""; if ( yyyy >= 2009 ) { for(i=0;i < 25; i++){ year = yy; if(i==0){ year = "-----"; yearValue = ""; } if(mm > 6 ){ if(i==1){ year = yy + "A" ; yy++; }else if(i==2){ year = yy + "B" ; } }else{ if(i==2){ year = yy + "A" ; yy++; }else if(i==3){ year = yy + "B" ; } } if(i==24) year = yy + " ÀÌÀü" ; yearValue = year.length > 4?year.substring(0,5):year; if(i==24) yearValue = yearValue.substring(0,4); if(i==0){ form.car_made_year.options[i] = new Option(year,yearValue,true,true); }else{ form.car_made_year.options[i] = new Option(year,yearValue); } if(i != 0) yy--; } } else { for(i=0;i < 24; i++){ year = yy; if(i==0){ year = "-----"; yearValue = ""; } if(mm > 6 ){ if(i==1){ year = yy + "A" ; yy++; }else if(i==2){ year = yy + "B" ; } }else{ if(i==2){ year = yy + "A" ; yy++; }else if(i==3){ year = yy + "B" ; } } if(i==23) year = yy + " ÀÌÀü" ; yearValue = year.length > 4?year.substring(0,5):year; if(i==23) yearValue = yearValue.substring(0,4); if(i==0){ form.car_made_year.options[i] = new Option(year,yearValue,true,true); }else{ form.car_made_year.options[i] = new Option(year,yearValue); } if(i != 0) yy--; } } } function subChangeOption() { var form = document.carform; var yyyy = form.contract_start_date.value.substring(0,4); if(form.fix_car_made_year.value != "") { if ( yyyy >= 2009 ) { for(i=0 ; i < 25; i++){ if(form.car_made_year.options[i].value == form.fix_car_made_year.value){ form.car_made_year.options[i].selected = true; break; } } } else { for(i=0 ; i < 24; i++){ if(form.car_made_year.options[i].value == form.fix_car_made_year.value){ form.car_made_year.options[i].selected = true; break; } } } } } // º¸Çè½ÃÀÛÀÏ ÀԷ½à º¸ÇèÁ¾·áÀÏ °¡Á®¿À±â(À±³â °í·Á ¼öÁ¤) function checkBox(){ var start_date = document.carform.contract_start_date.value; if(checkDate(eval("docmenst.carform.contract_start_date"))) { var yyyy = eval(start_date.substring(0, 4)); var yy = eval(start_date.substring(0, 4)) + 1; var mm = eval(start_date.substring(4, 6)); var dd = eval(start_date.substring(6,8)); if(mm < 10) mm = "0"+mm; if(dd < 10) dd = "0"+dd; if(LeafYearCheck(yyyy) && mm == "02"){ if(dd == "29") { document.carform.contract_end_date.value = yy + mm + "28"; }else { document.carform.contract_end_date.value = yy + mm + dd; } }else{ document.carform.contract_end_date.value = yy + mm + dd; } } } ////////////////////////À±³â ¿©ºÎ üũ////////////////////////////////////////// function LeafYearCheck(yyyy) { if((yyyy % 4) == 0) { if((yyyy % 100) == 0) { if((yyyy % 400) == 0) return true; else return false; } else return true; } return false; } function premiumClickIng() { var image_text = ""; image_text = "" + " " + " " + " " + "
" + " " + " " + " " + " " + " " + " " + "
"; inner_txt.innerHTML = image_text; } //¿ÞÂÊ °ø¹é trim function ltrim(para) { while(para.substring(0,1) == ' ') para = para.substring(1, para.length); return para; } //³»ºÎ °ø¹é trim function mtrim(para) { for ( i = 0; i < para.length;) if ( para.substring(i,i+1) == ' ' ) para = para.substring(0, i) + para.substring(i+1, para.length); else i++; return para; } //¿ìÃø °ø¹é trim function rtrim(para) { while(para.substring(para.length-1, para.length) == ' ') para = para.substring(0, para.length-1); return para; } // string String::trim(); String.prototype.trim = function() { return this.replace(/(^\s*)|(\s*$)/g, ""); } function selectedValuePosition(form, str) { for(i=0 ; i < from.length; i++){ if(form.options[i].value == str){ form.options[i].selected = true; break; } } } //°³¹ß¿ø ÇÒÀÎÇÒÁõµî±ÞÄڵ带 IV ÇÒÀÎÇÒÁõµî±ÞÄÚµå·Î º¯È¯ 2006.12.7 by Á¶¿Ïµ¿ function GradeToCode(grade) { var code = 0; if(grade.indexOf('Z') == -1 && grade.indexOf('F') == -1 && grade.indexOf('P') == -1 ) { return grade; } grade = grade.replace('Z','0'); grade = grade.replace('F','5'); grade = grade.replace('P','9'); code = parseInt(grade) + 200; return code; } //IV ÇÒÀÎÇÒÁõµî±ÞÄڵ带 °³¹ß¿ø ÇÒÀÎÇÒÁõµî±ÞÄÚµå·Î º¯È¯ 2006.12.7 by Á¶¿Ïµ¿ function CodeToGrade(code) { if(code <= 200) return code; var grade = ""; var rank = ""; code = code - 200; if(code%10 == 0) { rank = "Z"; } else if(code%10 == 5) { rank = "F"; } else if(code%10 == 9) { rank = "P"; } grade = parseInt(code/10) + rank; return grade; } //°³¹ß¿ø ÇÒÀÎÇÒÁõµî±ÞÄڵ带 °³¹ß¿ø ÇÒÀÎÇÒÁõÀ²·Î º¯È¯ - 2007³â 1³â¸¸ »ç¿ë 2006.12.7 by Á¶¿Ïµ¿ function GradeToRate(grade) { var rate = 0; var rank = ""; if(grade.indexOf('Z') == -1 && grade.indexOf('F') == -1 && grade.indexOf('P') == -1 ) { return grade; } if(grade == "17Z") { rate = 45; } else if(grade == "18P") { rate = 40; } else { rate = (21-parseInt(grade.substring(0,grade.length-1)))*10; rank = grade.substring(grade.length-1,grade.length); if( rank == "F") { rate -= 5; } } return rate; } //IV ÇÒÀÎÇÒÁõµî±ÞÄڵ带 °³¹ß¿ø ÇÒÀÎÇÒÁõÀ²·Î º¯È¯ - 2007³â 1³â¸¸ »ç¿ë 2006.12.7 by Á¶¿Ïµ¿ function CodeToRate(code) { if(code <= 200) return code; var rate = 0; if(code < 370) { rate = 410 - code; } else if(code == 370) { rate = 45; } else if(code == 389) { rate = 40; } return rate; } //°³¹ß¿ø ÇÒÀÎÇÒÁõÀ²¸¦ °³¹ß¿ø ÇÒÀÎÇÒÁõµî±ÞÄÚµå·Î º¯È¯ - 2007³â 1³â¸¸ »ç¿ë 2006.12.14 by ±è¼ö¿¬ function RateToGrade(rate) { if(rate < 40 || rate > 200) return rate; var grade = ""; if(rate > 45) grade = 21-parseInt((rate%10 == 5?parseInt(rate)+10:rate)/10) + (rate%10 == 0?"Z":"F"); else if(rate == 45) grade = "17Z"; else if(rate == 40) grade = "18P"; return grade; } //°³¹ß¿ø ÇÒÀÎÇÒÁõÀ²¸¦ IVÇÒÀÎÇÒÁõµî±ÞÄÚµå·Î º¯È¯ - 2007³â 1³â¸¸ »ç¿ë 2006.12.14 by ±è¼ö¿¬ function RateToCode(rate) { if(rate < 40 || rate > 200) return rate; var grade = ""; if(rate > 45) grade = 21-parseInt((rate%10 == 5?parseInt(rate)+10:rate)/10) + (rate%10 == 0?"Z":"F"); else if(rate == 45) grade = "17Z"; else if(rate == 40) grade = "18P"; return GradeToCode(grade); } function chkSubstractCd(car_value, substract ) { if ( car_value > 0 ) { if ( '0106' == substract[substract.selectedIndex].value && car_value < 100 ) { alert('»ç°í½Ãº»Àκδã±ÝÀº Â÷·®°¡¾× º¸´Ù ³ô°Ô ¼±ÅÃÇϽǼö ¾ø½À´Ï´Ù.'); substract.selectedIndex = 1; return; } else if ( '0206' == substract[substract.selectedIndex].value && car_value < 200 ) { alert('»ç°í½Ãº»Àκδã±ÝÀº Â÷·®°¡¾× º¸´Ù ³ô°Ô ¼±ÅÃÇϽǼö ¾ø½À´Ï´Ù.'); substract.selectedIndex = 1; return; } else if ( '0306' == substract[substract.selectedIndex].value && car_value < 300 ) { alert('»ç°í½Ãº»Àκδã±ÝÀº Â÷·®°¡¾× º¸´Ù ³ô°Ô ¼±ÅÃÇϽǼö ¾ø½À´Ï´Ù.'); substract.selectedIndex = 1; return; } } else { alert('Â÷·®Ã£±âÈÄ ¼±ÅÃÇØÁÖ¼¼¿ä.'); substract.selectedIndex = 1; return; } } function checkValidDate(search_date) { if ( search_date.length != 8 ) { return false; } year = search_date.substring(0,4); month = search_date.substring(4,6); day = search_date.substring(6,8); if ( month < 1 || month > 12 ) { return false; } else if ( month==2 && day!='' ) { if ( LeafYearCheck(year) ) { if ( day<1 || day>29 ) { return false; } else { return true; } } else { if ( day<1 || day>28 ) { return false; } else { return true; } } } else if ( "04,06,09,11".indexOf(month) != -1 && (day<1 || day>30) ) { return false; } else if ( "01,03,05,07,08,10,12".indexOf(month) != -1 && (day<1 || day>31) ) { return false; } else { return true; } return false; } function getShortTimeStringAjax() { var xmlHttp = new ActiveXObject("Microsoft.XMLHTTP") var reqUrl = '/ivcar/common/getAjaxList.jsp' + '?ajax_type=getShortTimeString' + '&debug_str=false'; xmlHttp.open("GET",reqUrl, false); xmlHttp.send(); return xmlHttp.responseTEXT.trim(); } function chkPubAccidentIncPrice(substract) { //alert(substract.selectedIndex); //alert(document.carform.pub_accident_inc_price.options[document.carform.pub_accident_inc_price.selectedIndex].value); //ÀÚ±âºÎ´ã±Ý if( document.carform.contract_start_date.value < 20110221) return; if(substract.selectedIndex != 0 ) { //alert(document.carform.pub_accident_inc_price.selectedIndex); document.carform.pub_accident_inc_price.selectedIndex = substract.selectedIndex-1 ; //alert(document.carform.pub_accident_inc_price.selectedIndex); } } function chkAccdientToSubstract(accdient) { //alert(substract.selectedIndex); //alert(document.carform.pub_substract_cd.options[document.carform.pub_substract_cd.selectedIndex].value); //¹°ÀûÇÒÁõ ó¸® //alert(document.carform.pub_substract_cd.selectedIndex); if( document.carform.pub_substract_cd.selectedIndex == 0) return; if( document.carform.contract_start_date.value < 20110221) return; document.carform.pub_substract_cd.selectedIndex = accdient.selectedIndex+1 ; if(document.carform.pub_premium_6 != undefined)document.carform.pub_premium_6.value=""; //alert(document.carform.pub_substract_cd.selectedIndex); } function chkPubAccidentIncPriceContract(substract) { //alert(substract.selectedIndex); //alert(document.carform.pub_accident_inc_price.options[document.carform.pub_accident_inc_price.selectedIndex].value); //ÀÚ±âºÎ´ã±Ý if( document.carform.contract_start_date.value < 20110221) return; if(substract.selectedIndex != 0 ) { //alert(document.carform.pub_accident_inc_price.selectedIndex); document.carform.accident_inc_price.selectedIndex = substract.selectedIndex-1 ; document.carform.subsctract_accident.value = document.carform.accident_inc_price.options[document.carform.accident_inc_price.selectedIndex].text; //alert(document.carform.pub_accident_inc_price.selectedIndex); } if(substract.selectedIndex == 0 ) document.carform.subsctract_accident.value = ""; } function chkAccdientToSubstractContract(accdient) { //alert(substract.selectedIndex); //alert(document.carform.pub_substract_cd.options[document.carform.pub_substract_cd.selectedIndex].value); //¹°ÀûÇÒÁõ ó¸® //alert(document.carform.pub_substract_cd.selectedIndex); if( document.carform.contract_start_date.value < 20110221) return; document.carform.substract_cd.selectedIndex = accdient.selectedIndex+1 ; document.carform.subsctract_accident.value = document.carform.accident_inc_price.options[document.carform.accident_inc_price.selectedIndex].text; //alert(document.carform.pub_substract_cd.selectedIndex); }