function stripHTMLtag(string) {
   var objStrip = new RegExp();
   objStrip = /[<][^>]*[>]/gi;   
   return string.replace(objStrip, "");
}

function Editinit(action)
{
	var cw = document.getElementById("HTMLEDITOR").contentWindow;
	var f = document.fm;
	var Mysource = "<style>P {margin-top:2px;margin-bottom:2px;}" + 
				   "body {padding:2px 4px; border-left:1px solid #43396b; border-right:1px solid #43396b; border-top:1x solid #43396b; border-bottom:0px; font-size:12px; overflow:auto; background-color:#110920; color:#615873;}" +//322054||93899d
				   "</style>";
	var content = f.content.value;

	cw.document.designMode="On";
	cw.document.open("text/html");

	if(action=='write') {
		cw.document.write(Mysource);
	} else {
		cw.document.write(Mysource+content);
	}
	cw.document.close();
	cw.document.body.style.fontFamily = "µ¸¿ò";
	cw.document.oncontextmenu = new Function("return false;");
	//cw.document.body.onpaste =  new Function("return false;");
	cw.document.body.ondrop =  new Function("return false;");
	//cw.document.focus();
	//cw.focus();
	f.title.focus();
}

function onReset()
{
	var f = document.fm;
	f.title.value="";
	HTMLEDITOR.document.body.innerHTML="";
	f.title.focus();
}
var isActiveflag=false;
function selectMyGameID(val){
	return false;
}
function sendit(action)
{
	Filecheck();

	var f = document.fm;

	if (isActiveflag==false)
	{	
		if (Check(f.title.value) < 1 )
		{
			f.title.focus();
			alert("Á¦¸ñÀ» ÀÔ·ÂÇÏ¼¼¿ä.");
			return;
		}

		if(f.title.value.indexOf("¡¡") != -1)
		{
			f.title.focus();
			alert("Æ¯¼ö¹®ÀÚÀÇ °ø¹éÀº »ç¿ëÇÏ½Ç ¼ö ¾ø½À´Ï´Ù.");
			return;
		}		

		if(get_strlen(f.title.value) > 100)
		{
			alert("Á¦¸ñÀº ÇÑ±Û ±âÁØ 50ÀÚ ÀÌ»ó ÀÔ·ÂÇÏ½Ç ¼ö ¾ø½À´Ï´Ù.");
			f.title.value = cutStr(f.title.value, 100);
			f.title.focus();
			return;
		}
		if (HTMLEDITOR.document.body.innerHTML == '')
		{
			alert('³»¿ëÀ» ÀÔ·ÂÇØ ÁÖ¼¼¿ä');
			HTMLEDITOR.focus();
			return;
		}
		
		f.content.value = GetSource_pasteUse();
		temp = document.createElement("TEXTAREA");
		temp.name = "contents";
		temp.value = f.content.value;
		temp.style.display = 'none';
		f.appendChild(temp);

		// ÆÄÀÏÀÌ¸§, ÆÄÀÏ¿ë·®, ÆÄÀÏÅ°,ÀÌ¹ÌÁö °¡·Î°ª, ÀÌ¹ÌÁö ¼¼·Î°ª, ¸ÖÆ¼¹Ìµð¾î¼Ò½º°æ·Î, ¸ÖÆ¼¹Ìµð¾î¿øº»°æ·Î  µéÀ» ÃÊ±âÈ­ÇÑ´Ù.
		f.fileIdxs.value = ""
		f.fileNames.value = ""
		f.fileSizes.value = ""
		f.fileKeys.value = ""
		f.fileWidths.value = ""
		f.fileHeights.value = ""
		f.fileStatus.value = ""
		f.mediaIdxs.value = ""
		f.linkUrls.value = ""
		f.originalSiteUrls.value = ""
		f.multimediaStatus.value = ""
		
		// ÆÄÀÏÀÌ¸§, ÆÄÀÏ¿ë·®, ÆÄÀÏÅ°,ÀÌ¹ÌÁö °¡·Î°ª, ÀÌ¹ÌÁö ¼¼·Î°ª, ¸ÖÆ¼¹Ìµð¾î¼Ò½º°æ·Î, ¸ÖÆ¼¹Ìµð¾î¿øº»°æ·Î µéÀ»
		// ´ÙÀ½ ÆÄÀÏ¿¡¼­ ¹Þ±â À§ÇØ ÀúÀåÇÑ´Ù.
		// ÆÄÀÏÀÌ ¿©·¯°³ÀÏ¶§ @#·Î ±¸ºÐÇÑ´Ù.


		for (i=1;i<f.fileNameList.options.length;i++)
		{
			f.fileIdxs.value += f.fileIdxList.options[i].value+"@#";
			f.fileNames.value += f.fileNameList.options[i].value+"@#";
			f.fileSizes.value += f.fileSizeList.options[i].value+"@#";
			f.fileKeys.value += f.fileKeyList.options[i].value+"@#";
			f.fileWidths.value += f.fileWidthList.options[i].value+"@#";
			f.fileHeights.value += f.fileHeightList.options[i].value+"@#";
			f.fileStatus.value += f.fileStatusList.options[i].value+"@#";
		}

		if(action == "image"){
			if (f.fileNames.value == "")
			{
				alert("ÀÌ¹ÌÁö °Ô½ÃÆÇÀº ÀÌ¹ÌÁö¸¦ Ã·ºÎÇÏ¿© ÁÖ¼Å¾ß µî·ÏÀÌ °¡´ÉÇÕ´Ï´Ù.");
				return;
			}
		}
		
		if(action == "strategy" || action == "strategy_edit"){
			checkFlag = false;
			
			for(i=0; i<f.contentKindIdx_1.length; i++){
				if(f.contentKindIdx_1[i].checked && f.contentKindIdx_1[i].value != -1){
					checkFlag = true;
				}				
			}
			for(i=0; i<f.contentKindIdx_2.length; i++){
				if(f.contentKindIdx_2[i].checked && f.contentKindIdx_2[i].value != -1){
					checkFlag = true;
				}
			}
			if(!checkFlag){
				alert("Ä«Å×°í¸®¸¦ ¼±ÅÃÇØÁÖ¼¼¿ä.");
				return;
			}
		}
		
		if(action == "image_edit")
		{
			checknum_new = f.fileStatus.value.indexOf("NEW");
			checknum_db = f.fileStatus.value.indexOf("DB");
					
			if(checknum_new == -1 && checknum_db == -1)
			{
				alert("ÀÌ¹ÌÁö °Ô½ÃÆÇÀº ÀÌ¹ÌÁö¸¦ Ã·ºÎÇÏ¿© ÁÖ¼Å¾ß µî·ÏÀÌ °¡´ÉÇÕ´Ï´Ù.");
				return;
			}
		}

		
		for (i=1;i<f.urllist.options.length;i++)
		{
			f.mediaIdxs.value += f.mediaIdxList.options[i].value+"@#";
			f.linkUrls.value += f.urllist.options[i].value+"@#";
			if(get_strlen(f.hometownlist.options[i].value) != 0) {
				f.originalSiteUrls.value += f.hometownlist.options[i].value+"@#";
			} else {
				f.originalSiteUrls.value += " @#";
			}
			f.multimediaStatus.value += f.multimediaList.options[i].value+"@#";
		}

		if(f.scrapYN.checked){
			f.scrapYN.value = "Y";
		}else{
			f.scrapYN.value = "N";
		}

		isActiveflag = true;

		f.method = 'post';
		/*
		alert(f.fileNames.value);
		alert(f.fileSizes.value);
		alert(f.fileKeys.value);
		alert(f.fileWidths.value);
		alert(f.fileHeights.value);
		alert(f.linkUrls.value);
		alert(f.originalSiteUrls.value);
		*/

		if(action == "write" || action == "image" || action == "strategy")  {
			f.action = gamePath + "/ArticleInsert.do";
		} else {
			f.action = gamePath + "/ArticleEdit.do";
		}
		
		f.submit();
	}
	else
	{
		alert("µî·ÏÁßÀÔ´Ï´Ù. Àá½Ã¸¸ ±â´Ù¸®¼¼¿ä");
		return;
	}
}




