MINI MINI MANI MO

Path : /home/lhcar/www/mobile/_config/_js/
File Upload :
Current File : /home/lhcar/www/mobile/_config/_js/wysiwyg.js

/*
Áö¿ì´Ô ±Û ÂüÁ¶
http://www.phpschool.com/gnuboard4/bbs/board.php?bo_table=tipntech&wr_id=48766&sca=&sfl=wr_subject%7C%7Cwr_content&stx=%C0%A7%C1%F6%C0%A8&sop=and
ÂüÁ¶ÇßÀ½.

Â÷ÀÌÁ¡ : Ŭ·¡½ºÇü½Ä
Ãß°¡
1.±Û µî·Ï½Ã ±Û¾È¾²¸é °æ°í¹®±¸¶ç¿ì±â	: hname='´Ü¾î' required
2.<p>Å×±× <br>·Î º¯È¯				: join»ç¿ë
*/
var wysiwyg_Class	= function () {

	var textareaName	= new Array(); //typeÀÌ "editor"ÀÎ textarea ¹è¿­
	this.img_upload		= new Array();
	this.img_upload_num	= 0;

	this.frame_use	= '';		//iframe name¸í
	this.img		= '';		//¾÷·ÎµåÇÑ À̹ÌÁö¸í.
	var viewSource	= false;
	this.edit_mode = new Array(); // ÆíÁý ¸ðµå

	this.htmlid	= '';

	/*##############################################################################################################
	ÇöÀç À§Ä¡¿¡¼­ rankup_edit°æ·Î °ª ¾Ë¾Æ³½´Ù.
	##############################################################################################################*/
	var file_location	= document.URL;
	var domainname		= document.domain;
	var loca_gubun	= file_location.split('/');
	var domain_dot	= domainname.split('.');
	var loca		= '';

	for(var i=0; i<domain_dot.length; i++) {

		if(domain_dot[i].length>3) {

			var domainis	= true;
			break;
		}
	}

	var loca_gubun_minus	= (domainis==true) ? 4 : 5 ;

	var classObj = this;

	for(var i=0; i<loca_gubun.length - loca_gubun_minus; i++) {

		loca	+= '../';
	}



	//ÇÔ¼ö
	this.htmledit			= function (excute, bool, value, num){

		if(viewSource == false) {

			document.getElementById('iframe'+textareaName[num]).contentWindow.focus();

			if(navigator.appName != "Microsoft Internet Explorer" && excute=="backcolor") excute = "hilitecolor";
			document.getElementById('iframe'+textareaName[num]).contentWindow.document.execCommand(excute, bool, value);
			document.getElementById('fontfaceLayer'+num).style.display = "none";
			document.getElementById('fontsizeLayer'+num).style.display = "none";
			document.getElementById('fgLayer'+num).style.display = "none";
			document.getElementById('bgLayer'+num).style.display = "none";
			this.copyTohtml();
		}
	}

	this.viewLayer			= function (num, layerId,e){

		if(layerId) {
			var tx = e?e.pageX:event.x;
			//var ty = e?e.pageY:document.body.scrollTop + event.y;
			document.getElementById(layerId).style.left = tx - 15;
			//document.getElementById(layerId).style.top = ty+10;
		}

		document.getElementById('fontfaceLayer'+num).style.display = "none";
		document.getElementById('fontsizeLayer'+num).style.display = "none";
		document.getElementById('fgLayer'+num).style.display = "none";
		document.getElementById('bgLayer'+num).style.display = "none";
		if(layerId) document.getElementById(layerId).style.display = "inline";
		//if(layerId) document.getElementById(layerId).focus();
	}


	/*##############################################################################################################
	À̹ÌÁö ¾÷·Îµå
	##############################################################################################################*/
	this.use_image			= function (elmId, elmName, num) {

		this.frame_use	= eval(elmId);
	
		if(window.attachEvent) {

			this.img_upload[this.img_upload_num]	= showModalDialog(loca+'wysiwyg/img_add.html?iname='+elmId+'&num='+num, window, 'resizable: yes; help: no; status: no; scroll: no; dialogWidth:650px;dialogHeight:300px;');

			if(this.img_upload[this.img_upload_num]) {

				this.frame_use.focus();
				this.frame_use.document.execCommand('InsertImage', false, loca+'wysiwyg/PEG_temp/'+this.img_upload[this.img_upload_num]);//ºÎ¸ðâ¿¡ À̹ÌÁö ³Ö±â
				this.img_upload_num++;
			}

		} else if(window.addEventListener) {

			window.open(loca+'wysiwyg/img_add.html?iname='+elmId+'&num='+num+'&img_num='+this.img_upload_num, window, 'resizable: yes; help: no; status: no; scroll: no;');
		}
	}

	/*##############################################################################################################
	ffÀ϶§´Â ÀÌ ÇÔ¼ö ÀÌ¿ëÇØ¼­ À̹ÌÁö¸¦ ¿øÇÏ´Â °÷¿¡ ³õ´Â´Ù.
	##############################################################################################################*/
	this.ff_img_view		= function () {

		if(this.img) {

			this.frame_use.document.execCommand('InsertImage', false, loca+'wysiwyg/PEG_temp/'+this.img);//ºÎ¸ðâ¿¡ À̹ÌÁö ³Ö±â
			this.img_upload[this.img_upload_num]	= this.img;
			this.img_upload_num++;
		}
	}

	this.viewSource			= function (elmId,elmName, num){
		viewSource	= true;
		document.getElementById(elmId).style.display = "none";
		document.getElementsByName(elmName)[0].style.display = "inline";
		document.getElementById('viewSourceBtn'+num).style.display = "none";
		document.getElementById('viewEdirorBtn'+num).style.display = "inline";
		document.getElementsByName(elmName)[0].value = document.getElementById(elmId).contentWindow.document.body.innerHTML;
	}

	this.viewEdiror			= function (elmId,elmName, num){
		viewSource	= false;
		document.getElementById(elmId).style.display = "inline";
		document.getElementsByName(elmName)[0].style.display = "none";
		document.getElementById('viewSourceBtn'+num).style.display = "inline";
		document.getElementById('viewEdirorBtn'+num).style.display = "none";
		document.getElementById(elmId).contentWindow.document.body.innerHTML = document.getElementsByName(elmName)[0].value;
	}

	this.copyTohtml			= function (){
		for (var i=0;i<textareaName.length;i++){
			document.getElementsByName(textareaName[i])[0].value = document.getElementById("iframe"+textareaName[i]).contentWindow.document.body.innerHTML;
		}
	}

	this.copyToeditor		= function (){
		for (var i=0;i<textareaName.length;i++){
			document.getElementById("iframe"+textareaName[i]).contentWindow.document.body.innerHTML = document.getElementsByName(textareaName[i])[0].value;
		}
	}
	//ÇÔ¼ö ³¡	

	this.createELM			= function (){

		var left1 = (navigator.appName == "Microsoft Internet Explorer")?"353px":"349px"; //È­¸é¿¡ µû¶ó ¾à°£¾¿ Á¤ÇØÁà¾ßÇØ¿ä..(IE:FireFox)
		var left2 = (navigator.appName == "Microsoft Internet Explorer")?"403px":"389px"; //È­¸é¿¡ µû¶ó ¾à°£¾¿ Á¤ÇØÁà¾ßÇØ¿ä..(IE:FireFox)
		var left3 = (navigator.appName == "Microsoft Internet Explorer")?"519px":"515px"; //È­¸é¿¡ µû¶ó ¾à°£¾¿ Á¤ÇØÁà¾ßÇØ¿ä..(IE:FireFox)
		var left4 = (navigator.appName == "Microsoft Internet Explorer")?"537px":"533px"; //È­¸é¿¡ µû¶ó ¾à°£¾¿ Á¤ÇØÁà¾ßÇØ¿ä..(IE:FireFox)

		var c = 0;
		var textareaObj = document.getElementsByTagName('textarea');
		for (var i=0;i<textareaObj.length;i++){
			if(textareaObj[i].getAttribute("type")=="editor"){
				textareaName[c] = textareaObj[i].getAttribute("name");
				c++;
			}
		}
		for (var i=0;i<textareaName.length;i++){
			var textareaOrg = document.getElementsByName(textareaName[i])[0];
			var tbl_width_num	= (textareaOrg.style.width)?textareaOrg.style.width:530;
			var tbl_width	= parseInt(tbl_width_num) - 2;

			textareaOrg.style.width	= tbl_width_num;

			//¾ÆÀÌÇÁ·¹ÀÓ»ý¼º
			var editorFrameObj = document.createElement("iframe");
			editorFrameObj.setAttribute("id","iframe"+textareaName[i]);
			editorFrameObj.setAttribute("name","iframe"+textareaName[i]);
			editorFrameObj.setAttribute("scrolling","yes");
			editorFrameObj.setAttribute("frameBorder","no");
			editorFrameObj.setAttribute("wrap","virtual");
			editorFrameObj.style.width = tbl_width;
			editorFrameObj.style.height = textareaOrg.style.height;
			editorFrameObj.style.border = "1px solid #D0D0D0";
			editorFrameObj.onmouseover = new Function("Wysiwyg.viewLayer('"+i+"');");
			textareaOrg.parentNode.insertBefore(editorFrameObj,textareaOrg);

			var doc = document.getElementById("iframe"+textareaName[i]).contentWindow.document;
			doc.open(); 
			doc.write("<html><head>");
			doc.write("<style type='text/css'>");
			doc.write("p{ margin:0px; }");
			doc.write("ul,ol{ margin-top:0; margin-bottom:0; }");	
			doc.write("body, table, td{");
			doc.write("scrollbar-3dlight-color:#E0E0E0;");
			doc.write("scrollbar-arrow-color:#E0E0E0;"); 
			doc.write("scrollbar-base-color:#E0E0E0;"); 
			doc.write("scrollbar-darkshadow-color:#FFFFFF;"); 
			doc.write("scrollbar-face-color:#FFFFFF;"); 
			doc.write("scrollbar-highlight-color:#FFFFFF;"); 
			doc.write("scrollbar-shadow-color:#E0E0E0;");
			doc.write("font-family:'Arial'; font-size:9pt; line-height:140%;}");
			doc.write("</style>");
			doc.write("</head><body bgcolor='#FFFFFF'>"+textareaOrg.value+"</body></html>"); 
			doc.close(); 

			// µðÀÚÀθðµå
			if(document.getElementsByName(textareaName[i])[0].getAttribute("readonly")==true) {
				doc.designMode = "off";
			} else {
				doc.designMode = "on";
			}
			textareaOrg.style.backgroundColor="#ffffff";
			textareaOrg.style.color="#336699";
			textareaOrg.style.fontSize="9pt";
			textareaOrg.style.border = "1px solid #D0D0D0";
			textareaOrg.style.fontFamily="Tahoma";
			textareaOrg.style.display="none";

			// À̺¥Æ® ó¸®(³»¿ë »óÈ£º¹Á¦ ºÎºÐ)
			if(document.addEventListener){
				doc.addEventListener("mousedown", Wysiwyg.copyTohtml, false);
				doc.addEventListener("blur", Wysiwyg.copyTohtml, false);
				textareaOrg.addEventListener("mousedown", Wysiwyg.copyToeditor, false);
				textareaOrg.addEventListener("blur", Wysiwyg.copyToeditor, false);
			}else if(document.attachEvent){
				doc.attachEvent("onmousedown", Wysiwyg.copyTohtml, false);
				document.getElementById("iframe"+textareaName[i]).attachEvent("onblur", Wysiwyg.copyTohtml, false);
				textareaOrg.attachEvent("onmousedown", Wysiwyg.copyToeditor, false);
				textareaOrg.attachEvent("onblur", Wysiwyg.copyToeditor, false);
			}

			

			//µµ±¸Å×À̺í»ý¼º
			var ctrlObj  = "<table width=\""+tbl_width+"\" cellSpacing=\"5\" cellPadding=\"0\" border=\"0\" style=\"margin-top:0px;margin-left:0px;\"> ";
			ctrlObj += " <tr> ";
			ctrlObj += " <td> ";
			ctrlObj += " 	<img src=\""+loca+"wysiwyg/editor_images/ed_fontface.gif\" border=\"0\" alt=\"±ÛÀÚü\" onClick=\"Wysiwyg.viewLayer('"+i+"', 'fontfaceLayer"+i+"',arguments[0]);\"> ";
			ctrlObj += " 	<img src=\""+loca+"wysiwyg/editor_images/ed_fontsize.gif\" border=\"0\" alt=\"±ÛÀÚÅ©±â\" onClick=\"Wysiwyg.viewLayer('"+i+"', 'fontsizeLayer"+i+"',arguments[0]);\"> ";
			ctrlObj += " 	<img src=\""+loca+"wysiwyg/editor_images/ed_virtical.gif\"> ";
			ctrlObj += " 	<A href=\"javascript:Wysiwyg.htmledit('bold', false, null, '"+i+"');\"><img src=\""+loca+"wysiwyg/editor_images/ed_format_bold.gif\" border=\"0\" alt=\"º¼µåü\"></A> ";
			ctrlObj += " 	<A href=\"javascript:Wysiwyg.htmledit('italic', false, null, '"+i+"');\"><img src=\""+loca+"wysiwyg/editor_images/ed_format_italic.gif\" border=\"0\" alt=\"±â¿ï¸²Ã¼\"></A> ";
			ctrlObj += " 	<A href=\"javascript:Wysiwyg.htmledit('underline', false, null, '"+i+"');\"><img src=\""+loca+"wysiwyg/editor_images/ed_format_underline.gif\" border=\"0\" alt=\"¹ØÁÙ\"></A> ";
			ctrlObj += " 	<A href=\"javascript:Wysiwyg.htmledit('StrikeThrough', false, null, '"+i+"');\"><img src=\""+loca+"wysiwyg/editor_images/ed_format_strike.gif\" border=\"0\" alt=\"Ãë¼Ò¼±\"></A> ";
			ctrlObj += " 	<img src=\""+loca+"wysiwyg/editor_images/ed_color_fg.gif\" border=\"0\" alt=\"±ÛÀÚ»ö»ó\" onClick=\"Wysiwyg.viewLayer('"+i+"', 'fgLayer"+i+"',arguments[0]);\"> ";
			ctrlObj += " 	<img src=\""+loca+"wysiwyg/editor_images/ed_color_bg.gif\" border=\"0\" alt=\"¹è°æ»ö»ó\" onClick=\"Wysiwyg.viewLayer('"+i+"', 'bgLayer"+i+"',arguments[0]);\"> ";
			ctrlObj += " 	<img src=\""+loca+"wysiwyg/editor_images/ed_virtical.gif\"> ";
			ctrlObj += " 	<A href=\"javascript:Wysiwyg.htmledit('justifyleft', false, null, '"+i+"');\"><img src=\""+loca+"wysiwyg/editor_images/ed_align_left.gif\" border=\"0\" alt=\"ÁÂÃøÁ¤·Ä\"></a> ";
			ctrlObj += " 	<A href=\"javascript:Wysiwyg.htmledit('justifycenter', false, null, '"+i+"');\"><img src=\""+loca+"wysiwyg/editor_images/ed_align_center.gif\" border=\"0\" alt=\"Áß½ÉÁ¤·Ä\"></a> ";
			ctrlObj += " 	<A href=\"javascript:Wysiwyg.htmledit('justifyright', false, null, '"+i+"');\"><img src=\""+loca+"wysiwyg/editor_images/ed_align_right.gif\" border=\"0\" alt=\"¿ìÃøÁ¤·Ä\"></a> ";
			ctrlObj += " 	<img src=\""+loca+"wysiwyg/editor_images/ed_virtical.gif\"> ";
			ctrlObj += " 	<A href=\"javascript:Wysiwyg.htmledit('insertorderedlist', false, null, '"+i+"');\"><img src=\""+loca+"wysiwyg/editor_images/ed_list_number.gif\" border=\"0\" alt=\"¼ýÀÚ¸ñ·Ï\"></a> ";
			ctrlObj += " 	<A href=\"javascript:Wysiwyg.htmledit('insertunorderedlist', false, null, '"+i+"');\"><img src=\""+loca+"wysiwyg/editor_images/ed_list_dot.gif\" border=\"0\" alt=\"Á¡Ç¥½Ã¸ñ·Ï\"></a> ";
			ctrlObj += " 	<A href=\"javascript:Wysiwyg.htmledit('outdent', false, null, '"+i+"');\"><img src=\""+loca+"wysiwyg/editor_images/ed_format_outdent.gif\" border=\"0\" alt=\"µé¿©¾²±âÁÙÀ̱â\"></a> ";
			ctrlObj += " 	<A href=\"javascript:Wysiwyg.htmledit('indent', false, null, '"+i+"');\"><img src=\""+loca+"wysiwyg/editor_images/ed_format_indent.gif\" border=\"0\" alt=\"µé¿©¾²±â´ÃÀ̱â\"></a> ";
			ctrlObj += " 	<img src=\""+loca+"wysiwyg/editor_images/ed_virtical.gif\"> ";
			ctrlObj += " 	<A href=\"javascript:Wysiwyg.htmledit('InsertHorizontalRule', false, null, '"+i+"');\"><img src=\""+loca+"wysiwyg/editor_images/ed_hr.gif\" border=\"0\" alt=\"ÇÑÁÙ³Ö±â\"></a> ";



			ctrlObj += " 	<img id=\"viewEdirorBtn"+i+"\" src=\""+loca+"wysiwyg/editor_images/ed_editor.gif\" border=\"0\" alt=\"ÆíÁýÈ­¸é\" style=\"display:none\" onClick=\"Wysiwyg.viewEdiror('iframe"+textareaName[i]+"','"+textareaName[i]+"', '"+i+"');\"> ";
			ctrlObj += " 	<img id=\"viewSourceBtn"+i+"\" src=\""+loca+"wysiwyg/editor_images/ed_html.gif\" border=\"0\" alt=\"¼Ò½ºº¸±â\" style=\"display:inline\" onClick=\"Wysiwyg.viewSource('iframe"+textareaName[i]+"','"+textareaName[i]+"', '"+i+"');\"> ";
			ctrlObj += " 	<img id=\"viewSourceBtn"+i+"\" src=\""+loca+"wysiwyg/editor_images/icon_img.gif\" border=\"0\" alt=\"À̹ÌÁö ¾÷·Îµå\" style=\"display:inline\" onClick=\"Wysiwyg.use_image('iframe"+textareaName[i]+"','"+textareaName[i]+"', '"+i+"');\"> ";
			ctrlObj += " 	<br> ";
			ctrlObj += " 	<div id=\"fontfaceLayer"+i+"\" style=\"position:absolute; width:70px; border:1px solid #999999; display:none;\"> ";
			ctrlObj += " 		<table width=\"100%\" cellspacing=\"0\" cellpadding=\"0\" border=\"0\" bgcolor=\"#ffffff\"> ";
			ctrlObj += " 		<tr onmouseover=\"this.style.backgroundColor='#E0E0E0'\" onmouseout=\"this.style.backgroundColor=''\"><td style=\"padding-left:3px;\" onmousedown=\"Wysiwyg.htmledit('fontname', false, 'µ¸¿ò', '"+i+"');\">µ¸¿ò</td></tr> ";
			ctrlObj += " 		<tr onmouseover=\"this.style.backgroundColor='#E0E0E0'\" onmouseout=\"this.style.backgroundColor=''\"><td style=\"padding-left:3px;\" onmousedown=\"Wysiwyg.htmledit('fontname', false, '±¼¸²', '"+i+"');\">±¼¸²</td></tr> ";
			ctrlObj += " 		<tr onmouseover=\"this.style.backgroundColor='#E0E0E0'\" onmouseout=\"this.style.backgroundColor=''\"><td style=\"padding-left:3px;\" onmousedown=\"Wysiwyg.htmledit('fontname', false, '¹ÙÅÁ', '"+i+"');\">¹ÙÅÁ</td></tr> ";
			ctrlObj += " 		<tr onmouseover=\"this.style.backgroundColor='#E0E0E0'\" onmouseout=\"this.style.backgroundColor=''\"><td style=\"padding-left:3px;\" onmousedown=\"Wysiwyg.htmledit('fontname', false, '±Ã¼­', '"+i+"');\">±Ã¼­</td></tr> ";
			ctrlObj += " 		<tr onmouseover=\"this.style.backgroundColor='#E0E0E0'\" onmouseout=\"this.style.backgroundColor=''\"><td style=\"padding-left:3px;\" onmousedown=\"Wysiwyg.htmledit('fontname', false, 'Arial', '"+i+"');\">Arial</td></tr> ";
			ctrlObj += " 		<tr onmouseover=\"this.style.backgroundColor='#E0E0E0'\" onmouseout=\"this.style.backgroundColor=''\"><td style=\"padding-left:3px;\" onmousedown=\"Wysiwyg.htmledit('fontname', false, 'Tahoma', '"+i+"');\">Tahoma</td></tr> ";
			ctrlObj += " 		<tr onmouseover=\"this.style.backgroundColor='#E0E0E0'\" onmouseout=\"this.style.backgroundColor=''\"><td style=\"padding-left:3px;\" onmousedown=\"Wysiwyg.htmledit('fontname', false, 'Verdana', '"+i+"');\">Verdana</td></tr> ";
			ctrlObj += " 		<tr onmouseover=\"this.style.backgroundColor='#E0E0E0'\" onmouseout=\"this.style.backgroundColor=''\"><td style=\"padding-left:3px;\" onmousedown=\"Wysiwyg.htmledit('fontname', false, 'Time', '"+i+"');\">Time</td></tr> ";
			ctrlObj += " 		</table> ";
			ctrlObj += " 	</div> ";
			ctrlObj += " 	<div id=\"fontsizeLayer"+i+"\" style=\"position:absolute; width:38px; border:1px solid #999999; display:none;\"> ";
			ctrlObj += " 		<table width=\"100%\" cellspacing=\"0\" cellpadding=\"0\" border=\"0\" bgcolor=\"#ffffff\"> ";
			ctrlObj += " 		<tr onmouseover=\"this.style.backgroundColor='#E0E0E0'\" onmouseout=\"this.style.backgroundColor=''\"><td style=\"padding-left:3px;\" onmousedown=\"Wysiwyg.htmledit('fontsize', false, 1, '"+i+"');\">1</td></tr> ";
			ctrlObj += " 		<tr onmouseover=\"this.style.backgroundColor='#E0E0E0'\" onmouseout=\"this.style.backgroundColor=''\"><td style=\"padding-left:3px;\" onmousedown=\"Wysiwyg.htmledit('fontsize', false, 2, '"+i+"');\">2</td></tr> ";
			ctrlObj += " 		<tr onmouseover=\"this.style.backgroundColor='#E0E0E0'\" onmouseout=\"this.style.backgroundColor=''\"><td style=\"padding-left:3px;\" onmousedown=\"Wysiwyg.htmledit('fontsize', false, 3, '"+i+"');\">3</td></tr> ";
			ctrlObj += " 		<tr onmouseover=\"this.style.backgroundColor='#E0E0E0'\" onmouseout=\"this.style.backgroundColor=''\"><td style=\"padding-left:3px;\" onmousedown=\"Wysiwyg.htmledit('fontsize', false, 4, '"+i+"');\">4</td></tr> ";
			ctrlObj += " 		<tr onmouseover=\"this.style.backgroundColor='#E0E0E0'\" onmouseout=\"this.style.backgroundColor=''\"><td style=\"padding-left:3px;\" onmousedown=\"Wysiwyg.htmledit('fontsize', false, 5, '"+i+"');\">5</td></tr> ";
			ctrlObj += " 		<tr onmouseover=\"this.style.backgroundColor='#E0E0E0'\" onmouseout=\"this.style.backgroundColor=''\"><td style=\"padding-left:3px;\" onmousedown=\"Wysiwyg.htmledit('fontsize', false, 6, '"+i+"');\">6</td></tr> ";
			ctrlObj += " 		</table> ";
			ctrlObj += " 	</div> ";
			ctrlObj += " 	<div id=\"fgLayer"+i+"\" style=\"position:absolute; width:160px; height:75px; border:1px solid #999999; display:none;\"> ";
			ctrlObj += " 		<table width=\"100%\" cellspacing=\"0\" cellpadding=\"0\" border=\"0\" bgcolor=\"#ffffff\"> ";
			ctrlObj += " 		<td> ";
			ctrlObj += " 			<table cellspacing=\"0\" cellpadding=\"0\" border=\"1\" bordercolor=\"#000000\" style=\"border-collapse:collapse; margin:7px;\"> ";
			ctrlObj += " 			<tr height=\"11\"> ";
			ctrlObj += " 			<td width=\"11\" bgcolor=\"#FE1100\" onmousedown=\"Wysiwyg.htmledit('forecolor', false, '#FE1100', '"+i+"');\"></td> ";
			ctrlObj += " 			<td width=\"11\" bgcolor=\"#FE4C24\" onmousedown=\"Wysiwyg.htmledit('forecolor', false, '#FE4C24', '"+i+"');\"></td> ";
			ctrlObj += " 			<td width=\"11\" bgcolor=\"#FE875A\" onmousedown=\"Wysiwyg.htmledit('forecolor', false, '#FE875A', '"+i+"');\"></td> ";
			ctrlObj += " 			<td width=\"11\" bgcolor=\"#FECDA7\" onmousedown=\"Wysiwyg.htmledit('forecolor', false, '#FECDA7', '"+i+"');\"></td> ";
			ctrlObj += " 			<td width=\"11\" bgcolor=\"#040967\" onmousedown=\"Wysiwyg.htmledit('forecolor', false, '#040967', '"+i+"');\"></td> ";
			ctrlObj += " 			<td width=\"11\" bgcolor=\"#2D328D\" onmousedown=\"Wysiwyg.htmledit('forecolor', false, '#2D328D', '"+i+"');\"></td> ";
			ctrlObj += " 			<td width=\"11\" bgcolor=\"#44499A\" onmousedown=\"Wysiwyg.htmledit('forecolor', false, '#44499A', '"+i+"');\"></td> ";
			ctrlObj += " 			<td width=\"11\" bgcolor=\"#686EB8\" onmousedown=\"Wysiwyg.htmledit('forecolor', false, '#686EB8', '"+i+"');\"></td> ";
			ctrlObj += " 			<td width=\"11\" bgcolor=\"#669900\" onmousedown=\"Wysiwyg.htmledit('forecolor', false, '#669900', '"+i+"');\"></td> ";
			ctrlObj += " 			<td width=\"11\" bgcolor=\"#66CC00\" onmousedown=\"Wysiwyg.htmledit('forecolor', false, '#66CC00', '"+i+"');\"></td> ";
			ctrlObj += " 			<td width=\"11\" bgcolor=\"#99FF00\" onmousedown=\"Wysiwyg.htmledit('forecolor', false, '#99FF00', '"+i+"');\"></td> ";
			ctrlObj += " 			<td width=\"11\" bgcolor=\"#FF99FF\" onmousedown=\"Wysiwyg.htmledit('forecolor', false, '#FF99FF', '"+i+"');\"></td> ";
			ctrlObj += " 			</tr> ";
			ctrlObj += " 			<tr height=\"11\"> ";
			ctrlObj += " 			<td width=\"11\" bgcolor=\"#6E0017\" onmousedown=\"Wysiwyg.htmledit('forecolor', false, '#6E0017', '"+i+"');\"></td> ";
			ctrlObj += " 			<td width=\"11\" bgcolor=\"#7B243D\" onmousedown=\"Wysiwyg.htmledit('forecolor', false, '#7B243D', '"+i+"');\"></td> ";
			ctrlObj += " 			<td width=\"11\" bgcolor=\"#834C6B\" onmousedown=\"Wysiwyg.htmledit('forecolor', false, '#834C6B', '"+i+"');\"></td> ";
			ctrlObj += " 			<td width=\"11\" bgcolor=\"#66FFFF\" onmousedown=\"Wysiwyg.htmledit('forecolor', false, '#66FFFF', '"+i+"');\"></td> ";
			ctrlObj += " 			<td width=\"11\" bgcolor=\"#006BD4\" onmousedown=\"Wysiwyg.htmledit('forecolor', false, '#006BD4', '"+i+"');\"></td> ";
			ctrlObj += " 			<td width=\"11\" bgcolor=\"#0087E1\" onmousedown=\"Wysiwyg.htmledit('forecolor', false, '#0087E1', '"+i+"');\"></td> ";
			ctrlObj += " 			<td width=\"11\" bgcolor=\"#37B7FE\" onmousedown=\"Wysiwyg.htmledit('forecolor', false, '#37B7FE', '"+i+"');\"></td> ";
			ctrlObj += " 			<td width=\"11\" bgcolor=\"#A7DEFE\" onmousedown=\"Wysiwyg.htmledit('forecolor', false, '#A7DEFE', '"+i+"');\"></td> ";
			ctrlObj += " 			<td width=\"11\" bgcolor=\"#FFCC00\" onmousedown=\"Wysiwyg.htmledit('forecolor', false, '#FFCC00', '"+i+"');\"></td> ";
			ctrlObj += " 			<td width=\"11\" bgcolor=\"#FFFF00\" onmousedown=\"Wysiwyg.htmledit('forecolor', false, '#FFFF00', '"+i+"');\"></td> ";
			ctrlObj += " 			<td width=\"11\" bgcolor=\"#FEFE9F\" onmousedown=\"Wysiwyg.htmledit('forecolor', false, '#FEFE9F', '"+i+"');\"></td> ";
			ctrlObj += " 			<td width=\"11\" bgcolor=\"#FEFED0\" onmousedown=\"Wysiwyg.htmledit('forecolor', false, '#FEFED0', '"+i+"');\"></td> ";
			ctrlObj += " 			</tr> ";
			ctrlObj += " 			<tr height=\"11\"> ";
			ctrlObj += " 			<td width=\"11\" bgcolor=\"#4E003D\" onmousedown=\"Wysiwyg.htmledit('forecolor', false, '#4E003D', '"+i+"');\"></td> ";
			ctrlObj += " 			<td width=\"11\" bgcolor=\"#6D2262\" onmousedown=\"Wysiwyg.htmledit('forecolor', false, '#6D2262', '"+i+"');\"></td> ";
			ctrlObj += " 			<td width=\"11\" bgcolor=\"#926594\" onmousedown=\"Wysiwyg.htmledit('forecolor', false, '#926594', '"+i+"');\"></td> ";
			ctrlObj += " 			<td width=\"11\" bgcolor=\"#C2A9C5\" onmousedown=\"Wysiwyg.htmledit('forecolor', false, '#C2A9C5', '"+i+"');\"></td> ";
			ctrlObj += " 			<td width=\"11\" bgcolor=\"#005557\" onmousedown=\"Wysiwyg.htmledit('forecolor', false, '#005557', '"+i+"');\"></td> ";
			ctrlObj += " 			<td width=\"11\" bgcolor=\"#03747B\" onmousedown=\"Wysiwyg.htmledit('forecolor', false, '#03747B', '"+i+"');\"></td> ";
			ctrlObj += " 			<td width=\"11\" bgcolor=\"#579D9F\" onmousedown=\"Wysiwyg.htmledit('forecolor', false, '#579D9F', '"+i+"');\"></td> ";
			ctrlObj += " 			<td width=\"11\" bgcolor=\"#A2C6CC\" onmousedown=\"Wysiwyg.htmledit('forecolor', false, '#A2C6CC', '"+i+"');\"></td> ";
			ctrlObj += " 			<td width=\"11\" bgcolor=\"#FF6600\" onmousedown=\"Wysiwyg.htmledit('forecolor', false, '#FF6600', '"+i+"');\"></td> ";
			ctrlObj += " 			<td width=\"11\" bgcolor=\"#FF9933\" onmousedown=\"Wysiwyg.htmledit('forecolor', false, '#FF9933', '"+i+"');\"></td> ";
			ctrlObj += " 			<td width=\"11\" bgcolor=\"#FECD8A\" onmousedown=\"Wysiwyg.htmledit('forecolor', false, '#FECD8A', '"+i+"');\"></td> ";
			ctrlObj += " 			<td width=\"11\" bgcolor=\"#FEE2B0\" onmousedown=\"Wysiwyg.htmledit('forecolor', false, '#FEE2B0', '"+i+"');\"></td> ";
			ctrlObj += " 			</tr> ";
			ctrlObj += " 			<tr height=\"11\"> ";
			ctrlObj += " 			<td width=\"11\" bgcolor=\"#1B0B73\" onmousedown=\"Wysiwyg.htmledit('forecolor', false, '#1B0B73', '"+i+"');\"></td> ";
			ctrlObj += " 			<td width=\"11\" bgcolor=\"#4C379D\" onmousedown=\"Wysiwyg.htmledit('forecolor', false, '#4C379D', '"+i+"');\"></td> ";
			ctrlObj += " 			<td width=\"11\" bgcolor=\"#876EBA\" onmousedown=\"Wysiwyg.htmledit('forecolor', false, '#876EBA', '"+i+"');\"></td> ";
			ctrlObj += " 			<td width=\"11\" bgcolor=\"#BBBAEF\" onmousedown=\"Wysiwyg.htmledit('forecolor', false, '#BBBAEF', '"+i+"');\"></td> ";
			ctrlObj += " 			<td width=\"11\" bgcolor=\"#008E37\" onmousedown=\"Wysiwyg.htmledit('forecolor', false, '#008E37', '"+i+"');\"></td> ";
			ctrlObj += " 			<td width=\"11\" bgcolor=\"#26B168\" onmousedown=\"Wysiwyg.htmledit('forecolor', false, '#26B168', '"+i+"');\"></td> ";
			ctrlObj += " 			<td width=\"11\" bgcolor=\"#47BE80\" onmousedown=\"Wysiwyg.htmledit('forecolor', false, '#47BE80', '"+i+"');\"></td> ";
			ctrlObj += " 			<td width=\"11\" bgcolor=\"#76D3A2\" onmousedown=\"Wysiwyg.htmledit('forecolor', false, '#76D3A2', '"+i+"');\"></td> ";
			ctrlObj += " 			<td width=\"11\" bgcolor=\"#B31C00\" onmousedown=\"Wysiwyg.htmledit('forecolor', false, '#B31C00', '"+i+"');\"></td> ";
			ctrlObj += " 			<td width=\"11\" bgcolor=\"#B03F21\" onmousedown=\"Wysiwyg.htmledit('forecolor', false, '#B03F21', '"+i+"');\"></td> ";
			ctrlObj += " 			<td width=\"11\" bgcolor=\"#AE623A\" onmousedown=\"Wysiwyg.htmledit('forecolor', false, '#AE623A', '"+i+"');\"></td> ";
			ctrlObj += " 			<td width=\"11\" bgcolor=\"#AC6E54\" onmousedown=\"Wysiwyg.htmledit('forecolor', false, '#AC6E54', '"+i+"');\"></td> ";
			ctrlObj += " 			</tr> ";
			ctrlObj += " 			<tr height=\"11\"> ";
			ctrlObj += " 			<td width=\"11\" bgcolor=\"#FEFEFE\" onmousedown=\"Wysiwyg.htmledit('forecolor', false, '#FEFEFE', '"+i+"');\"></td> ";
			ctrlObj += " 			<td width=\"11\" bgcolor=\"#E6E6E6\" onmousedown=\"Wysiwyg.htmledit('forecolor', false, '#E6E6E6', '"+i+"');\"></td> ";
			ctrlObj += " 			<td width=\"11\" bgcolor=\"#CDCDCD\" onmousedown=\"Wysiwyg.htmledit('forecolor', false, '#CDCDCD', '"+i+"');\"></td> ";
			ctrlObj += " 			<td width=\"11\" bgcolor=\"#B4B4B4\" onmousedown=\"Wysiwyg.htmledit('forecolor', false, '#B4B4B4', '"+i+"');\"></td> ";
			ctrlObj += " 			<td width=\"11\" bgcolor=\"#A8A8A8\" onmousedown=\"Wysiwyg.htmledit('forecolor', false, '#A8A8A8', '"+i+"');\"></td> ";
			ctrlObj += " 			<td width=\"11\" bgcolor=\"#8D8D8D\" onmousedown=\"Wysiwyg.htmledit('forecolor', false, '#8D8D8D', '"+i+"');\"></td> ";
			ctrlObj += " 			<td width=\"11\" bgcolor=\"#747474\" onmousedown=\"Wysiwyg.htmledit('forecolor', false, '#747474', '"+i+"');\"></td> ";
			ctrlObj += " 			<td width=\"11\" bgcolor=\"#595959\" onmousedown=\"Wysiwyg.htmledit('forecolor', false, '#595959', '"+i+"');\"></td> ";
			ctrlObj += " 			<td width=\"11\" bgcolor=\"#4B4B4B\" onmousedown=\"Wysiwyg.htmledit('forecolor', false, '#4B4B4B', '"+i+"');\"></td> ";
			ctrlObj += " 			<td width=\"11\" bgcolor=\"#303030\" onmousedown=\"Wysiwyg.htmledit('forecolor', false, '#303030', '"+i+"');\"></td> ";
			ctrlObj += " 			<td width=\"11\" bgcolor=\"#0A0A0A\" onmousedown=\"Wysiwyg.htmledit('forecolor', false, '#0A0A0A', '"+i+"');\"></td> ";
			ctrlObj += " 			<td width=\"11\" bgcolor=\"#000000\" onmousedown=\"Wysiwyg.htmledit('forecolor', false, '#000000', '"+i+"');\"></td> ";
			ctrlObj += " 			</tr> ";
			ctrlObj += " 			</table> ";
			ctrlObj += " 			</td> ";
			ctrlObj += " 		</table> ";
			ctrlObj += " 	</div> ";
			ctrlObj += " 	<div id=\"bgLayer"+i+"\" style=\"position:absolute; width:160px; height:75px; border:1px solid #999999; display:none;\"> ";
			ctrlObj += " 		<table width=\"100%\" cellspacing=\"0\" cellpadding=\"0\" border=\"0\" bgcolor=\"#ffffff\"> ";
			ctrlObj += " 		<td> ";
			ctrlObj += " 			<table cellspacing=\"0\" cellpadding=\"0\" border=\"1\" bordercolor=\"#000000\" style=\"border-collapse:collapse; margin:7px;\"> ";
			ctrlObj += " 			<tr height=\"11\"> ";
			ctrlObj += " 			<td width=\"11\" bgcolor=\"#FE1100\" onmousedown=\"Wysiwyg.htmledit('backcolor', false, '#FE1100', '"+i+"');\"></td> ";
			ctrlObj += " 			<td width=\"11\" bgcolor=\"#FE4C24\" onmousedown=\"Wysiwyg.htmledit('backcolor', false, '#FE4C24', '"+i+"');\"></td> ";
			ctrlObj += " 			<td width=\"11\" bgcolor=\"#FE875A\" onmousedown=\"Wysiwyg.htmledit('backcolor', false, '#FE875A', '"+i+"');\"></td> ";
			ctrlObj += " 			<td width=\"11\" bgcolor=\"#FECDA7\" onmousedown=\"Wysiwyg.htmledit('backcolor', false, '#FECDA7', '"+i+"');\"></td> ";
			ctrlObj += " 			<td width=\"11\" bgcolor=\"#040967\" onmousedown=\"Wysiwyg.htmledit('backcolor', false, '#040967', '"+i+"');\"></td> ";
			ctrlObj += " 			<td width=\"11\" bgcolor=\"#2D328D\" onmousedown=\"Wysiwyg.htmledit('backcolor', false, '#2D328D', '"+i+"');\"></td> ";
			ctrlObj += " 			<td width=\"11\" bgcolor=\"#44499A\" onmousedown=\"Wysiwyg.htmledit('backcolor', false, '#44499A', '"+i+"');\"></td> ";
			ctrlObj += " 			<td width=\"11\" bgcolor=\"#686EB8\" onmousedown=\"Wysiwyg.htmledit('backcolor', false, '#686EB8', '"+i+"');\"></td> ";
			ctrlObj += " 			<td width=\"11\" bgcolor=\"#669900\" onmousedown=\"Wysiwyg.htmledit('backcolor', false, '#669900', '"+i+"');\"></td> ";
			ctrlObj += " 			<td width=\"11\" bgcolor=\"#66CC00\" onmousedown=\"Wysiwyg.htmledit('backcolor', false, '#66CC00', '"+i+"');\"></td> ";
			ctrlObj += " 			<td width=\"11\" bgcolor=\"#99FF00\" onmousedown=\"Wysiwyg.htmledit('backcolor', false, '#99FF00', '"+i+"');\"></td> ";
			ctrlObj += " 			<td width=\"11\" bgcolor=\"#FF99FF\" onmousedown=\"Wysiwyg.htmledit('backcolor', false, '#FF99FF', '"+i+"');\"></td> ";
			ctrlObj += " 			</tr> ";
			ctrlObj += " 			<tr height=\"11\"> ";
			ctrlObj += " 			<td width=\"11\" bgcolor=\"#6E0017\" onmousedown=\"Wysiwyg.htmledit('backcolor', false, '#6E0017', '"+i+"');\"></td> ";
			ctrlObj += " 			<td width=\"11\" bgcolor=\"#7B243D\" onmousedown=\"Wysiwyg.htmledit('backcolor', false, '#7B243D', '"+i+"');\"></td> ";
			ctrlObj += " 			<td width=\"11\" bgcolor=\"#834C6B\" onmousedown=\"Wysiwyg.htmledit('backcolor', false, '#834C6B', '"+i+"');\"></td> ";
			ctrlObj += " 			<td width=\"11\" bgcolor=\"#66FFFF\" onmousedown=\"Wysiwyg.htmledit('backcolor', false, '#66FFFF', '"+i+"');\"></td> ";
			ctrlObj += " 			<td width=\"11\" bgcolor=\"#006BD4\" onmousedown=\"Wysiwyg.htmledit('backcolor', false, '#006BD4', '"+i+"');\"></td> ";
			ctrlObj += " 			<td width=\"11\" bgcolor=\"#0087E1\" onmousedown=\"Wysiwyg.htmledit('backcolor', false, '#0087E1', '"+i+"');\"></td> ";
			ctrlObj += " 			<td width=\"11\" bgcolor=\"#37B7FE\" onmousedown=\"Wysiwyg.htmledit('backcolor', false, '#37B7FE', '"+i+"');\"></td> ";
			ctrlObj += " 			<td width=\"11\" bgcolor=\"#A7DEFE\" onmousedown=\"Wysiwyg.htmledit('backcolor', false, '#A7DEFE', '"+i+"');\"></td> ";
			ctrlObj += " 			<td width=\"11\" bgcolor=\"#FFCC00\" onmousedown=\"Wysiwyg.htmledit('backcolor', false, '#FFCC00', '"+i+"');\"></td> ";
			ctrlObj += " 			<td width=\"11\" bgcolor=\"#FFFF00\" onmousedown=\"Wysiwyg.htmledit('backcolor', false, '#FFFF00', '"+i+"');\"></td> ";
			ctrlObj += " 			<td width=\"11\" bgcolor=\"#FEFE9F\" onmousedown=\"Wysiwyg.htmledit('backcolor', false, '#FEFE9F', '"+i+"');\"></td> ";
			ctrlObj += " 			<td width=\"11\" bgcolor=\"#FEFED0\" onmousedown=\"Wysiwyg.htmledit('backcolor', false, '#FEFED0', '"+i+"');\"></td> ";
			ctrlObj += " 			</tr> ";
			ctrlObj += " 			<tr height=\"11\"> ";
			ctrlObj += " 			<td width=\"11\" bgcolor=\"#4E003D\" onmousedown=\"Wysiwyg.htmledit('backcolor', false, '#4E003D', '"+i+"');\"></td> ";
			ctrlObj += " 			<td width=\"11\" bgcolor=\"#6D2262\" onmousedown=\"Wysiwyg.htmledit('backcolor', false, '#6D2262', '"+i+"');\"></td> ";
			ctrlObj += " 			<td width=\"11\" bgcolor=\"#926594\" onmousedown=\"Wysiwyg.htmledit('backcolor', false, '#926594', '"+i+"');\"></td> ";
			ctrlObj += " 			<td width=\"11\" bgcolor=\"#C2A9C5\" onmousedown=\"Wysiwyg.htmledit('backcolor', false, '#C2A9C5', '"+i+"');\"></td> ";
			ctrlObj += " 			<td width=\"11\" bgcolor=\"#005557\" onmousedown=\"Wysiwyg.htmledit('backcolor', false, '#005557', '"+i+"');\"></td> ";
			ctrlObj += " 			<td width=\"11\" bgcolor=\"#03747B\" onmousedown=\"Wysiwyg.htmledit('backcolor', false, '#03747B', '"+i+"');\"></td> ";
			ctrlObj += " 			<td width=\"11\" bgcolor=\"#579D9F\" onmousedown=\"Wysiwyg.htmledit('backcolor', false, '#579D9F', '"+i+"');\"></td> ";
			ctrlObj += " 			<td width=\"11\" bgcolor=\"#A2C6CC\" onmousedown=\"Wysiwyg.htmledit('backcolor', false, '#A2C6CC', '"+i+"');\"></td> ";
			ctrlObj += " 			<td width=\"11\" bgcolor=\"#FF6600\" onmousedown=\"Wysiwyg.htmledit('backcolor', false, '#FF6600', '"+i+"');\"></td> ";
			ctrlObj += " 			<td width=\"11\" bgcolor=\"#FF9933\" onmousedown=\"Wysiwyg.htmledit('backcolor', false, '#FF9933', '"+i+"');\"></td> ";
			ctrlObj += " 			<td width=\"11\" bgcolor=\"#FECD8A\" onmousedown=\"Wysiwyg.htmledit('backcolor', false, '#FECD8A', '"+i+"');\"></td> ";
			ctrlObj += " 			<td width=\"11\" bgcolor=\"#FEE2B0\" onmousedown=\"Wysiwyg.htmledit('backcolor', false, '#FEE2B0', '"+i+"');\"></td> ";
			ctrlObj += " 			</tr> ";
			ctrlObj += " 			<tr height=\"11\"> ";
			ctrlObj += " 			<td width=\"11\" bgcolor=\"#1B0B73\" onmousedown=\"Wysiwyg.htmledit('backcolor', false, '#1B0B73', '"+i+"');\"></td> ";
			ctrlObj += " 			<td width=\"11\" bgcolor=\"#4C379D\" onmousedown=\"Wysiwyg.htmledit('backcolor', false, '#4C379D', '"+i+"');\"></td> ";
			ctrlObj += " 			<td width=\"11\" bgcolor=\"#876EBA\" onmousedown=\"Wysiwyg.htmledit('backcolor', false, '#876EBA', '"+i+"');\"></td> ";
			ctrlObj += " 			<td width=\"11\" bgcolor=\"#BBBAEF\" onmousedown=\"Wysiwyg.htmledit('backcolor', false, '#BBBAEF', '"+i+"');\"></td> ";
			ctrlObj += " 			<td width=\"11\" bgcolor=\"#008E37\" onmousedown=\"Wysiwyg.htmledit('backcolor', false, '#008E37', '"+i+"');\"></td> ";
			ctrlObj += " 			<td width=\"11\" bgcolor=\"#26B168\" onmousedown=\"Wysiwyg.htmledit('backcolor', false, '#26B168', '"+i+"');\"></td> ";
			ctrlObj += " 			<td width=\"11\" bgcolor=\"#47BE80\" onmousedown=\"Wysiwyg.htmledit('backcolor', false, '#47BE80', '"+i+"');\"></td> ";
			ctrlObj += " 			<td width=\"11\" bgcolor=\"#76D3A2\" onmousedown=\"Wysiwyg.htmledit('backcolor', false, '#76D3A2', '"+i+"');\"></td> ";
			ctrlObj += " 			<td width=\"11\" bgcolor=\"#B31C00\" onmousedown=\"Wysiwyg.htmledit('backcolor', false, '#B31C00', '"+i+"');\"></td> ";
			ctrlObj += " 			<td width=\"11\" bgcolor=\"#B03F21\" onmousedown=\"Wysiwyg.htmledit('backcolor', false, '#B03F21', '"+i+"');\"></td> ";
			ctrlObj += " 			<td width=\"11\" bgcolor=\"#AE623A\" onmousedown=\"Wysiwyg.htmledit('backcolor', false, '#AE623A', '"+i+"');\"></td> ";
			ctrlObj += " 			<td width=\"11\" bgcolor=\"#AC6E54\" onmousedown=\"Wysiwyg.htmledit('backcolor', false, '#AC6E54', '"+i+"');\"></td> ";
			ctrlObj += " 			</tr> ";
			ctrlObj += " 			<tr height=\"11\"> ";
			ctrlObj += " 			<td width=\"11\" bgcolor=\"#FEFEFE\" onmousedown=\"Wysiwyg.htmledit('backcolor', false, '#FEFEFE', '"+i+"');\"></td> ";
			ctrlObj += " 			<td width=\"11\" bgcolor=\"#E6E6E6\" onmousedown=\"Wysiwyg.htmledit('backcolor', false, '#E6E6E6', '"+i+"');\"></td> ";
			ctrlObj += " 			<td width=\"11\" bgcolor=\"#CDCDCD\" onmousedown=\"Wysiwyg.htmledit('backcolor', false, '#CDCDCD', '"+i+"');\"></td> ";
			ctrlObj += " 			<td width=\"11\" bgcolor=\"#B4B4B4\" onmousedown=\"Wysiwyg.htmledit('backcolor', false, '#B4B4B4', '"+i+"');\"></td> ";
			ctrlObj += " 			<td width=\"11\" bgcolor=\"#A8A8A8\" onmousedown=\"Wysiwyg.htmledit('backcolor', false, '#A8A8A8', '"+i+"');\"></td> ";
			ctrlObj += " 			<td width=\"11\" bgcolor=\"#8D8D8D\" onmousedown=\"Wysiwyg.htmledit('backcolor', false, '#8D8D8D', '"+i+"');\"></td> ";
			ctrlObj += " 			<td width=\"11\" bgcolor=\"#747474\" onmousedown=\"Wysiwyg.htmledit('backcolor', false, '#747474', '"+i+"');\"></td> ";
			ctrlObj += " 			<td width=\"11\" bgcolor=\"#595959\" onmousedown=\"Wysiwyg.htmledit('backcolor', false, '#595959', '"+i+"');\"></td> ";
			ctrlObj += " 			<td width=\"11\" bgcolor=\"#4B4B4B\" onmousedown=\"Wysiwyg.htmledit('backcolor', false, '#4B4B4B', '"+i+"');\"></td> ";
			ctrlObj += " 			<td width=\"11\" bgcolor=\"#303030\" onmousedown=\"Wysiwyg.htmledit('backcolor', false, '#303030', '"+i+"');\"></td> ";
			ctrlObj += " 			<td width=\"11\" bgcolor=\"#0A0A0A\" onmousedown=\"Wysiwyg.htmledit('backcolor', false, '#0A0A0A', '"+i+"');\"></td> ";
			ctrlObj += " 			<td width=\"11\" bgcolor=\"#000000\" onmousedown=\"Wysiwyg.htmledit('backcolor', false, '#000000', '"+i+"');\"></td> ";
			ctrlObj += " 			</tr> ";
			ctrlObj += " 			</table> ";
			ctrlObj += " 			</td> ";
			ctrlObj += " 		</table> ";
			ctrlObj += " 	</div> ";
			ctrlObj += " </td> ";
			ctrlObj += " </tr>";
			//ctrlObj += " <td align=\"right\"><a href=\"javascript:Wysiwyg.PreView('"+i+"')\"><img src=\"images/btn_preview.gif\" border=\"0\" align=\"right\"></a></td> ";
			ctrlObj += " </table> ";

			var tableObj = document.createElement("table");
			if(document.all){
				var trObj = tableObj.insertRow();
				var tdObj = trObj.insertCell();
				tableObj.setAttribute("cellSpacing","0");
				tableObj.setAttribute("cellSpacing","0");
				tableObj.setAttribute("border","0");
				tableObj.setAttribute("bgColor", "#EFECE3");

			}else{
				var trObj = document.createElement('tr'); 
				var tdObj = document.createElement('td');
				tableObj.setAttribute("cellSpacing","0");
				tableObj.setAttribute("cellSpacing","0");
				tableObj.setAttribute("border","0");
				tableObj.setAttribute("bgColor", "#EFECE3");

			}
				
			tableObj.setAttribute("id","td"+textareaName[i]);
			if(!document.all){
				trObj.appendChild(tdObj);
				tableObj.appendChild(trObj);
			}

			editorFrameObj.parentNode.insertBefore(tableObj,editorFrameObj);
			tdObj.innerHTML = ctrlObj;

			// html (¼Ò½ºº¸±â) ¸ðµå Ȱ¼ºÈ­
			if(document.getElementsByName(textareaName[i])[0].getAttribute("mode")=="html") {
				setTimeout("Wysiwyg.viewSource('iframe"+textareaName[i]+"', '"+textareaName[i]+"', "+i+")", 500);

			}
	
		}
	}




	/*-----------------------------------------------------------------------------------------------
	iframe ³»ÀÇ ÆíÁýÇÑ ³»¿ëÀ» parent textarea ·Î ÀÔ·Â  ¹× required ½Ã iframe ³» ÆíÁý ¿µ¿ª¿¡ Æ÷Ä¿½º À§Ä¡
	-------------------------------------------------------------------------------------------------*/
	this.submit_result		= function (num) {

		var iname	= 'iframe'+textareaName[num];
		var wname	= textareaName[num];

		var iframe_value	= eval(iname).document.body;
		var doc				= document.getElementById(wname);

		var required	= (doc.getAttribute("REQUIRED")!=null) ? doc.required : doc.getAttribute("REQUIRED");

		if(iframe_value.innerHTML.toLowerCase() == "&nbsp;<br>") iframe_value.innerHTML = '';
		if(iframe_value.innerHTML.toLowerCase() == "<p>&nbsp;</p>") iframe_value.innerHTML = '';

		/*-----------------------------
		<p></p>¸¦ <br>·Î º¯È¯ÇÏ´Â ÀÛ¾÷
		-----------------------------*/
		var iframe_value_arr1		= iframe_value.innerHTML.split('<P>');
		var iframe_value_result1	= iframe_value_arr1.join("");
		var iframe_value_arr2		= iframe_value_result1.split('</P>');
		var iframe_value_result2	= iframe_value_arr2.join('<br>');

		/*-----------------------------
		iframe°ªÀ» textarea·Î ¿Å±â´Â ÀÛ¾÷
		-----------------------------*/
		document.getElementById(wname).value	= iframe_value_result2;

		//## [Áß¿ä] ::<textarea name='content' type='editor' hname='³»¿ë' required nofocus></textarea> ó·³ 'nofocus'¸¦ ÇÔ²² ½áÁà¾ß ÇÑ´Ù!
		if(document.getElementById(iname).style.display=="none" && required != null) doc.focus(); // HTML ÆíÁýÀÎ °æ¿ì
		else if(iframe_value_result2=='' && required != null) eval(iname).focus(); // EDITOR ÆíÁýÀÎ °æ¿ì
		else return;
	}


	/*----------------------------------------------------------------------
	°æ°í¹®±¸ »Ñ·ÁÁÖ±â.
	À̾ȿ¡ div_submit_resultÇÔ¼ö ÀÖÀ½.
	----------------------------------------------------------------------*/
	this.submit_start	 = function () {
	
		for(var i=0; i<textareaName.length; i++) {

			var aa = Wysiwyg.submit_result(i);

			if(aa == false)
				return false;
		}

		return true;
	}
}

var Wysiwyg	= new wysiwyg_Class;

if(window.addEventListener) window.addEventListener("load", Wysiwyg.createELM, false);
else if(window.attachEvent) window.attachEvent("onload", Wysiwyg.createELM);



/*
var myRequest = new Ajax.Request(url, {
	method: 'get',
	onSuccess: function(transport) {
		if (!transport.responseText.match(null)) {
			//    .
		}
		myRequest = null;
	}
});
*/

OHA YOOOO