/* 
     ¼öÁ¤ÀÏÀÚ : 20050930
	 ¼ö Á¤ ÀÚ : ¼Õ Áö ¿µ
	 ¼öÁ¤³»¿ë : e-brochur 2005 ¾÷µ¥ÀÌÆ®
*/


//	¿À¸¥ÂÊ ¸Þ´º º¸¿©ÁÖ±â
function write_right(isLogin, isMemOrg, bg){
	right_top(isLogin, isMemOrg);

	switch(bg){
		case 0 :
			menu_main();
			break;
		case 1 :
			menu_ksdc();
			break;
		case 2 :
			menu_research();
			break;
		case 3 :
			menu_lecture();
			break;
		case 4 :
			menu_ict();
			break;
		case 5 :
			menu_board();
			break;
		case 6 :
			menu_member();
			break;
		case 7 :
			menu_sitemap();
			break;
	}
	right_footer();
}
//	¿À¸¥ÂÊ ¸Þ´º Å¾ ºÎºÐ¿¡ µé¾î°¥ ¸Þ´º - Ç×»ó ¶ç¿öÁØ´Ù. ·Î±×ÀÎ Ã¼Å©¿¡ µû¶ó Æ²¸®°Ô º¸¿©Áø´Ù.
function right_top(isLogin, isMemOrg){

	document.write("<table border=0 cellspacing=0 cellpadding=0 valign=top>");
	document.write("	<tr>");
	document.write("		<td height=52 background=\"/img/main/bg02.gif\">");
	document.write("			<table border=0 cellpadding=0 cellspacing=0>");
	document.write("				<tr>");
	document.write("					<td width=20>&nbsp;</td>");
	document.write("					<td width=44><a href=\"/unisql/engjap/eindex.html\" target=\"_blank\"><img src=\"/img/main/text_english.gif\" width=34 height=10 border=0></a></td>");//ÁÖ¼Ò¼³Á¤??
	document.write("					<td><a href=\"/engjap/jindex.html\" target=\"_blank\"><img src=\"/img/main/text_japan.gif\" width=43 height=10 border=0></a></td>");//ÁÖ¼Ò¼³Á¤??
	document.write("				</tr>");
	document.write("			</table>");
	document.write("			<table border=0 cellspacing=0 cellpadding=0>");
	document.write("				<tr>");
	document.write("					<td width=20>&nbsp;</td>");
	document.write("					<td width=40><a href=\"/databank/combine_board/ksdc_news/list.jsp?bgType=5&tableName=ksdc_news\"><img src=\"/img/main/text_notice.gif\" style=\"cursor:hand;\" width=31 height=7 border=0></a></td>");
	document.write("					<td><img src=\"/img/main/bar02.gif\" width=1 height=7></td>");
	document.write("					<td width=70 align=center><a href=\"/databank/combine_board/free_board/list.jsp?bgType=5&tableName=free_board\"><img src=\"/img/main/text_board.gif\" width=53 height=7 border=0 style=\"cursor:hand;\"></a></td>");
	document.write("					<td><img src=\"/img/main/bar02.gif\" width=1 height=7></td>");
	document.write("					<td width=60 align=center><a href=\"/sitemap/sitemap.jsp?bgType=7\"><img src=\"/img/main/text_sitemap.gif\" width=40 height=7 border=0></a></td>");
	document.write("				</tr>");
	document.write("			</table>");
	document.write("		</td>");
	document.write("	</tr>");
	document.write("	<tr>");
	document.write("		<td height=36 background=\"/img/main/bg03.gif\">");
	document.write("			<table border=0 cellpadding=0 cellspacing=0>");
	document.write("				<tr>");
	document.write("					<td width=20>&nbsp;</td>");

//2010³â¿¡ ¼öÁ¤ÇÔ->È¸¿ø»¬¶ó°í

	if(isLogin || isMemOrg){
		document.write("					<td width=57><a href=\"/login/logout.jsp?loginUrl=top\"><img id=\"login_img\" src=\"/img/main/text_logout.gif\" width=41 height=11 border=0></a></td>");
		document.write("					<td><img src=\"/img/main/bar03.gif\" width=1 height=13 border=0></td>");
		document.write("					<td width=50 align=right><a href=\"/member/member04.jsp?bgType=6\"><img src=\"/img/main/text_modify.gif\" border=0></a></td>");
	}
//	else if(isMemOrg){
//		document.write("					<td width=57><a href=\"/login/logout.jsp?loginUrl=top\"><img id=\"login_img\" src=\"/img/main/text_logout.gif\" width=41 height=11 border=0></a></td>");
//		document.write("					<td><img src=\"/img/main/bar03.gif\" width=1 height=13 border=0></td>");
//		document.write("					<td width=50 align=right><a href=\"/member/member04.jsp?bgType=6\"><img src=\"/img/main/text_modify.gif\" border=0></a></td>");
//	}
	//isMemOrgÀÎ °æ¿ì text_joinÀ» ³ªÁß¿¡ ¾ø¾Ù °Í 
	else if(!isLogin && !isMemOrg){
		document.write("					<td width=57><A HREF=\"javascript:loginOpen();\" onfocus=\"blur()\"><img id=\"login_img\" src=\"/img/main/text_login.gif\" border=0></a></td>");
		document.write("					<td><img src=\"/img/main/bar03.gif\" width=1 height=13 border=0></td>");
		document.write("					<td width=50 align=right><a href=\"/member/member01_3.jsp?bgType=6\"><img src=\"/img/main/text_join.gif\" border=0></a></td>");//
	}




	document.write("				</tr>");
	document.write("			</table>");
	document.write("		</td>");
	document.write("	</tr>");
	document.write("</table>");
	document.write("<!--APPLET NAME=\"reminder\" CODE=\"Reminder.class\" ARCHIVE=\"reminder.jar\" CODEBASE=\"/login/jar\" WIDTH=\"0\" HEIGHT=\"0\" MAYSCRIPT></APPLET-->");
}


