function CheckSearch() {	
	var theForm = document.getElementById("frm_board_search");
	var vSearchValue = theForm.search_value.value.replace(" ", "¦£");

	if (Len(theForm.search_value.value) == 0) {
		alert('°Ë»ö¾î¸¦ ÀÔ·ÂÇÏ¿© ÁÖ½Ê½Ã¿ä.');
		theForm.search_value.focus();
		return false;
	}

	if (document.getElementById("search_key").value == 'content') {
	
		if (
			vSearchValue=='about' ||
			vSearchValue=='1' ||
			vSearchValue=='after' ||
			vSearchValue=='2' ||
			vSearchValue=='all' ||
			vSearchValue=='also' ||
			vSearchValue=='3' ||
			vSearchValue=='an' ||
			vSearchValue=='4' ||
			vSearchValue=='and' ||
			vSearchValue=='5' ||
			vSearchValue=='another' ||
			vSearchValue=='6' ||
			vSearchValue=='any' ||
			vSearchValue=='7' ||
			vSearchValue=='are' ||
			vSearchValue=='8' ||
			vSearchValue=='as' ||
			vSearchValue=='9' ||
			vSearchValue=='at' ||
			vSearchValue=='0' ||
			vSearchValue=='be' ||
			vSearchValue=='$' ||
			vSearchValue=='because' ||
			vSearchValue=='been' ||
			vSearchValue=='before' ||
			vSearchValue=='being' ||
			vSearchValue=='between' ||
			vSearchValue=='both' ||
			vSearchValue=='but' ||
			vSearchValue=='by'||
			vSearchValue=='came' ||
			vSearchValue=='can' ||
			vSearchValue=='come' ||
			vSearchValue=='could' ||
			vSearchValue=='did' ||
			vSearchValue=='do' ||
			vSearchValue=='each' ||
			vSearchValue=='for' ||
			vSearchValue=='from' ||
			vSearchValue=='get' ||
			vSearchValue=='got' ||
			vSearchValue=='has' ||
			vSearchValue=='had' ||
			vSearchValue=='he' ||
			vSearchValue=='have' ||
			vSearchValue=='her' ||
			vSearchValue=='here' ||
			vSearchValue=='him' ||
			vSearchValue=='himself' ||
			vSearchValue=='his' ||
			vSearchValue=='how' ||
			vSearchValue=='if' ||
			vSearchValue=='in' ||
			vSearchValue=='into' ||
			vSearchValue=='is' ||
			vSearchValue=='it' ||
			vSearchValue=='like' ||
			vSearchValue=='make' ||
			vSearchValue=='many' ||
			vSearchValue=='me' ||
			vSearchValue=='might' ||
			vSearchValue=='more' ||
			vSearchValue=='most' ||
			vSearchValue=='much' ||
			vSearchValue=='must' ||
			vSearchValue=='my' ||
			vSearchValue=='never' ||
			vSearchValue=='now' ||
			vSearchValue=='of' ||
			vSearchValue=='on' ||
			vSearchValue=='only' ||
			vSearchValue=='or' ||
			vSearchValue=='other' ||
			vSearchValue=='our' ||
			vSearchValue=='out' ||
			vSearchValue=='over' ||
			vSearchValue=='said' ||
			vSearchValue=='same' ||
			vSearchValue=='see' ||
			vSearchValue=='should' ||
			vSearchValue=='since' ||
			vSearchValue=='some' ||
			vSearchValue=='still' ||
			vSearchValue=='such' ||
			vSearchValue=='take' ||
			vSearchValue=='than' ||
			vSearchValue=='that' ||
			vSearchValue=='the' ||
			vSearchValue=='their' ||
			vSearchValue=='them' ||
			vSearchValue=='then' ||
			vSearchValue=='there' ||
			vSearchValue=='these' ||
			vSearchValue=='they' ||
			vSearchValue=='this' ||
			vSearchValue=='those' ||
			vSearchValue=='through' ||
			vSearchValue=='to' ||
			vSearchValue=='too' ||
			vSearchValue=='under' ||
			vSearchValue=='up' ||
			vSearchValue=='very' ||
			vSearchValue=='was' ||
			vSearchValue=='way' ||
			vSearchValue=='we' ||
			vSearchValue=='well' ||
			vSearchValue=='were' ||
			vSearchValue=='what' ||
			vSearchValue=='where' ||
			vSearchValue=='which' ||
			vSearchValue=='while' ||
			vSearchValue=='who' ||
			vSearchValue=='with' ||
			vSearchValue=='would' ||
			vSearchValue=='you' ||
			vSearchValue=='your' ||
			vSearchValue=='a' ||
			vSearchValue=='b' || 
			vSearchValue=='c' || 
			vSearchValue=='d' || 
			vSearchValue=='e' || 
			vSearchValue=='f' || 
			vSearchValue=='g' || 
			vSearchValue=='h' || 
			vSearchValue=='i' || 
			vSearchValue=='j' || 
			vSearchValue=='k' || 
			vSearchValue=='l' || 
			vSearchValue=='m' || 
			vSearchValue=='n' || 
			vSearchValue=='o' || 
			vSearchValue=='p' || 
			vSearchValue=='q' || 
			vSearchValue=='r' || 
			vSearchValue=='s' || 
			vSearchValue=='t' || 
			vSearchValue=='u' || 
			vSearchValue=='v' || 
			vSearchValue=='w' || 
			vSearchValue=='x' || 
			vSearchValue=='y' || 
			vSearchValue=='z'
		) {
			alert('°Ë»öÀÌ ºÒ°¡ÇÑ Å°¿öµå ¶Ç´Â Full-Text °Ë»öÀÌ ºÒ°¡ÇÑ Noise Å°¿öµå ÀÔ´Ï´Ù.\n\n´Ù¸¥ ¹®ÀÚ¿­·Î °Ë»öÀ» ¼öÇàÇØ ÁÖ½Ã±æ ºÎÅ¹ µå¸³´Ï´Ù.');
			theForm.search_value.focus();
			return false;
		}
	}
	
	return true;
}

