/*
	ÇÁ·Î±×·¥ Àü¿ë: TAB ¸Þ´º
	0 : ÇÁ·Î±×·¥¼Ò°³
	1 : °øÁö»çÇ×
	2 : ¹æ¼Û´Ù½Ãº¸±â
	3 : ½ÃÃ»ÀÚÂü¿©
*/

function Click_Title(idx)
{
	try{				
		var form = document.PageForm ;
		
		form.action = "search.asp?CodeNum="+idx ; 			
		form.submit();
		
	}catch(e){}	
	
}
function Click_TAB(idx)
{	
	var form = document.PageForm ;
	switch(idx)
	{
		case 0 : 
			{  location.href = "vod.asp?CodeNum="+form.CodeNum.value+"#LIST"; break; }
		case 1 : 
			{  location.href = "notice.asp?CodeNum="+form.CodeNum.value+"#LIST"; break; }
		case 2 : 
			{  location.href = "board.asp?CodeNum="+form.CodeNum.value+"#LIST"; break;  }
		
		default : 
			{  location.href = "vod.asp?CodeNum"+form.CodeNum.value; break; }
	}
	
}

/*
	°Ô½ÃÆÇ º»¹®(TEXT) º¸ÀÓ
*/
function Href_BoardText( boardnum )
{	
	/*¸ñ·Ï¿¡¼­¿¡¼­ Å¬¸¯½Ã*/
	//try{				
		var page = 1;		
		var form = document.PageForm ;
		try{
		
		page = form.NowPage.value ;
		if ( boardnum == "-1" ) {
			boardnum = "-1" ;
			if ( form.Chk.length > 1 )
			{
				for(var i=0; i < form.Chk.length; i++)
				{
					if (form.Chk[i].checked)
						boardnum += ","+ form.Chk[i].value ;					
				}
			}
		}
		document.PageForm.CheckedSTR.value = boardnum ;
		}catch(e){}
		
		document.PageForm.action = "board.asp?CodeNum="+form.CodeNum.value+"&BoardNum="+boardnum+"&page="+page; 				
		document.PageForm.submit();
		
	//}catch(e){}

}

/*
	°øÁö»çÇ× º»¹®(TEXT) º¸ÀÓ
*/
function Href_NoticeText( noticenum )
{	
	/*¸ñ·Ï¿¡¼­¿¡¼­ Å¬¸¯½Ã*/
	//try{				
		var page = 1 ;
		var tab = 1 ; //°øÁö»çÇ×
		
		try{
			page = document.PageForm.NowPage.value;
			if ( noticenum == "-1" ) {
				noticenum = "-1" ;
				if ( document.PageForm.Chk.length > 1 )
				{
					for(var i=0; i < document.PageForm.Chk.length; i++)
					{
						if (document.PageForm.Chk[i].checked)
							noticenum += ","+ document.PageForm.Chk[i].value ;					
					}
				}
			}			
		}catch(e){}
		
		document.PageForm.action = "notice.asp?NoticeNumSTR="+noticenum+"&TAB="+tab+"&page="+page; 	
		document.PageForm.submit();
		
	//}catch(e){}

}


/*
	ÇÁ·Î±×·¥ ¼­ºêÅ¸ÀÌÆ² º¸ÀÓ
*/
function Show_Details()
{	
	var tmp = 'block';
	
	try { 
		
		if (!(div_subtitle)) return; 
	}catch(e){ 
		return;//0°ÇÀÎ °æ¿ì
	}	
	
	if (div_subtitle.length > 1)
	{
		tmp = (div_subtitle[0].style.display =='block') ? 'none' : 'block' ;
		
		for (var i=0; i< div_subtitle.length; i++)
		{
			div_subtitle[i].style.display = tmp ;
		}
	}
	else
	{
		tmp = (div_subtitle.style.display =='block') ? 'none' : 'block' ;
		div_subtitle.style.display = tmp ;
	}
	
}
function Show_Detail(idx)
{
	var tmp = 'block';
	
	if (div_subtitle.length > 1)
	{
		tmp = (div_subtitle[idx].style.display =='block') ? 'none' : 'block' ;
			div_subtitle[idx].style.display = tmp ;	
	}
	else
	{
		tmp = (div_subtitle.style.display =='block') ? 'none' : 'block' ;
		div_subtitle.style.display = tmp ;
	}
}
/*
	¸ñ·Ï¿¡¼­ °Ë»ö ¹öÆ° Å¬¸¯ ÀÌº¥Æ®
*/


function Click_Search()
{
	
	var form = document.PageForm ;			
	
	var SearchInput = form.SearchInput.value ;
	var SearchOption = form.SearchOption[form.SearchOption.selectedIndex].value;
	//var SDate = form.sdate.value ;
	//var EDate = form.edate.value
	var PARAM = "&SearchOption="+SearchOption+"&SearchInput="+SearchInput; //+"&SDate="+SDate +"&EDate="+EDate ;

	try{		
	}catch(e){}
	
	if (form.CodeNum)
	form.action = "vod_en.asp?CodeNum="+form.CodeNum.value+ PARAM; 	
	else
	form.action = "vod_en.asp?CodeNum=1001"+ PARAM; 	
	form.submit();

}