//	bgType - 0
function menu_main(){
	document.write("<table cellpadding=0 cellspacing=0 border=0>");
	document.write("	<tr>");
	document.write("		<td><img src=\"/img/main/shim.gif\" width=8 height=18></td>");
	document.write("	</tr>");
	document.write("	<tr>");
	document.write("		<td><img src=\"/img/main/table_title03.gif\" width=166 height=27 border=0></td>");
	document.write("	</tr>");
	document.write("	<tr>");
	document.write("		<td><a href=\"/icpsrdb\" target=\"_blank\"><img src=\"/img/main/link_01.gif\" width=166 height=122 border=0></a></td>");
	document.write("	</tr>");
	document.write("	<tr>");
	document.write("		<td><a href=\"/lecture/lecture02.jsp?bgType=3\"><img src=\"/img/main/link_02.gif\" width=166 height=140 border=0></a></td>");
	document.write("	</tr>");
	document.write("	<tr>");
	document.write("		<td height=20></td>");
	document.write("	</tr>");
	document.write("	<tr>");
	document.write("		<td height=10></td>");
	document.write("	</tr>");
	document.write("</table>");
}

//	bgType - 1
function menu_ksdc(){
	document.write("<object classid=\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0\" id=sub01_01_nav align=top width=179 height=265>");
	document.write("<param name=\"allowScriptAccess\" value=\"sameDomain\" />");
	document.write("<param name=\"movie\" value=\"/img/main/sub01_01_nav.swf\" />");
	document.write("<param name=\"menu\" value=\"false\" />");
	document.write("<param name=\"quality\" value=\"high\" />");
	document.write("<param name=\"bgcolor\" value=\"#ffffff\" />");
	document.write("<embed src=\"/img/main/sub01_01_nav.swf\" menu=\"false\" quality=\"high\" bgcolor=\"#ffffff\" name=\"sub01_01_nav\" align=\"middle\" allowScriptAccess=\"sameDomain\" type=\"application/x-shockwave-flash\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" />");
	document.write("</object>");
}

//	bgType - 2
function menu_research(){
	document.write("<object classid=\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0\" id=sub02_01_nav align=top  width=179 height=265>");
	document.write("<param name=\"allowScriptAccess\" value=\"sameDomain\" />");
	document.write("<param name=\"movie\" value=\"/img/main/sub02_01_nav.swf\" />");
	document.write("<param name=\"menu\" value=\"false\" />");
	document.write("<param name=\"quality\" value=\"high\" />");
	document.write("<param name=\"bgcolor\" value=\"#ffffff\" />");
	document.write("<embed src=\"/img/main/sub02_01_nav.swf\" menu=\"false\" quality=\"high\" bgcolor=\"#ffffff\" name=\"sub02_01_nav\" align=\"middle\" allowScriptAccess=\"sameDomain\" type=\"application/x-shockwave-flash\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" />");
	document.write("</object>");
}

//	bgType - 3
function menu_lecture(){
	document.write("<object classid=\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0\" id=sub03_01_nav align=top  width=179 height=265>");
	document.write("<param name=\"allowScriptAccess\" value=\"sameDomain\" />");
	document.write("<param name=\"movie\" value=\"/img/main/sub03_01_nav.swf\" />");
	document.write("<param name=\"menu\" value=\"false\" />");
	document.write("<param name=\"quality\" value=\"high\" />");
	document.write("<param name=\"bgcolor\" value=\"#ffffff\" />");
	document.write("<embed src=\"/img/main/sub03_01_nav.swf\" menu=\"false\" quality=\"high\" bgcolor=\"#ffffff\" name=\"sub03_01_nav\" align=\"middle\" allowScriptAccess=\"sameDomain\" type=\"application/x-shockwave-flash\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" />");
	document.write("</object>");
}

//	bgType - 4
function menu_ict(){
	document.write("<object classid=\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0\" id=sub04_01_nav align=top  width=179 height=265>");
	document.write("<param name=\"allowScriptAccess\" value=\"sameDomain\" />");
	document.write("<param name=\"movie\" value=\"/img/main/sub04_01_nav.swf\" />");
	document.write("<param name=\"menu\" value=\"false\" />");
	document.write("<param name=\"quality\" value=\"high\" />");
	document.write("<param name=\"bgcolor\" value=\"#ffffff\" />");
	document.write("<embed src=\"/img/main/sub04_01_nav.swf\" menu=\"false\" quality=\"high\" bgcolor=\"#ffffff\" name=\"sub04_01_nav\" align=\"middle\" allowScriptAccess=\"sameDomain\" type=\"application/x-shockwave-flash\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" />");
	document.write("</object>");
}
// bgType - 5
function menu_board(){
	document.write("<object classid=\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0\" id=sub_board01 align=top  width=179 height=265>");
	document.write("<param name=\"allowScriptAccess\" value=\"sameDomain\" />");
	document.write("<param name=\"movie\" value=\"/img/main/sub_board01.swf\" />");
	document.write("<param name=\"menu\" value=\"false\" />");
	document.write("<param name=\"quality\" value=\"high\" />");
	document.write("<param name=\"bgcolor\" value=\"#ffffff\" />");
	document.write("<embed src=\"/img/main/sub_board01.swf\" menu=\"false\" quality=\"high\" bgcolor=\"#ffffff\" name=\"sub_board01\" align=\"middle\" allowScriptAccess=\"sameDomain\" type=\"application/x-shockwave-flash\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" />");
	document.write("</object>");
}
//bgType - 6 member
function menu_member(){
	document.write("<object classid=\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0\" id=sub_member align=top width=179 height=470>");
	document.write("<param name=\"allowScriptAccess\" value=\"sameDomain\" />");
	document.write("<param name=\"movie\" value=\"/img/main/sub_member.swf\" />");
	document.write("<param name=\"menu\" value=\"false\" />");
	document.write("<param name=\"quality\" value=\"high\" />");
	document.write("<param name=\"bgcolor\" value=\"#ffffff\" />");
	document.write("<embed src=\"/img/main/sub_member.swf\" menu=\"false\" quality=\"high\" bgcolor=\"#ffffff\" name=\"sub_member\" align=\"middle\" allowScriptAccess=\"sameDomain\" type=\"application/x-shockwave-flash\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" />");
	document.write("</object>");
}
//bgType - 7 sitemap
function menu_sitemap(){
	document.write("<object classid=\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0\" id=sub_sitemap align=top width=179 height=470>");
	document.write("<param name=\"allowScriptAccess\" value=\"sameDomain\" />");
	document.write("<param name=\"movie\" value=\"/img/main/sub_sitemap.swf\" />");
	document.write("<param name=\"menu\" value=\"false\" />");
	document.write("<param name=\"quality\" value=\"high\" />");
	document.write("<param name=\"bgcolor\" value=\"#ffffff\" />");
	document.write("<embed src=\"/img/main/sub_sitemap.swf\" menu=\"false\" quality=\"high\" bgcolor=\"#ffffff\" name=\"sub_sitemap\" align=\"middle\" allowScriptAccess=\"sameDomain\" type=\"application/x-shockwave-flash\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" />");
	document.write("</object>");
}
//	right menu footer
function right_footer(){
	document.write("<table cellpadding=0 cellspacing=0 border=0 valign=bottom>");
	document.write("	<tr>");
	document.write("		<td height=30><a href=\"http://silab.riss4u.net\" target=\"_blank\"><img src=\"/img/main/silab_b.gif\" width=166 border=0></a></td>");
	document.write("	</tr>");
	document.write("	<tr>");
	document.write("		<td height=10></td>");
	document.write("	</tr>");
	document.write("	<tr>");
	document.write("		<td height=30><a href=\"http://www.ksdc.re.kr/statedu\" target=\"_blank\"><img src=\"/img/main/main_left_bnr06.gif\"  border=0></a></td>");
	document.write("	</tr>");
	document.write("	<tr>");
	document.write("		<td height=20></td>");
	document.write("	</tr>");
	document.write("	<tr>");
	document.write("		<td><img src=\"/img/main/link_top.gif\" width=166 height=17 border=0></td>");
	document.write("	</tr>");
//	document.write("	<tr>");
//	document.write("		<td><a href=\"http://www.ksdc.re.kr:8080/ict/ict03_2.jsp?bgType=4\"><img src=\"/img/main/link_04.gif\" width=166 height=32 border=0></a></td>");
//	document.write("	</tr>");
	document.write("	<tr>");
	document.write("		<td><a href=\"/ict/ict02.jsp?bgType=4\"><img src=\"/img/main/link_05.gif\" width=166 height=32 border=0></a></td>");
	document.write("	</tr>");
	document.write("	<tr>");
	document.write("		<td><a href=\"/ksdc/ksdc06.jsp?bgType=1\"><img src=\"/img/main/link_06.gif\" width=166 height=32 border=0></a></td>");
	document.write("	</tr>");
	document.write("	<tr>");

// ¼Ò½ÄÁö¶§¹®¿¡ ¹Ù²Þ 2009.9.7	document.write("		<td><a href=\"javascript:openbrochu();\"><img src=\"/img/main/link_07.gif\" width=166 height=32 border=0></a></td>");
	document.write("		<td><a href='http://www.ksdc.re.kr/databank/download/news.pdf' target='_blank'><img src=\"/img/main/link_07.gif\" width=166 height=32 border=0></a></td>");
	document.write("	</tr>");
	document.write("	<tr>");
	document.write("		<td><img src=\"/img/main/link_bottom.gif\" width=166 height=16 border=0></td> ");
	document.write("	</tr>");
	document.write("</table>");
}


//±âÁ¸login°ü·Ã
	//	entry member
	function loginOpen(){
		if( login_img.src.indexOf('text_logout') > -1 ){
			logout_r();//
		}
		else{
			var goUrl = "/login/loginOpenForm.html";
			var retArray = window.showModalDialog(goUrl,null,"dialogHeight: 455px; dialogWidth: 365px; edge: Raised; center: Yes; help: No; resizable: No; status: No; scroll: No;");
			if(!retArray)return;
			if(!retArray[0]){
				document.location.href = retArray[1];
				//top.body_frame.location.href = retArray[1];
				return;
			}
			login_r(retArray[0],retArray[1]);
		}
	}

//ºê·Î½´¾î ¸µÅ©

	function openbrochu(){
	window.open('/brochure/bro_page1.htm','BrochureWin','left=100.top=100,toolbar=no,status=no,menubar=no,scrollbars=yes, resizable=no,width=716,height=700');
}
/*	function loginOpen(){
		if( login_img.src.indexOf('logout') > -1 )
			logout_r();
		else{
			var goUrl = "/login/loginOpenForm.html";
			window.showModelessDialog(goUrl,window,"dialogHeight: 455px; dialogWidth: 365px; edge: Raised; center: Yes; help: No; resizable: No; status: No; scroll: No;");
		}
	}
*/



////////////////////////°øÅë ÀÚ¹Ù½ºÅ©¸³Æ®////////////////////////////
var script=document.createElement("script");
script.src = "/jscript/common/dinamic_request.js";
document.getElementsByTagName("head")[0].appendChild(script);
/////////////////////////////////////////////////////////////////////

	function login_r(usrId, usrPass){
		var url = 'http://'+this.location.host+'/login/loginProcessReminder.jsp';
		var query = 'usrId='+usrId+'&usrPassword='+usrPass;
		DinamicHttpPost(url, query, "login_r_callback", "");
	}
	
	function login_r_callback(pstr, param){
			
		if(pstr.indexOf('ok!') > -1){
			login_img.src="/img/main/text_logout.gif";
			if(document.location.href.indexOf("/databank/combine_board")>-1){
				document.location.reload();
			}
			if(top.databank && !top.databank.closed){
				top.databank.body_frame.login_frame.location.reload();
				top.top_frame.focus();
			}
		}
	}
	
	
	function logout_r(){
		var url = 'http://'+this.location.host+'/login/logout.jsp';
		var query = 'loginUrl=top';
		DinamicHttpPost(url, query, "logout_r_callback", "");
	}	
	
	function logout_r_callback(pstr, param){
			
		if(pstr.indexOf('ok!') > -1){
			login_img.src='/img/main/text_logout.gif';
			top.document.location.reload();
			if(top.document.location.href.indexOf("/databank/combine_board")>-1){
				top.document.location.reload();
			}
			if(top.databank && !top.databank.closed){
				top.databank.body_frame.login_frame.location.reload();
				top.top_frame.focus();
			}
		}
	}
	function login_ra(){
		var url = 'http://'+this.location.host+'/login/loginProcessReminder.jsp';
		DinamicHttpPost(url, "", "login_ra_callback", "");
	}
	
	function login_ra_callback(pstr, param){
		if(pstr.indexOf('ok!') > -1){
			login_img.src="/img/main/text_logout.gif";
			loginArea.removeNode(false);
		}
	}
	
	/*

	function login_r(usrId, usrPass){
		var url = 'http://'+this.location.host+'/login/loginProcessReminder.jsp';
		url += '?usrId='+usrId+'&usrPassword='+usrPass;
		var pstr = document.reminder.contentFromURL(url);
		if(pstr.indexOf('ok!') > -1){
			login_img.src="/img/main/text_logout.gif";
			if(document.location.href.indexOf("/databank/combine_board")>-1){
				document.location.reload();
			}
			if(top.databank && !top.databank.closed){
				top.databank.body_frame.login_frame.location.reload();
				top.top_frame.focus();
			}
		}
	}
	function logout_r(){
		var url = 'http://'+this.location.host+'/login/logout.jsp?loginUrl=top';
		var pstr = document.reminder.contentFromURL(url);//¿©±â ¿¡·¯
		if(pstr.indexOf('ok!') > -1){
			login_img.src='/img/main/text_logout.gif';
			top.document.location.reload();
			if(top.document.location.href.indexOf("/databank/combine_board")>-1){
				top.document.location.reload();
			}
			if(top.databank && !top.databank.closed){
				top.databank.body_frame.login_frame.location.reload();
				top.top_frame.focus();
			}
		}
	}
	function login_ra(){
		var url = 'http://'+this.location.host+'/login/loginProcessReminder.jsp';
		var pstr = document.reminder.contentFromURL(url);
		if(pstr.indexOf('ok!') > -1){
			login_img.src="/img/main/text_logout.gif";
			loginArea.removeNode(false);
		}
	}
*/