var blnUploading = false;
var blnDeleting = false;

function AttachFile() {
	var strFilePath = 'ÆÄÀÏ Ã·ºÎ Áß...';
	var intFileCnt = document.getElementById("file_list").length;

	if (Len(document.getElementById("file_path").value) == 0) {
		alert('Ã·ºÎÇÒ ÆÄÀÏÀ» ¼±ÅÃÇÏ¿© ÁÖ½Ê½Ã¿ä.');
		return;
	}

	if (blnUploading) {
		alert('ÆÄÀÏ Ã·ºÎÁßÀÔ´Ï´Ù.');
		return;
	}

	if (blnDeleting) {
		alert('ÆÄÀÏÀ» Ã·ºÎ ÁßÀÔ´Ï´Ù.\n\nÆÄÀÏ Ã·ºÎ ¿Ï·á ÈÄ »èÁ¦ÇÏ¿© ÁÖ½Ê½Ã¿ä.');
		return;
	}

	if (intFileCnt >= 5) {
		alert('ÆÄÀÏÀ» ´õ ÀÌ»ó Ã·ºÎÇÒ ¼ö ¾ø½À´Ï´Ù.');
		return;
	}

	blnUploading = true;

	var nIndex = strFilePath.lastIndexOf('\\');
	if (nIndex > 0)	strFilePath = strFilePath.substr(nIndex + 1);

	var option = new Option(strFilePath, strFilePath, true);
	document.frm_attach_file.file_list.options[intFileCnt] = option;
	
	document.frm_attach_file.submit();
}

function UploadComplete(FilePath, FileName) {
	var intFileCnt = document.getElementById("file_list").length;
	blnUploading = false;

	var nListIndex = intFileCnt - 1;
	document.getElementById("file_list").options[nListIndex].value = FilePath;
	document.getElementById("file_list").options[nListIndex].text = FileName;
}

function UploadCancel() {
	var intFileCnt = document.getElementById("file_list").length;
	blnUploading = false;
	
	var nListIndex = intFileCnt - 1;
	document.getElementById("file_list").options[nListIndex] = null;

	self.ifrm_area.location.href = "about:blank";	
}

