var xgAllHA = new Array();var _waitingObject =null;var _waitingHTML = null;var _waittimer	= null;function xgHTMLAreaClasses(){	this.separator				="xg_ha_separator";	this.toolbar					="xg_ha_toolbar";	this.button						="xg_ha_button";	this.buttonOver				="xg_ha_button_over";	this.toolbars					="xg_ha_toolbars";	this.surface						="xg_ha_surface";	this.backgroundSurface = "xg_ha_backgroundsurface";}function xgHTMLArea(){	this.dLeft						=0;	this.dTop						=0;	this.dWidth					=100;	this.dHeight					=100;	this._headerHeight		=0;	this.ParentObject			=document.body;	this._parentObject		="";	this.createHeader			=xgHA_createHeader;	this.createToolbar		=xgHA_createToolbar;	this.createFormatToolBar = xgHA_createFormatToolBar;	this.Draw						=xgHA_draw;	this.allowFormating			=true;	this.allowInsertObjects	=true;	this.allowTemplates			=true;	this.allowCutCopyPaste	=true;	this.allowUndoRedo			=true;	this.toolbarFont				=new Array("Lucida","Lucida Grande","Arial","Verdana","Tahoma","Helvetica");	this.fontFormats				=new Array("label_title","label","label_white");	this.toolbar1Buttons		=new Array("cut","copy","paste","s","bold","italic","underline","strike","s","sup","sub","s","undo","redo","s","align_left","align_center","align_right",		"align_justify","s","inc_ident","dec_ident","s","list_num","list_bullet",		"s","remove_format","remove_tags","select_all","s");	this.toolbar2Buttons		= null;	this.toolbar3Buttons = new Array("source","maximize","s");	this.classes					=new xgHTMLAreaClasses;	this._resizeToolbars	=xgHA_resizeToolbars;	this._resizeEditor			 = xgHA_resizeEditor;	this.pasteHTML				=xgHA_pasteHTML;	this.getSelectedHTML       =xgHA_getSelectedHTML;	this.getSelectedImage		=xgHA_getSelectedImage;	this.executeAction			=xgHA_executeAction;	this.maximizeEditor		=xgHA_maximizeEditor;	this.isMaximized				=false;	this._alignObject				=xgHA_alignObject;	this._modifyObject			=xgHA_modifyObject;	this.onInsertTemplate		=xgHA_onInsertTemplate;	this.onInsertLink				=xgHA_onInsertLink;	this.onInsertPicture			= xgHA_onInsertPicture;	this.onInsertMovie			=xgHA_onInsertMovie;	this.onInsertReport			=xgHA_onInsertReport;	this.onInsertEmbeded		=xgHA_onInsertEmbeded;	this.onInsertMusic			=xgHA_onInsertMusic;	this.onEditPicture				=xgHA_onEditPicture;	this.onInsertChars = xgHA_onInsertSpecialChars;	this.onInsertTable			=xgHA_onInsertTable;	this.onInsertEmoticons = xgHA_onInsertEmoticons;		this._hidePopups				= xgHA_hidePopups;	this._createFontPopup	= _createFontPopup;	this._createFontSizePopup = _createFontSizePopup;	this._createFormatPopup = _createFormatPopup;	this._createColorPopup		=_createColorPopup;		this.save									=xgHA_save;		this.ObjectIndex = xgAllHA.length;	xgAllHA[xgAllHA.length]=this;}function xgHA_draw(left,top,width,height){	// revalid			this.toolbar2Buttons = new Array();		//new Array("color_bg","color_fg","s","hr","s","link","rlink","anchor","s","image","table","emo","chars","s","template","s");		var k=0;		this.toolbar2Buttons[k] = "color_bg";k++;		this.toolbar2Buttons[k] = "color_fg";k++;		this.toolbar2Buttons[k] = "s";k++;		if (this.allowInsertObjects){			this.toolbar2Buttons[k] = "hr";k++;			this.toolbar2Buttons[k] = "s";k++;			this.toolbar2Buttons[k] = "link";k++;			this.toolbar2Buttons[k] = "rlink";k++;	//		this.toolbar2Buttons[k] = "anchor";k++;			this.toolbar2Buttons[k]="s";k++;	//		this.toolbar2Buttons[k]="table";k++;this.toolbar2Buttons[k]="emo";k++;this.toolbar2Buttons[k]="chars";k++;	//		this.toolbar2Buttons[k]="s";k++;			this.toolbar2Buttons[k]="image";k++;			this.toolbar2Buttons[k]="movie";k++;			this.toolbar2Buttons[k]="report";k++;			this.toolbar2Buttons[k]="embeded";k++;			this.toolbar2Buttons[k]="music";k++;			this.toolbar2Buttons[k]="s";k++;		}		this.toolbar2Buttons[k] = "edit_picture";k++;		this.toolbar2Buttons[k]="border";k++;		this.toolbar2Buttons[k] ="s";k++;		this.ParentObject.className = this.classes.surface;		var _po = document.createElement("DIV");		_po.style.position = "absolute";		_po.style.left = xg.util.getLeft(this.ParentObject); 		_po.style.top = xg.util.getTop(this.ParentObject) ; _po.style.width = this.ParentObject.offsetWidth; _po.style.height = this.ParentObject.offsetHeight;		_po.className = this.classes.backgroundSurface;		document.body.appendChild(_po);		this._parentObject = _po;				this.createHeader();		var _editfrm = document.createElement("IFRAME");		_editfrm.style.position = "absolute";_editfrm.style.left = 0; _editfrm.style.top=0;		_editfrm.frameBorder=0;		this._parentObject.appendChild(_editfrm);		var _textarea = document.createElement("TEXTAREA");		_textarea.style.position = "absolute";_textarea.style.left = 0; _textarea.style.top = 0; 		this._textarea = _textarea;		this._parentObject.appendChild(_textarea);		_textarea.style.zIndex = 2000;		_textarea.style.visibility = "hidden";			_editfrm.src = xg.coreLocation+"xg-htmlarea.htm";			if (xg.browser.sName == "ie"){			try{			_editfrm.contentWindow.document.designMode = "on";			}catch(e){			}		}else{			_editfrm.contentDocument.designMode = "on";			_editfrm.contentDocument.body.contentEditable = true;		}				this._editor = _editfrm;		this._resizeEditor();		var _txtha = this;		window.onresize = function(){			_editfrm.style.width = parseInt(_editfrm.style.width);	}						this._trange = null;		_editfrm.onload = function(){			if (xg.browser.sName != "ie"){				_editfrm.contentDocument.designMode = "on";				_editfrm.contentDocument.body.contentEditable = true;			}			//paste content html			var ta = document.getElementById(_txtha.ParentObject.id+"_textarea");			_txtha.pasteHTML(reformatText(ta.value));		}			try{		_editfrm.contentWindow.document.onkeyup = function(){					_txtha._trange = _editfrm.contentWindow.document.selection.createRange();		}				_editfrm.contentWindow.document.onmouseup = function(){			_txtha._trange = _editfrm.contentWindow.document.selection.createRange();			_txtha._hidePopups();		}	}catch(E){			}				_editfrm.onblur = function(){//			_txtha._trange = _editfrm.contentWindow.document.selection.createRange();//			alert(_txtha._trange.text);		//	_txtha._trange.select();			_txtha._hidePopups();		}		if (xg.browser.sName == "ie"){				var ta =document.getElementById(_txtha.ParentObject.id+"_textarea");				ta.value = reformatText(ta.value);				_txtha.pasteHTML(ta.value);		}}function xgHA_createHeader(){	this._headerHeight = 50;	//creating surface	var _surface = document.createElement("DIV");	_surface.style.position = "absolute";	_surface.style.left = 0;	_surface.className = this.classes.toolbars;	_surface.unselectable = "on";	_surface.style.backgroundImage = "url('"+xg.coreLocation+"/imgs/htmlarea/bg_header.png')";	this._parentObject.appendChild(_surface);	this._toolbars = _surface;	this._resizeToolbars();	//creating first toolbar	var tb1 = this.createToolbar(this.toolbar1Buttons);	var tb2 = this.createToolbar(this.toolbar2Buttons);	var tb3 = this.createToolbar(this.toolbar3Buttons);	if (this.allowFormating){	var tb_font = this.createFormatToolBar();	}	this._tb1 = tb1;	this._tb2 = tb2;	this._tb3 = tb3;	if (this.allowFormating){		tb_font.style.position = "absolute";		tb_font.style.left = tb2.offsetWidth;		tb_font.style.top = tb1.offsetHeight;	}	tb3.style.position = "absolute";	tb3.style.left = this._parentObject.offsetWidth - tb3.offsetWidth-2;	tb3.style.top = this._headerHeight - tb3.offsetHeight;	if (xg.browser.sName != "ie"){		tb3.style.left = this._parentObject.offsetWidth-tb3.offsetWidth;		tb3.style.top = this._headerHeight - tb3.offsetHeight-2;	}}function xgHA_createFormatToolBar(){	var _tb = document.createElement("DIV");	_tb.style.position = "absolute";	_tb.style.height = 25;	_tb.style.backgroundImage = "url('"+xg.coreLocation+"/imgs/htmlarea/toolbar.bg.gif')";	var th = "<table UNSELECTABLE='on' border='0' cellspacing='2' cellpadding='0' height='100%'>";	th+="<tr>";	th+="<td UNSELECTABLE='on' class='xg_ha_button'>Font </td>";	th+="<td UNSELECTABLE='on' class='xg_ha_button'><div id='_f_font' UNSELECTABLE='on' style='border:solid silver 1px;width:20px;height:18px;'>"+		"<img UNSELECTABLE='on' style='position:relative;left:5px;top:5px;' src='"+xg.coreLocation+"/imgs/htmlarea/toolbar.expand.gif' border='0'/>"+"</div></td>";	th+="<td UNSELECTABLE='on' class='xg_ha_button'>M&atilde;rime</td>";	th+="<td UNSELECTABLE='on' class='xg_ha_button'><div id='_f_size' UNSELECTABLE='on' style='border:solid silver 1px;width:20px;height:18px;'>"+		"<img UNSELECTABLE='on' style='position:relative;left:5px;top:5px;' src='"+xg.coreLocation+"/imgs/htmlarea/toolbar.expand.gif' border='0'/>"+"</div></td>";	th+="</tr>";	th+="</table>";	_tb.innerHTML = th;	_tb.unselectable = "on";	_tb.onselectstart = function(){return false;}	this._toolbars.appendChild(_tb);	var tfont = document.getElementById("_f_font");	var tsize = document.getElementById("_f_size");	var _fontPopup = this._createFontPopup();	var _formatPopup = this._createFormatPopup();	var _fontSizePopup = this._createFontSizePopup();	var _colorPopup	= this._createColorPopup();			this._fontPopup = _fontPopup;	this._formatPopup = _formatPopup;	this._fontSizePopup = _fontSizePopup;	this._colorPopup = _colorPopup;	var _top = xg.util.getTop(this._parentObject);	var _left = xg.util.getLeft(this._parentObject);	tfont.onmouseover = function(){ this.style.border = 'solid black 1px';}	tfont.onmouseout = function(){ this.style.border = 'solid silver 1px';}	tfont.onclick = function(){			_fontPopup.style.left = xg.util.getLeft(tfont)-100-_left;			_fontPopup.style.top = xg.util.getTop(tfont)-_top+20-8;			if (_fontPopup.style.visibility == "visible"){				_fontPopup.style.visibility = "hidden";				return;			}			_formatPopup.style.visibility = "hidden";			_fontPopup.style.visibility = "visible";			_fontSizePopup.style.visibility = "hidden";	}	tsize.onmouseover = function(){ this.style.border = 'solid black 1px';}	tsize.onmouseout = function(){ this.style.border = 'solid silver 1px';}	tsize.onclick = function(){			_fontSizePopup.style.left = xg.util.getLeft(tsize)-8-_left;			_fontSizePopup.style.top = xg.util.getTop(tsize)-_top+20-8;			if (_fontSizePopup.style.visibility == "visible"){				_fontSizePopup.style.visibility = "hidden";				return;			}			_formatPopup.style.visibility = "hidden";			_fontPopup.style.visibility = "hidden";			_fontSizePopup.style.visibility = "visible";	}	return _tb;}function xgHA_createToolbar(tbuttons){		var _table = document.createElement("TABLE");		_table.border = 0;		_table.style.width = 100;_table.cellPadding = 0; _table.cellSpacing=0;		this._toolbars.appendChild(_table);		var _width = 0;		_table.style.height = 25;		_table.unselectable = "on";		var _row = _table.insertRow(0);		_row.unselectable = "on";		var _ha = this;		_row.style.backgroundImage = "url('"+xg.coreLocation+"/imgs/htmlarea/toolbar.bg.gif')";		for (var i =0;i<tbuttons.length ;i++ ){				var _cell = _row.insertCell(i);				if (tbuttons[i]!="s"){					var th = _getIcon(tbuttons[i]);					_cell.innerHTML = "<div UNSELECTABLE='ON'>"+th+"</div>";					_cell.style.width = 20;					_cell.style.height = 25;					_cell.align = "center";					_cell.valign="middle";					_cell.title = _getTitle(tbuttons[i]);					_cell._action = tbuttons[i];					_width+=20;					_cell.className = _ha.classes.button;					_cell.unselectable = "on";					_cell.atomicSelection = false;					_cell.onmouseover = function(){						this.childNodes[0].className = _ha.classes.buttonOver;						//this.className = _ha.classes.buttonOver;					}					_cell.onmouseout = function(){						this.childNodes[0].className = _ha.classes.button;					}					_cell.onmousedown = function(){						_ha.executeAction(this._action);						return false;					}				}else{					_cell.innerHTML = "<img UNSELECTABLE='ON' src='"+xg.coreLocation+"/imgs/htmlarea/toolbar.end.gif'/>";					_cell.style.width = 2;					_cell.style.height = 25;					_width += 20;				}		}		_table.style.width = _width;		_table.style.height =25;		return _table;}function _getTitle(nm){	var _h = "?";	if (nm == "bold") _h = "Îngroşat (bold)";	if (nm == "italic") _h = "Înclinat (italic)";	if (nm == "underline") _h = "Subliniat (underline)";	if (nm == "strike") _h = "Tăiat";	if (nm == "sup") _h = "Putere (superscript)";	if (nm == "sub") _h = "Indice (substript)";	if (nm == "undo") _h = "Stare anterioară (undo)";	if (nm == "redo") _h ="Stare ulterioară (redo)";	if (nm == "align_left") _h = "Aliniază la stânga";	if (nm == "align_center") _h ="Aliniază central";	if (nm == "align_right") _h = "Aliniază la dreapta";	if (nm == "align_justify") _h = "Aliniează în bloc";	if (nm == "list_num") _h = " Inserează / Şterge listă numerotată";	if (nm == "list_bullet") _h =" Inserează / Şterge listă cu puncte";	if (nm == "color_fg") _h = "Culoarea textului";	if (nm == "color_bg") _h="Culoarea fundalului";	if (nm == "hr") _h = "Inserează linie orizontală";	if (nm == "link") _h = "Inserează / editează link";	if (nm == "rlink") _h ="Şterge link";	if (nm == "image") _h = "Imagine - fotografie";	if (nm == "movie") _h = "Film";	if (nm == "report") _h = "Documente DOC sau PDF";	if (nm == "embeded") _h = "Embeded";	if (nm == "music") _h = "Fisiere audio";	if (nm == "table") _h = "Tabel";	if (nm == "anchor") _h = "Ancoră";	if (nm == "remove_format") _h = "Înlătură format";	if (nm == "remove_tags") _h = "Înlătură toate tagurile";	if (nm == "select_all") _h = "Selectează tot";	if (nm == "emo") _h = "Emoticoane";	if (nm == "chars") _h = "Charactere speciale";	if (nm == "maximize") _h = "Maximizează mărimea editorului";	if (nm == "source") _h = "Arată sursa textului editat";	if (nm == "cut") _h = "Taie";	if (nm == "copy") _h = "Copiază";	if (nm == "paste") _h = "Lipeşte";	if (nm == "inc_ident") _h = "Creşte identarea";	if (nm == "dec_ident") _h = "Micşorează identarea";	if (nm == "template") _h = "Şabloane";	if (nm == "edit_picture") _h = "Editează fotografia";	if (nm == "border") _h = "Aplică bordură";			return _h;}function _getIcon(nm){	var dv ="";	var _h = 0;	if (nm == "bold") _h = 19;	if (nm == "italic") _h = 20;	if (nm == "underline") _h = 21;	if (nm == "strike") _h = 22;	if (nm == "sup") _h = 24;	if (nm == "sub") _h = 23;	if (nm == "undo") _h = 13;	if (nm == "redo") _h =14;	if (nm == "align_left") _h = 29;	if (nm == "align_center") _h =30;	if (nm == "align_right") _h = 31;	if (nm == "align_justify") _h = 32;	if (nm == "list_num") _h = 25;	if (nm == "list_bullet") _h =26;	if (nm == "color_fg") _h = 44;	if (nm == "color_bg") _h=45;	if (nm == "hr") _h = 39;	if (nm == "link") _h = 33;	if (nm == "rlink") _h =34;	if (nm == "image") _h = 36;	if (nm == "movie") _h = -1;	if (nm == "report") _h = -1;	if (nm == "embeded") _h = -1;	if (nm == "music") _h = -1;	if (nm == "table") _h = 38;	if (nm == "anchor") _h = 35;	if (nm == "remove_format") _h = 18;	if (nm == "remove_tags") _h = 3;	if (nm == "select_all") _h = 17;	if (nm == "emo") _h = 40;	if (nm == "chars") _h = 41;	if (nm == "maximize") _h = 65;	if (nm == "source") _h = 0;	if (nm == "cut") _h = 6;	if (nm == "copy") _h = 7;	if (nm == "paste") _h = 8;	if (nm == "inc_ident") _h = 28;	if (nm == "dec_ident") _h = 27;	if (nm == "template") _h = 5;	if (nm == "border") _h = 53;	if (nm == "edit_picture") _h = -1;	if (_h > -1){	_h = parseInt(_h)*16;	dv = "<div UNSELECTABLE='ON' style='width:16px;height:16px;border:solid red 0px;overflow:hidden;background-position:0px -"+(_h)		+"px;background-image:url("+xg.coreLocation+"imgs/htmlarea/icons.gif)'></div>";	}else{		if (nm == "embeded"){				dv = "<div UNSELECTABLE='ON' style='width:16px;height:16px;border:solid red 0px;overflow:hidden;background-image:url(http://imgs.heeloo.net/icons/16/html_add.png)'></div>";		}		if (nm == "music"){				dv = "<div UNSELECTABLE='ON' style='width:16px;height:16px;border:solid red 0px;overflow:hidden;background-image:url(http://imgs.heeloo.net/icons/16/sound.png)'></div>";		}		if (nm == "movie"){			dv = "<div UNSELECTABLE='ON' style='width:16px;height:16px;border:solid red 0px;overflow:hidden;background-image:url(http://imgs.heeloo.net/icons/16/film.png)'></div>";	}if (nm == "report"){			dv = "<div UNSELECTABLE='ON' style='width:16px;height:16px;border:solid red 0px;overflow:hidden;background-image:url(http://imgs.heeloo.net/icons/16/report.png)'></div>";	}if (nm == "edit_picture"){			dv = "<div UNSELECTABLE='ON' style='width:16px;height:16px;border:solid red 0px;overflow:hidden;background-image:url(http://imgs.heeloo.net/icons/16/image_edit.png)'></div>";	}	}	return dv;}function xgHA_getSelectedHTML(){	var th = "lala";	var doc = null;	if (xg.browser.sName == "ie"){		doc = this._editor.contentWindow.document;	}else{		doc = this._editor.contentDocument;	}		if (xg.browser.sName == "ie"){		var trange = doc.selection.createRange();		return trange.htmlText;	}else{		var selection = this._editor.contentWindow.getSelection();		var range = selection.getRangeAt(0);		return range.toString();	}	return th;}function xgHA_pasteHTML(_html){	var doc = null;	var _thtml = escape(_html);	_html = unescape((_thtml));	_html = parseObjectsForIE(_html);	if (xg.browser.sName == "ie"){		try{		doc = this._editor.contentWindow.document;		}catch(e){		}	}else{		try{		doc = this._editor.contentDocument;		}catch(e){		}	}	if (xg.browser.sName == "ie"){		try{			this._editor.contentWindow.focus();			//if (this._trange)			//alert(this._trange.text);						//return;		}catch(e){			alert(e.description);		}				if (this._trange)	{			//alert(this._trange);			this._editor.contentWindow.focus();			this._trange.select();			try{			this._trange.pasteHTML(_html);			}catch(exception){			}			this._trange.select();		}		else{			try{			if (doc.body != null){				doc.body.innerHTML = _html;			}else{				_waitToDrawIFrame();				_waitingObject = this._editor;				_waitingHTML = _html;			}			}catch(e){}		}	}else{		this._editor.focus();		var selection = this._editor.contentWindow.getSelection();;		if (selection.rangeCount > 0) {			range = selection.getRangeAt(0);			range.deleteContents();			var newP = this._editor.contentDocument.createElement("SPAN");			newP.innerHTML = _html;			range.insertNode(newP);		}	}	}function xgHA_save(){		var ta = document.getElementById(this.ParentObject.id+"_textarea");		var _doc = null;		if (xg.browser.sName == "ie"){			_doc = this._editor.contentWindow.document;		}else{			_doc = this._editor.contentDocument;		}				var _value = _doc.body.innerHTML;		ta.value = _value;}function xgHA_executeAction(command){		var _doc = "";		if (xg.browser.sName == "ie"){			_doc = this._editor.contentWindow.document;			this._trange = _doc.selection.createRange();		}else{			_doc = this._editor.contentDocument;		}			//daca e internet explorer trebuie sa refac selectia		if (command == "cut"){			try{			_doc.execCommand("cut",false,null);			}catch(e){				alert("Din motive de securitate browserul tau nu permite accesul la memorie.\n\nFolositi CTR+X!");			}		}else		if (command == "copy")	{			try{			_doc.execCommand("copy",false,null);			}catch(e){					alert("Din motive de securitate browserul tau nu permite accesul la memorie.\n\nFolositi CTR+C!");			}		}else		if (command == "paste"){			try{			_doc.execCommand("paste",true,null);			}catch(e){				alert("Din motive de securitate browserul tau nu permite accesul la memorie.\n\nFolositi CTR+V!");			}		}else		if (command == "bold"){			_doc.execCommand("bold",false,null);		}else		if (command == "italic"){			_doc.execCommand("italic",false,null);		}else		if (command == "underline"){			_doc.execCommand("underline",false,null);		}else		if (command == "inc_ident"){			_doc.execCommand("Indent",false,null);		}else		if (command == "dec_ident"){			_doc.execCommand("Outdent",false,null);		}		if (command == "strike"){			_doc.execCommand("StrikeThrough",false,null);		}else		if (command == "sup"){			_doc.execCommand("SuperScript",false,null);		}else		if (command == "sub"){			_doc.execCommand("SubScript",false,null);		}else		if (command == "undo"){			_doc.execCommand("undo",false,null);		}else		if (command == "redo")	{			_doc.execCommand("redo",false,null);		}else		if (command == "remove_format"){			_doc.execCommand("RemoveFormat",false,null);		}else		if (command == "remove_tags"){			var myhtml = _doc.body.innerHTML;			myhtml= removeAllTags(myhtml);			myhtml = unescape((escape(myhtml)));			_doc.body.innerHTML = myhtml		}else		if (command == "select_all"){			this._editor.focus();			_doc.execCommand("SelectAll",false,null);		}else		if (command == "align_right"){			this._alignObject("right",_doc);		}else		if (command == "align_left")	{			this._alignObject("left",_doc);		}else		if (command == "align_center"){			this._alignObject("center",_doc);		}else		if (command == "border"){			this._modifyObject("border",_doc);		}else		if (command == "align_justify"){			_doc.execCommand("JustifyFull",false,null);		}else		if (command == "list_num"){			_doc.execCommand("InsertOrderedList",false,null);		}else		if (command == "list_bullet"){			_doc.execCommand("InsertUnorderedList",false,null);		}else		if (command == "hr"){			_doc.execCommand("InsertHorizontalRule",false,null);		}else		if (command == "link"){			this.onInsertLink();		}else		if (command == "rlink"){			_doc.execCommand("Unlink",false,null);		}else		if (command == "emo"){			this.onInsertEmoticons();		}else		if (command == "color_fg"){			if (this._colorPopup.style.visibility == "hidden"){				this._colorPopup.style.visibility = "visible";				this._colorPopup.style.left = 25;				this._colorPopup.style.top = 45;			}else{				this._colorPopup.style.visibility = "hidden";			}		}else		if (command == "color_bg"){			if (this._colorPopup.style.visibility == "hidden"){			this._colorPopup.style.visibility = "visible";			this._colorPopup.style.left = 0;			this._colorPopup.style.top = 45;			}else{				this._colorPopup.style.visibility = "hidden";			}				}else		if (command == "image"){			this.onInsertPicture();		}else		if (command == "movie"){			this.onInsertMovie();		}else	   if (command == "embeded"){			this.onInsertEmbeded();	   }		if (command == "music"){			this.onInsertMusic();		}else		if (command == "report"){			this.onInsertReport();		}else		if (command == "edit_picture"){			this.onEditPicture();		}else		if (command == "table")	{			this.onInsertTable();		}else		if (command == "chars"){			this.onInsertChars();		}else		if (command == "template"){			this.onInsertTemplate();		}else		if (command ==  "maximize"){			this.maximizeEditor();		}else		if (command == "source"){			if (this._textarea.style.visibility == "hidden"){				this._editor.style.visibility = "hidden";				this._textarea.style.visibility = "visible";				var doc = "";				if (xg.browser.sName == "ie"){					doc = this._editor.contentWindow.document;				}else{					doc = this._editor.contentDocument;				}				this._textarea.value = doc.body.innerHTML;			}else{					this._editor.style.visibility = "visible";					this._textarea.style.visibility = "hidden";				var doc = "";				if (xg.browser.sName == "ie"){					doc = this._editor.contentWindow.document;				}else{					doc = this._editor.contentDocument;				}								doc.body.innerHTML = parseObjectsForIE(this._textarea.value);			}		}	//i}//commandfunction xgHA_maximizeEditor(){		var obj = this._parentObject;		this._parentObject.style.position = "absolute";		if (!this.isMaximized){			this._parentObject.style.left = 0;			this._parentObject.style.top = 0;			this._parentObject.style.width = document.body.clientWidth;			this._parentObject.style.height = document.body.clientHeight;			this._resizeEditor();			this._resizeToolbars();			this.isMaximized = true;			this._parentObject.style.zIndex = 20000;		}else{			this._parentObject.style.left = xg.util.getLeft(this.ParentObject);			this._parentObject.style.top = xg.util.getTop(this.ParentObject);			this._parentObject.style.width = this.ParentObject.offsetWidth;			this._parentObject.style.height = this.ParentObject.offsetHeight;			this._resizeEditor();			this._resizeToolbars();			this.isMaximized = false;		}}function xgHA_resizeToolbars(){		this._toolbars.style.left = 0;		this._toolbars.style.top = 0;		var _width = this._parentObject.offsetWidth;		if (xg.browser.sName == "ie"){			_width = this._parentObject.offsetWidth-2;		}				this._toolbars.style.width = _width-2;		this._toolbars.style.height = this._headerHeight;		var tb3 = this._tb3;		if (tb3){				tb3.style.position = "absolute";				tb3.style.left = this._parentObject.offsetWidth - tb3.offsetWidth-2;				tb3.style.top = this._headerHeight - tb3.offsetHeight;			if (xg.browser.sName != "ie"){				tb3.style.left = this._parentObject.offsetWidth-tb3.offsetWidth-2;				tb3.style.top = this._headerHeight - tb3.offsetHeight-2;			}		}}function xgHA_resizeEditor(){		this._editor.style.left = 0;		this._editor.style.top = this._headerHeight;		this._editor.style.width = this._parentObject.offsetWidth-2;		this._editor.style.height = this._parentObject.offsetHeight-this._headerHeight-2;		this._textarea.style.top = this._headerHeight;		this._textarea.style.width = parseInt(this._editor.style.width);		this._textarea.style.height = parseInt(this._editor.style.height);		}function xgHA_onInsertTemplate(){		alert("inserting templates");}function xgHA_onInsertLink(){	var w = 400;	var h = 170;	var x = xg.util.getLeft(this._parentObject)+200;	var y = xg.util.getTop(this._parentObject);		if (window.parent){			var allfrms = window.parent.document.getElementsByTagName("IFRAME");			var myfrm = null;			for (var i = 0;i<allfrms.length ;i++ ){				if (allfrms[i].contentWindow == window){					myfrm = allfrms[i];					break;				}			}			if (myfrm != null){				var frmleft = window.parent.xg.util.getLeft(myfrm);				var frmtop = window.parent.xg.util.getTop(myfrm);				x+= frmleft;				y+= frmtop;			}	}	var _ha = this;	//x = 1; y = 1;	var curS = _ha.getSelectedHTML();	var win = xg.window.showInner('Adauga meniu',xg.coreLocation+'htmlarea/insert_link.xgs?lnk='+curS,w,h,x,y);			win.onclose = function(){				var rv = win.returnValue;				if (rv != -1){					_ha.pasteHTML(rv);				}			}}function xgHA_onEditPicture(){	alert("edit picture");}function xgHA_onInsertPicture(){	var t = this;	var wip = xg.window.showModal("choose logo",myServer+"/uc/showgallery.html",650,500,0,-30,"black");				 wip.onclose = function(){		if (wip.returnValue != -1){			var rv = wip.returnValue;			var imgURL = rv[0];			var imgSize = rv[1];			var _width = "480";					if (imgSize == 3) _width = 480;			if (imgSize == 2) _width = 300;			if (imgSize == 1) _width = 150;			var th = "<img  onclick=\"openGallery(this);\" style='width:"+_width+"px; TEXT-ALIGN: center; MARGIN: 0px auto 10px; DISPLAY: block; CURSOR: hand' src='"+imgURL+"' border='0'  border='0'/>";			t.pasteHTML(th);				}else{			t.pasteHTML("");		} }	//alert("event: [object].onInsertPicture");}function xgHA_onInsertMovie(){	var t = this;	var wip = xg.window.showModal("choose logo",myServer+"/uc/showvideo.html",650,500,0,-30,"black");				 wip.onclose = function(){		if (wip.returnValue != -1){			var rv = wip.returnValue;						var videoID = rv[0];			var imgSize = rv[1];			var _width = "490";					if (imgSize == 3) _width = 490;			if (imgSize == 2) _width = 300;			if (imgSize == 1) _width = 150;			var tvServer = myServer;			tvServer = tvServer.substring(tvServer.indexOf("heeloo."));			tvServer = "http://video."+tvServer;						var th = '<div style="width:500px;height:320px;background-image:url(http://imgs.heeloo.net/bghtv.png);background-repeat:no-repeat;background-position:center center;"><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" width="500" height="320" id="xxx" align="middle"><param name="allowScriptAccess" value="sameDomain" /><param name="allowFullScreen" value="true" />	<param name="movie" value="'+tvServer+'/play/'+videoID+'/" /><param name="quality" value="high" /><param name="wmode" value="transparent" /><param name="bgcolor" value="#ffffff" />	<embed src="'+tvServer+'/play/'+videoID+'/" quality="high" wmode="transparent" bgcolor="#ffffff" width="500" height="320" name="xxxx" align="middle" allowScriptAccess="sameDomain" allowFullScreen="true" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /></object></div>';			t.pasteHTML(th);		}else{			t.pasteHTML("");		}}//onclose}//videofunction xgHA_onInsertEmbeded(){	var t = this;	var wie = xg.window.showModal("choose embeded",myServer+"/uc/showembeded.html",540,310,0,0);	wie.onclose = function(){		if (wie.returnValue == "-1"){				t.pasteHTML("");		}else{			var th = wie.returnValue;			t.pasteHTML(th);		}	}}function xgHA_onInsertMusic(){		var t = this;	var wip = xg.window.showModal("choose logo",myServer+"/uc/showmusic.html",650,500,0,-30,"black");				 wip.onclose = function(){		if (wip.returnValue != -1){			var rv = wip.returnValue;			var imgURL = rv[0];			var imgSize = rv[1];			var _width = "490";			if (imgSize == 3) _width = 490;			if (imgSize == 2) _width = 300;			if (imgSize == 1) _width = 150;			var musicServer = myServer;			musicServer = musicServer.substring(musicServer.indexOf("heeloo."));			musicServer = "http://music."+musicServer;						var th = '<div style="width:380px;height:60px;background-image:url(http://imgs.heeloo.net/bghm.png);background-repeat:no-repeat;background-position:center center;"><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" width="380" height="60" id="mp3player" align="middle"><param name="allowScriptAccess" value="sameDomain" /><param name="allowFullScreen" value="false" /><param name="movie" value="'+musicServer+'/play/'+imgURL+'" /><param name="menu" value="false" /><param name="quality" value="high" /><param name="wmode" value="transparent" /><param name="bgcolor" value="#ededed" />	<embed src="'+musicServer+'/play/'+imgURL+'" menu="false" quality="high" wmode="transparent" bgcolor="#ededed" width="380" height="60" name="mp3player" align="middle" allowScriptAccess="sameDomain" allowFullScreen="false" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /></object></div>';			t.pasteHTML(th);		}else{			t.pasteHTML("");		} }}function xgHA_onInsertReport(){		var t = this;	var wip = xg.window.showModal("choose logo",myServer+"/uc/showdocs.html",650,500,0,-30,"black");				 wip.onclose = function(){		if (wip.returnValue != -1){			var rv = wip.returnValue;			var docURL = rv[0];			var docName = rv[1];			var _width = "490";											var th = '<table border="0" cellspacing="2" cellpadding="2" width="100%" class="b_doc_surface">';			th+="<tr>";				th+="<td width='1%'><img src='http://filetypes.heeloo.net/"+docURL+"' width='64'>";				th+="</td>";				th+="<td width='99%'><b>Document:</b><br>Titlu:<br>URL:<a href='"+docURL+"' target='_self'>"+docName+"</a></td>";			th+="</tr>";			th+="</table>";			t.pasteHTML(th);		}else{			t.pasteHTML("");		} }	//alert("event: [object].onInsertPicture");}function xgHA_onInsertTable(){	alert("inserttable");}function xgHA_onInsertSpecialChars(){	var w = 400;		var h = 400;		var x = document.body.clientWidth/2-w/2;		var y = document.body.clientHeight/2-h/2;		var win = xg.window.showModal("insert char",xg.coreLocation+"htmlarea/insert_chars.xgs",w,h,x,y);		var _ha = this;				win.onclose = function(){			if (win.returnValue != "-1"){				_ha.pasteHTML(win.returnValue);			}		}}function xgHA_onInsertEmoticons(){		var w = 400;		var h = 400;		var x = document.body.clientWidth/2-w/2;		var y = document.body.clientHeight/2-h/2;		var win = xg.window.showModal("insert char",xg.coreLocation+"htmlarea/insert_emo.xgs",w,h,x,y);		var _ha = this;				win.onclose = function(){			if (win.returnValue != "-1"){				_ha.pasteHTML(win.returnValue);			}		}}function xgHA_getSelectedImage(){	var _doc = null;	if (xg.browser.sName == "ie"){		_doc = this._editor.contentWindow.document;	}else{		_doc = this._editor.contentDocument;	}		var myimg = null;		if (xg.browser.sName == "ie"){			var _s = _doc.selection;			var _cr = _s.createRange();			if (_s.type == "Control"){					myimg = _cr.item(0);				}			}else{			var selection =this._editor.contentWindow.getSelection();			var imgs = this._editor.contentDocument.getElementsByTagName("IMG");			var range = selection.getRangeAt(0);			var st = range.startOffset;			var se = range.endOffset;			for (var i =0 ;i<imgs.length ;i++ ){					if (selection.containsNode(imgs[i],true)){						myimg = imgs[i];						break;				}				}		}		return myimg;}function xgHA_modifyObject(oo,_doc){		var myimg = null;		try{		if (xg.browser.sName == "ie"){			var _s = _doc.selection;			var _cr = _s.createRange();			if (_s.type == "Control"){					myimg = _cr.item(0);				}			}else{			var selection =this._editor.contentWindow.getSelection();			var imgs = this._editor.contentDocument.getElementsByTagName("IMG");			var range = selection.getRangeAt(0);			var st = range.startOffset;			var se = range.endOffset;			for (var i =0 ;i<imgs.length ;i++ ){					if (selection.containsNode(imgs[i],true)){						myimg = imgs[i];						break;				}				}		}		}catch(E){			return;		}		if (myimg == null) return;		if (myimg.style.border.length == 0){			myimg.style.padding="10";			myimg.style.margin = "10";		}else{			myimg.style.padding="0";			myimg.style.border="";			myimg.style.margin = "0";		}}function xgHA_alignObject(align,_doc){				if (xg.browser.sName == "ie"){			var _s = _doc.selection;			var _cr = _s.createRange();			if (_s.type == "Control"){					if (_cr.item(0).tagName == "IMG"){					var img = _cr.item(0);					img.align = align;					return;				}			}		}else{			var selection =this._editor.contentWindow.getSelection();			var imgs = this._editor.contentDocument.getElementsByTagName("IMG");			var range = selection.getRangeAt(0);			var st = range.startOffset;			var se = range.endOffset;			var _myimg = null;			for (var i =0 ;i<imgs.length ;i++ ){					if (selection.containsNode(imgs[i],true)){						_myimg = imgs[i];						break;				}				}			if (_myimg != null){					_myimg.align = align;			}		}				if (align == "left"){					_doc.execCommand("JustifyLeft",false,null);					}else				if (align == "right"){					_doc.execCommand("JustifyRight",false,null);				}else				if (align == "center"){					_doc.execCommand("JustifyCenter",false,null);				}			}function xgHA_hidePopups(){		this._formatPopup.style.visibility = "hidden";		this._fontPopup.style.visibility = "hidden";		this._fontSizePopup.style.visibility = "hidden";		this._colorPopup.style.visibility = "hidden";}function _createColorPopup(){	var _d = _createPopup("_colorsContainer",200,160);	this._parentObject.appendChild(_d);	var _mycont = document.getElementById("_colorsContainer");	var color = "FFFF00#FFFF33#FFFF99#FFFFCC#CCFFCC#CCFF99#CCFF33#CCFF00#FFCC00#FFCC33#FFCC33#FFCC66#FFCC99#FFCCCC#FFCCFF#CCCCFF#CCCCCC#CCCC99#CCCC66#CCCC33#CCCC00#FF9900#FF9933#FF9966#FF9999#FF99CC#FF99FF#CC99FF#CC99CC#CC99CC#CC9999#CC9999#CC9999#CC9966#CC9933#CC9900#FF6600#FF6633#FF6666#FF6699#FF6699#FF66CC#FF66FF#CC66FF#FF0000#FF00CC#660099#6600FF#990066#993333#666633#6666CC#6666FF#669999#996699#6699FF#666666#66FF00#66CC00#66FFCC#00FF33#99FF00#339933#3399CC#3399FF#0099CC#006699#003333#009900#3300CC#330066#EAEAEA#6F6F6F#FF8080#FFFF80#80FF80#804000#8080FF#000000#FFFFFF#800000#8000FF#B6B6B6#D7D7D7#";	var th = "<table border='1' cellspacing='1' cellpadding='1'>";	var r = 0;	var c = 0;	while (color.indexOf("#")>-1){		var mycolor = "#"+color.substring(0,color.indexOf("#"));		if (c == 0){			th+="<tr>";		}		th+="<td UNSELECTABLE='on' style='width:14px;cursor:pointer;height:14px;overflow:hidden;border:solid silver 1px;overflow:hidden;float:left;background-color:"+mycolor+";' onclick='_selectTAColor(&quot;"+mycolor+"&quot;,"+this.ObjectIndex+")' >&nbsp;</td>";		c++;		if (c == 10){				c=0;				r++;				th+="</tr>";		}		color = color.substring(color.indexOf("#")+1);	}	th+="</table>";	_mycont.innerHTML = th;	_d.style.visibility = "hidden";	return _d;}function _createFontSizePopup(){	var _d = _createPopup("_fontSizeContainer",80,100);		this._parentObject.appendChild(_d);		var _mycont = document.getElementById("_fontSizeContainer");		var th = "<table UNSELECTABLE='on' border='0' width='100%'>";		var fs = new Array("8","9","10","11","12","14","16","20","30");		for (var i = 0;i<fs.length ;i++ ){			th+="<tr>";				th+="<td UNSELECTABLE='on'><div UNSELECTABLE='on' style='color:gray;font-family:verdana,tahoma;font-size:10px;border:solid white 1px;cursor:default;'"+					" onmouseover='this.style.color=&quot;black&quot;;this.style.border=&quot;solid silver 1px;&quot;' "+					" onclick='_clickOnFontSize(this,"+this.ObjectIndex+")' "+					" onmouseout='this.style.color=&quot;gray&quot;;this.style.border=&quot;solid white 1px;&quot;'>"+fs[i]+"</div></td>";			th+="</tr>";		}		th+="</table>";		_mycont.innerHTML = th;		_d.style.visibility = "hidden";		return _d;}function _createFormatPopup(){	var _d = _createPopup("_formatContainer",200,50);		this._parentObject.appendChild(_d);		var _mycont = document.getElementById("_formatContainer");				var formats = this.fontFormats;		var th = "<table UNSELECTABLE='on' border='0' width='100%'>";		for (var i = 0;i<formats.length ;i++ ){			th+="<tr>";				th+="<td UNSELECTABLE='on'><div UNSELECTABLE='on' style='cursor:default;color:gray;font-family:tahoma;font-size:10px;border:solid white 1px;' class='xg_"+formats[i]+"' "+					" onmouseover='this.style.color=&quot;black&quot;;this.style.border=&quot;solid silver 1px;&quot;' "+					" onclick='_clickOnFormat(this,"+this.ObjectIndex+")' "+					" onmouseout='this.style.color=&quot;gray&quot;;this.style.border=&quot;solid white 1px;&quot;'>"+formats[i]+"</div></td>";			th+="</tr>";		}		th+="</table>";		_mycont.innerHTML = th;		_d.style.visibility = "hidden";		return _d;}function _clickOnFormat(obj,index){	var fname = obj.innerHTML;	var _ha = xgAllHA[index];	if (xg.browser.sName == "ie"){		_ha._editor.contentWindow.document.execCommand("RemoveFormat",true,null);		_ha.pasteHTML("<span class='xg_"+fname+"'>"+_ha.getSelectedHTML()+"</span>");	}else{		_ha._editor.contentDocument.execCommand("RemoveFormat",false,null);		_ha.pasteHTML("<span class='xg_"+fname+"'>"+_ha.getSelectedHTML()+"</span>");	}	_ha._hidePopups();}function _selectTAColor(color,index){	var _ha = xgAllHA[index];	var comm = "ForeColor";	if (parseInt(_ha._colorPopup.style.left)==0){		comm = "BackColor";	}else{		comm = "ForeColor";	}	if (xg.browser.sName == "ie"){			_ha._editor.contentWindow.document.execCommand(comm,true,color);	}else{		_ha._editor.contentDocument.execCommand(comm,false,color);	}	_ha._hidePopups();}function _clickOnFontSize(obj,index){	var fname = obj.innerHTML;	var _ha = xgAllHA[index];	if (xg.browser.sName == "ie"){		_ha._editor.contentWindow.document.execCommand("RemoveFormat",true,null);		_ha.pasteHTML("<font style='font-size:"+fname+"px'>"+_ha.getSelectedHTML()+"</font>");	}else{		_ha._editor.contentDocument.execCommand("RemoveFormat",false,null);		_ha.pasteHTML("<font style='font-size:"+fname+"px'>"+_ha.getSelectedHTML()+"</font>");	}	_ha._hidePopups();}function _clickOnFont(obj,index){	var fname = obj.innerHTML;	var _ha = xgAllHA[index];	if (xg.browser.sName == "ie"){		_ha._editor.contentWindow.document.execCommand("FontName",false,fname);	}else{		_ha._editor.contentDocument.execCommand("FontName",false,fname);	}	_ha._hidePopups();}function _createFontPopup(){		var _d = _createPopup("_fontContainer",200,100);		this._parentObject.appendChild(_d);		var _mycont = document.getElementById("_fontContainer");		_mycont.innerHTML = "font";		var th = "<table UNSELECTABLE='on' border='0' width='100%'>";				for (var i = 0;i<this.toolbarFont.length ;i++ ){			th+="<tr>";				th+="<td UNSELECTABLE='on'><div UNSELECTABLE='on' style='color:gray;font-family:"+this.toolbarFont[i]+";font-size:10px;border:solid white 1px;cursor:pointer;'"+					" onmouseover='this.style.color=&quot;blue&quot;;this.style.border=&quot;solid silver 1px;&quot;' "+					" onclick='_clickOnFont(this,"+this.ObjectIndex+")' "+					" onmouseout='this.style.color=&quot;gray&quot;;this.style.border=&quot;solid white 1px;&quot;'>"+this.toolbarFont[i]+"</div></td>";			th+="</tr>";		}		th+="</table>";		_mycont.innerHTML = th;		_d.style.visibility = "hidden";		return _d;}function _createPopup(_id,w,h){	var _d =document.createElement("DIV");		_d.unselectable='on';		_d.style.position = "absolute";		_d.style.left = 10;		_d.style.top = 10;		_d.style.width = w;		_d.style.height = h;		_d.style.zIndex =200;		var _iw = parseInt(_d.style.width)-16;		var _ih = parseInt(_d.style.height)-16;		var th="<table UNSELECTABLE='on' id='_shadow_table' border='0' cellspacing='0' cellpadding='0' style='position:absolute;width:100%;height:100%'>";		th+="<tr height='8' >";		th+="<td UNSELECTABLE='on' align='right' valign='bottom'>";			th+="<div UNSELECTABLE='on' style='border:solid red 0px;width:8px;height:8px;overflow:hidden;background-image:url("+xg.coreLocation+"/imgs/shadows/shadow_left_top_corner.png);'></div>";		th+="</td>";		th+="<td UNSELECTABLE='on' style='background-image:url("+xg.coreLocation+"/imgs/shadows/shadow_top_border.png);background-repeat:repeat-x;overflow:hidden;'>";		th+="</td>";		th+="<td UNSELECTABLE='on' style='width:8px;overflow:hidden;'><div UNSELECTABLE='on' style='border:none;width:8px;height:8px;overflow:hidden;background-image:url("+xg.coreLocation+"/imgs/shadows/shadow_right_top_corner.png);'></div></td>";	th+="</tr>";	th+="<tr height='"+_ih+"'>";			th+="<td UNSELECTABLE='on' style='width:8px;background-image:url("+xg.coreLocation+"/imgs/shadows/shadow_left_border.png);background-repeat:repeat-y'></td>";			th+="<td UNSELECTABLE='on' align='left' valign='top' style='width:"+_iw+"px;background-color:white;'>";  					//cred ca aici vine continutul					th+="<div UNSELECTABLE='on' id='"+_id+"'></div>";			th+="</td>";			th+="<td UNSELECTABLE='on' style='background-image:url("+xg.coreLocation+"/imgs/shadows/shadow_right_border.png);background-repeat:repeat-y'></td>";	th+="</tr>";	th+="<tr height='8'>";			th+="<td UNSELECTABLE='on' align='right' valign='top' style=''>";			th+="<div UNSELECTABLE='on' style='width:8px;height:8px;overflow:hidden;background-image:url("+xg.coreLocation+"/imgs/shadows/shadow_left_bottom_corner.png);'></div></td>";			th+="<td UNSELECTABLE='on' style='background-image:url("+xg.coreLocation+"/imgs/shadows/shadow_bottom_border.png);background-repeat:repeat-x'></td>";			th+="<td UNSELECTABLE='on' >";			th+=" <div UNSELECTABLE='on' style='width:8px;height:8px;overflow:hidden;background-image:url("+xg.coreLocation+"/imgs/shadows/shadow_right_bottom_corner.png);'></div></td>";	th+="</tr></table>";	_d.innerHTML = th;	return _d;}function _waitToDrawIFrame(){				if (_waitingObject == null){			_waittimer = window.setTimeout("_waitToDrawIFrame()",10);		}else{			var _doc = _waitingObject.contentWindow.document.body;			try{			_doc.innerHTML = reformatText(_waitingHTML);			_waitingObject = null;			_waitingHTML = null;			}catch(e){}			window.clearTimeout(_waittimer);		}}function reformatText(str){	str = replaceStr(str,"&row;","\r");	str = replaceStr(str,"&enter;","\n");	str = replaceStr(str,"&tab;","\t");	str = replaceStr(str,"~amp;","&");return str;}function parseObjectsForIE(str){	while (str.toLowerCase().indexOf("<object")>-1){			var send = str.toLowerCase().indexOf(">",str.toLowerCase().indexOf("<object")+1)+1;			var objStr = str.substring(str.toLowerCase().indexOf("<object"),send);			if (str.toLowerCase().indexOf("data=")>-1){				var dataURL = objStr.substring(objStr.indexOf("data=")+5);				dataURL = dataURL.substring(0,dataURL.indexOf(" "));				var widthS = objStr.substring(objStr.indexOf("width=")+6);				widthS = widthS.substring(0,widthS.indexOf(" "));				var heightS = objStr.substring(objStr.indexOf("height=")+7);				heightS = heightS.substring(0,heightS.indexOf(" "));				objStr = objStr.substring(0,objStr.indexOf("data=\""))+"  "+objStr.substring(objStr.indexOf("\"",objStr.indexOf("data=\"")+7)+1);				dataURL = replaceStr(dataURL,"\"","");				dataURL = replaceStr(dataURL,"'","");				var dataSrc = dataURL.substring(0,dataURL.indexOf("?"));				var dataParams = dataURL.substring(dataURL.indexOf("?")+1);				var mystr = '<embed src="'+dataSrc+'" width='+widthS+' height='+heightS+' allowscriptaccess="always" type="application/x-shockwave-flash" '+					'pluginspage="http://www.macromedia.com/go/getflashplayer" allowfullscreen="true" align="middle" flashvars="'+dataParams+'"/>';				return mystr;			}else{				return str;			}	}//while	return str;}