function changeIt(ImageToChange, ImageToShow) {
    if (document.images) { document[ImageToChange].src = ImageToShow; }
}
function bar(message) {
    if (document.images) { window.status = message; return true }
}

function openNewWindow(window) {
	open(window,"NewWindow","left=0, top=0, toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=no, width=729, height=580");
}

//=============================
// ¾ÆÀÌÇÁ·¹ÀÓ ÀÚµ¿¼Ò½º
//=============================
function doResize(){
	if(eval(myframe.document.body.scrollHeight)==false){
		document.getElementById("container").style.height = 140;
	}else{
		document.getElementById("container").style.height=myframe.document.body.scrollHeight;
	}
}


//=============================
// ¸®½ºÆ® Å¬¸¯½Ã ÆîÄ§ ¸Þ´º
//=============================
var Menu_Old='';
function menu(name, img_title){
	var tmp_img;
	var old_img_title;
	if(Menu_Old != name){
		if(Menu_Old != ''){
			old_img_title = document.getElementById("img_title_q_"+Menu_Old).src
			document.getElementById("submenu_"+Menu_Old).style.display = "none";
			document.getElementById("img_title_q_"+Menu_Old).src = old_img_title.replace("_ov.gif", ".gif");
			document.getElementById("img_arrow_"+Menu_Old).src = "/img/common/icn_arrow.gif";

			tmp_img = document.getElementById("img_audio_"+Menu_Old);
			if (tmp_img){
				document.getElementById("img_audio_"+Menu_Old).src = "/img/common/icn_audio.gif";
			}
			stopItVer7();
		}
		document.getElementById("submenu_"+name).style.display = "block";
		document.getElementById("img_title_q_"+name).src = img_title+"_ov.gif";
		document.getElementById("img_arrow_"+name).src = "img/icn_arrow_ov.gif";
		//document.getElementById("img_audio_"+name).src = "/img/common/icn_audio_on.gif";
		Menu_Old = name;
	}else{
		document.getElementById("submenu_"+name).style.display = "none";
		document.getElementById("img_title_q_"+name).src = img_title+".gif";
		document.getElementById("img_arrow_"+name).src = "/img/common/icn_arrow.gif";

		tmp_img = document.getElementById("img_audio_"+name);
		if (tmp_img){
			document.getElementById("img_audio_"+name).src = "/img/common/icn_audio.gif";
		}
		Menu_Old = '';
		stopItVer7();
	}
}


//=============================
// ¸®½ºÆ® Å¬¸¯½Ã ÆîÄ§ ¸Þ´º2
//=============================
var menu_old = '';
var menu_old_td = '';
function fjChoiceOpenMenu(name){
	var submenu=eval("submenu_"+name+".style");
	var subtdmenu=eval("document.all.td_choice_"+name);
	if(menu_old != submenu){
		if(menu_old != ''){
			menu_old.display='none';
			menu_old_td.className='';
		}
		submenu.display='block';
		subtdmenu.className = 'library';		
		menu_old = submenu;
		menu_old_td = subtdmenu;
	}else{
		submenu.display='none';
		subtdmenu.className = '';
		menu_old='';
	}
}

//=============================
// More ¹öÆ° ´­·¶À»¶§
//=============================
function ShowMenu4() {
	if(document.getElementById("hide41").style.display == "none") {
		document.getElementById("hide41").style.display = "";
		document.getElementById("img_hide4").src = "/img/common/btn_close.gif";
	} else {
		document.getElementById("hide41").style.display = "none";
		document.getElementById("img_hide4").src = "/img/common/btn_more.gif";
	}
}

//=============================
// °æÇè´ã°ú Áø·á³ëÆ® ÀÌµ¿½Ã
//=============================
var old='';
function cmlist_view(num){		
	submenu=eval("cmlist"+num+".style");
	if(old!='') old.display='none';
	else cmlist1.style.display='none';
	submenu.display='block';
	old=submenu;
}
function cmlist_hidden(){
	if(old!='') old.display='none';
}