function DeleteFile() {
	var FileList = document.getElementById("file_list");

	if (blnUploading) {
		alert('ÆÄÀÏÀ» Ã·ºÎ ÁßÀÔ´Ï´Ù.\n\nÆÄÀÏ Ã·ºÎ ¿Ï·á ÈÄ »èÁ¦ÇÏ¿© ÁÖ½Ê½Ã¿ä.');
		return;
	}
	if (blnDeleting) {
		alert('ÆÄÀÏ »èÁ¦ÁßÀÔ´Ï´Ù.');
		return;
	}
	
	if (FileList.length == 0) {
		alert('»èÁ¦ÇÒ ÆÄÀÏÀÌ ¾ø½À´Ï´Ù.');
		return;
	}
	
	if (FileList.selectedIndex < 0 || FileList.selectedIndex == null) {
		alert('»èÁ¦ÇÒ ÆÄÀÏÀ» ¼±ÅÃÇÏ¿© ÁÖ½Ê½Ã¿ä.');
		return;
	}
	
	blnDeleting = true;

	FileList.options[FileList.selectedIndex].text = FileList.options[FileList.selectedIndex].text + ' File remove...';

	var nIndex, strFilePath, strFileName;

	strFilePath = FileList.options[FileList.selectedIndex].value;
	nIndex = strFilePath.lastIndexOf('/');
	strFileName = strFilePath.substr(nIndex + 1);
	strFilePath = strFilePath.substr(0, nIndex);

	if (strFilePath.toLowerCase( ).indexOf('/pds/board/temp') >= 0) {
		document.frm_delete_file.delete_file_index.value = FileList.selectedIndex;
		document.frm_delete_file.delete_file_path.value = FileList.options[FileList.selectedIndex].value;
		
		document.frm_delete_file.submit();
	} else {
		if (Len(document.getElementById("delete_file_list").value) > 0) document.getElementById("delete_file_list").value = document.getElementById("delete_file_list").value + ',';
		document.getElementById("delete_file_list").value = document.getElementById("delete_file_list").value + FileList.options[FileList.selectedIndex].value;
		
		DeleteComplete(FileList.selectedIndex);
	}
}

function DeleteComplete(ListIndex) {
	blnDeleting = false;
	
	document.getElementById("file_list").options[ListIndex] = null;
}

function DeleteCancel() {
	blnDeleting = false;
	
	var FileList = document.getElementById("file_list");

	var strFilePath = FileList.options[FileList.selectedIndex].value;
	var nIndex = strFilePath.lastIndexOf('/');
	var strFileName = strFilePath.substr(nIndex + 1);

	FileList.options[FileList.selectedIndex].text = strFileName;
}

function KeyDeleteFile() {
	if (window.event.keyCode == 46) DeleteFile();
}

function SetImageInfo() {
	for (var i, i = document.getElementById("img_list_1").length - 1; i >= 0; i--)
		document.getElementById("img_list_1").options[i] = null;

	for (var i, i = document.getElementById("img_list_2").length - 1; i >= 0; i--)
		document.getElementById("img_list_2").options[i] = null;

	if (document.getElementById("org_content") != null) {
		if (Len(document.all.org_content.innerHTML) > 0) {
			self.ifrm_area.document.open();
			self.ifrm_area.document.write(document.all.org_content.innerHTML);
			self.ifrm_area.document.close();
			
			if (self.ifrm_area.document.getElementsByTagName("img").length) {
				var intImgIndex = self.ifrm_area.document.getElementsByTagName("img").length - 1;
			
				for (var i, i = 0; i <= intImgIndex; i++) {
					var option = new Option(self.ifrm_area.document.getElementsByTagName("img")[i].src, self.ifrm_area.document.getElementsByTagName("img")[i].src, true);
					document.getElementById("img_list_1").options[i] = option;
					document.getElementById("img_list_1").options[i].selected = true;
				}
			}
		}
	}
		
	self.ifrm_area.document.open();
	self.ifrm_area.document.write(document.all.content.value);
	self.ifrm_area.document.close();

	if (self.ifrm_area.document.getElementsByTagName("img").length) {
		var intImgIndex = self.ifrm_area.document.getElementsByTagName("img").length - 1;
	
		for (var i, i = 0; i <= intImgIndex; i++) {
			var option = new Option(self.ifrm_area.document.getElementsByTagName("img")[i].src, self.ifrm_area.document.getElementsByTagName("img")[i].src, true);
			document.getElementById("img_list_2").options[i] = option;
			document.getElementById("img_list_2").options[i].selected = true;
		}
	}
}

