//******* Latest Modify : 2003-10-24 7:16¿ÀÈÄ ******* ns4 = (document.layers)? true:false ie4 = (document.all)? true:false //******* Form Color Marking ******* var markingcolor = "yellow" var colorfree = "white" function RemarkField(InObj,CLR) { var markcolor; if ( CLR == 0 ) markcolor = colorfree; else if ( CLR == 1 ) markcolor = markingcolor; InObj.style.backgroundColor = markcolor; } function FormHighLight(InObj) { RemarkField(InObj,1); InObj.select(); InObj.focus(); } function FormHighLightINIT(InObj) { for ( var i=0; i < InObj.elements.length; i++ ) { if ( InObj.elements[i].style.backgroundColor != "" ) RemarkField(InObj.elements[i],0); } } //******* Form Validate ******* function CheckZerolength(InObj) { var ReturnValue = false; if ( InObj.value.length == 0 ) { //FormHighLight(InObj); ReturnValue = true; } return ReturnValue; } function CheckSpace(InObj) { var ReturnValue = false; var pttn = /\s/gi; if ( InObj.value.search(pttn) > -1 ) { ReturnValue = true; } /* if (InObj.value.length == 0) ReturnValue = true; for (i = 0; i < InObj.value.length; i++) if (InObj.value.charAt(i) == ' ') { ReturnValue = true; break; } */ return ReturnValue; } function CheckBlank(InObj) { var ReturnValue = false; if (InObj.value.split(" ").join("") == "") { ReturnValue = true; } return ReturnValue; } function CheckNumber(InObj) { var ReturnValue = false; if ( isNaN(InObj.value) ) { ReturnValue = true; FormHighLight(InObj); } return ReturnValue; } function CheckJumin(InObj1,InObj2) { var chk=0; if ( InObj1.value.length == 6 ) { if ( InObj2.value.length == 7 ) { for (var i=0; i<=5; i++) { chk = chk + ((i%8+2) * parseInt(InObj1.value.substring(i,i+1))) } for (var i=6; i<=11;i++) { chk = chk + ((i%8+2) * parseInt(InObj2.value.substring(i-6,i-5))) } chk = 11 - (chk%11); chk = chk % 10; if (chk != InObj2.value.substring(6,7)) { return true; } else return false; } else return true; } else return true; } function CheckMail(InObj) { var ReturnValue = false; var InStr = InObj.value; var i,AtCheck,PtCheck; AtCheck = 0; PtCheck = 0; for ( i = 0; i < InStr.length; i++ ) { if ( (InStr.charAt(i)=='/') || (InStr.charAt(i)==' ') ) { alert("¸ÞÀÏÁÖ¼Ò¿¡ ´ÙÀ½¹®ÀÚ´Â »ç¿ëÇϽǼö ¾ø½À´Ï´Ù. (°ø¹é,½½·¯½Ã(/))\n´Ù½Ã ÀÔ·ÂÇØ ÁÖ¼¼¿ä."); //FormHighLight(InObj); ReturnValue = true; return true; } if ( (InStr.charAt(i) < '!') || (InStr.charAt(i) > 'z') ) { alert("¸ÞÀÏÁÖ¼Ò Çü½ÄÀÌ À߸øµÇ¾ú½À´Ï´Ù."); //FormHighLight(InObj); ReturnValue = true; return true; } if ( (InStr.charAt(i)==',') || (InStr.charAt(i)==';') ) { alert("½°Ç¥³ª ¼¼¹ÌÄÝ·ÐÀ¸·Î ±¸ºÐÇÒ¼ö ¾ø½À´Ï´Ù."); //FormHighLight(InObj); ReturnValue = true; return true; } if ( (InStr.charAt(i)=='@') ) AtCheck = AtCheck + 1; if ( (InStr.charAt(i)=='.') ) PtCheck = PtCheck + 1; } if ( AtCheck != 1 ) { alert("¸ÞÀÏÁÖ¼Ò Çü½ÄÀÌ À߸øµÇ¾ú½À´Ï´Ù."); //FormHighLight(InObj); ReturnValue = true; return true; } if ( PtCheck < 1 || PtCheck > 3 ) { alert("¸ÞÀÏÁÖ¼Ò Çü½ÄÀÌ À߸øµÇ¾ú½À´Ï´Ù."); //FormHighLight(InObj); ReturnValue = true; return true; } return ReturnValue; } function CheckSelect(InObj) { var ReturnValue = true var c = 0 for ( i = 0; i < InObj.options.length; i++ ) if ( InObj.options(i).selected ) { ReturnValue = false; return ReturnValue; } return ReturnValue; } function CheckRadio(InObj) { var ReturnValue = true var c = 0 try { c = InObj.length; } catch(Exception) { c = 0; } if ( c == undefined ) c = 1 ; if ( c == 1 ) { if ( InObj.checked ) { ReturnValue = false; return ReturnValue; } } else if ( c > 1 ) { for ( var i = 0; i < c; i++ ) { if ( InObj(i).checked ) { ReturnValue = false; return ReturnValue; } } } return ReturnValue; } function CheckboxSelectAll(Obj) { var Objlen = 0; try { Objlen = Obj.length; } catch(Exception) { Objlen = 0; } if ( Objlen == undefined ) Objlen = 1 ; if ( Objlen == 1 ) { Obj.checked = true ; } else if ( Objlen > 1 ) { for ( var i = 0; i < Objlen; i++ ) { Obj[i].checked = true ; } } //box=document.FormName.elements['varname[]']; //box[i].checked=false; } function CheckboxUnselectAll(Obj) { var Objlen = 0; try { Objlen = Obj.length; } catch(Exception) { Objlen = 0; } if ( Objlen == undefined ) Objlen = 1 ; if ( Objlen == 1 ) { Obj.checked = false ; } else if ( Objlen > 1 ) { for ( var i = 0; i < Objlen; i++ ) { Obj[i].checked = false ; } } } //******* Object Control ******* var hideTimeout function showObject(obj) { if (ns4) obj.visibility = "show" else if (ie4) { if(obj) obj.style.visibility = "visible" } return obj } function hideObject(obj) { if(hideTimeout != null) window.clearTimeout(hideTimeout); if (ns4) obj.visibility = "hide" else if (ie4) { if(obj) obj.style.visibility = "hidden" } } var swapObj = new Array(); function showLayers() { var tobj for( i=0;i 0) && (parseInt(navigator.appVersion) >= 4) ) { window.external.AddFavorite(location.href,document.title); } } //******* Display Deco ******* function DateWriter() { var d; var s = ""; d = new Date(); var x = new Array("Sunday","Monday","Tuesday"); x = x.concat("Wednesday","Thursday","Friday"); x = x.concat("Saturday"); var y = new Array("January","February","March","April","May"); y = y.concat("June","July","August","September","October"); y = y.concat("November","December"); s+= x[d.getDay()] + ", "; s+= y[d.getMonth()]+ " "; s+= d.getDate() + ", "; s+= d.getYear(); document.write(s); } //******* Public Form Validate ******* function imageView() { if ( document.imgview ) { var wheight; var wwidth; wheight = imgview.height + 95; wwidth = imgview.width + 30; if ( wwidth > 420 ) { imgview.width = 400; } //window.resizeTo(wwidth,wheight); } }