function Filecheck() {

	var deloptionIDX = '';
	var deloptionIDX_url = '';
	var Contentstr = HTMLEDITOR.document.body.innerHTML;
	var f = document.fm;
	
	if(f.fileNameList.length>1) { //Ã·ºÎÆÄÀÏÀÌ Á¸ÀçÇÏ¸é °Ë»ç
		for(var i=f.fileNameList.length-1;i>0;i--) {
			Filepath = f.fileNameList[i].value;

			if(Filepath!=-1) {

				var cutan = Domain_UImage.indexOf('/an');
				Filepath = Domain_UImage.substring(0, cutan) +"/"+ f.fileNameList[i].value;
				checknum = Contentstr.indexOf(Filepath);
				if(checknum==-1) { //Ã·ºÎÆÄÀÏÀÌ º»¹®¿¡ Á¸ÀçÇÏÁö¾Ê´Â´Ù¸é option »èÁ¦

					if(f.fileStatusList[i].value == "NEW") {

						f.fileIdxList.remove(i);	
						f.fileNameList.remove(i);	
						f.fileKeyList.remove(i);				
						f.fileSizeList.remove(i);
						f.fileWidthList.remove(i);
						f.fileHeightList.remove(i);		
						f.fileStatusList.remove(i);		
						
					} else if(f.fileStatusList[i].value == "DB") {
						
						f.fileStatusList[i].value = "REMOVE";
						f.fileStatusList[i].text = "REMOVE";
					}
				}
			}
		}

		var attachsize = 0;
		for(t=0;t<f.fileSizeList.length;t++) {
			attachsize += parseInt(Math.round(f.fileSizeList[t].value/1024));
		}
		f.filesSize.value=attachsize;
	}

	if(f.urllist.length>1) { //¸ÖÆ¼¹Ìµð¾î °É±â°¡ Á¸ÀçÇÏ¸é °Ë»ç
		for(var i=f.urllist.length-1;i>0;i--) {
			Filepath = f.urllist[i].value;
			if(Filepath!=-1) {
				Filepath = f.urllist[i].value;
				
				checknum = Contentstr.indexOf(Filepath);
				if(checknum==-1) { //Ã·ºÎÆÄÀÏÀÌ º»¹®¿¡ Á¸ÀçÇÏÁö¾Ê´Â´Ù¸é option »èÁ¦

					if(f.multimediaList[i].value == "NEW") {
						f.mediaIdxList.remove(i);
						f.urllist.remove(i);
						f.hometownlist.remove(i);
						f.multimediaList.remove(i);
						
					} else if(f.multimediaList[i].value == "DB") {
						f.multimediaList[i].value = "REMOVE";
						f.multimediaList[i].text = "REMOVE";
					}
				}
			}
		}
	}
	return true;
}