//=============================
// °æÇè´ã°ú Áø·á³ëÆ® º¸±â ½ºÅ©¸³
//=============================
function explist(cate_code, exper_idx){
	emailwindow=dhtmlmodal.open('EmailBox', 'iframe', '/exp_note/popup_exp_list.asp?cate_code='+cate_code+'&exper_idx='+exper_idx, '±â»Ýº´¿ø', 'width=775px,height=639px,center=0,resize=0,scrolling=1')
}

function expwrite(cate_code){
	emailwindow=dhtmlmodal.open('EmailBox', 'iframe', '/exp_note/popup_exp_write.asp?cate_code='+cate_code, '±â»Ýº´¿ø', 'width=775px,height=639px,center=0,resize=0,scrolling=1')
}

function note(cate_code, note_idx){
	emailwindow=dhtmlmodal.open('EmailBox', 'iframe', '/exp_note/popup_note.asp?cate_code='+cate_code+'&note_idx='+note_idx, '±â»Ýº´¿ø', 'width=775px,height=639px,center=0,resize=0,scrolling=1')
}

function notice1(){
	emailwindow=dhtmlmodal.open('EmailBox', 'iframe', '/notice/notice_01.asp', '±â»Ýº´¿ø', 'width=775px,height=639px,center=0,resize=0,scrolling=1')
}

function notice2(){
	emailwindow=dhtmlmodal.open('EmailBox', 'iframe', '/notice/notice_02.asp', '±â»Ýº´¿ø', 'width=775px,height=639px,center=0,resize=0,scrolling=1')
}

function notice3(news_idx){
	emailwindow=dhtmlmodal.open('EmailBox', 'iframe', '/notice/notice_03.asp?news_idx='+news_idx, '±â»Ýº´¿ø', 'width=775px,height=639px,center=0,resize=0,scrolling=1')
}

function joytoon(){
	emailwindow=dhtmlmodal.open('EmailBox', 'iframe', '/joytoon/joy_chijil.asp?idx_toon=1', '±â»Ýº´¿ø', 'width=775px,height=639px,center=0,resize=0,scrolling=1')
}
function library(){
	emailwindow=dhtmlmodal.open('EmailBox', 'iframe', '/library/library.asp?cate_code=1', '¶óÀÌºê·¯¸®', 'width=775px,height=639px,center=0,resize=0,scrolling=1')
}


//=============================
// À½¼ºÆÄÀÏ ½ÇÇà ½ºÅ©¸³Æ®
//=============================
// ¹Ìµð¾î ÇÃ·¹ÀÌ¾î 7ÀÌ»óÀÇ ¿ÀºêÁ§Æ® »ç¿ë½Ã ÀÌ°ÍÀ» »ç¿ëÇÑ´Ù.
var state = 'stop';
var position = 0;
// Àç»ý
function fjClickSound(name, img_title, sound_file){		
	var tmp_img;
	if (document.all.img_audio_all){
		if (sound_all == true){
			sound_all = false;
			document.getElementById("img_audio_all").src = "/img/common/icn_audio_all.gif";
			stopItVer7();
		}		
	}
	
	if(Menu_Old != name){
		if(Menu_Old != ''){
			old_img_title = document.getElementById("img_title_q_"+Menu_Old).src
			document.getElementById("submenu_"+Menu_Old).style.display = "none";
			document.getElementById("img_title_q_"+Menu_Old).src = old_img_title.replace("_ov.gif", ".gif");
			document.getElementById("img_arrow_"+Menu_Old).src = "/img/common/icn_arrow.gif";

			tmp_img = document.getElementById("img_audio_"+Menu_Old);
			if (tmp_img){
				document.getElementById("img_audio_"+Menu_Old).src = "/img/common/icn_audio.gif";
			}
			//sound_all = false;
			stopItVer7();
		}
		document.getElementById("submenu_"+name).style.display = "block";
		document.getElementById("img_title_q_"+name).src = img_title+"_ov.gif";
		document.getElementById("img_arrow_"+name).src = "img/icn_arrow_ov.gif";
		document.getElementById("img_audio_"+name).src = "/img/common/icn_audio_on.gif";
		//sound_all = false;
		playItVer7(sound_file);
		Menu_Old = name;		
	}else{
		if (state=='stop'){
			document.getElementById("submenu_"+name).style.display = "block";
			document.getElementById("img_title_q_"+name).src = img_title+"_ov.gif";
			document.getElementById("img_arrow_"+name).src = "img/icn_arrow_ov.gif";
			document.getElementById("img_audio_"+name).src = "/img/common/icn_audio_on.gif";
			//sound_all = true;
			playItVer7(sound_file);
			Menu_Old = name;
		}else{
			//document.getElementById("submenu_"+name).style.display = "none";
			//document.getElementById("img_title_q_"+name).src = img_title+".gif";
			//document.getElementById("img_arrow_"+name).src = "/img/common/icn_arrow.gif";
			tmp_img = document.getElementById("img_audio_"+name);
			if (tmp_img){
				document.getElementById("img_audio_"+name).src = "/img/common/icn_audio.gif";
			}			
			//sound_all = false;
			stopItVer7();
			//Menu_Old = '';
		}
	}
}

