function check_login() {
	var check_log=document.loginform;
	if (!check_log.memberid.value) {
		alert ('È¸¿ø ¾ÆÀÌµð¸¦ ÀÔ·ÂÇØ ÁÖ¼¼¿ä');
		check_log.memberid.focus();
		return false;
		}
	if (!check_log.passwd.value) {
	alert ('ºñ¹Ð¹øÈ£¸¦ ÀÔ·ÂÇØ ÁÖ¼¼¿ä');
	check_log.passwd.focus();
	return false;
	}
}

function OpenAnotherWin(szhref){
	AnotherWin = window.open(szhref,"AnotherWin", 
	"toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,width=370,height=330");
}

var nk = 0;
function rndhphoto(){
	setTimeout("hphotoChange()",2000);
}

function hphotoChange(now){
	max = hphoto.length;
	hphoto[nk].style.display='none';

	++nk;
	nk=nk==max?0:nk;

	hphoto[nk].style.display='block';

	if(!now)rndhphoto();
}

var o = 0;
function ondhphoto(){
	setTimeout("ophotoChange()",2500);
}

function ophotoChange(now){
	max = ophoto.length;
	ophoto[o].style.display='none';

	++o;
	o=o==max?0:o;

	ophoto[o].style.display='block';

	if(!now)ondhphoto();
}