function GetSource()
{
	var backcolor = HTMLEDITOR.document.body.style.backgroundColor;
	var obj = HTMLEDITOR.document.all["backcolor"];
	var HTMLSOURCE = '';

	if (HTMLEDITOR.document.body.innerHTML == '')
	{
		alert('³»¿ëÀ» ÀÔ·ÂÇØÁÖ¼¼¿ä');
		HTMLEDITOR.focus();
		return;
	}
	if (backcolor.length == 0 || obj != null)
		HTMLSOURCE = HTMLEDITOR.document.body.innerHTML;
	else
		HTMLSOURCE = "<div id='backcolor' style='background-color:" + backcolor + "'>" + HTMLEDITOR.document.body.innerHTML + "</div>";
	return HTMLSOURCE;
}

function Check(keyword)
{
	var st_num, key_len;
	st_num = keyword.indexOf(" ");
	while (st_num != -1)
	{
		keyword = keyword.replace(" ", "");
		st_num  = keyword.indexOf(" ");
	}
	key_len=keyword.length;
	return key_len;
}

function get_strlen(str)
{
    var i, l = 0;
    for (i = 0; i < str.length; i++)
    {
      var n = str.charCodeAt(i);
      if ( (n >= 0)  && (n < 256) )
        l += 1;
      else
        l += 2;
    }
    return l;
}


function AttachMultimedia() {
	var f = document.fm;
	var _AttachMultiWin = window.open (gamePath + "/MediaInsertForm.do?bbsidx="+f.bbsidx.value,"_AttachMultimedia","width=360,height=280,status=yes");
	_AttachMultiWin.focus();
}



function AddOptionURL(StrURL,StrHomeTown)
{
	var f = document.fm;

	var new_option = new Option("-1", "-1");
	f.mediaIdxList.options[f.mediaIdxList.options.length] = new_option;
	
	new_option = new Option(StrURL,StrURL);
	f.urllist.options[f.urllist.options.length] = new_option;
	
	new_option = new Option(StrHomeTown,StrHomeTown);
	f.hometownlist.options[f.hometownlist.options.length] = new_option;

	new_option = new Option("NEW", "NEW");
	f.multimediaList.options[f.multimediaList.options.length] = new_option;
	
	var MySelect = HTMLEDITOR.document.selection.createRange();
	if (MySelect.parentElement().all.HTMLEDITOR != null){
		HTMLEDITOR.focus();
		MySelect = HTMLEDITOR.document.selection.createRange();
	}

	strFiletype = StrURL.substr(StrURL.length-3,StrURL.length);
	strFiletype = strFiletype.toUpperCase();
	if(strFiletype=="GIF"||strFiletype=="JPG") {
		c = "<center><div class='image'><img src='"+StrURL+"'></div></center>";
	} else {
		//c='<center><embed src='+StrURL+' width=290 Height=220></center>';
		c='<center><embed src='+StrURL+' width=460 Height=389></center>';
	}

	MySelect.pasteHTML(c);
}

