var dragapproved=false;
var zcor,xcor,ycor;

function moveNoticeMain()
{
	if(event.button==1 && dragapproved)
	{
		zcor.style.pixelLeft=tempvar1+event.clientX-xcor;
		zcor.style.pixelTop=tempvar2+event.clientY-ycor;
		leftpos=document.all.notice_main.style.pixelLeft-document.body.scrollLeft;
		toppos=document.all.notice_main.style.pixelTop-document.body.scrollTop;
		return false;
	}
}

function dragNoticeMain()
{
	if(!document.all) return;
	if(event.srcElement.id=="notice_bar")
	{
		dragapproved=true;
		zcor=notice_main;
		tempvar1=zcor.style.pixelLeft;
		tempvar2=zcor.style.pixelTop;
		xcor=event.clientX;
		ycor=event.clientY;
		document.onmousemove=moveNoticeMain;
	}
}

function openDisplay()
{
	if(notice_sub.style) notice_sub.style.display='';
}

function closeDisplay()
{
	if(notice_sub.style) notice_sub.style.display='none';
}

function staticize()
{
	notice_main.style.left=document.body.scrollLeft+leftpos;
	notice_main.style.top=document.body.scrollTop+toppos;
}

document.onmousedown=dragNoticeMain;
document.onmouseup=new Function('dragapproved=false');

function closeWin(frm)
{
	if(frm.nopop && frm.nopop.checked==true) setCookie('NOPOP',1,0);

	if(window.name=='notice')
	{
		self.close();
	}
	else
	{
		if(notice_main.style.display=='') notice_main.style.display='none';
		else notice_main.style.display='';
	}
}