function fjClickAllSound(img_audio, sound_file){
	if (state=='stop'){
		document.getElementById(img_audio).src = "/img/common/icn_audio_on.gif";
		playItVer7(sound_file);
	}else{
		document.getElementById(img_audio).src = "/img/common/icn_audio.gif";
		sound_all = false;
		stopItVer7();			
	}		
}

var sound_all = false;
function fjClickAllSound2(img_audio, sound_file){
	//alert(state);
	if (state=='stop'){
		document.getElementById(img_audio).src = "/img/common/icn_audio_all_on.gif";
		sound_all = true;
		playItVer7(sound_file);		
	}else{
		document.getElementById(img_audio).src = "/img/common/icn_audio_all.gif";
		sound_all = false;
		stopItVer7();
		
	}		
}

function playItVer7(file_path){
	document.SPlay.URL = file_path;
	if (state=='pause'){
		document.SPlay.controls.currentPosition = position;
	}else{
		document.SPlay.controls.currentPosition = 0;
	}
	document.SPlay.controls.play();
	state = 'play';
}

//ÀÏ½ÃÁ¤Áö
function pauseItVer7(){
	position = document.SPlay.Controls.currentPosition;
	document.SPlay.controls.pause(); 
	state   =   'pause'
}

//¸ØÃã
function stopItVer7(){
	if (sound_all==false){
		document.SPlay.controls.stop();
		state   =   'stop';
	}	
}

var bDetect = ( (navigator.userAgent.indexOf("MSIE") >= 0) &&
(navigator.appVersion.substring(0,1) >= 4) )
if(bDetect){document.write("<STYLE>.off{display:none}</STYLE>")}
function showSol(proNum){
     if (bDetect){
          if (proNum.className=="off"){
               proNum.className="on";
          }
          else{proNum.className="off"}
     }
}

function ShowDiv(target){	
	document.getElementById(target).style.display = "";	
}

function HiddenDiv(target){	
	document.getElementById(target).style.display = "none";			
}

function trim(value){
	return value.replace(/^\s+|\s+$/g, "");
}


function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

function fjBodySecurity(){
	return false;
}
//document.oncontextmenu=fjBodySecurity;
document.ondragstart=fjBodySecurity;
document.onselectstart=fjBodySecurity;




//=============================
// ¾Ö´Ï¸ÞÀÌ¼Ç ÁúÈ¯º° º¸±â ¸Þ´º
//=============================

var selectCk=0;
function searchDetailView(){
	if(selectCk==0){
		document.getElementById('detailSearch').style.display="block";
		selectCk=1;		
		document.getElementById('searchDetailImg').src = document.getElementById('searchDetailImg').src.replace("_open.gif", "_close.gif");
	}else {
		document.getElementById('detailSearch').style.display="none";
		selectCk=0;
		document.getElementById('searchDetailImg').src = document.getElementById('searchDetailImg').src.replace("_close.gif", "_open.gif");
	}
}
