var dystart,qTime=0,vTime=0,pView=0,tTime;function timeSet(){dystart=new Date;return!0}function getValue(a){var b=0,c;if(null!=a)if(null!=a.length)for(c=0;c<a.length;c++)b+=parseInt(a[c].getAttribute("value"),10);else b=a.getAttribute("value");return b}var viewRatio=50,maxViewTime=5E3;
function timecheck(a,b){var c=document.getElementById("queryTbl");if(null!=c&&0!=dystart&&null!=dystart){var e=document.getElementById("viewTbl");var d=document.getElementById("pageTbl");var h=document.getElementById("totalTbl");a=getValue(a);b=getValue(b);var f=new Date;var g=f-dystart-a-b;f-=dystart;g=0>g?0:g;h.style.backgroundColor="transparent";c.title="DB: "+a+" [ms]";e.title="JSP: "+b+" [ms]";d.title="IE: "+g+" [ms]";h.innerHTML=Math.round(f/100)/10+" [s]";f>maxViewTime&&(h.style.backgroundColor=
"#ffff33",viewRatio=viewRatio*maxViewTime/f);c.innerHTML="&nbsp;";e.innerHTML="&nbsp;";d.innerHTML="&nbsp;";c.width=Math.floor(a/viewRatio+1);e.width=Math.floor(b/viewRatio+1);d.width=Math.floor(g/viewRatio+1);dystart=0}}$(function(){$(".toggleTop").on("click",function(){toggleTopFrame(this)});$(".toggleSub").on("click",function(){toggleSubFrame(this)});$(".toggleAll").on("click",function(){toggleAllFrame(this)})});
var old_cols=null,old_rows=null,old_prnt=null,toggleCol=!1,toggleRow=!1,toggleAll=!1,togglePrnt=!1;
function toggleTopFrame(a){var b=top.document.getElementById("TOP_FRAME");if(!b){var c=top.document.getElementsByName("TOP_FRAME");1==c.length&&(b=c[0])}!b||0>b.cols.indexOf(",")||(toggleCol?(toggleCol=!1,10>=old_cols.split(",")[0]||512<old_cols.split(",")[0]?b.cols="160,*":b.cols=old_cols,null!=a&&(0==a.className.length?a.style.backgroundColor="Red":a.className="toggleTop")):(toggleCol=!0,old_cols=b.cols,b.cols="10,*",null!=a&&(0==a.className.length?a.style.backgroundColor="Gray":a.className="toggleOff")))}
function toggleSubFrame_Iframe(a){var b=$("iframe[name=QUERY]",parent.document);if(!(1>b.length)){if(toggleRow){toggleRow=!1;var c=Number($(b).attr("old_height"));b.height(c);null!=a&&(0==a.className.length?a.style.backgroundColor="Green":a.className="toggleSub")}else toggleRow=!0,c=$(b).contents().find("#QUERY_TBL")[0],c=c.offsetTop+c.offsetHeight+c.parentNode.offsetTop,$(b).attr("old_height",b.height()),b.height(c),null!=a&&(0==a.className.length?a.style.backgroundColor="Gray":a.className="toggleOff");
a=$("iframe[name=RESULT]",parent.document);$(a).css("height","calc(100% - "+c+"px - 8px)")}}
function toggleSubFrame(a){var b;toggleSubFrame_Iframe(a);var c=parent.document.getElementById("SUB_FRAME");if(!c){var e=parent.document.getElementsByName("SUB_FRAME");1==e.length&&(c=e[0])}if(c)if(toggleRow)toggleRow=!1,old_rows&&(c.rows=old_rows),null!=a&&(0==a.className.length?a.style.backgroundColor="Green":a.className="toggleSub");else{toggleRow=!0;if(1E3>c.rows.split(",")[0]&&(old_rows=c.rows,null!=parent.QUERY)){var d=parent.QUERY.document.getElementById("QUERY_TBL");if(null!=d){e=c.rows.split(",");
d=d.offsetTop+d.offsetHeight+d.parentNode.offsetTop+",*";for(b=2;b<e.length;b++)d=d+","+e[b];c.rows=d}}null!=a&&(0==a.className.length?a.style.backgroundColor="Gray":a.className="toggleOff")}}
function toggleAllFrame(a){toggleAll?(toggleAll=!1,toggleCol&&toggleTopFrame(),toggleRow&&toggleSubFrame(),null!=a&&(0==a.className.length?a.style.backgroundColor="Blue":a.className="toggleAll")):(toggleAll=!0,toggleCol||toggleTopFrame(),toggleRow||toggleSubFrame(),null!=a&&(0==a.className.length?a.style.backgroundColor="Gray":a.className="toggleOff"))}
function toggleFrame(a){var b=parent.document.getElementsByTagName("FRAMESET");1==b.length&&(oSubFrame=b[0]);if(oSubFrame)if(togglePrnt)togglePrnt=!1,oSubFrame.rows=old_prnt,a&&(a.innerHTML="(-)");else{togglePrnt=!0;old_prnt=oSubFrame.rows;var c=-1;for(b=0;b<parent.frames.length;b++)if(self.frames.name==parent.frames[b].name){c=b;break}b=oSubFrame.rows.split(",");null==a?b[c]="0":(b[c]=a.offsetTop+a.offsetHeight+a.parentNode.offsetTop,a.innerHTML="(+)");c=b[0];for(a=1;a<b.length;a++)c=c+","+b[a];
oSubFrame.rows=c}}function adjustFrameHeightSleep(){0==$("body").width()||100==$("body").width()?setTimeout(function(){adjustFrameHeightSleep()},10):adjustFrameHeight()}$(function(){0==$("body").width()||100==$("body").width()?setTimeout(function(){adjustFrameHeightSleep()},1):adjustFrameHeight()});$(function(){"undefined"!=typeof h_qryFcs&&"false"==h_qryFcs||focusFirstElm()});
function focusFirstElm(){var a;var b=document.getElementsByTagName("FORM");if(0<b.length){var c=!1;var e=b[0];for(a=0;a<e.elements.length;a++){var d=e.elements[a];if(!(null==d||d.disabled||d.readOnly||"text"!=d.type&&"checkbox"!=d.type&&"radio"!=d.type&&"passwd"!=d.type&&"textarea"!=d.type&&"select-one"!=d.type&&"select-multiple"!=d.type)&&(document.getBoxObjectFor?(b=document.getBoxObjectFor(d),0!=b.width&&(c=!0)):d.getBoundingClientRect&&(b=d.getBoundingClientRect(),b.left!=b.right&&(c=!0)),c)){d.focus();
break}}historyBack()}}function focus1(){alert("Old Script Error!!\ncustom/query_info.jsp,custom/result_info.jsp Please delete the following part.\n<script>Tag(Header fix and Focus) , BODY onLoad and oncontextmenu Attribute")};
