function previewBoard(pfrmFrameName, plngChatboardId)
{
	document.forms.item(pfrmFrameName).action = '/products/chatboard/messages.asp?scb=' + plngChatboardId + '&pvw=1';
	document.forms.item(pfrmFrameName).target = 'ifrChatMessages';
	document.forms.item(pfrmFrameName).submit();
}

function updateBoard(pfrmFrameName, plngChatboardId)
{
	document.forms.item(pfrmFrameName).action = '/asp/v20/admin/admChatboardConfig.asp?id=' + plngChatboardId + '&action=update';
	document.forms.item(pfrmFrameName).target = '';
	document.forms.item(pfrmFrameName).submit();
}

function previewLog(pfrmFrameName, plngWeblogId)
{
	document.forms.item(pfrmFrameName).action = '/products/weblog/weblog.asp?id=' + plngWeblogId;
	document.forms.item(pfrmFrameName).target = 'ifrPreviewLog';
	document.forms.item(pfrmFrameName).inpAction.value = 'preview';
	document.forms.item(pfrmFrameName).submit();
}
function insertLog(pfrmFrameName, plngWeblogId)
{
	document.forms.item(pfrmFrameName).action = '/asp/v20/admin/admWeblogLogs.asp?id=' + plngWeblogId;
	document.forms.item(pfrmFrameName).target = '';
	document.forms.item(pfrmFrameName).inpAction.value = 'insert';
	document.forms.item(pfrmFrameName).submit();
}
function updateLog(pfrmFrameName, plngWeblogId)
{
	document.forms.item(pfrmFrameName).action = '/asp/v20/admin/admWeblogLogs.asp?id=' + plngWeblogId;
	document.forms.item(pfrmFrameName).target = '';
	document.forms.item(pfrmFrameName).inpAction.value = 'update';
	document.forms.item(pfrmFrameName).submit();
}

function changeChatboardId(pUrl, pId)
{
	document.location=pUrl + '?id=' + pId;
}

function changeWeblogId(pUrl, pId)
{
	document.location=pUrl + '?id=' + pId;
}

function  setItalic(pControl)
{
	var sSel;
			
	pControl.focus();
			
	sSel = document.selection.createRange().text;
	if (sSel == '') 
	{
		document.selection.createRange().text = sSel + '<i></i>';	
	}
	else
	{
		document.selection.createRange().text = '<i>' + sSel + '</i>';	
	}
}
	
function  setBold(pControl)
{
	var sSel;
			
	pControl.focus();
			
	sSel = document.selection.createRange().text;
	if (sSel == '') 
	{
		document.selection.createRange().text = sSel + '<b></b>';	
	}
	else
	{
		document.selection.createRange().text = '<b>' + sSel + '</b>';	
	}
}

function  setUnderline(pControl)
{
	var sSel;
			
	pControl.focus();
			
	sSel = document.selection.createRange().text;
	if (sSel == '') 
	{
		document.selection.createRange().text = sSel + '<u></u>';	
	}
	else
	{
		document.selection.createRange().text = '<u>' + sSel + '</u>';	
	}
}

function createLink(pControl)
{
	var win;
	var link;
	var sSel;
	
	sSel = document.selection.createRange().text;
			
	setWindowStatus('Creating link...');
			
	win = window.showModalDialog('admWeblogUtilCreateLink.asp',sSel,'dialogHeight:250px;dialogWidth:300px;status:0;scroll:0;');
	if (win != null ) {		
		link = '<a href="' + win[0] + '" target="' + win[2] + '" title="' + win[3] + '" class="' + win[4] + '">' + win[1] + '</a>';
				
		pControl.focus();
		document.selection.createRange().text = link;
	}		
	setWindowStatus('');

}
		
function createImage(pControl)
{
	var win;
	var link;
			
	setWindowStatus('Creating image tag...');
			
	win = window.showModalDialog('admWeblogUtilCreateImage.asp','','dialogHeight:500px;dialogWidth:300px;status:0;scroll:0;');
	if (win != null ) {		
		link = '<img src="' + win[0] + '" align="' + win[1] + '" border="' + win[5] + '" alt="' + win[2] + '"';
		
		if (win[3] > 0) 
		{
			link += ' width="' + win[3] + '"';
		}
		if (win[4] >0)
		{
			link += ' height="' + win[4] + '"';
		}
		link += '>';
		
		pControl.focus();
		document.selection.createRange().text = link;
	}			
	setWindowStatus('');
			
		
}
		
function setWindowStatus(pText)
{
	window.status = pText;
}

