<!--
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&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<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function MM_goToURL() { //v3.0
  var i, args=MM_goToURL.arguments; document.MM_returnValue = false;
  for (i=0; i<(args.length-1); i+=2) eval(args[i]+".location='"+args[i+1]+"'");
}

function MM_showHideLayers() { //v9.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) 
  with (document) if (getElementById && ((obj=getElementById(args[i]))!=null)) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}

function leftMenu(id) {
	for(num=1; num<=5; num++) {
	document.getElementById('lmb'+num).style.display='block';
	document.getElementById('slmb'+num).style.display='none';
	document.getElementById(id).style.display='none';
	document.getElementById('s'+id).style.display='block';	
	}
}

function menuClose(id) {
	for(num=1; num<=5; num++) {
	document.getElementById(id).style.display='none';
	document.getElementById('lmb'+num).style.display='block';
    }
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function f_disabled(lname, truefalse) {
    document.getElementById(lname).disabled=truefalse;
}


// »õÃ¢¿­±â-»çÀÌÁîÀû¿ë
function OpenWin(url,name,width,height,top,left){
	wid = ( screen.availwidth - width ) / 2;
	hei = ( screen.availheight - height ) / 2;
	size = 'width=' + width + ',height=' + height + ',top=' + top + ',left=' + left;
	etc = size + ',resizable=yes,scrollbars=yes,status=no';
	window.open(url,name,etc);
}

// »õÃ¢¿­±â
function OpenWin2(url,name){
	window.open(url,name);
}

//inputBOX¿¡ ÀÌ¹ÌÁö ³Ö±â
function clrImg(obj){
	obj.style.backgroundImage="";
	obj.onkeydown=obj.onmousedown=null;
}

//·¹ÀÌ¾î ÆË¾÷¸¸µé±â
function layerPop_mask(loptions) {
    /* loptions 
    parent_id : ÆË¾÷id
    w : ³ÐÀÌ
    h :	³ôÀÌ
	tx : Å¬¸¯ xÁÂÇ¥
    ty : Å¬¸¯ yÁÂÇ¥
    tttl : ÃÖ»ó´ÜÁ¦¸ñ(È¸»ö)
    sttl : ÆÄ¶õ»öÁ¦¸ñ
    body : ³»¿ë
    closebtn : trueÀÌ¸é ´Ý±â¹öÆ° »ý±è
    cfmbtn : tag »ç¿ëÇÏ¿© È®ÀÎ ¹öÆ° »ý¼º°¡´É, ¾øÀ¸¸é "È®ÀÎ"ÀÌ¹ÌÁö
    close_callback : ´Ý±â¹öÆ° ´­·¶À» °æ¿ì ½ÇÇàÇÒ ÇÔ¼ö
    is_ani : À§Ä¡ÀÌµ¿ ¾Ö´Ï¸ÞÀÌ¼Ç(ajaxÈ£Ãâ½Ã »ç¿ë)
    bodystyle : ³»¿ëÇ¥½Ã div style (ex: overflow:hidden)
    body_bc :·¹ÀÌ¾î Å×µÎ¸® color
    */
    ie6_select_hidden();
    var pophtml;
    var maskLayer = Ext.get('mask');
    var bodyLayer = Ext.get(loptions.parent_id);
    var maxHeight = document.documentElement.scrollHeight;
    if(document.documentElement.clientHeight>maxHeight) maxHeight=document.documentElement.clientHeight;
    //var maxHeight = (document.documentElement.clientHeight > document.body.clientHeight) ? document.documentElement.clientHeight : document.body.clientHeight;
    var cfm_btn = (loptions.cfm_btn && loptions.cfm_btn!="undefined") ? loptions.cfm_btn : '<img src="/images/adm/btn_pc_popok.gif" id="l_ok_btn" class="pop_btn" width="80" height="30" border="0" />';
    var fn = (loptions.cfm_callback && loptions.cfm_callback!="undefined") ? loptions.cfm_callback : "layer_close('"+loptions.parent_id+"')";
    var fn_close = (loptions.close_callback && loptions.close_callback!="undefined") ? loptions.close_callback : "layer_close('"+loptions.parent_id+"')";
    var cls_btn = (loptions.close_btn && loptions.close_btn!="undefined") ? '<img class="pop_btn" id="l_close_btn" src="/images/adm/btn_pc_close.gif" width="12" height="12" border="0" style="border:3px solid #e3e3e3;" />' : "";
    var bodystyle = (loptions.bodystyle && loptions.bodystyle!="undefined") ? loptions.bodystyle : '';
    cfm_btn = (loptions.cfm_btn=='n') ? '' : '        <div style="text-align:center;" id="layer_pop_cfmbtn"><a href="javascript:'+fn+';">'+cfm_btn+'</a></div>';
    var body_bc = (loptions.body_bc && loptions.body_bc!="undefined") ? loptions.body_bc : '#008dd3';

    maskLayer.setStyle('height', maxHeight + 'px');
    maskLayer.setStyle('display','block');
    pophtml = (loptions.body_bg && loptions.body_bg!='undefined') ? '    <div style="padding:5px 5px 15px 5px; display:block;" id="layer_pop_size">' : '    <div style="background:url(/images/adm/pc_pop_bg.gif) top repeat-x; padding:5px 5px 15px 5px; display:block;" id="layer_pop_size">';
    pophtml += (loptions.tttl && loptions.tttl!='undefined') ? '        <div class="hpad_04 t11p_gray" style="float:left;" id="layer_pop_tttl">'+loptions.tttl+'</div>' : '';
    pophtml += '        <div class="hpad_04" style="float:right;" id="layer_pop_clsbtn"><a href="javascript:'+fn_close+';">'+cls_btn+'</a></div>';
    pophtml += '        <div style="float:none; clear:both;"></div>';
    pophtml += (loptions.sttl && loptions.sttl!='undefined') ? '        <div class="blue t14p" style="height:16px; margin: 10px 0 0 10px;" id="layer_pop_sttl">'+loptions.sttl+'</div>' : '';

    if(cls_btn == "" && (loptions.tttl == "" || loptions.tttl == 'undefined')){
        pophtml += '        <div id="layer_pop_body" style="text-align:center;padding:0;'+bodystyle+'">'+loptions.body+'</div>';
    }else{
        pophtml += '        <div id="layer_pop_body" style="text-align:center;padding:15px 0;'+bodystyle+'">'+loptions.body+'</div>';
    }
    pophtml += cfm_btn;
    pophtml += '    </div>';

    var cl = document.body.clientWidth;

	if(loptions.ty && loptions.ty!="undefined"){
		var topFix = loptions.ty;
	}else{
		//var topFix = (loptions.h && loptions.h!="undefined") ? parseInt((maxHeight+loptions.h)/2 - loptions.h) : 220;
        var topFix = Ext.getBody().getScroll().top + (Ext.getBody().getViewSize().height - loptions.h)/2; //ty°ªÀÌ ¾øÀ¸¸é h°ªÀº ¹Ýµå½Ã Á¸ÀçÇØ¾ß ÇÔ
        //var topFix = Ext.getBody().getScroll().top + (loptions.h-Ext.getBody().getViewSize().height)/2; //ty°ªÀÌ ¾øÀ¸¸é h°ªÀº ¹Ýµå½Ã Á¸ÀçÇØ¾ß ÇÔ
	}
    
    //var leftFix = parseInt((cl+loptions.w)/2 - loptions.w);
    var leftFix = parseInt((cl+loptions.w)/2 - loptions.w);
    if(loptions.is_ani=='y') {
        bodyLayer.shift({x:leftFix,y:topFix,duration:0.1}).scale(loptions.w,loptions.h, {
            duration:0.2,
            callback: function() {
                if(Ext.get("layer_pop_size")) Ext.get("layer_pop_size").setStyle('display','none');
                bodyLayer.dom.innerHTML = pophtml;
                Ext.get("layer_pop_size").setStyle('display','block');
            }
        });
    }
    else {
        bodyLayer.setStyle({
            'top' : topFix + 'px',
            'left' : leftFix + 'px',
            'border': '4px solid ' + body_bc,
            'width': loptions.w + 'px'
        });
        if(loptions.h && loptions.h!="undefined") bodyLayer.setStyle({'height': loptions.h + 'px'});
        Ext.get(loptions.parent_id).dom.innerHTML = pophtml;
        bodyLayer.fadeIn({duration:0.4});
    }
}

//·Îµù ·¹ÀÌ¾î
function layer_loading_mask() {
    layerPop_mask({
        parent_id : ddEl, 
        w : 200,
        h : 99,
        tttl : '',
        sttl : '',
        body : '<img src=\"/images/loading.gif\"><p>Loading...</p>',
        cfm_btn : 'n'
    });
}

function layer_close(pLayer) {
    Ext.get('layer_pop_size').remove();
    Ext.get(pLayer).fadeOut({duration:0.2,remove: false,useDisplay: true});
    Ext.get('mask').setStyle('display','none');
    ie6_select_show();
}

//ie6ÀÏ¶§ selectbox º¸ÀÌ±â
function layer_close_ie6(pLayer) {
    Ext.get('layer_pop_size').remove();
    Ext.get(pLayer).fadeOut({duration:0.2,remove: false,useDisplay: true});
    Ext.get('mask').setStyle('display','none');
    ie6_select_show();
}

//ie6ÀÏ¶§ selectbox °¨Ãß±â
function ie6_select_hidden() {
    if(navigator.userAgent.indexOf("MSIE 6")>-1 && navigator.userAgent.indexOf("MSIE 7")<0){ //for IE6 hidden selectbox
        Ext.select('select').each(function() {this.setStyle('display','none');});
    }
}
//ie6ÀÏ¶§ selectbox º¸ÀÌ±â
function ie6_select_show() {
    if(navigator.userAgent.indexOf("MSIE 6")>-1 && navigator.userAgent.indexOf("MSIE 7")<0){ //for IE6 hidden selectbox
        Ext.select('select').each(function() {this.setStyle('display','');});
    }
}

function gotoTop() {
    location.href="/adm/request/";
}

function msgRet(msgtxt,el,color,loading,submitbtn) {
    var curEl = Ext.get(el);
    try {
        showTopMsg(msgtxt);
    }
    catch(e) {
        alert(msgtxt);
    }
    if(!color || color=="undefined") color="";
    if(loading && loading!="undefined") {
        Ext.get(loading).remove();
    }
    curEl.highlight(color,{ duration: 2 });
    curEl.focus();
    if(!submitbtn || submitbtn=="undefined") {
        Ext.get('fm_submit_btn').fadeIn();
    }
    else {
        try {
            Ext.get(submitbtn).fadeIn();
        }
        catch(e) {}
    }
    return false;
}
function keyOnlyNumber(e) {
    var key;
    var keychar;
    if (window.event)
       key = window.event.keyCode;
    else if (e)
       key = e.which;
    else
       return true;
    keychar = String.fromCharCode(key);
    if ((key==null) || (key==0) || (key==8) ||  (key==9) || (key==13) || (key==27) || (key==39) || (key==37) || (key>95 && key<106) )
       return true;
    else if ((("0123456789").indexOf(keychar) > -1))
       return true;
    else
       return false;
}

//-->
