ScreenMidY = screen.availHeight/2;
ScreenMidX = screen.availWidth/2;

function OpenWindow(URL,NAME,TOP,LEFT,WIDTH,HEIGHT,SCROLL)
{
 eval(NAME + " = window.open('" + URL + "','" + NAME + "','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=" + SCROLL + ",resizable=no,copyhistory=no,top=" + TOP + ",left=" + LEFT + ",width=" + WIDTH + ",height=" + HEIGHT + "')");
}

function OcilateWindow(WindowObject,Radius,CX,CY,Position,Base,Dir)
{
 XX = Math.cos(((Position * Dir)/Base) * (Math.PI*2)) * Radius;
 YY = Math.sin(((Position * Dir)/Base) * (Math.PI*2)) * Radius;
 TX = XX+CX;
 TY = YY+CY;
 eval(WindowObject + ".moveTo("+ TX +","+ TY +")");
}

function TogglePanelWidget(inPanel, inDirection, inTotalPanels, inPanelPrefix) {
	var i_MaxPanel	= inTotalPanels;
	var s_PanelPrefix = inPanelPrefix;
	var i_ShowPanel = 0;

	for (var i=1; i<=i_MaxPanel; i++) {
		if (document.getElementById(s_PanelPrefix + i).style.display != 'none')
			document.getElementById(s_PanelPrefix + i).style.display = 'none';
	} 

	if ((inPanel == i_MaxPanel) && (inDirection == 1)) {
		i_ShowPanel = 1;
	} else if ((inPanel == 1) && (inDirection == -1)) {
		i_ShowPanel = i_MaxPanel;
	} else {
		i_ShowPanel = parseInt(inPanel) + parseInt(inDirection);
	}
	
	document.getElementById(s_PanelPrefix + i_ShowPanel).style.display = 'block';
}


//forum board page functions
function getBoardDesc(VirtualDir, BoardID){
	OpenWindow (VirtualDir + "/forum/description.asp?BoardID=" + BoardID,"PopUp",0,0,500,300,"YES");
}

function showMoods(VirtualDir, Col1, Col2) {
	OpenWindow(VirtualDir + "/forum/mood.asp?C1=" + Col1 + "&C2=" + Col2,"PopUp",0,0,200,300,"YES");
}

function chkSpace()	{
	if (document.frmthread.txtTitle.value == ""){
		alert("Please enter a title.")
		document.frmthread.txtTitle.focus();
		
	}
	else if (document.frmthread.txtMsg.value == ""){
		alert("Please post a message for your new thread.")
		document.frmthread.txtMsg.focus();
	}
	else
	{	
	document.frmthread.submit();
	}
}
function Clear()	
{document.frmthread.reset();}

function reload(boardid, PageID){
	document.location.href="default.asp?PSID="+PageID+"&ThreadID="+document.frmMsg.selthread.options[document.frmMsg.selthread.selectedIndex].value+"&boardid="+boardid+"";
}

function chkMsgSpace()	{
	if (document.frmMsg.txtTitle.value == ""){
		alert("Please enter a title.")
		document.frmMsg.txtTitle.focus();
	}
	else if (document.frmMsg.txtMsg.value == ""){
		alert("Please enter a message.")
		document.frmMsg.txtMsg.focus();
	}
	else
	{	
		document.frmMsg.submit();
	}
}

function MsgClear()	{
	document.frmMsg.reset();
}
function deletethis(){
	document.frmthread.submit();
}