

function SetFont()
{
	if(document.selection && document.selection.type == "Text")	
  		{ 
  			var range = document.selection.createRange(); 
  			var strSoftFont = document.PostGroupBBsForm.SoftFont.options[document.PostGroupBBsForm.SoftFont.selectedIndex].value;
  			var strSoftSize = document.PostGroupBBsForm.SoftSize.options[document.PostGroupBBsForm.SoftSize.selectedIndex].value;
  			var strSoftColor = document.PostGroupBBsForm.SoftColor.options[document.PostGroupBBsForm.SoftColor.selectedIndex].value;
  			range.text = '[[font[s]size="' + strSoftSize + '"[s]' + 'color="' + strSoftColor + '"]]' + range.text + '[[/font]]';

		}	
}

function SetBold()
{
	
	if(document.selection && document.selection.type == "Text")	
  		{ 
  			var range = document.selection.createRange(); 
  			range.text = '[B]' + range.text + '[/B]';
		}	
}


function SetItalic()
{
	if(document.selection && document.selection.type == "Text")	
  		{ 
  			var range = document.selection.createRange(); 
  			range.text = '[I]' + range.text + '[/I]';
		}	
}


function SetUnderLine()
{
	if(document.selection && document.selection.type == "Text")	
  		{ 
  			var range = document.selection.createRange(); 
  			range.text = '[U]' + range.text + '[/U]';
		}	
}

function SetCenter()
{
	if(document.selection && document.selection.type == "Text")	
  		{ 
  			var range = document.selection.createRange(); 
  			range.text = '[DC]' + range.text + '[/D]';
		}
}

function SetLink()
{
	if(document.selection && document.selection.type == "Text")	
  		{ 
  			var range = document.selection.createRange(); 
			insertLink = prompt("请填写您要链接的网址：", "http://" + range.text);			
			if ((insertLink != null) && (insertLink != "") && (insertLink != "undefined")) 
				{  			
  					range.text = '[A]' + insertLink + '[/AE]' + range.text + '[/A]';
  				}	
		}
}

function SetEmail()
{
	if(document.selection && document.selection.type == "Text")	
  		{ 
  			var range = document.selection.createRange(); 
			insertEmail = prompt("请填写邮件地址信息：", range.text);			
			if ((insertEmail != null) && (insertEmail != "") && (insertEmail != "undefined")) 
				{  			
  					range.text = '[[a[s]href="mailto:' + insertEmail + '"]]' + range.text + '[[/a]]';
  				}	
		}
}

function SetImage(obj)
{
		insertImage = prompt("请填写图片链接地址信息：", "http://");			
		if ((insertImage != null) && (insertImage != "") && (insertImage != "undefined")) 
		{  			
			//document.PostGroupBBsForm.BBsContent.value += '[IMG]' + insertImage + '[/IMG]';
			obj.value += '[IMG]' + insertImage + '[/IMG]';
		}
}

function SetFlash(obj)
{
		insertFLASH = prompt("请填写FLASH链接地址信息：", "http://");			
		if ((insertFLASH != null) && (insertFLASH != "") && (insertFLASH != "undefined")) 
		{  			
			//document.PostGroupBBsForm.BBsContent.value += '[FLASH]' + insertFLASH + '[/FLASH]';
			obj.value += '[FLASH]' + insertFLASH + '[/FLASH]';
		}
}

function SetMedia(obj)
{
		insertMedia = prompt("请填写视频链接地址信息：", "http://");			
		if ((insertMedia != null) && (insertMedia != "") && (insertMedia != "undefined")) 
		{  			
			//document.PostGroupBBsForm.BBsContent.value += '[MEDIA]' + insertMedia + '[/MEDIA]';
			obj.value += '[MEDIA]' + insertFLASH + '[/MEDIA]';
		}
}