function setEmoticon(E) {
	var MySelect = HTMLEDITOR.document.selection.createRange();
	if (MySelect.parentElement().all.HTMLEDITOR == null){
		MySelect.pasteHTML ("<img src='"+Domain_WWW+"/img/ico/ico_emoticon_"+E+".gif'>")
	} else {
		HTMLEDITOR.focus();
		MySelect = HTMLEDITOR.document.selection.createRange();
		MySelect.pasteHTML("<img src='"+Domain_WWW+"/img/ico/ico_emoticon_"+E+".gif'>")
	}
	HTMLEDITOR.focus();
}






function SetClipBoardData(StrText)
{
	window.clipboardData.setData('Text',StrText);
	alert("URLÀÌ º¹»çµÇ¾ú½À´Ï´Ù.\nºÙ¿©³Ö±â(Ctrl+V)¸¦ ÀÌ¿ëÇÏ¿© URLÀ» º¹»çÇÏ¼¼¿ä.");
}


function AttachImage() {
	Filecheck();
	var f = document.fm;
	
	if(parseInt(f.filesSize.value) >= 2048) {
		alert("Ã·ºÎÇÒ ¼ö ÀÖ´Â ÆÄÀÏ ¿ë·®ÀÇ ÃÑÇÕÀº 2MB ¹Ì¸¸ÀÔ´Ï´Ù.");
		return;
	} else {
		var _AttachImgWin = window.open (gamePath + "/AttachFileInsertForm.do?bbsidx="+f.bbsidx.value+"&filesSize="+f.filesSize.value, "_AttachImage", "width=360,height=280,status=yes");

		_AttachImgWin.focus();
	}
}




function setFile(status, fileSize, fileName, key, width, height) {
	FileExistCheck(key);
	
	var f = document.fm;
	
	if(status == -1) {
		alert("ÆÄÀÏ ¿ë·®(2M)À» ÃÊ°úÇÏ¿´½À´Ï´Ù.");
		return;
	} else if(status == -2) {
		alert("ÀÌ¹ÌÁö Çü½Ä(jpg,gif,bmp,png)ÀÌ ¾Æ´Õ´Ï´Ù.");
		return;
	
	} else if(status == -99) {
		alert("ÆÄÀÏ ¾÷·Îµå¿¡ ½ÇÆÐÇÏ¿´½À´Ï´Ù.");
		return;
	}
	
	var iWidth = "";
	var iHeight = height;

	if(width>532){
		iHeight/=width/532;
		iWidth=532;
	}else{
			iHeight=height;
			iWidth=width
	}

	var MySelect = HTMLEDITOR.document.selection.createRange();

	if (MySelect.parentElement().all.HTMLEDITOR != undefined){
		HTMLEDITOR.focus();
		MySelect = HTMLEDITOR.document.selection.createRange();
	}

	var cutan = Domain_UImage.indexOf('/an');

//	MySelect.pasteHTML("<center><div class='image'><img src='"+Domain_UImage.substring(0, cutan)+fileName+"' width="+iWidth+" height="+height+" onclick='ImagePreview(this.src, this.width, this.height)' style='cursor:hand'></div></center>");
//	MySelect.pasteHTML("<center><img src='"+Domain_UImage.substring(0, cutan)+"/"+fileName+"' width="+iWidth+" height="+iHeight+" onclick='ImagePreview(this.src, "+width+", "+height+")' style='cursor:hand'></center>");
	MySelect.pasteHTML("<center><img src='" + Domain_UImage + "/" + fileName + "' width=" + iWidth + " height=" + iHeight + " onclick='ImagePreview(this.src, "+width+", "+height+")' style='cursor:hand' name='JCEImgUpload'></center>");


	f.filesSize.value = parseInt(f.filesSize.value)+parseInt(Math.round(fileSize/1024));
	
	var newOption = new Option("-1", "-1");
	f.fileIdxList.options[f.fileIdxList.options.length] = newOption;	
		
	newOption = new Option(fileName, fileName);
	f.fileNameList.options[f.fileNameList.options.length] = newOption;	
	
	newOption = new Option(key, key);
	f.fileKeyList.options[f.fileKeyList.options.length] = newOption;	
		
	newOption = new Option(width, width);
	f.fileWidthList.options[f.fileWidthList.options.length] = newOption;	

	newOption = new Option(height, height);
	f.fileHeightList.options[f.fileHeightList.options.length] = newOption;	
					
	newOption = new Option(""+fileSize, ""+fileSize);
	f.fileSizeList.options[f.fileSizeList.options.length] = newOption;	
	
	newOption = new Option("NEW", "NEW");
	f.fileStatusList.options[f.fileStatusList.options.length] = newOption;	
	
	HTMLEDITOR.focus();
}