function Click_Search_Culture(mPtn)
{
	alert("1111");
	var form = document.PageForm ;			
	
	if (mPtn==1) {
		var SearchInput = form.SearchInput.value ;
		var SearchOption = form.SearchOption[form.SearchOption.selectedIndex].value;
	} else {
		var SearchInput = form.SearchInput2.value ;
		var SearchOption = form.SearchOption2[form.SearchOption2.selectedIndex].value;
	}
	
	//var SDate = form.sdate.value ;
	//var EDate = form.edate.value
	var PARAM = "&SearchOption="+SearchOption+"&SearchInput="+SearchInput; //+"&SDate="+SDate +"&EDate="+EDate ;

	try{		
	}catch(e){}
	
	if (form.CodeNum)
		form.action = "vod.asp?CodeNum="+form.CodeNum.value+ PARAM; 	
	else
		form.action = "vod.asp?CodeNum=1001"+ PARAM; 	
	
	form.submit();

}



/* Æ®¸® °ü·Ã */
function SetDisplayParent (idx)
{ 	
	document.PageForm.PCodeNum.value = idx; 		
}

function Href_SM(idx,MenuID)
{ 
	/*ºÎ¸ð ¸Þ´º¿¡¼­ Å¬¸¯½Ã*/
	
	if (idx =="1005") {location = "Album.asp"; return;}
	
	try{				
		if (idx == "1006") //°øÁö»çÇ×
		{ location.href = "notice.asp?CodeNum="+idx; }	
		else		
		{ location.href = "vod.asp?CodeNum="+idx; }			
		
	}catch(e){}
}

function Href_SMSub(idx, Menu)
{
	
	/*¼­ºê ¸Þ´º¿¡¼­ Å¬¸¯½Ã*/
	try{				
		location.href = "vod.asp?CodeNum="+idx; 			
		
	}catch(e){}
}
	
var tmpToggle = 0;
function ShowToggle()
{
	if (tmpToggle == 1 ) { Default_SMSub(0); tmpToggle = 0; }
	else { Default_SMSub(1); tmpToggle= 1;}
}
	
	
/* °øÅë : Æ®¸® °ü·Ã */

function Click_SM(idx)
{	
	
	try {
		if (DEFAULT_TYPE ==0)
		{
			for (var i=0; i< SMSub.length; i++)
			{
					SMSub[i].style.display = 'none';					
			}
			SMSub[idx].style.display = 'block';			
		}
	}catch(e){}
	
	Click_Img(idx) ;

}
function Click_Img(idx) 
{	
	try{
		var Common_Img_Path = '../Common/img/';
		for (var i=0; i< SM.length; i++)
		{			
			
				document.SMImg[i].src = Common_Img_Path + 'icon_leftmenu_close.gif';
				
		}
	
		document.SMImg[idx].src = Common_Img_Path + 'icon_leftmenu_open.gif';
		
	}catch(e){}	
	
}

function Default_SMSub(display_type)
{
	try {
		if (SMSub.length >= 2)
		{	
			if ( display_type == 0)
			{
				for (var i=0; i< SMSub.length; i++)
				{
					SMSub[i].style.display = 'none';
				}
				SMSub[0].style.display = 'block';
					
			}		
			else if ( display_type == 1)
			{
				
				for (var i=0; i< SMSub.length; i++)
				{
					SMSub[i].style.display = 'block';
				}
				SMSub[3].style.display = 'none';	//º¯È­»ê È­¿äÂù¾ç ¿¹¹èÅ×µÎ¸®
			}	
		}	
		else
		{
			SMSub.style.display = 'block';
		}
	}catch(e){}
	
}
/* °Ô½ÃÆÇ ±Û ¹Ì¸®º¸±â */

function Show_Msg(title, content, writer) 
{
	var wx, wy, idw, clw, scl, max_x, left;
	wx = window.event.clientX; 
	wy = window.event.clientY;

	idw = showmsg.style.pixelWidth;
	clw = document.body.clientWidth;
	scl = document.body.scrollLeft;

	max_x =  scl + clw - idw - 22;
	left = scl + wx - idw/3;
	
	if(left > max_x)
		left = max_x;
	if(left < scl)
		left = scl+2;

	showmsg.style.pixelLeft = left;
	showmsg.style.pixelTop = document.body.scrollTop + wy + 10;

	sp_title.innerHTML = title;
	sp_content.innerHTML = content;
	sp_writer.innerHTML = writer;
	
	showmsg.style.visibility = "visible";
}

function Hide_Msg()
{
	showmsg.style.visibility = "hidden";
}



function na_restore_img_src(name, nsdoc)
{
  var img = eval((navigator.appName.indexOf('Netscape', 0) != -1) ? nsdoc+'.'+name : 'document.all.'+name);
  if (name == '')
    return;
  if (img && img.altsrc) {
    img.src    = img.altsrc;
    img.altsrc = null;
  } 
}

function na_preload_img()
{ 
  var img_list = na_preload_img.arguments;
  if (document.preloadlist == null) 
    document.preloadlist = new Array();
  var top = document.preloadlist.length;
  for (var i=0; i < img_list.length; i++) {
    document.preloadlist[top+i]     = new Image;
    document.preloadlist[top+i].src = img_list[i+1];
  } 
}

function na_change_img_src(name, nsdoc, rpath, preload)
{ 
  var img = eval((navigator.appName.indexOf('Netscape', 0) != -1) ? nsdoc+'.'+name : 'document.all.'+name);
  if (name == '')
    return;
  if (img) {
    img.altsrc = img.src;
    img.src    = rpath;
  } 
}

