/********************* frame.jsp *********************************************************************************************************************************/ function checkloading(){ try{ if(document.frames.main){ //$(document.frames.main.document.head).append('
 처리중입니다...
'); } }else{ $mainbody.find('.frameblock').remove(); } } }catch(e){ try{ //console.log(e); }catch(e){} } setTimeout(checkloading,300); } var hasCloseBtn = false; var frameset1rows, frameset2cols; function overrideOpen(win){ //팝업 레이어 사용안함 if(true)return; frameset1rows = document.getElementsByTagName('frameset')[0].rows; frameset2cols = document.getElementsByTagName('frameset')[1].cols; win.originalOpen = win.open; win.open = function(url,winname,param){ if(url.indexOf('displayXUI') > -1){ win.originalOpen(url,winname,param); return; } var $mainbody = $(document.frames.main.document.body); if(param)param = param.toLowerCase(); var width = param.split('width=')[1].split(',')[0]; var height = param.split('height=')[1].split(',')[0]; var x = $mainbody.width()/2-width/2; x = parseInt(x); var y = $mainbody.height()/2-height/2; y = parseInt(y); if(x<0)x = 0; if(y<0)y = 0; try{ var zidx = 1000+$mainbody.find('.popframeblock').length; var html='
' +' ' +'
' +''; $mainbody.find('.popframeblock'+winname+',iframe[name="'+winname+'"]').remove(); $mainbody.append(html); return $mainbody.find('iframe[name="'+winname+'"]')[0].contentWindow; }catch(e){ alert('브라우저 오류입니다. 페이지를 새로 고칩니다.'); location.href=location.href; } }; } function bindload(mainifr){ //팝업 레이어 사용안함 if(true)return; try{ try{ if(getPopCookie() == 'no' || document.documentMode < 10) return; }catch(e){return;} overrideOpen(mainifr.contentWindow); mainifr.contentWindow.poploadbind=function(popifr){ if(popifr.contentWindow.location.href.indexOf('reuse_copy_form.jsp') > -1){ closepop(); } overrideOpen(popifr.contentWindow); popifr.contentWindow.close=function(){ popifr.contentWindow.parent.$('.popframeblock,.popifr').remove(); }; popifr.contentWindow.focus=null; try{ Object.keys(popifr.contentWindow).filter(function(m){ for(var m in popifr.contentWindow){ try{ var con = popifr.contentWindow[m].toString(); if(con.substr(0,9) == 'function ' && con.indexOf('[native code]')==-1){ if(con.indexOf('window.close()') > -1||con.indexOf('self.close()') > -1){ con=con.replace('window.close()','parent.parent.closepop(window.name)'); con=con.replace('self.close()','parent.parent.closepop(window.name)'); popifr.contentWindow.eval(m+'='+con); hasCloseBtn=true; } } }catch(e){ console.log(e); } } }); }catch(e){} $(popifr.contentWindow.document.body).find('*').each(function(){ try{ var oncl = $(this).attr('onclick').toString(); if(oncl){ if(oncl.indexOf('window.close()')>-1||oncl.indexOf('self.close()')>-1){ oncl = oncl.replace('window.close()','parent.parent.closepop(window.name)'); oncl = oncl.replace('self.close()','parent.parent.closepop(window.name)'); $(this).attr('onclick',oncl); hasCloseBtn=true; } } }catch(e){} try{ var href = $(this).attr('href'); if(href){ if(href.indexOf('window.close()')>-1||href.indexOf('self.close()')>-1){ href = href.replace('window.close()','parent.parent.closepop(window.name)'); href = href.replace('self.close()','parent.parent.closepop(window.name)'); $(this).attr('href',href); hasCloseBtn=true; } } }catch(e){} }); if(!hasCloseBtn){ if(popifr.contentWindow.document.body.innerHTML == ''){ closepop(window.name); }else{ $(popifr.contentWindow.document.body).append('
닫기
'); } } hasCloseBtn=false; $(popifr.contentWindow.document.body).css({'background-color':'#fff','overflow':'hidden'}); var ch = popifr.contentWindow.document.body.clientHeight; var sh = popifr.contentWindow.document.body.scrollHeight; var oh = $(popifr).height(); var arr = [ch,sh,oh].sort(function(a,b){return b-a;}); $(popifr).height(arr[0]); var cw = popifr.contentWindow.document.body.clientWidth; var sw = popifr.contentWindow.document.body.scrollWidth; var ow = $(popifr).width(); arr = [cw,sw,ow].sort(function(a,b){return b-a;}); $(popifr).width(arr[0]); var $mainbody = $(document.frames.main.document.body); var x = $mainbody.width()/2-sw/2; x = parseInt(x); var y = $mainbody.height()/2-sh/2; y = parseInt(y); if(x<0)x=0; if(y<0)y=0; $(popifr).css({top:y+'px',left:x+'px'}); }; var html='
' +'' +'' +'' +'' +'
'; $(mainifr.contentWindow.document.body).append(html); $(mainifr.contentWindow.document.body).find('#formDiv').prepend('
') $(mainifr.contentWindow.document.head).append(''); }catch(e){} } function closepop(name){ if(!name){ $(document.frames.main.document.body).find('.popframeblock,.popifr').remove(); }else{ $(document.frames.main.document.body).find('.popframeblock'+name+',.popifr'+name).remove(); } } function setCookie( name, value, expiredays ) { var todayDate = new Date(); todayDate.setDate( todayDate.getDate() + expiredays ); document.cookie = name + "=" + escape( value ) + "; path=/; expires=" + todayDate.toGMTString() + ";" } function setpop(idx){ if(idx == 0){ setCookie('usepop','yes',999); }else{ setCookie('usepop','no',999); } if(confirm('다음페이지부터 적용됩니다\n\n지금 새로고침하고 적용하시겠습니까?\n\n새로고침시 현재 페이지의 입력내용이 사라집니다.')){ document.frames.main.location.reload(); } } function getPopCookie(){ var coo=document.cookie; var popcoo; try{ popcoo = coo.split('usepop=')[1].split(';')[0]; }catch(e){} if(!popcoo)popcoo='no'; return popcoo; } function bindtopload(topwin){ //팝업 레이어 사용안함 if(true)return; try{ if(document.documentMode<10) return; }catch(e){ return; } var dv=$(topwin.document.getElementById('top_other_menu')); dv.append(''); var popcoo = getPopCookie(); idx = popcoo == 'yes' ? 0 : 1; dv.find('select')[0].selectedIndex=idx; } var tf=false; function toggleForm(obj){ tf = !tf; if(tf){ obj.value = '원래대로'; $(document.frames.main.document.body).find('#formDiv').css({ 'position':'absolute', 'top':'0', 'left':'0', 'width':'100%', 'height':$(document.frames.main.document.body).height()+'px', 'background-color':'#fff', 'z-index':'2000', 'overflow':'scroll' }); }else{ obj.value = '전체화면보기'; $(document.frames.main.document.body).find('#formDiv').css({ 'position':'', 'width':'', 'height':'', 'overflow':'' }); } } var togglemax=false; function toggleMaximum(obj){ togglemax = !togglemax; if(obj)obj.value = togglemax?'원래대로':'최대화'; alert("frame.jsp 297 프레임 호출"); var row = parseInt(document.getElementsByTagName('frameset')[0].rows.split(',')[0]); var col = parseInt(document.getElementsByTagName('frameset')[1].cols.split(',')[0]); toggleMaxAct(row,col); } function toggleMaxAct(row,col){ var orow = parseInt(frameset1rows.split(',')[0]); var ocol = parseInt(frameset2cols.split(',')[0]); if(togglemax){ row-=3; col-=5; }else{ row+=3; col+=5; } if(row<0)row = 0; if(row>orow)row = orow; if(col<0)col = 0; if(col>ocol)col = ocol; document.getElementsByTagName('frameset')[0].rows=row+',*'; document.getElementsByTagName('frameset')[1].cols=col+',*'; if((togglemax&&row0&&col>0)){ setTimeout(function(){toggleMaxAct(row,col);},0); } } setTimeout(checkloading,100);