<!--
function storeCaret(text) { 
	if (text.createTextRange) {
		text.caretPos = document.selection.createRange().duplicate();
	}
}

function addText(text) {
	var myContent =  document.add_article.Content;
	if(document.all)
	{
		if (document.add_article.Content.createTextRange && document.add_article.Content.caretPos) {      
			var caretPos = document.add_article.Content.caretPos;      
			caretPos.text = caretPos.text.charAt(caretPos.text.length - 1) == ' ' ?
			text + ' ' : text;
		}
		else document.add_article.Content.value += text;
		document.add_article.Content.focus(caretPos)
	}else
	{	
            var startPos = document.add_article.Content.selectionStart;
            var endPos = document.add_article.Content.selectionEnd;
            var chaineBBCode = document.add_article.Content.value;

            myContent.value = chaineBBCode.substring(0, startPos) + text + chaineBBCode.substring(endPos, chaineBBCode.length);
		
	}//end if	
}
 /* function addText(text)
  {
    var obj = document.add_article;  
    var Content = obj.Content.value;
	obj.Content.value = Content + text;
  }*/

  function B()
  {
    Code = "[b][/b]";
	addText(Code);
  }
  
  function I()
  {
    Code = "[i][/i]";
	addText(Code);
  }  
  
  function U()
  {
    Code = "[u][/u]";
	addText(Code);
  }  
  
  function Red()
  {
    Code = "[red][/red]";
	addText(Code);
  } 
  
  function Blue()
  {
    Code = "[blue][/blue]";
	addText(Code);
  }   
  
  function Green()
  {
    Code = "[green][/green]";
	addText(Code);
  } 
  
  function Gray()
  {
    Code = "[gray][/gray]";
	addText(Code);
  }   
  
  function White()
  {
    Code = "[white][/white]";
	addText(Code);
  }  
  
  function Move()
  {
    Code = "[maq][/maq]";
	addText(Code);
  } 
    
  function Img()
  {
    Code = "[img]輸入圖片路徑[/img]";
	addText(Code);
  }

  function Url()
  {
    Code = "[url]輸入網址[/url]";
	addText(Code);
  }  

  function Email()
  {
    Code = "[email]輸入e-mail[/email]";
	addText(Code);
  }  

  function Quote()
  {
    Code = "[quote]請輸入引用文字[/quote]";
	addText(Code);
  }
  
  function Bq()
  {
    Code = "[bq][/bq]";
	addText(Code);
  }  

  function Move2()
  {
    Code = "[maq2][/maq2]";
	addText(Code);
  } 

  function Url2()
  {
    Code = "[url2]輸入網址[str]輸入網站名稱[/url2]";
	addText(Code);
  }  
  
  function hr()
  {
    Code = "[hr]";
	addText(Code);
  } 