function SetFileInfo () {
	for (var i, i = 0; i < document.getElementById("file_list").length; i++) {
		var option = new Option(document.getElementById("file_list").options[i].text, document.getElementById("file_list").options[i].value, true);

		document.getElementById("file_list_1").options[i] = option;
		document.getElementById("file_list_1").options[i].selected = true;
	}
}

function KeyEnter() {
	if (window.event.keyCode == 13) CheckForm();
}

function CheckForm() {

	if ((blnUploading) || (blnDeleting)) {
		alert('Ã·ºÎÆÄÀÏ ¶Ç´Â ÀÌ¹ÌÁö ÆÄÀÏ µî·ÏÁßÀÔ´Ï´Ù. Àá½Ã¸¸ ±â´Ù·Á ÁÖ½Ê½Ã¿À.');
		return;
	}

	if (Len(document.board_form.writer_name.value) == 0) {
		alert('µî·ÏÀÚ¸íÀ» ÀÔ·ÂÇÏ¿© ÁÖ½Ê½Ã¿ä.');
		document.board_form.writer_name.focus();
		return;
	}

	if (Len(document.board_form.email.value) == 0) {
		alert('µî·ÏÀÚ EmailÀ» ÀÔ·ÂÇÏ¿© ÁÖ½Ê½Ã¿ä.');
		document.board_form.email.focus();
		return;
	}
	
	if (Len(document.board_form.subject.value) == 0) {
		alert('Á¦¸ñÀ» ÀÔ·ÂÇÏ¿© ÁÖ½Ê½Ã¿ä.');
		document.board_form.subject.focus();
		return;
	}
	
	if (Len(document.board_form.pass_wd.value) == 0) {
		alert('ºñ¹Ð¹øÈ£¸¦ ÀÔ·ÂÇÏ¿© ÁÖ½Ê½Ã¿ä.')
		document.board_form.pass_wd.focus();
		return;
	}

	if (Len(document.board_form.content.value) == 0) {
		alert('³»¿ëÀ» ÀÔ·ÂÇÏ¿© ÁÖ½Ê½Ã¿ä.')
		return;
	}

	SetImageInfo();
	if (document.getElementById("frm_attach_file")) {
		SetFileInfo();
	}

	document.board_form.submit();
}

function CheckDelete() {
	if (document.getElementById("pass_wd")) {
		if (Len(document.getElementById("pass_wd").value) == 0) {
			alert('ºñ¹Ð¹øÈ£¸¦ ÀÔ·ÂÇÏ¿© ÁÖ½Ê½Ã¿ä.');
			document.getElementById("pass_wd").focus();
			return;
		}
	}

	if (document.getElementById("org_content") != null) {
		if (Len(document.all.org_content.innerHTML) > 0) {
			self.ifrm_area.document.open();
			self.ifrm_area.document.write(document.all.org_content.innerHTML);
			self.ifrm_area.document.close();
			
			if (self.ifrm_area.document.getElementsByTagName("img").length) {
				var intImgIndex = self.ifrm_area.document.getElementsByTagName("img").length - 1;
			
				for (var i, i = 0; i <= intImgIndex; i++) {
					var option = new Option(self.ifrm_area.document.getElementsByTagName("img")[i].src, self.ifrm_area.document.getElementsByTagName("img")[i].src, true);
					document.getElementById("img_list").options[i] = option;
					document.getElementById("img_list").options[i].selected = true;
				}
			}
		}
	}

	document.board_form.submit();
}

function CheckPassword() {
	if (document.getElementById("pass_wd")) {
		if (Len(document.getElementById("pass_wd").value) == 0) {
			alert('ºñ¹Ð¹øÈ£¸¦ ÀÔ·ÂÇÏ¿© ÁÖ½Ê½Ã¿ä.');
			document.getElementById("pass_wd").focus();
			return;
		}
	}

	document.board_form.submit();
}

