/*@cc_on _d=document; eval('var document=_d; var getEl=_d.getElementById;')@*/
var _d = document;
var _getId= _d.getElementById;

// 브라우저 체크
var unitPixel="px";

var isIE=false;
var isIE6=false;
var isIE7=false;
var isChrome=false;
var isFF=false;
var isSafari=false;
var agt = navigator.userAgent.toLowerCase();
if (agt.indexOf("msie")>-1) {
    isIE=true;
    if (agt.indexOf("msie 7")>-1) isIE7=true;
    else isIE6=true;
} else {
    if (agt.indexOf("chrome")>-1) isChrome=true;
    else {
        if (agt.indexOf("safari")>-1) isSafari=true;
        else {
            if (agt.indexOf("firefox")>-1) isFF=true;
        }
    }
}

//
// 체크 관련 함수들
//
function isImage (filename) {
    if (filename.match(/(.jpg|.jpeg|.gif|.png|.bmp)$/i)) return true;
    else return false;
}

function isMedia (filename) {
    if (filename.match(/(.wma|.wmv|.avi|.mpg|.mpeg|.mp2|.mp3|.asf)$/i)) return true;
    else return false;
}

function isFile(filename) {
    if (!filename.match(/[\\\:\*\?\|<>]/)) return true;
    else return false;
}

function isBlank (str) {
	var str_len;
	str = str.replace(" ", "");
	str_len=str.length;
	if (str_len>0) return false;
	else return true;
}