function FileExistCheck(key) {

	var deloptionIDX = '';
	var deloptionIDX_url = '';
	var Contentstr = HTMLEDITOR.document.body.innerHTML;
	var f = document.fm;
	
	if(f.fileNameList.length > 1) { //Ã·ºÎÆÄÀÏÀÌ Á¸ÀçÇÏ¸é °Ë»ç
		for(var i=f.fileNameList.length-1; i>0 ;i--) {
			fileName = f.fileNameList[i].value;
		
			if(fileName != -1) {
				var cutan = Domain_UImage.indexOf('/an');
				Filepath = Domain_UImage.substring(0, cutan) +"/"+ f.fileNameList[i].value;

				Filepath = Filepath.replace("&", "&amp;");

				checknum = Contentstr.indexOf(Filepath);

				if(checknum==-1) { //Ã·ºÎÆÄÀÏÀÌ º»¹®¿¡ Á¸ÀçÇÏÁö¾Ê´Â´Ù¸é option »èÁ¦
					
					if(f.fileStatusList[i].value == "NEW") {
						f.fileIdxList.remove(i);
						f.fileNameList.remove(i);	
						f.fileKeyList.remove(i);				
						f.fileSizeList.remove(i);
						f.fileWidthList.remove(i);
						f.fileHeightList.remove(i);		
						f.fileStatusList.remove(i);		
						
					} else if(f.fileStatusList[i].value == "DB") {
						f.fileStatusList[i].value = "REMOVE";
						f.fileStatusList[i].text = "REMOVE";
					}
					
				}				
			}
		}
		
		var attachFileSize = 0;
		for(t=0;t<f.fileSizeList.length;t++) {
			attachFileSize += parseInt(Math.round(f.fileSizeList[t].value/1024));
		}
		f.filesSize.value = attachFileSize;		
	}
}


function cutStr(str,limit){
	var tmpStr = str;
	var byte_count = 0;
	var len = str.length;
	var dot = "";

	for(i=0; i<len; i++){
		byte_count += chr_byte(str.charAt(i)); 
		if(byte_count == limit-1){
			if(chr_byte(str.charAt(i+1)) == 2){
				tmpStr = str.substring(0,i+1);
				dot = "...";
			}else {
				if(i+2 != len) dot = "...";
				tmpStr = str.substring(0,i+2);
			}
			break;
		}else if(byte_count == limit){
			if(i+1 != len) dot = "...";
			tmpStr = str.substring(0,i+1);
			break;
		}
	}
	return tmpStr;
}

function chr_byte(chr){
	if(escape(chr).length > 4)
		return 2;
	else
		return 1;
}

