// ------------------------------------------------------------------ // hd_min // ¼öÁ¤ÀÏ : 2011-07-26 // ------------------------------------------------------------------ // ------------------------------------------------------------------ // Global Variables // ------------------------------------------------------------------ var ie = (window.navigator.appName=="Microsoft Internet Explorer")? true: false; var chrome = (window.navigator.userAgent.match(/Chrome/i))? true : false; var opera = (window.navigator.userAgent.match(/Opera/i))? true : false; var firefox = (window.navigator.userAgent.match(/Firefox/i))? true : false; var safari = (window.navigator.userAgent.match(/Safari/i) && !window.navigator.userAgent.match(/Chrome/i))? true : false; // ------------------------------------------------------------------ // FormCheck // ------------------------------------------------------------------ function FormCheck(frm) { if(!frm) return alert("FormCheck Error : parameter is null"); if(typeof(frm)=="string"){ var s = document.getElementById(frm); if(!s) s = eval("document."+frm); if(!s) return alert("FormCheck Error : Invalid Form id or name"); this.frm = s; } else{ this.frm = frm; } if(!this.frm.tagName || this.frm.tagName.toLowerCase()!="form") return alert("FormCheck Error : Not Form"); this.check_stop = false; // ------------------------------------------ // get element // ------------------------------------------ this.element = function(name) { return this.frm.elements[name]; } // ------------------------------------------ // get value // ------------------------------------------ this.get = function(name) { var el = this.element(name); if(el) return el.value; else return null; } // ------------------------------------------ // set value // ------------------------------------------ this.set = function(name, value) { var el = this.element(name); if(el){ if(!el.tagName){ for(var i=0; i= dim){ set_scrollTop(pst, window.parent); } else{ var np = pst + dim; if(np<0) np = 0; set_scrollTop(np, window.parent); } } } // ---------------------------------------------- // enter_submit (onkeypress) // ---------------------------------------------- function enter_submit(e) { var key = null; var obj = null; if(ie){ key = window.event.keyCode; obj = window.event.srcElement; } else{ key = e.which; obj = e.target; } if(key==13){ try{ obj.form.submit(); } catch(e){} } } // ------------------------------------------------------------------ // copy_n_paste // ------------------------------------------------------------------ function copy_n_paste(copy_id, paste_id) { var src = document.getElementById(copy_id); var dst = document.getElementById(paste_id); if(!src || !dst) return; for(var node=src.firstChild; node; node=node.nextSibling) dst.appendChild(node.cloneNode(true)); } // ------------------------------------------------------------------ // find_upto_remove // ------------------------------------------------------------------ function find_upto_rem(obj, tag_name, cls_name) { for(var node=obj.parentNode; node; node=node.parentNode) { var tagname = (node.tagName)? node.tagName.toLowerCase() : ""; if(tagname==tag_name && node.className==cls_name){ node.parentNode.removeChild(node); break; } } } // ---------------------------------------------- // cmd open scroll window // ---------------------------------------------- function open_swindow(path, win_name, width, height, center) { if(!width) width = 600; if(!height) height = 600; var win = "win_"+win_name; if(window[win]){ try{ window[win].close(); }catch(e){} } var pos = ""; if(center){ var mw = window.screen.availWidth; var mh = window.screen.availHeight; var left = parseInt((mw - width)/2); var top = parseInt((mh - height)/2)-20; if(left<0) left = 0; if(top<0) top = 0; pos = ",left="+left+",top="+top; } window[win] = window.open(path, win_name, "width="+width+",height="+height+",resizable=yes,scrollbars=yes"+pos); } // ---------------------------------------------- // Àüü üũ // ---------------------------------------------- function check_all(obj, field) { var arr = document.getElementsByName(field); if(!arr) return; for(var i=0; i