// ===========================================
//
//		µ¿¿µ»ó °Ô½ÃÆÇ¿¡ ÇÊ¿äÇÑ ½ºÅ©¸³Æ® Ãß°¡ ( 2006-08-03 ºÀÁØ )
//
// ===========================================

// ±Û µî·Ï.. ºó°ª Ã¼Å©
function CheckFormMovie() {
	var theForm = document.board_form;
	
	if (Len(theForm.subject.value) == 0) {
		alert('Á¦¸ñÀ» ÀÔ·ÂÇÏ¿© ÁÖ½Ê½Ã¿ä.');
		theForm.subject.focus();
		return;
	}

	if (Len(theForm.content.value) == 0) {
		theForm.content.focus();
		alert('³»¿ëÀ» ÀÔ·ÂÇÏ¿© ÁÖ½Ê½Ã¿ä.')
		return;
	}

	if (board_form.TABSFileup.UploadFiles.Count == 0) {
		alert('µ¿¿µ»ó ÆÄÀÏÀ» ÇÏ³ªÀÌ»ó µî·ÏÇÏ¿© ÁÖ½Ê½Ã¿ä.');
		return;
	}

	// ActivX ½ÇÇàÇÏ±â..
	if (document.getElementById("TABSFileup")) {
		if (board_form.TABSFileup.UploadFiles.Count > 0) {
			board_form.TABSFileup.PostMultipartFormData();
		}
	}

	theForm.submit();
}

// ÀÌ¹ÌÁöÀÎÁö..
function imageonly(theForm){
	 if(theForm.img_path.value != "") {                                  //ÆÄÀÏÀÌ  ¼±ÅÃµÈ °æ¿ì 
	 var strFile = theForm.img_path.value;      //ÆÄÀÏ¸í
	 var strLen  = strFile.length;              //ÆÄÀÏ¸í ÀüÃ¼±æÀÌ  
	 var strExt  = strFile.substring(strLen-3); //ÆÄÀÏ È®ÀåÀÚ 

//  ÀÌ¹ÌÁö¸¸ ¾÷·Îµå 
		 if ((strExt.toLowerCase() != "jpg") &&
			 (strExt.toLowerCase() != "gif")) {

			theForm.reset();
			 alert( strExt + " Çü½ÄÀº ¾÷·Îµå°¡ Çã¿ëµÇÁö ¾Ê´Â ÆÄÀÏÇü½ÄÀÔ´Ï´Ù.\n");

		 }   //End If strExt

	 }  //End If file

}

// µ¿¿µ»óÀÎÁö..
function mediaonly(theForm){
	 if(theForm.media_path.value != "") {                                  //ÆÄÀÏÀÌ  ¼±ÅÃµÈ °æ¿ì 
	 var strFile = theForm.media_path.value;      //ÆÄÀÏ¸í
	 var strLen  = strFile.length;              //ÆÄÀÏ¸í ÀüÃ¼±æÀÌ  
	 var strExt  = strFile.substring(strLen-3); //ÆÄÀÏ È®ÀåÀÚ 

//  WMV¸¸ ¾÷·Îµå 
		 if (strExt.toLowerCase() != "WMV") {

			theForm.reset();
			 alert( strExt + " Çü½ÄÀº ¾÷·Îµå°¡ Çã¿ëµÇÁö ¾Ê´Â ÆÄÀÏÇü½ÄÀÔ´Ï´Ù.\nWMV Çü½ÄÀÇ ÆÄÀÏÀ» ¿Ã·ÁÁÖ½Ã±â ¹Ù¶ø´Ï´Ù.\n");

		 }   //End If strExt

	 }  //End If file

}

// ÆÄÀÏ ¼±ÅÃ ´ëÈ­»óÀÚ¸¦ ¿ÀÇÂÇØ¼­ ¾÷·ÎµåÇÒ ÆÄÀÏÀ» ¼±ÅÃÇÑ´Ù.
function addFiles()  
{
    board_form.TABSFileup.AddFile();
}

