
var leftpos = 0, toppos = 0;
if (screen) { leftpos = screen.width/2-380; toppos = screen.height/2-240; }

// *******************************************************

function postFormat(theform,thetype)
{
	var text;
	if ( thetype == "url" ) { text = window.prompt("http://",""); }
	else { text = window.prompt("",""); }
	if (( text != null ) && ( text != "" ))
	{
		if ( thetype == "url" ) { postForm.postBody.value += "["+thetype+"="+text+"]"+text+"[/"+thetype+"] "; }
		if ( thetype == "img" ) { postForm.postBody.value += "["+thetype+"]"+text+"[/"+thetype+"] "; }
		if ( thetype == "b" ) { postForm.postBody.value += "["+thetype+"]"+text+"[/"+thetype+"] "; }
		if ( thetype == "u" ) { postForm.postBody.value += "["+thetype+"]"+text+"[/"+thetype+"] "; }
		if ( thetype == "i" ) { postForm.postBody.value += "["+thetype+"]"+text+"[/"+thetype+"] "; }
	}
	theform.message.focus();
}

// *******************************************************

function openStockWatcher( userID )
{ win = window.open('user_stockwatch.asp?userID='+userID,'','width=200,height=400,resizable=yes,scrollbars=no,menubar=no,toolbar=no,directories=no,location=no,status=no'); }

// *******************************************************

function openBrowser( userID )
{ win = window.open('browser.asp','','width=600,height=400,resizable=yes,scrollbars=no,menubar=no,toolbar=no,directories=no,location=no,status=no'); }

function popThreadBrowser( thread_id, post_id, post_boardid, post_symbol )
{ win = window.open('board_threadview.asp?thread_id='+thread_id+'&postID='+post_id+'&boardID='+post_boardid+'&sym='+post_symbol,'width=100,height=100,resizable=yes,scrollbars=auto,menubar=no,toolbar=no,directories=no,location=no,status=no'); }


// *******************************************************

function popAvatarSelect( returnElement )
{ win = window.open('user_avatar_select.asp?a=&e='+returnElement,'','width=340,height=260,resizable=yes,scrollbars=auto,menubar=no,toolbar=no,directories=no,location=no,status=no'); }

function popPostPreview()
{ win = window.open('board_postpreview.asp','','width=600,height=400,resizable=yes,scrollbars=auto,menubar=no,toolbar=no,directories=no,location=no,status=no'); }

function popThreadBrowser( thread_id, post_id, post_boardid, post_symbol )
{ win = window.open('board_threadview.asp?thread_id='+thread_id+'&postID='+post_id+'&boardID='+post_boardid+'&sym='+post_symbol,'width=100,height=100,resizable=yes,scrollbars=auto,menubar=no,toolbar=no,directories=no,location=no,status=no'); }

// *******************************************************

function post_check()
{
	if ( document.postForm.postSubject.value == '' )
	{
		alert('You must enter a subject for your post.');
		document.postForm.postSubject.focus();
		document.postForm.postSubject.className = 'frmTB300R';
		return false;
	}
	else { return true; }
}
