
function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}
function gourl(url){
	self.location=url;
}
function goindy2k(url){
	indy2k.location=url;
}
function centerwin(url,winname,features)
{
	
	features = features.toLowerCase();
	len = features.length;
	sumchar= "";
	for (i=1; i <= len; i++) 
	{ 
		onechar = features.substr(i-1, 1);
		if (onechar != " ") sumchar += onechar;
	}
	
	features = sumchar; 
	sp = new Array();
	sp = features.split(',', 10);
	splen = sp.length;
	for (i=0; i < splen; i++) 
	{ 
	if (sp[i].indexOf("width=") == 0)
	{ 
	width = Number(sp[i].substring(6)); 
	} else if (sp[i].indexOf("height=") == 0) 
	{
	height = Number(sp[i].substring(7)); 
	}
	}
	sleft = (screen.width - width) / 2;
	stop = (screen.height - height) / 2;
	features = features + ",left=" + sleft + ",top=" + stop;
	popwin = window.open(url,winname,features); 
}

function playflash(file,width,height,bgcolor,quality,name){
	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+'" id="'+name+'">');  //ÇÃ·¡½¬ÇÃ·¹ÀÌ¾î ¹öÀüÀÌ ÀÌÀü¹öÀüÀÏ°æ¿ì ¹öÀü 8À» º¯°æ
	document.write('<param name="movie" value="'+file+'" />');
	document.write('<param name="quality" value="'+quality+'" />');
	document.write('<param name="wmode" value="transparent" />');  //Åõ¸íÇÃ·¡½¬°¡ ¾Æ´Ò°æ¿ì ÀÌ ¶óÀÎÀ» »èÁ¦
	document.write('<param name="bgcolor" value="'+bgcolor+'" />');
	document.write('<embed src="'+file+'" quality="'+quality+'" wmode="transparent" bgcolor="'+bgcolor+'" width="'+width+'" height="'+height+'" name="'+name+'" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />');
	document.write('</object>')
}

function wit_cancel(item){
	if(confirm("Á¦ÃâÃë¼Ò´Â 1È¸¿¡ ÇÑÇÏ¿© Çã¿ëµË´Ï´Ù.\n\nÁ¦ÃâÇÑ ³»¿ëÀ» Ãë¼Ò ÇÏ½Ã°Ú½À´Ï±î?")){
		theForm = document.hiddenForm;
		theForm.modify_no.value = item;
		theForm.action = "my_writing_cancel.asp";
		theForm.submit();
	}
}

function go_board_more(siteid){
	var bcode = document.all['bcode_more_no'].value;
	var url = "/board/board.asp?exec=list&mcode=id&bcode="+bcode;
	parent.location=url;
}
function g_bookmark(){
	window.external.AddFavorite('http://www.gateenglish.com','GATE English');
}

function webzine_view(no,w,h){
	var width = (parseFloat(w)*2+60);
	var height = (parseFloat(h)+160);
	var top  = (document.body.clientHeight - height) / 2;
	var left = (document.body.clientWidth - width) / 2;

	var sok="width="+width+",height="+height+",status=yes,top="+top+",left="+left;	
	window.open("/infor_desk/webzine/view.asp?no="+no,"",sok);
}
function howtouse(a){
	var w = document.body.clientWidth;
	var h = document.body.clientHeight;
	window.open('/help/index.asp?no='+a,'gatehelp','top=10,left=5,resizable=yes,width='+w+',height='+h);
}