// facial icon ##################################################################### start
   
  function smiley()
  {
    Code = "mtmd:)";
	addText(Code);
  } 
  function wink()
  {
    Code = "mtmd;)";
	addText(Code);
  } 

  function cheesy()
  {
    Code = "mtmd:D";
	addText(Code);
  } 

  function grin()
  {
    Code = "mtmd;D";
	addText(Code);
  } 

  function angry()
  {
    Code = "mtmd〉:(";
	addText(Code);
  } 

  function sad()
  {
    Code = "mtmd:(";
	addText(Code);
  } 

  function shocked()
  {
    Code = "mtmd:o";
	addText(Code);
  } 

  function cool()
  {
    Code = "mtmd8)";
	addText(Code);
  }
  
  function huh()
  {
    Code = "mtmd???";
	addText(Code);
  } 

  function rolleyes()
  {
    Code = "mtmd::)";
	addText(Code);
  }          
  <!--08-14-2003 Add-->
  function tongue()
  {
    Code = "mtmd:P";
	addText(Code);
  }  
          
  function embarassed()
  {
    Code = "mtmd:-[";
	addText(Code);
  }              
  
  function lipsrsealed()
  {
    Code = "mtmd:-X";
	addText(Code);
  }
            
    function undecided()
  {
    Code = "mtmd:-i";
	addText(Code);
  }
            
    function kiss()
  {
    Code = "mtmd:-*";
	addText(Code);
  }
 /*            
    function cry()
  {
    Code = "mtmd:'(";
	addText(Code);
  }*/ 
  
    function cry()
  {
    Code = "mtmd!_!";
	addText(Code);
  } 
  
  <!--08-17-2003 #####################################################################-->
     function size()
  {
    Code = "[size=2][/size]";
	addText(Code);
  } 

     function fontstrike()
  {
    Code = "[strike][/strike]";
	addText(Code);
  }                                               
  
     function Orange()
  {
    Code = "[orange][/orange]";
	addText(Code);
  }  
  <!--Sup、Sup ######################################################################--> 
     function Sup()
  {
    Code = "[sup][/sup]";
	addText(Code);
  }  

     function Sub()
  {
    Code = "[sub][/sub]";
	addText(Code);
  }  

     function table()
  {
    Code = "[table][tr][td][/td][/tr][/table]";
	addText(Code);
  }  

     function tr()
  {
    Code = "[tr][/tr]";
	addText(Code);
  }  

     function td()
  {
    Code = "[td][/td]";
	addText(Code);
  }  
  <!--08-17-2003 #######################################################-->
     function wave()
  {
    Code = "mtmd^^y";
	addText(Code);
  }  

     function clap()
  {
    Code = "mtmd()";
	addText(Code);
  }  
  <!--12-03-2003 Flash 以及空白 #######################################-->
     function space()
  {
    Code = "[s]";
	addText(Code);
  } 
  
      function flash()
  {
    Code = "[flash=200,200]請輸入網址[/flash]";
	addText(Code);
  } 
  
      function movie()
  {
    Code = "[movie=200,200 autoplay=1]請輸入網址[/movie]";
	addText(Code);
  }

      function qtmovie()
  {
    Code = "[qtmovie=200,200 autoplay=1]請輸入QuickTime 影音網址[/qtmovie]";
	addText(Code);
  }
  <!-- $RCSfile: FlashDetection2k.pm,v $ $Revision: 1.71 $ :  server can't tell if your browser has Flash;  you have a Netscape-like browser, here is some client-side JavaScript to detect if you have Flash. --><script type="text/javascript" language="JavaScript">
<!-- start JS detection
FlashMode = 0;
if (navigator.plugins && navigator.plugins.length > 0)
{
	if (navigator.plugins["Shockwave Flash"])
	{
		var plugin_version = 0;
		var words = navigator.plugins["Shockwave Flash"].description.split(" ");

		for (var i = 0; i < words.length; ++i)
		{
			if (isNaN(parseInt(words[i])))
			continue;
			plugin_version = words[i];
		}
		if (plugin_version >= 6)
		{
			var plugin = navigator.plugins["Shockwave Flash"];
			var numTypes = plugin.length;
			for (j = 0; j < numTypes; j++)
			{
				mimetype = plugin[j];
				if (mimetype)
				{
					if (mimetype.enabledPlugin && (mimetype.suffixes.indexOf("swf") != -1))
						FlashMode = 1;
					// Mac wierdness
					if (navigator.mimeTypes["application/x-shockwave-flash"] == null)
						FlashMode = 0;
				}
			}
		}
	}
}
do_dw_var = FlashMode;
browser_flash_version = plugin_version;
// end JS detection -->   

//2005-08-19 增加項目 #####################################################################
      function Arrow()
  {
    Code = "[->]";
	addText(Code);
  } //end func

      function Linux()
  {
    Code = "[linux name=請輸入標題]請輸入內容[/linux]";
	addText(Code);
  } //end func

      function realmovie()
  {
    Code = "[real=200,200 autoplay=1]請輸入 RealPlay 影音網址[/real]";
	addText(Code);
  }//end 

      function Color()
  {
    Code = "[color=請輸入顏色碼][/color]";
	addText(Code);
  }//end 

  function Img2()
  {
    Code = "[img border=1 align=center alt=圖形說明文字]輸入圖片路徑[/img]";
	addText(Code);
  }//end 

//-->      