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()",5000);
}

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.spam.value) {
		alert ('½ºÆÔ¹æÁö¸¦ À§ÇÑ Á¶Ä¡ÀÌ¿À´Ï ¿ÞÂÊ ¼ýÀÚ¸¦ ÀÔ·ÂÇÏ¿© ÁÖ¼¼¿ä');
		check_comm.spam.focus();
		return false;
	}

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

}

function ZipWindow(ref,what) {
	var window_left = (screen.width-640)/2;
	var window_top = (screen.height-480)/2;
	ref = ref + "?what=" + what;      
	window.open(ref,"zipWin",'width=550,height=200,status=no,top=' + window_top + ',left=' + window_left + '');
}

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

function media(url,w,h) {
document.write("<object classid=CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95 width='"+ w +"' height='"+ h +"' id='Player' name='Player' 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...'><param name='Filename' value='"+ url +"'><param name='AutoStart' VALUE='0'><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='showpositioncontrols' VALUE='0'><param name='ShowTracker' VALUE='1'><param name='SendMouseClickEvents' VALUE='-1'><param name='Buffer' VALUE='3'></object>");
}

function view_movie() {
	im1 = document.all('movie1');
	mv1 = document.all('movie2');
	im1.style.display='none';
	mv1.style.display='';
	document.mPlayer.play();
}

function noview(no) {
	document.getElementById("main_"+ no).style.display = 'none';
}

var imgObj = new Image();
function showImgWin(imgName)
{
	imgObj.src = imgName;
	setTimeout("createImgWin(imgObj)", 100);
}
function createImgWin(imgObj)
{
	var window_left = (screen.width-imgObj.width)/2;
	var window_top = (screen.height-imgObj.height)/2;

	if (!imgObj.complete)
	{
		setTimeout("createImgWin(imgObj)", 100);
		return;
	}
	imageWin = window.open("", "imageWin","width=" + imgObj.width + ",height=" + imgObj.height + ',top=' + window_top + ',left=' + window_left );
	imageWin.document.write("<html><body style='margin:0'>");
	imageWin.document.write("<img src='" + imgObj.src + "' onclick=self.close() style=cursor:hand>");
	imageWin.document.write("</body><html>");
	imageWin.document.title = 'ÀÌ¹ÌÁö È®´ëº¸±â';
	imageWin.focus();
}

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';
		}
	}
}

var favoriteurl="http://www.kjdaily.com"
var favoritetitle="±¤ÁÖ¸ÅÀÏ"
 
function favor() {

if (document.all) window.external.AddFavorite(favoriteurl,favoritetitle)

 
}

function cNotice(id) {
	img = document.all('center_img');
	var obj = document.all('cinfo');
	var len = obj.length;
	var j=1;
	
	for(i=0; i<len; ++i) {
		if(eval(id)==i) {
			obj[i].style.display='block';
			img[i].src='/mainimg/center'+j+'_over.gif';
		} else {
			obj[i].style.display='none';
			img[i].src='/mainimg/center'+j+'.gif';
		}
		++j
	}
}

function LoadMaincenter() {
	var img = document.all('center_img');
	img[0].src='/mainimg/center1_over.gif';
} 