function wt_process(wt_num){
		var url;	
		//url = "/myclass/wit/index.asp?classroom_no="+wt_num;
		url = "http://data.witnsam.com/program/CLUE/wit_class/index.asp?company=witnsam&classroom_no="+wt_num;
		ttp = window.open(url,'wit_window','width=1000,height=710,toolbar=no,location=no,status=yes,menubar=no,scrollbars=no,resizable=no');
		//ttp = window.showModalDialog(url,"study_modal","dialogWidth:980px; dialogHeight:760px; scroll:0; help:0; status:1");
		//ttp.moveTo(0,0);
}
function sam_toeic_process(st_num){
		var turl;	
		turl = "http://data.witnsam.com/program/sam_toeic/index.asp?classroom_no="+st_num;
		centerwin(turl,'wit_window','width=1000,height=710,toolbar=no,location=no,status=yes,menubar=no,scrollbars=no,resizable=no');		
}
function wt_process_startup(wt_num){
		var url;	
		//url = "/myclass/wit/index.asp?classroom_no="+wt_num;
		url = "http://data.witnsam.com/program/CLUE/wit_startup/index.asp?classroom_no="+wt_num;
		ttp = window.open(url,'wit_window','width=1000,height=710,toolbar=no,location=no,status=yes,menubar=no,scrollbars=no,resizable=no');
		//ttp = window.showModalDialog(url,"study_modal","dialogWidth:980px; dialogHeight:760px; scroll:0; help:0; status:1");
		//ttp.moveTo(0,0);
}
function wt_process_main(wt_num){
		var url;	
		url = "myclass/wit/index.asp?classroom_no="+wt_num;
		ttp = window.open(url,'wit_window','width=1000,height=710,toolbar=no,location=no,status=yes,menubar=no,scrollbars=no,resizable=no');
		//ttp = window.showModalDialog(url,"study_modal","dialogWidth:980px; dialogHeight:760px; scroll:0; help:0; status:1");
		//ttp.moveTo(0,0);
}
function escoop_process(cno){
		var url;	
		url = "http://data.witnsam.com/Program/CLUE/escoop/index.asp?company=witnsam&classroom_no="+cno;
		ttp = window.open(url,'study_window','width=980,height=710,toolbar=no,location=no,status=yes,menubar=no,scrollbars=yes,resizable=no');
		//ttp.moveTo(10,10);
}
function ldiary(a){
		window.open('schedule.asp?no='+a,'wp','top=20,left=20,width=520,height=718,toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=no');
}

function roundTable(objID) {
	var obj = document.getElementById(objID);
	var Parent, objTmp, Table, TBody, TR, TD;
	var bdcolor, bgcolor, Space;
	var trIDX, tdIDX, MAX;
	var styleWidth, styleHeight;
	
	// get parent node
	Parent = obj.parentNode;
	objTmp = document.createElement('SPAN');
	Parent.insertBefore(objTmp, obj);
	Parent.removeChild(obj);
	
	// get attribute
	bdcolor = obj.getAttribute('rborder');
	bgcolor = obj.getAttribute('rbgcolor');
	radius = parseInt(obj.getAttribute('radius'));
	if (radius == null || radius < 1) radius = 1;
	else if (radius > 6) radius = 6;
	
	MAX = radius * 2 + 1;
	
	/*
	create table {{
	*/
	Table = document.createElement('TABLE');
	TBody = document.createElement('TBODY');
	
	Table.cellSpacing = 0;
	Table.cellPadding = 0;
	
	for (trIDX=0; trIDX < MAX; trIDX++) {
		TR = document.createElement('TR');
		Space = Math.abs(trIDX - parseInt(radius));
		for (tdIDX=0; tdIDX < MAX; tdIDX++) {
			TD = document.createElement('TD');
			
			styleWidth = '1px'; styleHeight = '1px';
			if (tdIDX == 0 || tdIDX == MAX - 1) styleHeight = null;
			else if (trIDX == 0 || trIDX == MAX - 1) styleWidth = null;
			else if (radius > 2) {
				if (Math.abs(tdIDX - radius) == 1) styleWidth = '2px';
				if (Math.abs(trIDX - radius) == 1) styleHeight = '2px';
			}
			
			if (styleWidth != null) TD.style.width = styleWidth;
			if (styleHeight != null) TD.style.height = styleHeight;
			
			if (Space == tdIDX || Space == MAX - tdIDX - 1) TD.style.backgroundColor = bdcolor;
			else if (tdIDX > Space && Space < MAX - tdIDX - 1) TD.style.backgroundColor = bgcolor;
			
			if (Space == 0 && tdIDX == radius) TD.appendChild(obj);
			TR.appendChild(TD);
		}
		TBody.appendChild(TR);
	}
	
	Table.appendChild(TBody);
	
	// insert table and remove original table
	Parent.insertBefore(Table, objTmp);
}

function addmoney_pay(classroom_no){
		var url;
		url = "http://data.witnsam.com/program/pay/addmoney_pay_plugin.asp?classroom_no="+classroom_no;
		window.open(url,'wit_window','width=1000,height=710,toolbar=no,location=no,status=yes,menubar=no,scrollbars=no,resizable=no');
	//window.open('/mypage/window_schedule.asp?classroom_no='+classroom_no,'multi_window','width=800,height=610,toolbar=no,left=10,top=10,location=no,status=yes,menubar=no,scrollbars=yes,resizable=no');
}

function fnPopupCancle(intWidth, intHeight, strURL){
	window.open(strURL,'PopupCancle','top=10,left=5,resizable=yes,width='+intWidth+',height='+intHeight);
}