function isUrl (url) {
    var urlPattern = /^(?:(?:ftp|https?):\/\/)?(?:[a-z0-9](?:[-a-z0-9]*[a-z0-9])?\.)+(?:com|edu|biz|org|gov|int|info|mil|net|name|museum|coop|aero|[a-z][a-z])\b(?:\d+)?(?:\/[^;"'<>()\[\]{}\s\x7f-\xff]*(?:[.,?]+[^;"'<>()\[\]{}\s\x7f-\xff]+)*)?/;
    return urlPattern.test(url.toLowerCase());
}

function isEmail(v) {
	return v.search(/^\s*[\w\-]+\@[\w\~\-]+(\.[\w\~\-]+)+\s*$/g)>=0;
}

function isEng (str) {
    var pattern = /[^(a-zA-Z)]/;
    if ( pattern.test (str) ) { return false; }
    else { return true; }
}

function isNum (str) {
    var pattern = /[^(0-9)]/;
    if ( pattern.test (str) ) { return false; }
    else { return true; }
}

function isID (str) {
    var pattern = /[^(a-z0-9)]/;
    if ( pattern.test (str) ) { return false; }
    else { return true; }
}

function isPWD (str) {
    var pattern = /[^(a-zA-Z0-9)]/;
    if ( pattern.test (str) ) { return false; }
    else {
		if ( str.length< 4 ) {
			return false;
		} else {
			return true;
		}
	}
}
function isColor(str) {
    var pattern = /[^(0-9a-fA-F)]/;
    if ( pattern.test (str) ) { return false; }
    else { return true; }
}
function isDate(str) {
    var arr=str.split("-");
    if (arr.length!=3) {
        return false;
    } else {
        if (!isNum(arr[0]) || !isNum(arr[1]) || !isNum(arr[2]) ) {
            return false;
        } else {
            var iyear=parseInt(arr[0]);
            var imonth=parseInt(arr[1]);
            if (imonth<0||imonth>13 ) {
                return false;
            } else {
                iday=parseInt(arr[2]);
                if (imonth==1 || imonth==3 || imonth==5 || imonth==7 || imonth==8 || imonth==10 || imonth==12 ) {
                    iend=31;
                } else if (imonth==4 || imonth==6 || imonth==9 || imonth==11 ){
                    iend=30;
                } else {
                    iend=(iyear%4==0)?29:28;
                }
                if(iday<0||iday>iend)return false;
                else return true;
            }
        }
    }
}

function isComNo(str) {
	var chkRule = "137137135";
	var step1, step2, step3, step4, step5, step6, step7;
	step1 = 0;
	for (i=0; i<7; i++)	{step1 = step1 + (str.substring(i, i+1) *chkRule.substring(i, i+1));}
	step2 = step1 % 10;
	step3 = (str.substring(7, 8) * chkRule.substring(7, 8))% 10;
	step4 = str.substring(8, 9) * chkRule.substring(8, 9);
	step5 = Math.round(step4 / 10 - 0.5);
	step6 = step4 - (step5 * 10);
	step7 = (10 - ((step2 + step3 + step5 + step6) % 10)) % 10;
	if (str.substring(9, 10) != step7) {return false;}
	return true;
}

function isRegNo(str)	{
	var ilastid,imod,iminus,ilast;
	var value0,value1,value2,value3,value4,value5,value6;
	var value7,value8,value9,value10,value11,value12;

	if (!isNaN(str)) {
		ilastid = parseFloat(str.substring(12,13));
		value0  = parseFloat(str.substring(0,1)) * 2;
		value1  = parseFloat(str.substring(1,2)) * 3;
		value2  = parseFloat(str.substring(2,3)) * 4;
		value3  = parseFloat(str.substring(3,4)) * 5;
		value4  = parseFloat(str.substring(4,5)) * 6;
		value5  = parseFloat(str.substring(5,6)) * 7;
		value6  = parseFloat(str.substring(6,7)) * 8;
		value7  = parseFloat(str.substring(7,8)) * 9;
		value8  = parseFloat(str.substring(8,9)) * 2;
		value9  = parseFloat(str.substring(9,10)) * 3;
		value10 = parseFloat(str.substring(10,11)) * 4;
		value11 = parseFloat(str.substring(11,12)) * 5;
		value12 = value0 + value1 + value2 + value3 + value4 + value5 + value6 + value7 + value8 + value9 + value10 + value11;
		imod = value12 % 11;
		iminus = 11 - imod;
		ilast = iminus % 10;
		if (ilast != ilastid) return false;
		else return true;
	}
	else return false;
}

function fnImageSize(f) {
	img = document.body.appendChild(document.createElement('img'))
	img.src = f;
	var w = img.offsetWidth;
	var h = img.offsetHeight;
	document.body.removeChild(img);
	return {width:w,height:h};
}

//
// String
//
String.prototype.ltrim=function(){return this.replace(/^\\s+/,'');}
String.prototype.rtrim=function(){return this.replace(/\\s+$/,'');}
String.prototype.trim=function(){return this.replace(/^\\s+|\\s+$/g,'');}
String.prototype.korLen=function(){var ret=0;for(var i=0; i<this.length;i++){var c=this.charAt(i);var enc=encodeURIComponent(c);ret++;if(enc.length>3) ret++;}return ret;}
String.prototype.stripTag=function(){var ret=this;var i=ret.indexOf("<");if(i>-1){ret=(ret.substring(0,i)+ret.substring(ret.indexOf(">",i)+1)).stripTag();}return ret;}
String.prototype.replaceAll=function(from, to){var ret=this;var tmp=this.toLowerCase();var fromStr=from.toLowerCase();var count=fromStr.length;while(tmp.indexOf(fromStr)>=0){var word=ret.substr(tmp.indexOf(fromStr),count);tmp=tmp.replace( from, to );ret = ret.replace( word, to );}return ret;}

//
// Flash
//
function flashObject(file_name,flashVar,width,height){
  document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="' + width + '" height="' + height + '">');
  document.write('<param name="movie" value="' + file_name + '">');
  document.write('<param name=FlashVars value="' + flashVar + '">');
  document.write('<param name="scale" value="noscale">');
  document.write('<param name="salign" value="lt" >');
  document.write('<param name="quality" value="high">');
  document.write('<param name="wmode" value="transparent">');
  document.write('<param name="allowScriptAccess" value="always">');
  document.write('<param name="allowNetworking" value="all">');
  document.write('<embed src="' + file_name +'" FlashVars="' + flashVar +'" scale="noscale" salign="lt" width="' + width + '" height="' + height + '" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" wmode="transparent" allowScriptAccess="always" allowNetworking="all"></embed>');
  document.write('</object>');
}

//
// 웹브라우저 체크
//
function whatBrowser () {
	ret="";
	if ( navigator.userAgent.indexOf ("Safari")>-1 ) {
		ret="Safari";
	} else if ( navigator.userAgent.indexOf ("MSIE 7")>-1 ){
		ret="IE7";
	} else if ( navigator.userAgent.indexOf ("Firefox")>-1 ){
		ret="Firefox";
	} else {
		ret="unknown";
	}
	return ret;
}

//
// AJAX 사용시 폼값 넘기기
//
function getPars ( f ) {
	var loop=f.elements.length;
	var pars="";

	if ( loop>0 ) {
		for (var x=0; x<loop; x++) {
			var el=f.elements;
			if ( el[x].name!=undefined && el[x].name!="" && el[x].name!="FCKeditor" ) {
                switch (el[x].type.toLowerCase()) {
                    case "text":
                    case "hidden":
                    case "button":
                    case "password":
                    case "select-one":
                    case "textarea":
                        if ( pars!= "" ) pars+="&";
                        pars+=el[x].name+"="+encodeURIComponent(el[x].value);
                        break;
                    case "checkbox":
                    case "radio":
                        if ( el[x].checked ) {
                            if ( pars!= "" ) pars+="&";
                            pars+=el[x].name+"="+encodeURIComponent(el[x].value);
                        }
                        break;
                }
			}
		}
	}

	return pars;

}

//
// 파싱
//
function getTagValue ( tag, txt ) {
    var ret="";
    txt=txt.rtrim().ltrim();
    var p1=txt.indexOf("<"+tag+">");
    var p2=txt.indexOf("</"+tag+">");
    if ( p1>-1 && p2>p1 ) {
       ret=txt.substring(p1+tag.length+2, p2);
    }
    return ret;
}


//
// Select Option 관련
//
function fnChangeOption ( obj, p1, p2 ) {var p1Txt=obj.options[p1].text;var p1Val=obj.options[p1].value;var p2Txt=obj.options[p2].text;var p2Val=obj.options[p2].value;obj.options[p2]=new Option(p1Txt,p1Val,false,false);obj.options[p1]=new Option(p2Txt,p2Val,false,true);}
function fnAddOption(obj,txt,val) {obj.options[obj.length]=new Option (txt, val, false, false);}
function fnMoveOption(obj,i){if(obj.selectedIndex>-1) {if(i<0){if(obj.selectedIndex==0){return;}}else{if(obj.selectedIndex==obj.length-1){return;}}fnChangeOption(obj,obj.selectedIndex,obj.selectedIndex+i);obj.options[obj.selectedIndex+i].selected=true;}}
function fnMoveMultiOption (obj, mv) {if (mv>0) {for(i=obj.length-1;i>=0;i--) {if(obj.options[i].selected){if(i<obj.length-1) {fnChangeOption(obj,i+1,i);}else{return;}}}}else{for(i=0;i<obj.length;i++){if(obj.options[i].selected){if(i>0){fnChangeOption(obj,i-1,i);}else{return;}}}}}
function fnRemoveOption(obj){var i;for (i = obj.length - 1; i>=0; i--) {if (obj.options[i].selected) {obj.remove(i);}}}

var isProc=0;
function fnProc(ProcFile,Pars,Func) {
    if (isProc==1) return;
    isProc=1;
    var myAjax=new Ajax.Request (
        ProcFile,{
             asynchronous:true
            ,method:"post"
            ,parameters:Pars
            ,onSuccess:function(request){
                isProc=0;
                var xmlDoc=request.responseXML;
                var Err=xmlDoc.getElementsByTagName("Err")[0].childNodes[0].nodeValue;
                var Msg = xmlDoc.getElementsByTagName("Msg")[0].childNodes[0].nodeValue;
                if(Err=="0"){eval(Func);}
                else if(Err=="1"){alert(Msg);}
                else if(Err=="9"){alert(Msg);location.reload();}
                else{alert("Request Failure");}
            }
            ,onFailure:function(){
                isProc=0;
                alert("에러가 발생했습니다.\n\n잠시후에 다시 이용해주세요.");
            }
        }
    );
}

function fnShowAreaSize() {var oDoc=document[document.compatMode=='CSS1Compat'?'documentElement':'body'];if(/Opera/.test(navigator.userAgent)) oDoc=document.body;return [oDoc.clientWidth, oDoc.clientHeight];}
function fnPageAreaSize() {var oDoc=document[document.compatMode=='CSS1Compat'?'documentElement':'body'];if(/Opera|Safari/.test(navigator.userAgent)) oDoc = document.body;if(/MSIE\s([0-9]+(\.[0-9]+)*)/.test(navigator.userAgent)&&parseFloat(RegExp.$1)<6) {var aOld=[oDoc.scrollLeft,oDoc.scrollTop];var aClient=getClientSize();oDoc.scrollLeft=999999;oDoc.scrollTop=999999;var aRet=[oDoc.scrollLeft+aClient[0],oDoc.scrollTop+aClient[1]];oDoc.scrollLeft=aOld[0];oDoc.scrollTop=aOld[1];return aRet;}return [oDoc.scrollWidth,oDoc.scrollHeight];}

    function fnPopLayer(LayerId, bl, w, h, zlev) {
        var obj=$(LayerId);
        if (bl) {
            if (w>0 && h>0 ) {
                obj.style.width=w+unitPixel;
                obj.style.height=h+unitPixel;
                $("elPopupFrame").style.width=(w-20)+unitPixel;
                $("elPopupFrame").style.height=(h-40)+unitPixel;
            }
            fnPopupMove(obj);
            obj.style.display="";
            fnBlockBack(1,zlev);
        } else {
            obj.style.display="none";
            fnBlockBack(0,zlev);
        }
    }

	function fnPageSize() {

	  var oDoc = document[document.compatMode == 'CSS1Compat' ?'documentElement' : 'body'];
	  if (/Opera/.test(navigator.userAgent)) oDoc = document.body;
	  return [
		oDoc.clientWidth,
		oDoc.clientHeight
	  ];

	}
	function fnPopupMove(el) {
        if ( isIE ) {
            scroll_left = parseInt(document.body.scrollLeft);
            scroll_top = parseInt(document.documentElement.scrollTop);
        } else {
            scroll_left = parseInt(self.pageXOffset);
            scroll_top = parseInt(self.pageYOffset);
        }
		var pos=fnPageSize();
		el_x=(parseInt(pos[0])-parseInt(el.style.width))/2;
		el_y=(parseInt(pos[1])-parseInt(el.style.height))/2;
        if (el_x<0) el_x=0;
        if (el_y<0) el_y=0;
		el.style.left=(scroll_left+el_x)+'px';
		el.style.top=(scroll_top+el_y)+'px';
	}
/*
	window.onresize=function() {
		if ($("elPopup").style.display=="") {
			fnPopupMove($("elPopup"));
		}
	}
*/
document.write('<div id="BlockBack0" style="display:none"></div><div id="BlockBack1" style="display:none"></div>');
document.write('<div id="BlockBack1" style="display:none"></div><div id="BlockBack1" style="display:none"></div>');
document.write('<div id="obProgressBar" style="display:none"><script language="javascript" type="text/javascript">flashObject("/flash/progressBar.swf","","200","200")</script></div>');
document.write('<div class="popupLayer" id="elPopup" style="top:0px;left:0px;display:none;"><div class="popupLayer-header"><div class="popupLayer-header-left"></div><div class="popupLayer-header-center" id="elPopupTitle"></div><div class="popupLayer-header-right"></div><div class="popupLayer-close"><img src="/img/popup/popup-close-bt.gif" alt="닫기" class="a" onclick="fnHidePopup(\'L\',this.parentNode.parentNode.parentNode.id,0)"/></div></div><div class="popupLayer-body"><iframe id="elPopupFrame" name="elPopupFrame" src="/modules/blank.html" frameborder="0" scrolling="no"></iframe></div></div>');
document.write('<div class="popupModal" id="elModal" style="top:0px;left:0px;display:none;"><div class="popupLayer-header"><div class="popupLayer-header-left"></div><div class="popupLayer-header-center" id="elModalTitle"></div><div class="popupLayer-header-right"></div><div class="popupLayer-close"><img src="/img/popup/popup-close-bt.gif" alt="닫기" class="a" onclick="fnHidePopup(\'L\',this.parentNode.parentNode.parentNode.id,1)"/></div></div><div class="popupLayer-body"><iframe id="elModalFrame" name="elModalFrame" src="/modules/blank.html" frameborder="0" scrolling="no"></iframe></div></div>');

function fnBlockBack (bl, zlev) {
    if (bl) {

        if( isIE ) {
            winWidth = parseInt(document.body.clientWidth);
            winHeight = parseInt(document.body.clientHeight);
            scrollLeft = parseInt(document.body.scrollLeft);
            scrollTop = parseInt(document.body.scrollTop);
        } else {
            winWidth = parseInt(self.innerWidth);
            winHeight = parseInt(self.innerHeight);
            scrollLeft = parseInt(self.pageXOffset);
            scrollTop = parseInt(self.pageYOffset);
        }
        $("BlockBack"+zlev).style.display="";
        $("BlockBack"+zlev).style.height=winHeight+unitPixel;

        if ( document.all ) {
            for( var i=0; i<document.all.tags("select").length; i++ ) {
                if (document.all.tags("select")[i].getAttribute("controlVisible")!="x") {
                    document.all.tags("select")[i].style.visibility="hidden";
                }
            }
        }
    } else {
        $("BlockBack"+zlev).style.display="none";
        if ( document.all ) {
            for( var i=0; i<document.all.tags("select").length; i++ ) {
                document.all.tags("select")[i].style.visibility="";
            }
        }
    }
}

function fnHideSelect(bl) {
    if (bl) {
        if (isIE && isIE6) {
            if ( document.all ) {
                for( var i=0; i<document.all.tags("select").length; i++ ) {
                    if (document.all.tags("select")[i].getAttribute("controlVisible")!="x") {
                        document.all.tags("select")[i].style.visibility="hidden";
                    }
                }
            }
        }
    } else {
        if (isIE && isIE6) {
            if ( document.all ) {
                for( var i=0; i<document.all.tags("select").length; i++ ) {
                    if (document.all.tags("select")[i].getAttribute("controlVisible")!="x") {
                        document.all.tags("select")[i].style.visibility="visible";
                    }
                }
            }
        }
    }
}

function fillZero (n) {
	var ret="";
	if (n.length<2) {
		ret="0"+n;
	} else {
		ret=n;
	}
	return ret;
}


function fnSetFileSize(sz){var i=sz/1024;if(i>1024){i=i/1024;ret=fnRound(i,2)+" MB";} else {ret=(i<0.01)?"0.01 KB":fnRound(i,2)+" KB";}return ret;}
function fnRound(n, digits){if(digits>=0) return parseFloat(n.toFixed(digits));digits = Math.pow(10, digits);var t=Math.round(n*digits)/digits;return parseFloat(t.toFixed(0));}
function fnCheckAll(f, objName, val) {for (var i=0;i<f.elements.length;i++){var e = f.elements[i];if ((e.name==objName)&&(e.type=='checkbox')&&(!e.disabled)){e.checked=val;}}}
function isChecked (f, objName) {for (var i=0;i<f.elements.length;i++){var e = f.elements[i];if ((e.name==objName)&&(e.type=='checkbox')&&(!e.disabled)){if(e.checked) return true;}}}
function retCheck (f, objName) {
    var ret="";
    for (var i=0;i<f.elements.length;i++){
        var e = f.elements[i];
        if ((e.name==objName)&&(e.type=='checkbox')&&(!e.disabled)){
            if(e.checked) {
                if (!isBlank(ret)) ret+=",";
                ret+=e.value
            }
        }
    }
    return ret;
}

function fnProgressBar (bl,param) {
    if (bl==1) {
        top.fnPopLayer("obProgressbar",1,200,200,1);
    } else {
        top.fnPopLayer("obProgressbar",0,0,0,1);
    }
}

function fnLoadEvent(func) {
  var oldonload = window.onload;
  if (typeof window.onload != 'function') {
    window.onload = func;
  } else {
    window.onload = function() {
      if (oldonload) {
        oldonload();
      }
      func();
    }
  }
}

function fnChecking(obj,elName,val) {
    for (i=0; i<obj.elements.length; i++) {
        var e=obj.elements[i];
        if (e.type=="checkbox" && e.name==elName && e.value==val) {
            e.checked=true;
            return;
        }
    }
}

var iLoop=0;
function fnIFrameResize() {
    if ( isBlank(window.name) ) return;
    var obj=parent.document.getElementById(window.name);
    minHeight = 300;
    var height=0;
    if (iLoop==0) obj.style.height=minHeight+unitPixel;
    try {
        if (iLoop>5){ iLoop=1; return; }
        iLoop++;
        var doc = obj.contentDocument || obj.contentWindow.document;

        if (isIE) {
            height = doc.body.scrollHeight;
            width = doc.body.scrollWidth;
        } else {
            var spaer = doc.body.appendChild(document.createElement('DIV'))
            spaer.style.clear = 'both';
            height=spaer.offsetTop;
            width =spaer.offsetWidth;
            spaer.parentNode.removeChild(spaer);
        }
        if (height < minHeight) height = minHeight;

        //obj.style.width  = width+unitPixel;
        obj.style.height = height+unitPixel;
        setTimeout(function(){ fnIFrameResize() }, 200);

    } catch (e) {

    }
}

function fnPopup(u, n, w, h, t, l, etc) {
    var attr= "width="+w+",height="+h+",top="+t+",left="+l;
    if (!isBlank(etc)) attr+=","+etc;
    var win=window.open(u, n, attr);
    win.focus ();
}

function fnPopupResize(w,h) {
    window.resizeTo(w,h);
}


function fnLogout() {
	fnProc("/login/proc.asp","act=logout","fnLogout_Success(Msg)");
}
function fnLogout_Success() {
	top.location.href='/';
}

function fnLogout2(campus_id) {
	fnProc("/login/proc.asp","act=logout","fnLogout_Success2('"+campus_id+"')");
}
function fnLogout_Success2(campus_id) {
	top.location.href="/campus/?campusid="+campus_id;
}


function fnMypage() { fnLocation("/campus/")}
function fnGoCampus(campus_id) {if(!isBlank(campus_id)){fnLocation("/campus/default.asp?campusid="+campus_id);}}
function fnLocation(uri){document.location=uri;}

function fnTrOver(el){el.style.backgroundColor="#eeeeee";}
function fnTrOut(el){el.style.backgroundColor="#ffffff";}

function errColor(obj,name) {
    if ( !isBlank(obj.value) ) {
        obj.value=obj.value.toUpperCase();
        if ( !isColor(obj.value) ) {
            alert(name+"이 잘못되었습니다.\n\n000000 ~ FFFFFF 사이의 값을 입력하셔야 합니다.");
            obj.focus ();
            return false;
        } else {
            return true;
        }
    } else {
        return true;
    }
}

function fnShowPopup (typ, id, url, tit, siz_w, siz_h, pos_t, pos_l) {
/*
    typ: 팝업 구분 (W:윈도우, L:레이어)
    id: 엘리먼트 ID
    url: 페이지 URL
    tit: 제목
    siz_w: 가로사이즈
    siz_h: 세로사이즈
    pos_t: Top
    pos_l: Left
*/
    if (typ=="W") {
        if (url.indexOf("?")>-1) url+="&flag=1"
        else url+="?flag=1"
        var el=window.open(url,id,"width="+siz_w+",height="+siz_h+",status=1,resizable=1,scrollbars=1");
        el.focus();
    } else {
        var el=$(id);
        var z_idx=0;
        if (siz_w>0 && siz_h>0 ) {
            el.style.width=siz_w+unitPixel;
            el.style.height=siz_h+unitPixel;
            if ( !isBlank(url) ) {
                $("elPopupFrame").style.width=(siz_w-20)+unitPixel;
                $("elPopupFrame").style.height=(siz_h-40)+unitPixel;
            }
        }

        if (!isBlank(tit)){$("elPopupTitle").innerHTML=tit;}
        el.style.display="";
        if (!isBlank(url)){elPopupFrame.location.replace(url);}
        fnPopupMove(el);
        fnBlockBack(1,z_idx);
    }
}

function fnShowModal(url, tit, siz_w, siz_h, pos_t, pos_1) {
    var el=$("elModal");
    var z_idx=1;
    if (siz_w>0 && siz_h>0 ) {
        el.style.width=siz_w+unitPixel;
        el.style.height=siz_h+unitPixel;
        if ( !isBlank(url) ) {
            $("elModalFrame").style.width=(siz_w-20)+unitPixel;
            $("elModalFrame").style.height=(siz_h-40)+unitPixel;
        }
    }

    if (!isBlank(tit)){$("elModalTitle").innerHTML=tit;}
    el.style.display="";
    if (!isBlank(url)){elModalFrame.location.replace(url);}
    fnPopupMove(el);
    fnBlockBack(1,z_idx);
}

function fnHidePopup (typ, elName, z_idx) {
    if (typ=="W") {
        window.close();
    } else {
        $(elName).style.display="none";
        fnBlockBack(0,z_idx);
    }
}

function fnEncode(val) {
    return encodeURIComponent(val);
}

function fnFileSelector(divId, dir) {
    var link="/modules/file/fileSelector.asp?divId="+divId+"&dir="+encodeURIComponent(dir);
    fnShowPopup("L","elPopup",link, "링크 - 신규", 500,300,0,0);
}

function TrOver(tr) {tr.style.backgroundColor="#EEEEEE";}
function TrOut(tr) {tr.style.backgroundColor="#FFFFFF";}

function SchTrOver(tr) {tr.style.backgroundColor="#EEEEEE";}
function SchTrOut(tr) {tr.style.backgroundColor="#F4F4F4";}


function goBoard(siteid, menuid, boardid, rowno) {
    document.location="./html.asp?siteid="+siteid+"&menuid="+menuid+"&boardid="+boardid+"&idx="+rowno;
}

function goBoard2(siteid, menuid, boardid, rowno, campusid) {
    document.location="./html.asp?siteid="+siteid+"&menuid="+menuid+"&boardid="+boardid+"&idx="+rowno+"&campusid="+campusid;
}

function cutStr(str,limit) {
    var ret = str;
    var byte_count = 0;
    var len = str.length;
    var dot = "";

    for (i = 0 ; i < len ; i++ ) {
        byte_count += chrByte(str.charAt(i));
        if(byte_count == limit-1){
            if(chrByte(str.charAt(i+1)) == 2){
                ret = str.substring(0,i+1);
                dot="...";
            }else {
                if(i+2 != len) dot = "..";
                ret=str.substring(0,i+2);
            }
            break;
        }else if(byte_count == limit){
            if(i+1 != len) dot = "..";
            ret=str.substring(0,i+1);
            break;
        }
    }
    return ret;
}

function chrByte(c){
    if(escape(c).length > 4)
        return 2;
    else
        return 1;
}

function fnSms(typ,req_id) {
    var win=window.open('sms.asp?typ='+typ+'&req_id='+req_id,'POPUP_SMS','width=200,height=400,top=100,left=100');
    win.focus();
}

function fnDownload(u) {
    var doc = window.document;
    var fr=doc.body.appendChild(document.createElement('IFRAME'));
    fr.width="0px";
    fr.height="0px";
    fr.src=u;
}

function fnShowSchedule(campusid, d) {
    window.open("/modules/calendar/schedule_pop1.asp?campusid="+campusid+"&d="+d,"schedule","width=400,height=400,top=100,left=100");
}