// ¼±ÅÃÇÑ ÆÄÀÏÀ» ¾ÆÀÌÄÜ ºä¿¡¼­ Á¦°ÅÇÑ´Ù.
function removeFiles()  
{
    board_form.TABSFileup.RemoveFile();
}

// ÆÄÀÏ ¼±ÅÃ ´ëÈ­»óÀÚ ¶Ç´Â µå·¡±×&µå·ÓÀ¸·Î ÆÄÀÏÀ» Ãß°¡ÇÒ ¶§ ¹ß»ýÇÏ´Â ÀÌº¥Æ®
function OnChangingUploadFile(TotalCount, TotalFileSize)
{
	if (TotalCount > 1) {
		alert("ÃÖ´ë 1°³±îÁö ¾÷·ÎµåÇÒ ¼ö ÀÖ½À´Ï´Ù.");
		board_form.TABSFileup.StopUpload = true;
	}
	if (TotalFileSize > 600 * 1024 * 1024) {
		alert("ÃÖ´ë 600M±îÁö ¾÷·ÎµåÇÒ ¼ö ÀÖ½À´Ï´Ù.");
		board_form.TABSFileup.StopUpload = true;
	}
}


// Æû ¿ä¼Ò µ¥ÀÌÅÍ¿Í ¼±ÅÃÇÑ ÆÄÀÏÀ» ÇÔ²² ¼­¹ö·Î Àü¼ÛÇÑ´Ù.
function submitForm()
{	
	var UploadFiles = board_form.TABSFileup.UploadFiles;
	if (UploadFiles.Count > 0) {
		board_form.TABSFileup.PostMultipartFormData();
	}
}

// submitForm()ÀÇ °á°ú·Î ¹ß»ýÇÏ´Â ÀÌº¥Æ®
function OnCompletedPostMultipartFormData(ErrType, ErrCode, ErrText)
{
	if (ErrType == 0) {
		// ¿À·ù°¡ ¹ß»ýÇÏÁö ¾ÊÀ» °æ¿ì ¼º°ø ÆäÀÌÁö·Î ÀüÈ¯ÇÑ´Ù.
		//alert(board_form.TABSFileup.Response);
		//location.href = "board_write_post.asp";
		document.board_form.file_list.value = board_form.TABSFileup.Response;
	}
	else
		// ¿À·ù Á¤º¸¸¦ °£´ÜÇÏ°Ô Ãâ·ÂÇÑ´Ù.
		alert("¿À·ùÇü½Ä:" + ErrType + "   ¿À·ùÄÚµå:" + ErrCode + "   ¿À·ù¼³¸í:" + ErrText);
}

// view ÆäÀÌÁö ¶ç¿ì±â
function viewon(strObj) {
	window.open('/photo/movie/view.asp?media_seq=' + strObj,'popup','width=658, height=580');
}

function MovieDelete(seq) {
	if (confirm("¼±ÅÃÇÏ½Å µ¿¿µ»óÀ» »èÁ¦ ÇÏ½Ã°Ú½À´Ï±î? »èÁ¦µÈ Á¤º¸´Â º¹±¸°¡ ºÒ°¡´ÉÇÕ´Ï´Ù.")) {
		document.movie.media_seq.value = seq;
		document.movie.action = "./delete_post.asp"
		document.movie.submit();
	} else {
		return;
	}
}

function MovieModify(seq) {
	document.movie.media_seq.value = seq;
	document.movie.action = "./modify.asp"
	document.movie.submit();
}

// µ¿¿µ»ó ¹öÆ°
function DivChange(lngObj) {
	if (lngObj == '1')
	{
		document.getElementById("content_div").style.display = '';
		document.getElementById("favorite_div").style.display = 'none';
	}
	if (lngObj == '2')
	{
		document.getElementById("content_div").style.display = 'none';
		document.getElementById("favorite_div").style.display = '';
	}
}

// ===========================================
//
//		µ¿¿µ»ó °Ô½ÃÆÇ¿¡ ÇÊ¿äÇÑ ½ºÅ©¸³Æ® Ãß°¡ ³¡~
//
// ===========================================