function GetSource_pasteUse()
{
	var backcolor = HTMLEDITOR.document.body.style.backgroundColor;
	var obj = HTMLEDITOR.document.all["backcolor"];
	var HTMLSOURCE = '';
	var div = document.createElement('div');

			var tagName=new Array;

				tagName[0] = 'script';
				tagName[1] = 'body';
				tagName[2] = 'link';
				tagName[3] = 'style';
				tagName[4] = 'applet';
				tagName[5] = 'noscript';
				tagName[6] = 'iframe';
				tagName[7] = 'frameset';
				tagName[8] = 'frame';
				tagName[9] = 'html';
				tagName[10] = 'head';
				tagName[11] = 'title';
				tagName[12] = 'meta';

			var actionTagName = new Array;

				actionTagName[0] = 'a';
				actionTagName[1] = 'div';
				actionTagName[2] = 'span';
				actionTagName[3] = 'table';
				actionTagName[4] = 'tr';
				actionTagName[5] = 'td';
				actionTagName[6] = 'img';
				actionTagName[7] = 'p';
				actionTagName[8] = 'th';
				actionTagName[9] = 'h1';
				actionTagName[10] = 'h2';
				actionTagName[11] = 'h3';
				actionTagName[12] = 'h4';
				actionTagName[13] = 'h5';
				actionTagName[14] = 'h6';
				actionTagName[15] = 'ul';
				actionTagName[16] = 'dl';
				actionTagName[17] = 'ol';
				actionTagName[18] = 'dt';
				actionTagName[19] = 'dd';
				actionTagName[20] = 'li';
				actionTagName[21] = 'input';
				actionTagName[22] = 'form';
				actionTagName[23] = 'hr';
				actionTagName[24] = 'strong';
				actionTagName[25] = 'b';
				actionTagName[26] = 'em';
				actionTagName[27] = 'center';
				actionTagName[28] = 'strike';
				actionTagName[29] = 'del';
				actionTagName[30] = 'u';
				actionTagName[31] = 'map';
				actionTagName[32] = 'textarea';
				actionTagName[33] = 'select';
				actionTagName[34] = 'option';
				actionTagName[35] = 'area';
				actionTagName[36] = 'object';
				actionTagName[37] = 'embed';

			var attName = new Array;

				attName[0] = 'onclick';
				attName[1] = 'onmouseover';
				attName[2] = 'onmouseout';
				attName[3] = 'style';
				attName[4] = 'onfocus';
				attName[5] = 'onload';
				attName[6] = 'onkeydown';
				attName[7] = 'onkeyup';
				attName[8] = 'onDragDrop';
				attName[9] = 'onAbort';
				attName[10] = 'onChange';
				attName[11] = 'ondblclick';
				attName[12] = 'onError';
				attName[13] = 'onSubmit';
				attName[14] = 'onKeyPress';
				attName[15] = 'onBlur';
				attName[16] = 'onMouseDown';
				attName[17] = 'onMouseMove';
				attName[18] = 'onMouseUp';
				attName[19] = 'onMove';
				attName[20] = 'onReset';
				attName[21] = 'onResize';
				attName[22] = 'onSelect';
				attName[23] = 'id';
				attName[24] = 'class';
				attName[25] = 'className';
				attName[26] = 'rel';
				attName[27] = 'action';
				
			div.innerHTML = HTMLEDITOR.document.body.innerHTML;

			for(var i=0; i<tagName.length; i++){
				var list = div.getElementsByTagName(tagName[i]);
				var length = list.length;

				for(var j=0; j < length; j++) {
						list[0].parentNode.removeChild(list[0]);
				}
			}


			for(var k=0; k<actionTagName.length; k++){
				var list = div.getElementsByTagName(actionTagName[k]);

				for(var l=0; l<list.length; l++){
					for(var m=0; m<attName.length; m++){
						if(list[l].getAttribute('name',0) != 'JCEImgUpload'){
							list[l].removeAttribute(attName[m],0);
						}
					}
					if(list[l].href) {
						if(list[l].href.indexOf('javascript:') >= 0) {
							//list[l].href = '#';
							list[l].href = Domain_WWW;
						}
					}
				}
			}
			
		if (backcolor.length == 0 || obj != null)
    		HTMLSOURCE = div.innerHTML;
    	else
    		//HTMLSOURCE = "<div id='backcolor' style='background-color:" + backcolor + "'><STYLE> {MARGIN-TOP: 1px; MARGIN-BOTTOM: 1px}</STYLE>\n" + div.innerHTML + "</div>";
    		HTMLSOURCE = "<div id='backcolor' style='background-color:'><STYLE> {MARGIN-TOP: 1px; MARGIN-BOTTOM: 1px}</STYLE>\n" + div.innerHTML + "</div>";
    		
		HTMLSOURCE = HTMLSOURCE.replace(/<FORM/gi, '&lt;FORM');
		HTMLSOURCE = HTMLSOURCE.replace(/<\/FORM/gi, '&lt;/FORM');
		HTMLSOURCE = HTMLSOURCE.replace(/<INPUT/gi, '&lt;INPUT');

	return HTMLSOURCE;
}
function currentID() {
	var _currentID = window.open(Domain_CONT + "/weblevels/avatar.do", "_currentID", "width=500,height=300,status=yes");
	_currentID.focus();
}