today = new Date();
var tyear = today.getYear(), tmonth = today.getMonth()+1, tday = today.getDate();
function setDate(val){
	if (val != "all"){
		var stmonth, stday;
		pday = tday - eval(val);
		date = new Date(tyear,tmonth,pday);
		stmonth = date.getMonth();
		stday = date.getDate();
		if (stmonth < 10) stmonth = "0" + stmonth;
		if (stmonth == 00) stmonth = "01";
		if (stday < 10) stday = "0" + stday;
		if (stday == 00) stday = "01";
		search_result.s_day.value = date.getYear() + '-' + stmonth + '-' + stday;
	} else {
		search_result.s_day.value = "2000-11-15";
	}
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function check_comment() {
	var check_comm=document.comm;
	if (!check_comm.member_name.value) {
		alert ('ÀÌ¸§À» ÀÔ·ÂÇØ ÁÖ¼¼¿ä');
		check_comm.member_name.focus();
		return false;
	}

	if (!check_comm.subject.value) {
		alert ('Á¦¸ñÀ» ÀÔ·ÂÇØ ÁÖ¼¼¿ä');
		check_comm.subject.focus();
		return false;
	}

	if (!check_comm.comment.value) {
		alert ('³»¿ëÀ» ÀÔ·ÂÇØ ÁÖ¼¼¿ä');
		check_comm.comment.focus();
		return false;
	}

	if (!check_comm.del_pass.value) {
		alert ('µ¶ÀÚÀÇ°ß »èÁ¦½Ã ÇÊ¿äÇÕ´Ï´Ù. ºñ¹Ð¹øÈ£¸¦ ÀÔ·ÂÇØ ÁÖ¼¼¿ä');
		check_comm.del_pass.focus();
		return false;
	}

}

function setCookie(name,value,expires) { 
	document.cookie=name + "=" + escape(value) + ((expires == null)? "" : (" ; expires=" + expires.toGMTString()));
}

function getCookie(name) { 
	var arg = name + "="; 
	var alen = arg.length; 
	var clen = document.cookie.length; 
	var i = 0; while(i< clen) { 
	var j = i + alen; 
	if(document.cookie.substring(i,j)==arg){ 
		var end = document.cookie.indexOf(";",j);
		if(end == -1) end = document.cookie.length; 
		return unescape(document.cookie.substring(j,end)); 
		}
		i=document.cookie.indexOf(" ",i)+1;
		if (i==0) break;
		} 
		return null;
}

function getFontCookie() { 
	var cookie = getCookie("news_font_size");
	if ( cookie == null ) return 16;
	if ( cookie.length ) return cookie; else return 16; 
}

function scaleFont(val) {
	var content, lineHeight; 
	content = document.getElementById("content"); 

	if (val > 0) {
		if (fontSize <= 18) { 
			fontSize = fontSize + val; 
			lineHeight = fontSize+Math.round(1.1*fontSize); 
			content.style.fontSize = fontSize + "px"; 
		} 
	} else {
		if (fontSize > 12) { 
			fontSize = fontSize + val; 
			lineHeight = fontSize+Math.round(1.1*fontSize); 
			content.style.fontSize = fontSize + "px"; 
		} 
	} 
	var mydate = new Date; 
	mydate.setDate(mydate.getDate()+1000); 
	//setCookie("news_font_size", fontSize, mydate); 
}

var fontSize = parseInt(getFontCookie());

function Add_edu() {

	var checkRow = edu.rows.length;
	if (checkRow > 30){
		alert("´õÀÌ»ó Ãß°¡ÇÒ¼ö ¾ø½À´Ï´Ù.")
		return;
	}

	var eduRow=edu.insertRow(checkRow);
	var aRows=edu.rows;
	var aCells=eduRow.cells;
	var TargetCell1 = aRows(eduRow.rowIndex).insertCell(aCells.length);
	var TargetCell2 = aRows(eduRow.rowIndex).insertCell(aCells.length);
	var TargetCell3 = aRows(eduRow.rowIndex).insertCell(aCells.length);

	eduRow.style.backgroundColor = "#f7f7f7"
	TargetCell1.align = "center"
	TargetCell2.align = "left"
	TargetCell3.align = "center"

	imgname = eduRow.rowIndex + 1

	TargetCell1.innerHTML="-±×¸²"+imgname+"-<br>-±×¸²"+imgname+"¼³¸í-<br><br><@"+imgname+">";
	TargetCell2.innerHTML="<input type=file name='file[]' size='50' class='input' style='width=80%;' onFocus='preview_new(this);'><input type='checkbox' name='pts"+imgname+"' value='Y'>ÃÖÀûÈ­<br><textarea name='img_con[]' cols='50' class='txtbox'></textarea><br><input type=radio name='malign"+imgname+"' value='L' checked><img src='/img/align_left.gif' align='absmiddle'><input type=radio name='malign"+imgname+"' value='C'><img src='/img/align_center.gif' align='absmiddle'><input type=radio name='malign"+imgname+"' value='R'><img src='/img/align_right.gif' align='absmiddle'>";
	TargetCell3.innerHTML=" ";
}


function Del_edu() {
	var myCheckRow = edu.rows.length;

	if (myCheckRow > 0) {
		document.all.edu.deleteRow()
	} else {
		alert("´õÀÌ»ó »èÁ¦ÇÒ ¼ö ¾ø½À´Ï´Ù.")
	}
}

function preview_new(obj,num){
	var preview="pre"+num;

	img = obj.value;
	if (img.length == 0) return;
	idx = img.lastIndexOf("\\");
	filename = img.substring(idx+1);
	idx2 = filename.lastIndexOf(".");
	ext = filename.substring(idx2+1);
	ext2 = ext.toLowerCase();
	if( ext2 != "jpg" && ext2 != "gif" & ext2 != "jpeg" ){
		alert('ÆÄÀÏÈ®ÀåÀÚ°¡ jpg³ª gif Çü½ÄÀÌ ¾Æ´Õ´Ï´Ù.\nÀÌ ÆÄÀÏÀº ¾÷·Îµå¸¦ ÇÒ ¼ö ¾ø½À´Ï´Ù.');
		obj.select();
	} else{
		preview.innerHTML = "<table width='110' border='0' cellpadding='5' cellspacing='1' bgcolor='#CCCCCC'><tr><td align='center' valign='middle' bgcolor='#FFFFFF'><img src=\"file://" + img + "\" width=120></td></tr></table>";
	}
}

function addon(t) {
	var old = document.insertform.title1;
	old.value = old.value + t;
}

function Add_mov() {

	var checkRowmov = mov.rows.length;
	if (checkRowmov > 20){
		alert("´õÀÌ»ó Ãß°¡ÇÒ¼ö ¾ø½À´Ï´Ù.")
		return;
	}

	var movRow=mov.insertRow(checkRowmov);
		movRow.style.backgroundColor = "#FFFFFF"
	var aRows=mov.rows;
	var aCells=movRow.cells;
	var TargetCell1 = aRows(movRow.rowIndex).insertCell(aCells.length);
	var TargetCell2 = aRows(movRow.rowIndex).insertCell(aCells.length);

	TargetCell1.align = "center"
	TargetCell2.align = "left"
	imgname = movRow.rowIndex + 1

TargetCell1.innerHTML="µ¿¿µ»ó"+imgname+"<br><br><¿µ"+imgname+">";
	TargetCell2.innerHTML="<textarea name='mov_con[]' cols='70' rows='3' wrap='VIRTUAL' class=input style='width=100%; line-height:130%; overflow:auto;'></textarea>";
}

function Del_mov() {
	var mycheckRowmov = mov.rows.length;
	if (mycheckRowmov > 0) {
		document.all.mov.deleteRow()
	} else {
		alert("´õÀÌ»ó »èÁ¦ÇÒ ¼ö ¾ø½À´Ï´Ù.")
	}
}

function mView(url) {
document.write("<object width='600' height='511' classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,16,0' id='V000057294'><param name='allowScriptAccess' value='always'><param name='movie' value='"+ url +"'><param name='allowFullScreen' value='true'><param name='quality' value='high'><embed src='"+ url +"' width='600' height='511' id='V000057294' allowScriptAccess='always'  allowFullScreen='true' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer'></embed></object>");
}

function m_Movie(wmv,w,h) {
document.write("<object classid=CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95 width='"+ w +"' height='"+ h +"' id='mmPlayer' name='mmPlayer' type='application/x-oleobject' codebase='http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701' standby='Loading Microsoft Windows Media Player components...' style='FILTER: xray()'><param name='Filename' value='"+ wmv +"'><param name='AutoStart' VALUE='1'><param name='AnimationAtStart' value='1'><param name='AllowChangeDisplaySize' value='1'><param name='EnableContextMenu' value='0'><param name='ShowControls' VALUE='1'><param name='ShowStatusBar' VALUE='0'><param name='ShowDisplay' VALUE='0'><param name='ShowTracker' VALUE='1'><param name='showpositioncontrols' VALUE='0'><param name='SendMouseClickEvents' VALUE='-1'><param name='Buffer' VALUE='3'></object>");
}

function m_Swf(wmv,w,h) {
document.write("<object width='"+ w +"'  height='"+ h +"' classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0' id='V000248491'><param name='movie' value='"+ wmv +"' /><param name='allowScriptAccess' value='always' /><param name='allowFullScreen' value='true' /><param name='quality' value='high' /><embed src='"+ wmv +"' width='"+ w +"' height='"+ h +"' name='V000248491' allowScriptAccess='always' allowFullScreen='true' quality='high' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer'></embed></object>");
}

function photoPicCtr(){
 var photoPicName ;
 for (i=1; i<=6; i++){
  photoPicName = "photoPic" + i ;
  document.getElementById(photoPicName).style.display = "none" ;
 }
 photoPicName = "photoPic" + arguments[0] ;
 document.getElementById(photoPicName).style.display = "" ;

}

var po = 1;
function aphoto(){
	setTimeout("aChange()",3000);
}

function aChange(now){
	++po;
	po=po==6?1:po;

	photoPicCtr(po);

	if(!now)aphoto();
}



function timeout(h){
var tout = h * 1000;
setTimeout("hide()",tout)
}

function  hide() {
	document.getElementById("pop").style.display = 'none';
	document.getElementById("movie").style.display = '';
}

function Change_Tab(f,s,c,w) {
	var tab_cnt = c;
	for(var i=1; i<=tab_cnt; i++) {
		if(i == s) {
			document.getElementById('LAY_' + f + '_' + i).style.display = 'block';
			document.getElementById('TAB_' + f + '_' + i).style.backgroundImage = 'url(/homeimg/tab_' + w + '_on.gif)';
			document.getElementById('TAB_' + f + '_' + i).className = 'tab_on';
		} else {
			document.getElementById('LAY_' + f + '_' + i).style.display = 'none';
			document.getElementById('TAB_' + f + '_' + i).style.backgroundImage = 'url(/homeimg/tab_' + w + '_off.gif)';
			document.getElementById('TAB_' + f + '_' + i).className = 'tab_off';
		}
	}
}

function slide(aid){
	var window_left = (screen.width-800)/2;
	var window_top = (screen.height-710)/2;
	ref = "/photo/nslide.php3?aid=" + aid;      
	window.open(ref,"slide",'width=800,height=710,status=no,top=' + window_top + ',left=' + window_left + '');
}

function schange (val) {
	if (val == null || val == "")
		return;

	location.href = "nslide.php3?aid=" + val;
}

function gohome(www){
	window.open(www,"home");
}

function hchange(sid,id) {
	var img = document.all(sid+'img');
	var obj = document.all(sid);
	var len = obj.length;
	var k=1;

	for(ps=0; ps<len; ++ps) {
		if(eval(id)==ps) {
			obj[ps].style.display='block';
			img[ps].src='/jiho/'+sid+''+k+'_over.gif';
		} else {
			obj[ps].style.display='none';
			img[ps].src='/jiho/'+sid+''+k+'.gif';
		}
		++k
	}
}

function change(str) {

if(str=="sub1"){ 
tv.style.display="none" 
dica.style.display="" 
}

if(str=="sub2"){ 
tv.style.display="" 
dica.style.display="none" 
}

}