function gourl(imsi_url){
	self.location=imsi_url;
}
function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}

function setCookie(	name,	value, expiredays	)
{
	var	todayDate	=	new	Date();
	todayDate.setDate( todayDate.getDate() + expiredays	);
	document.cookie	=	name + "=" + escape( value ) + ";	path=/;	expires="	+	todayDate.toGMTString()	+	";"
}
function getCookie( name )
{
var nameOfCookie = name + "=";
var x = 0;
while ( x <= document.cookie.length )
{
	var y = (x+nameOfCookie.length);
	if ( document.cookie.substring( x, y ) == nameOfCookie ) {
		if ( (endOfCookie=document.cookie.indexOf( ";", y )) == -1 )
			endOfCookie = document.cookie.length;
		return unescape( document.cookie.substring( y, endOfCookie ) );
	}
	x = document.cookie.indexOf( " ", x ) + 1;
	if ( x == 0 )
		break;
}
return "";
}

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 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 offline_order(classroom_no){
		var url;
		url = "http://data.witnsam.com/program/CLUE/wit_class/page_pt_2.asp?company=yonsei&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 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 mt_process(cid,id,class_no,classroom_no){
	var turl = "http://data.witnsam.com/program/multi/index.asp?company=yonsei&seq="+class_no+"&classroom_no="+classroom_no+"&cid="+cid+"&id="+id;
	window.open(turl,'multi_window','width=1000,height=710,toolbar=no,left=10,top=10,location=no,status=yes,menubar=no,scrollbars=no,resizable=no');
}
function wt_process(cid,id,wt_num){
		var url;
		url = "http://data.witnsam.com/program/CLUE/wit_class/index.asp?company=yonsei&classroom_no="+wt_num+"&cid="+cid+"&id="+id;
		window.open(url,'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_class/index.asp?company=yonsei&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 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 CheckStr(strOriginal, strFind, strChange){
    var position, strOri_Length;
    position = strOriginal.indexOf(strFind);  
    
    while (position != -1){
      strOriginal = strOriginal.replace(strFind, strChange);
      position    = strOriginal.indexOf(strFind);
    }
  
    strOri_Length = strOriginal.length;
    return strOri_Length;
}


//ÇÃ·¡½Ã ¸Þ´º¹Ù ¸µÅ©
function menuWelcome()
{
	location.href = "/welcome/";
}

function menuWelcome_sub1()
{
	location.href = "/welcome/";
}

function menuWelcome_sub2()
{
	location.href = "/welcome/Vision.asp";
}

function menuWelcome_sub3()
{
	location.href = "/welcome/Introduction.asp";
}

function menuWelcome_sub4()
{
	location.href = "/welcome/Environment.asp";
}

function menuWelcome_sub5()
{
	location.href = "/welcome/Contactus.asp";
}

function menuCorrect()
{
	location.href = "/Correct/";
}

function menuCorrect_sub1()
{
	location.href = "/Correct/";
}

function menuCorrect_sub2()
{
	location.href = "/correct/UseInfo.asp";
}

function menuCorrect_sub3()
{
	location.href = "/correct/CorrectReg.asp";
}

function menuCorrect_sub4()
{
	location.href = "/correct/CorrectFolder.asp";
}

function menuTran()
{
	location.href = "/Tran/";
}

function menuTran_sub1()
{
	location.href = "/Tran/";
}

function menuTran_sub2()
{
	location.href = "/Tran/UseInfo.asp";
}

function menuTran_sub3()
{
	location.href = "/Tran/TranReg.asp";
}

function menuTran_sub4()
{
	location.href = "/tran/TranFolder.asp";
}

function menuStudy()
{
	location.href = "/wit/WitDes.asp";
}

function menuStudy_sub1()
{
	location.href = "/wit/WitDes.asp";
}

function menuStudy_sub2()
{
	location.href = "/wit/";
}

function menuStudy_sub3()
{
	location.href = "/wit/WitFeature.asp";
}

function menuStudy_sub4()
{
	location.href = "/wit/WitProcess.asp";
}

function menuStudy_sub5()
{
	location.href = "/wit/WitValuation.asp";
}

function menuTest()
{
	location.href = "/wtest/";
}

function menuTest_sub1()
{
	location.href = "/wtest/";
}

function menuTest_sub2()
{
	location.href = "/wtest/Regular.asp";
}

function menuTest_sub3()
{
	location.href = "/wtest/Junior.asp";
}

function menuTest_sub4()
{
	location.href = "/wtest/TestMethod.asp";
}

function menuTest_sub5()
{
	location.href = "/wtest/RegInfo.asp";
}


function centerFlash1()
{
	menuCorrect();
}

function centerFlash2()
{
	menuTran();
}

function centerFlash3()
{
	menuStudy_sub2();
}

function centerFlash4()
{
	menuTest();
}

function flashBanner1()
{
	//window.open('/workshop/closing_notice_popup.html','workshop','width=382,height=286,toolbar=no,directories=no,status=no,scrollbars=NO,menubar=no,resizable=no,left=5,top=10"');
	window.open('/workshop/20100510/popup.html','workshop','width=670,height=700,toolbar=no,directories=no,status=no,scrollbars=yes,menubar=no,resizable=no,left=5,top=10"');

}

function flashBanner2()
{
	location.href="/quick/Default3.asp";
}

function flashBanner3()
{
	location.href="/quick/";	
	//location.href="/quick/Default2.asp";
}

function numberFormat(nStr)
{  
	nStr += '';  
	x = nStr.split('.');  
	x1 = x[0];  x2 = x.length > 1 ? '.' + x[1] : '';  
	var rgx = /(\d+)(\d{3})/;  
	while (rgx.test(x1))    
		x1 = x1.replace(rgx, '$1' + ',' + '$2');  
	return x1 + x2;
}