function bluring(){ 
if(event.srcElement.tagName=="A"||event.srcElement.tagName=="IMG") document.body.focus(); 
} 
document.onfocusin=bluring; 

var m_wx, m_wy;

function getMousePos()
{
	m_wx = event.clientX + document.body.scrollLeft;
	m_wy = event.clientY + document.body.scrollTop;
}


var m_ox = 0;
var m_oy = 0;


function layer_menu(x, y)
{
	menu = document.all.__menu__;
	
	if(m_ox>0 || m_oy>0)
	{
		x = m_ox;
		y = m_oy;
	}
	else
	{
		m_ox = x;
		m_oy = y;
	}
	
	getMousePos()
	
	menu.style.pixelLeft = x;
	menu.style.pixelTop  = y;
	menu.style.display = "block";
//	else
//		menu.style.display = "none";
	return false;
}


function layer_menu_hide()
{
	menu = document.all.__menu__;
	if(menu.style.display == 'none')
		return;
	menu.style.display = "none";
}


function findObj(n, d) { //v4.0
	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=findObj(n,d.layers[i].document);
	if(!x && document.getElementById) x=document.getElementById(n); return x;
}

function swapImage() {
	var i,j=0,x,a=swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
	if ((x=findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}



// 글 작성시에 빈기..
function check_form()
{
	if(!document.write.name.value)
	{
	document.write.name.focus();
	alert('이름을 입력하여 주세요.');
	return false;
	}

	if(!document.write.password.value)
	{
	document.write.password.focus();
	alert('암호를 입력하여 주세요.\n\n암호를 입력하셔야 수정/삭제를 할수 있습니다');
	return false;
	}

	if(!document.write.subject.value)
	{
	document.write.subject.focus();
	alert('제목을 입력해주세요!');
	return false;
	}
	if(!document.write.ll1.value)
	{
	document.write.ll1.focus();
	alert('감독을 입력해주세요!');
	return false;
	}
	if(!document.write.ll2.value)
	{
	document.write.ll2.focus();
	alert('주연을 입력해주세요!');
	return false;
	}
	if(!document.write.ll3.value)
	{
	document.write.ll3.focus();
	alert('장르를 입력해주세요!');
	return false;
	}
	if(!document.write.ll5.value)
	{
	document.write.ll5.focus();
	alert('상영시간을 입력해주세요!');
	return false;
	}
	if(!document.write.ll6.value)
	{
	document.write.ll6.focus();
	alert('개봉일을 입력해주세요!');
	return false;
	}
	if(!document.write.ll8.value)
	{
	document.write.ll8.focus();
	alert('내용을 입력해주세요!');
	return false;
	}
	document.check_attack.check.value=1;
	show_waiting();
	hideImageBox();

	return true;
}
