	if(StrTrim(document.title) != "") {
		
		if (top.window.name != "LectureRoom") {
			top.document.title = document.title;
		}
	}
	
	function CheckForm(form, Ctrl, Msg) {
		
		if (StrTrim(form[Ctrl].value) == "") {
			alert(Msg);form[Ctrl].focus();return false;
		} else {
			return true;	
		}
		
	}


	var tmp = new Date();
	var PageVersion = tmp.getYear() + "" + tmp.getMonth() + "" + tmp.getDate() + "" + tmp.getHours() + "" + tmp.getMinutes() + "" + tmp.getSeconds();
	
	function LectureRoomOpen(CUMENUCODE, S_ID, PageVersion) {
		//·ºÃÄ·ë ¿ÀÇÂ ÇÔ¼ö
		
		setCookie("flag_window", "0", 1);
		LectureRoomWin = top.window.open("/lecture/Lecture.htm?CUMENUCODE=" + CUMENUCODE + "&S_ID=" + S_ID + "&PageVersion=" + PageVersion, "LectureRoom", "width=1015,height=700,scrollbars=0,resizable=1,status=0,toolbar=0");
	}

	function PageVersion_update() {
		
		var tmp = new Date();
		
		PageVersion = tmp.getYear() + "" + tmp.getMonth() + "" + tmp.getDate() + "" + tmp.getHours() + "" + tmp.getMinutes() + "" + tmp.getSeconds();

	}

	// 2004.05.31 
	function WindowOpen(tURL, tName, tWidth, tHeight, tScrollBar, tToolBar, tstatus) {
		open(tURL, tName, "width=" + tWidth + ",height=" + tHeight + ",scrollbars=" + tScrollBar + ",toolbar=" + tToolBar + ", status=" + tstatus);
	}

	
	function GetCookie(name) {
		var arg = name + "=";
		var alen = arg.length;
			
		var clen = document.cookie.length;
		var i = 0;
			
		while (i < clen) {
			var j = i + alen;
				
			if(document.cookie.substring(i, j) == arg)
				return getCookieVal(j)
			i = document.cookie.indexOf(" ", i) + 1
			if (i == 0) break
		}
			
		return null
	}
	
	function setCookie( name, value, expiredays ) { 

		var todayDate = new Date(); 
		todayDate.setDate( todayDate.getDate() + expiredays ); 
		document.cookie = name + "=" + escape( value ) + "; path=/; expires=" + todayDate.toGMTString() + ";" 

	}

	
	function getCookieVal(offset) {
		var endstr = document.cookie.indexOf(";", offset)
		if (endstr == -1)
		endstr = document.cookie.length
		return unescape(document.cookie.substring(offset, endstr))
	}
	
	function StrTrim(strText) {
		var txt = "";
		var i_tmp;
		
		for(i_tmp=0;i_tmp <= strText.length - 1;i_tmp++) {
			if(strText.charAt(i_tmp) != " ") {
				txt = txt + strText.charAt(i_tmp);
			}
		}
		
		return txt;
	}
	
	function FormatComma(StrN) {
		var StrA = "" + ReplaceComma(StrN) + "";
		var StrB = "";

		var j = 0
		for(k=StrA.length - 1;k >= 0;k--) {
			if(j == 3) {
				StrB = StrA.charAt(k) + "," + StrB;
				j = 0;
			} else {
				StrB = StrA.charAt(k) + "" + StrB;
			}
			j++;
		}

		return StrB;
	}

	function ReplaceComma(StrText) {
		var StrA = "" + StrText + "";
		var StrB = "";
		
		for(k = 0;k <= StrA.length - 1;k++) {
			if(StrA.charAt(k) != ",") {
				StrB = StrB + "" + StrA.charAt(k);
			}
		}
		return StrB;
	}
	
	function FormReset(form) {
		if(!confirm("\n !!!\n\n ?")) {return;}
		form.reset();
	}
	
	function FontStyleinit(MenuStr, ct) {
		if (Number(ct) <= 0) {return;}
		for(i=1;i <= ct;i++) {
			var MenuID = document.all[MenuStr + "" + i];
			MenuID.style.cssText = document.all[MenuStr + "CSSOut" + i].innerHTML;
		}
	}
	
	function FontStyleOver(MenuStr, ct) {
		var MenuID = document.all[MenuStr + "" + ct];
		MenuID.style.cssText = document.all[MenuStr + "CSSOver" + ct].innerHTML;
	}
	
	function FontStyleOut(MenuStr, ct) {
		var MenuID = document.all[MenuStr + "" + ct];
		MenuID.style.cssText = document.all[MenuStr + "CSSOut" + ct].innerHTML;
	}
	
	function msgposit() {
		message.style.posLeft = event.x + 5 + document.body.scrollLeft;
		message.style.posTop = event.y + 22 + document.body.scrollTop;
		message.style.visibility = "visible";
	} 
	
	function msgset(str) {
		var text;
		text ='<table border=0 cellpadding=0 cellspacing=0 bgcolor=#FDFFF2 style="font-size:9pt; border-width:1; border-color:black; border-style:solid;">'; 
		text += '<tr><td>' + str + '</td></tr></table>';message.innerHTML=text;
	} 

	function msghide() {
		message.innerHTML='';
		message.style.posLeft = 0;
		message.style.posTop = 0;
		message.style.visibility = "hidden";
	}
	
	function logout() {
		if(!confirm("\n ?")) {return;}
		top.location.href = "/SSO/Logout.htm?<%=PageVersion%>";
	}
	
	function OpenLogout() {
		//open("/SSO/Logout.Check.html", "LogoutCheck", "width=0,height=0,left=13000,top=13000,scrollbars=0,resizable=yes");
	}

	function NumberCheck(NumStr) {
		if (	isNaN(Number(ReplaceComma(StrTrim(NumStr)))) ) {
			return false;
		} else {
			return true;
		}
	}
	

	
	var ieVer;

	if (navigator.userAgent.indexOf ("MSIE 4") != -1) {
		ieVer = 4;
	} else if (navigator.userAgent.indexOf ("MSIE 5") != -1) {
		ieVer = 5;
	} else if (navigator.userAgent.indexOf ("MSIE 5.5") != -1) {
		ieVer = 5.5;
	} else if (navigator.userAgent.indexOf ("MSIE 6") != -1) {
		ieVer = 6;
	} else if (navigator.userAgent.indexOf ("MSIE 7") != -1) {
		ieVer = 7;
	}
	
	function infoMenu(ID, CMU_ID) {

		infomenulay.style.posLeft = event.x + 15 + document.body.scrollLeft;
		infomenulay.style.posTop = event.y - 28 + document.body.scrollTop;
		
		var str = ""
		str += "<table border=0 cellpadding=0 width=120 cellspacing=0 bgcolor=#F6F6F6 style='border:1pt solid #919191;'>";

		str += "<tr>";
		str += "<td style='border-bottom:1pt solid #919191;border-right:0pt;padding-top:3pt;' nowrap bgcolor=#DCDCDC class=TabButton>";
		str += "&nbsp;<font style=\"color:#FF5555;font-size:9pt;font-weight:bold;\">[" + ID + "]</font>&nbsp;";
		str += "</td>";
		str += "</tr>";
		
		str += "<tr style='padding-top:3pt;padding-bottom:2pt;'>";
		str += "<td onmouseover=\"this.style.cssText='background:#225588;color:#FFFFFF;cursor:hand;';\" onmouseout=\"this.style.cssText='';\" onclick=\"infoMenu_Userinfo('" + ID + "', '" + CMU_ID + "')\;\">";
		str += "&nbsp;&nbsp;";
		str += "</td>";
		str += "</tr>";
		
		str += "<tr style='padding-top:3pt;padding-bottom:2pt;'>";
		str += "<td onmouseover=\"this.style.cssText='background:#225588;color:#FFFFFF;cursor:hand;';\" onmouseout=\"this.style.cssText='';\" onclick=\"infoMenu_SendMessage('" + ID + "')\;\">";
		str += "&nbsp;&nbsp;";
		str += "</td>";
		str += "</tr>";
		
		str += "<tr style='padding-top:3pt;padding-bottom:2pt;'>";
		str += "<td onmouseover=\"this.style.cssText='background:#225588;color:#FFFFFF;cursor:hand;';\" onmouseout=\"this.style.cssText='';\" onclick=\"infoMenu_add_fr('" + ID + "');\">";
		str += "&nbsp;&nbsp;";
		str += "</td>";
		str += "</tr>";
		
		str += "<tr style='padding-top:3pt;padding-bottom:2pt;'>";
		str += "<td onmouseover=\"this.style.cssText='background:#225588;color:#FFFFFF;cursor:hand;';\" onmouseout=\"this.style.cssText='';\" onclick=\"infoMenu_add_de('" + ID + "');\">";
		str += "&nbsp;&nbsp;";
		str += "</td>";
		str += "</tr>";
		
		str += "<tr style='padding-top:0pt;padding-bottom:2pt;'>";
		str += "<td align=right><font face=helvetica size=1>";
		str += "&nbsp;<a href=\"javascript:infoMenu_close()\;\">Close</a>&nbsp;";
		str += "</td>";
		str += "</tr>";
		
		str += "</table>";
		
		document.all.infomenulay.innerHTML = str;
		
		infomenulay.style.visibility = "visible";
	}
	
	function infoMenu_Userinfo(ID, CMU_ID) {
		open("/User/User.info.htm?ID=" + ID + "&CMU_ID=" + CMU_ID, "Userinfo_window", "width=100,height=100,scrollbars=0");
		
		infoMenu_close();
	}
	
	function infoMenu_SendMessage(ID) {
		open("/Message/MSG.send.htm?ID_RE=" + ID, "MSG_send_window", "width=100,height=100,scrollbars=0");

		infoMenu_close();
	}
	
	function infoMenu_add_fr(ID) {
		if(!confirm("\n !!!")) {
			infoMenu_close();
			return;	
		}
		
		HiddeniFrame.location.href = "/Message/MSG.fr.add.htm?ID_RE=" + ID;
		
		infoMenu_close();
	}
	
	
		
	
		
	function ShowUploadProgress(ATTACHN) { 

		strAppVersion = navigator.appVersion;
		
		if(ATTACHN > 0) {
			if (strAppVersion.indexOf('MSIE')!=-1 && strAppVersion.substr(strAppVersion.indexOf('MSIE')+5,1) > 4) { 
				winstyle = "dialogWidth=385px; dialogHeight:150px; center:yes"; 
				window.showModelessDialog("/Upload/show_progress.asp?nav=ie", null, winstyle); 
			} else {
				winpos = "left=" + ((window.screen.width-380)/2)+",top=" + ((window.screen.height-110)/2);
				winstyle = "width=380,height=110,status=no,toolbar=no,menubar=no," + "location=no,resizable=no,scrollbars=no,copyhistory=no," + winpos;
				window.open("/Upload/show_progress.asp",null,winstyle); 
			} 
		}

		return true; 
	} 

	function MSG_window_open(X, Y, MSG) {
		
		PageVersion_update();
		
		winstyle = "dialogWidth=" + X + "px; dialogHeight:" + Y + "px; center:yes; edge: Raised;help: No; resizable: No; status: No;"; 
		MSG_window = window.showModelessDialog("/MSG.window.htm?MSG=" + MSG + "&PageVersion=" + PageVersion, null, winstyle); 

	}

	

function resizeiframe(name, width, height)
{
	min_width_iframe = width;
	min_height_iframe = height;
	min_size_apply = 0;

	try{       
		var oBody = document.frames(name).document.body;
		var oFrame = document.all(name);
		var i_height = oBody.scrollHeight + (oBody.offsetHeight-oBody.clientHeight);
		var i_width = oBody.scrollWidth + (oBody.offsetWidth-oBody.clientWidth);
        
		if(min_size_apply){
			if(i_height < min_height_iframe){
				i_height = min_height_iframe;
			}
			if(i_width < min_width_iframe){
				i_width = min_width_iframe;
			}
		}
		
		oFrame.style.height = i_height;
		oFrame.style.width = i_width;
    
	}
	catch(e){
		window.status = 'Error: ' + e.number + '; ' + e.description;
	}
}