rem: tinyMCE.importPluginLanguagePack('flash','en,de,sv,zh_cn,cs');function TinyMCE_flash_getControlHTML(control_name){switch(control_name){case "flash":return '<img id="{$editor_id}_flash" src="{$pluginurl}/images/flash.gif" title="{$lang_insert_flash}" width="20" height="20" class="mceButtonNormal" onmouseover="tinyMCE.switchClass(this,\'mceButtonOver\');" onmouseout="tinyMCE.restoreClass(this);" onmousedown="tinyMCE.restoreAndSwitchClass(this,\'mceButtonDown\');" onclick="tinyMCE.execInstanceCommand(\'{$editor_id}\',\'mceFlash\');" />';}return "";}function TinyMCE_flash_execCommand(editor_id,element,command,user_interface,value){switch(command){case "mceFlash":var template=new Array();template['file']='../../plugins/flash/flash.htm';template['width']=400;template['height']=180;var name="",swffile="",swfwidth="",swfheight="",mceDo="insert";if(tinyMCE.selectedElement!=null&&tinyMCE.selectedElement.nodeName.toLowerCase()=="img"){tinyMCE.flashElement=tinyMCE.selectedElement;if(tinyMCE.flashElement){name=tinyMCE.flashElement.getAttribute('name')?tinyMCE.flashElement.getAttribute('name'):"";if(name!='mce_plugin_flash')return;swfwidth=tinyMCE.flashElement.getAttribute('width')?tinyMCE.flashElement.getAttribute('width'):"";swfheight=tinyMCE.flashElement.getAttribute('height')?tinyMCE.flashElement.getAttribute('height'):"";swffile=tinyMCE.flashElement.getAttribute('alt')?tinyMCE.flashElement.getAttribute('alt'):"";mceDo="update";}}tinyMCE.openWindow(template,{editor_id:editor_id,swffile:swffile,swfwidth:swfwidth,swfheight:swfheight,mceDo:mceDo});return true;}return false;}function TinyMCE_flash_cleanup(type,content){switch(type){case "insert_to_editor":return TinyMCE_flash_mkCodeCleanup('insertToEditor',content);case "get_from_editor":return TinyMCE_flash_mkCodeCleanup('getFromEditor',content);}return content;}function TinyMCE_flash_handleNodeChange(editor_id,node,undo_index,undo_levels,visual_aid,any_selection){function getAttrib(elm,name){return elm.getAttribute(name)?elm.getAttribute(name):"";}tinyMCE.switchClassSticky(editor_id+'_flash','mceButtonNormal');do{if(node.nodeName.toLowerCase()=="img"&&getAttrib(node,'name').indexOf('mce_plugin_flash')==0)tinyMCE.switchClassSticky(editor_id+'_flash','mceButtonSelected');}while((node=node.parentNode));return true;}function TinyMCE_flash_mkCodeCleanup(action,content){switch(action){case 'insertToEditor':content=replace(content);break;case 'getFromEditor':content=restore(content);break;}return content;}function TagObject(){this.tagName="";this.attributeNames=new Array();this.attributeValues=new Array();this.spaceRemoveRegex=new RegExp('[ ]*','g');this.newLineRemoveRegex=new RegExp('[\n]*','g');};TagObject.prototype.setTagName=function(name){this.tagName=name;};TagObject.prototype.getTagName=function(){return this.tagName;};TagObject.prototype.addAttribute=function(name,value){this.attributeNames[this.attributeNames.length]=name;this.attributeValues[this.attributeValues.length]=value;};TagObject.prototype.getAttributeNames=function(){return this.attributeNames;};TagObject.prototype.getAttributeValues=function(){return this.attributeValues;};TagObject.prototype.populate=function(tag){var stIndex=0;while(tag.charAt(stIndex)!='<')stIndex++;stIndex++;this.tagName=tag.substring(stIndex,tag.indexOf(" "));stIndex=tag.indexOf(" ");var endIndex;while(true){endIndex=tag.indexOf("=",stIndex);if(endIndex==-1)break;var attrName=tag.substring(stIndex,endIndex);attrName=attrName.replace(this.spaceRemoveRegex,"");attrName=attrName.replace(this.newLineRemoveRegex,"");attrName=attrName.toLowerCase();stIndex=endIndex+1;endIndex=tag.indexOf(" ",stIndex);if(endIndex==-1){endIndex=tag.indexOf(">",stIndex);if(endIndex==-1)endIndex=tag.length;}var attrValue=tag.substring(stIndex,endIndex);attrValue=attrValue.replace("/>","");attrValue=attrValue.replace(">","");this.addAttribute(attrName,attrValue);stIndex=endIndex;}};TagObject.prototype.getAttributeValue=function(attribName){for(var i=0;i<this.attributeNames.length;i++){if(this.attributeNames[i]==attribName)return this.attributeValues[i];}return null;};TagObject.prototype.setAttributeValue=function(attribName,attribValue){for(var i=0;i<this.attributeNames.length;i++){if(this.attributeNames[i]==attribName){this.attributeValues[i]=attribValue;return;}}this.addAttribute(attribName,attribValue);};function restore(content){content=content.replace(new RegExp('<[ ]*img','gi'),'<img');var newContent="";var startString;var stImgIndex;var endImgIndex;var imgString;var stIndex=0;var tagObjs;while((stImgIndex=content.indexOf('<img',stIndex))!=-1){startString=content.substring(stIndex,stImgIndex);newContent=newContent.concat(startString);endImgIndex=content.indexOf('/>',stImgIndex);if(endImgIndex==-1)break;stIndex=endImgIndex+"/>".length;imgString=content.substring(stImgIndex,stIndex);var tagObj=new TagObject();tagObj.populate(imgString);if(tagObj.getAttributeValue("name")=='"mce_plugin_flash"'){var width=tagObj.getAttributeValue("width");var height=tagObj.getAttributeValue("height");var src=tagObj.getAttributeValue("alt");var objTags=decodeAttributes(tagObj);var obj=getTagByName(objTags,"object");obj.setAttributeValue("width",width);obj.setAttributeValue("height",height);var embed=getTagByName(objTags,"embed");embed.setAttributeValue("width",width);embed.setAttributeValue("height",height);embed.setAttributeValue("src",src);newContent=newContent.concat(objectTagsToHTML(objTags));}else{newContent=newContent.concat(imgString);}}newContent=newContent.concat(content.substring(stIndex,content.length));return newContent;}function replace(content){content=content.replace(new RegExp('<[ ]*object','gi'),'<object');content=content.replace(new RegExp('<[ ]*/object[ ]*>','gi'),'</object>');var newContent="";var startString;var stObjIndex;var endObjIndex;var objString;var stIndex=0;var tagObjs;while((stObjIndex=content.indexOf('<object',stIndex))!=-1){startString=content.substring(stIndex,stObjIndex);newContent=newContent.concat(startString);endObjIndex=content.indexOf('</object>',stIndex);if(endObjIndex==-1)break;stIndex=endObjIndex+"</object>".length;objString=content.substring(stObjIndex,stIndex);tagObjs=getObjectTags(objString);if(tagObjs.length>0){var objTag=getTagByName(tagObjs,"object");var height=objTag.getAttributeValue("height");var width=objTag.getAttributeValue("width");var embedTag=getTagByName(tagObjs,"embed");var src=embedTag.getAttributeValue("src");var imgAttr=encodeObjectTags(tagObjs);var imgTag='<img width='+width+' height='+height+' alt='+src+' title='+src+' '+imgAttr+' name="mce_plugin_flash" class="mce_plugin_flash" '+'src="'+(tinyMCE.getParam("theme_href")+'/images/spacer.gif" />');newContent=newContent.concat(imgTag);}else{newContent=newContent.concat(objString);}}newContent=newContent.concat(content.substring(stIndex,content.length));return newContent;}function getObjectTags(objStr){var tagObjs=new Array();var tagObject;var stIndex=0;var endIndex=0;stIndex=objStr.indexOf("<object");if(stIndex==-1)return tagObjs;endIndex=objStr.indexOf(">");tagObject=new TagObject();tagObject.populate(objStr.substring(stIndex,endIndex+1));if(tagObject.getAttributeValue("classid")!="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000")return tagObjs;tagObjs[tagObjs.length]=tagObject;objStr=objStr.replace(new RegExp('<[ ]*param','gi'),'<param');objStr=objStr.replace(new RegExp('<[ ]*/param[ ]*>','gi'),'</param>');objStr=objStr.replace(new RegExp('<[ ]*embed','gi'),'<embed');objStr=objStr.replace(new RegExp('<[ ]*/embed[ ]*>','gi'),'</embed>');stIndex=endIndex;while((endIndex=objStr.indexOf("<param",stIndex))!=-1){stIndex=endIndex;endIndex=objStr.indexOf(">",stIndex);tagObject=new TagObject();tagObject.populate(objStr.substring(stIndex,endIndex+1));tagObjs[tagObjs.length]=tagObject;stIndex=endIndex;}endIndex=objStr.indexOf("<embed",stIndex);if(endIndex!=-1){stIndex=endIndex;endIndex=objStr.indexOf(">",stIndex);tagObject=new TagObject();tagObject.populate(objStr.substring(stIndex,endIndex+1));tagObjs[tagObjs.length]=tagObject;stIndex=endIndex;}return tagObjs;}function objectTagsToHTML(objTags){var htmlStr="";for(var i=0;i<objTags.length;i++){var tag=objTags[i];var tagAttrs=tag.getAttributeNames();var tagValues=tag.getAttributeValues();htmlStr=htmlStr.concat('<',tag.getTagName(),' ');for(var j=0;j<tagAttrs.length;j++){htmlStr=htmlStr.concat(tagAttrs[j],'=',tagValues[j],(j<tagAttrs.length-1)?' ':'');}if(tag.getTagName()=="param")htmlStr=htmlStr.concat(' />\n');else htmlStr=htmlStr.concat('>\n');}htmlStr=htmlStr.concat('</embed>\n');htmlStr=htmlStr.concat('</object>\n');return htmlStr;}function encodeObjectTags(objTags){var equal="&eqs;";var quote="&quot;";var question="&quest;";var equalReplace=new RegExp('=','g');var quoteReplace=new RegExp('"','g');var questionReplace=new RegExp("[\?]",'g');var objAttr='obj="';var paramAttr='param="';var embedAttr='embed="';for(var i=0;i<objTags.length;i++){var tagObj=objTags[i];var attrNames=tagObj.getAttributeNames();var attrValues=tagObj.getAttributeValues();if(tagObj.getTagName()=='object'){for(var j=0;j<attrNames.length;j++){var v=attrValues[j];v=v.replace(equalReplace,equal);v=v.replace(quoteReplace,quote);v=v.replace(questionReplace,question);objAttr=objAttr.concat('?',attrNames[j],'=',v);}}else if(tagObj.getTagName()=='param'){var n=tagObj.getAttributeValue("name");var v=tagObj.getAttributeValue("value");n=n.replace(quoteReplace,quote);v=v.replace(equalReplace,equal);v=v.replace(quoteReplace,quote);v=v.replace(questionReplace,question);paramAttr=paramAttr.concat('?',n,'=',v);}else if(tagObj.getTagName()=='embed'){for(var j=0;j<attrNames.length;j++){var v=attrValues[j];v=v.replace(equalReplace,equal);v=v.replace(quoteReplace,quote);v=v.replace(questionReplace,question);embedAttr=embedAttr.concat('?',attrNames[j],'=',v);}}}objAttr=objAttr.concat('"');paramAttr=paramAttr.concat('"');embedAttr=embedAttr.concat('"');var imageAttr=objAttr+" "+paramAttr+" "+embedAttr;return imageAttr;}function decodeAttributes(tagObj){var objAttr=tagObj.getAttributeValue("obj");if(objAttr==null)return creatDefaultFlashObjectTags();var paramAttr=tagObj.getAttributeValue("param");var embedAttr=tagObj.getAttributeValue("embed");var pArray=new Array(objAttr,paramAttr,embedAttr);var tagArray=new Array();var equal="&eqs;";var quote="&quot;";var question="&quest;";var equalReplace=new RegExp(equal,'g');var quoteReplace=new RegExp(quote,'g');var questionReplace=new RegExp(question,'g');for(var i=0;i<pArray.length;i++){var tObj;if(i==0){tObj=new TagObject();tObj.setTagName("object");}else if(i==2){tObj=new TagObject();tObj.setTagName("embed");}var attr=pArray[i].substring(2,pArray[i].length-1);var pairs=attr.split('?');for(var j=0;j<pairs.length;j++){var nvpair=pairs[j].split('=');var name=nvpair[0];name=name.replace(quoteReplace,'"');var value=nvpair[1];value=value.replace(equalReplace,'=');value=value.replace(quoteReplace,'"');value=value.replace(questionReplace,'?');if(i==0||i==2){tObj.addAttribute(name,value);}else{tObj=new TagObject();tObj.setTagName("param");tObj.addAttribute('name',name);tObj.addAttribute('value',value);tagArray[tagArray.length]=tObj;}}if(i!=1)tagArray[tagArray.length]=tObj;}return tagArray;}function getTagByName(tagObjs,tagName){for(var i=0;i<tagObjs.length;i++){var tObj=tagObjs[i];if(tObj.getTagName()==tagName)return tObj;}return null;}function getParameterTagWithName(tagObjs,paramName){paramName=paramName.toLowerCase();for(var i=0;i<tagObjs.length;i++){var tObj=tagObjs[i];if(tObj.getTagName()!='param')continue;var name=tObj.getAttributeValue('name');name=name.toLowerCase();if(name!=paramName)continue;return tObj;}return null;}function creatDefaultFlashObjectTags(){var tagObjs=new Array();var objTag=new TagObject();objTag.setTagName('object');objTag.addAttribute('classid','"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"');objTag.addAttribute('codebase','"http: 
add: tinyMCE.importPluginLanguagePack('flash','en,de,sv,zh_cn,cs,fa,fr_ca,fr');function TinyMCE_flash_getControlHTML(control_name){switch(control_name){case "flash":return '<img id="{$editor_id}_flash" src="{$pluginurl}/images/flash.gif" title="{$lang_insert_flash}" width="20" height="20" class="mceButtonNormal" onmouseover="tinyMCE.switchClass(this,\'mceButtonOver\');" onmouseout="tinyMCE.restoreClass(this);" onmousedown="tinyMCE.restoreAndSwitchClass(this,\'mceButtonDown\');" onclick="tinyMCE.execInstanceCommand(\'{$editor_id}\',\'mceFlash\');" />';}return "";}function TinyMCE_flash_parseAttributes(attribute_string){var attributeName="";var attributeValue="";var withInName;var withInValue;var attributes=new Array();var whiteSpaceRegExp=new RegExp('^[ \n\r\t]+','g');if(attribute_string==null||attribute_string.length<2)return null;withInName=withInValue=false;for(var i=0;i<attribute_string.length;i++){var chr=attribute_string.charAt(i);if((chr=='"'||chr=="'")&&!withInValue)withInValue=true;else if((chr=='"'||chr=="'")&&withInValue){withInValue=false;var pos=attributeName.lastIndexOf(' ');if(pos!=-1)attributeName=attributeName.substring(pos+1);attributes[attributeName.toLowerCase()]=attributeValue.substring(1).toLowerCase();attributeName="";attributeValue="";}else if(!whiteSpaceRegExp.test(chr)&&!withInName&&!withInValue)withInName=true;if(chr=='='&&withInName)withInName=false;if(withInName)attributeName+=chr;if(withInValue)attributeValue+=chr;}return attributes;}function TinyMCE_flash_execCommand(editor_id,element,command,user_interface,value){function getAttrib(elm,name){return elm.getAttribute(name)?elm.getAttribute(name):"";}switch(command){case "mceFlash":var name="",swffile="",swfwidth="",swfheight="",action="insert";var template=new Array();var inst=tinyMCE.getInstanceById(editor_id);var focusElm=inst.getFocusElement();template['file']='../../plugins/flash/flash.htm';template['width']=400;template['height']=195;if(focusElm!=null&&focusElm.nodeName.toLowerCase()=="img"){name=getAttrib(focusElm,'name');if(name!='mce_plugin_flash')return true;swffile=getAttrib(focusElm,'title');swfwidth=getAttrib(focusElm,'width');swfheight=getAttrib(focusElm,'height');action="update";}tinyMCE.openWindow(template,{editor_id:editor_id,swffile:swffile,swfwidth:swfwidth,swfheight:swfheight,action:action});return true;}return false;}function TinyMCE_flash_cleanup(type,content){switch(type){case "insert_to_editor":var startPos=0;var embedList=new Array();content=content.replace(new RegExp('<[ ]*embed','gi'),'<embed');content=content.replace(new RegExp('<[ ]*/embed[ ]*>','gi'),'</embed>');content=content.replace(new RegExp('<[ ]*object','gi'),'<object');content=content.replace(new RegExp('<[ ]*/object[ ]*>','gi'),'</object>');while((startPos=content.indexOf('<embed',startPos+1))!=-1){var endPos=content.indexOf('>',startPos);var attribs=TinyMCE_flash_parseAttributes(content.substring(startPos+6,endPos));embedList[embedList.length]=attribs;}var index=0;while((startPos=content.indexOf('<object',startPos))!=-1){var endPos=content.indexOf('>',startPos);endPos=content.indexOf('/>',endPos);if(endPos==-1){endPos=content.indexOf('</object>',endPos);endPos+=8;}else endPos+=2;if(index>=embedList.length)break;var attribs=embedList[index];var contentAfter=content.substring(endPos+1);content=content.substring(0,startPos);content+='<img name="mce_plugin_flash" width="'+attribs["width"]+'" height="'+attribs["height"]+'"';content+=' src="'+(tinyMCE.getParam("theme_href")+'/images/spacer.gif')+'" title="'+attribs["src"]+'"';content+=' alt="'+attribs["src"]+'" class="mce_plugin_flash" />'+content.substring(endPos+1);content+=contentAfter;index++;startPos++;}break;case "get_from_editor":var startPos=0;while((startPos=content.indexOf('<img',startPos))!=-1){var endPos=content.indexOf('/>',startPos);var attribs=TinyMCE_flash_parseAttributes(content.substring(startPos+4,endPos));if(attribs['name']!="mce_plugin_flash")break;endPos+=2;var embedHTML='';embedHTML+='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"';embedHTML+=' codebase="http: 
context:  tinyMCE.importPluginLanguagePack('flash','en,de,sv,zh_cn,cs');function TinyMCE_flash_getControlHTML(control_name){switch(control_name){case "flash":return '<img id="{$editor_id}_flash" src="{$pluginurl}/images/flash.gif" title="{$lang_insert_flash}" width="20" height="20" class="mceButtonNormal" onmouseover="tinyMCE.switchClass(this,\'mceButtonOver\');" onmouseout="tinyMCE.restoreClass(this);" onmousedown="tinyMCE.restoreAndSwitchClass(this,\'mceButtonDown\');" onclick="tinyMCE.execInstanceCommand(\'{$editor_id}\',\'mceFlash\');" />';}return "";}function TinyMCE_flash_execCommand(editor_id,element,command,user_interface,value){switch(command){case "mceFlash":var template=new Array();template['file']='../../plugins/flash/flash.htm';template['width']=400;template['height']=180;var name="",swffile="",swfwidth="",swfheight="",mceDo="insert";if(tinyMCE.selectedElement!=null&&tinyMCE.selectedElement.nodeName.toLowerCase()=="img"){tinyMCE.flashElement=tinyMCE.selectedElement;if(tinyMCE.flashElement){name=tinyMCE.flashElement.getAttribute('name')?tinyMCE.flashElement.getAttribute('name'):"";if(name!='mce_plugin_flash')return;swfwidth=tinyMCE.flashElement.getAttribute('width')?tinyMCE.flashElement.getAttribute('width'):"";swfheight=tinyMCE.flashElement.getAttribute('height')?tinyMCE.flashElement.getAttribute('height'):"";swffile=tinyMCE.flashElement.getAttribute('alt')?tinyMCE.flashElement.getAttribute('alt'):"";mceDo="update";}}tinyMCE.openWindow(template,{editor_id:editor_id,swffile:swffile,swfwidth:swfwidth,swfheight:swfheight,mceDo:mceDo});return true;}return false;}function TinyMCE_flash_cleanup(type,content){switch(type){case "insert_to_editor":return TinyMCE_flash_mkCodeCleanup('insertToEditor',content);case "get_from_editor":return TinyMCE_flash_mkCodeCleanup('getFromEditor',content);}return content;}function TinyMCE_flash_handleNodeChange(editor_id,node,undo_index,undo_levels,visual_aid,any_selection){function getAttrib(elm,name){return elm.getAttribute(name)?elm.getAttribute(name):"";}tinyMCE.switchClassSticky(editor_id+'_flash','mceButtonNormal');do{if(node.nodeName.toLowerCase()=="img"&&getAttrib(node,'name').indexOf('mce_plugin_flash')==0)tinyMCE.switchClassSticky(editor_id+'_flash','mceButtonSelected');}while((node=node.parentNode));return true;}function TinyMCE_flash_mkCodeCleanup(action,content){switch(action){case 'insertToEditor':content=replace(content);break;case 'getFromEditor':content=restore(content);break;}return content;}function TagObject(){this.tagName="";this.attributeNames=new Array();this.attributeValues=new Array();this.spaceRemoveRegex=new RegExp('[ ]*','g');this.newLineRemoveRegex=new RegExp('[\n]*','g');};TagObject.prototype.setTagName=function(name){this.tagName=name;};TagObject.prototype.getTagName=function(){return this.tagName;};TagObject.prototype.addAttribute=function(name,value){this.attributeNames[this.attributeNames.length]=name;this.attributeValues[this.attributeValues.length]=value;};TagObject.prototype.getAttributeNames=function(){return this.attributeNames;};TagObject.prototype.getAttributeValues=function(){return this.attributeValues;};TagObject.prototype.populate=function(tag){var stIndex=0;while(tag.charAt(stIndex)!='<')stIndex++;stIndex++;this.tagName=tag.substring(stIndex,tag.indexOf(" "));stIndex=tag.indexOf(" ");var endIndex;while(true){endIndex=tag.indexOf("=",stIndex);if(endIndex==-1)break;var attrName=tag.substring(stIndex,endIndex);attrName=attrName.replace(this.spaceRemoveRegex,"");attrName=attrName.replace(this.newLineRemoveRegex,"");attrName=attrName.toLowerCase();stIndex=endIndex+1;endIndex=tag.indexOf(" ",stIndex);if(endIndex==-1){endIndex=tag.indexOf(">",stIndex);if(endIndex==-1)endIndex=tag.length;}var attrValue=tag.substring(stIndex,endIndex);attrValue=attrValue.replace("/>","");attrValue=attrValue.replace(">","");this.addAttribute(attrName,attrValue);stIndex=endIndex;}};TagObject.prototype.getAttributeValue=function(attribName){for(var i=0;i<this.attributeNames.length;i++){if(this.attributeNames[i]==attribName)return this.attributeValues[i];}return null;};TagObject.prototype.setAttributeValue=function(attribName,attribValue){for(var i=0;i<this.attributeNames.length;i++){if(this.attributeNames[i]==attribName){this.attributeValues[i]=attribValue;return;}}this.addAttribute(attribName,attribValue);};function restore(content){content=content.replace(new RegExp('<[ ]*img','gi'),'<img');var newContent="";var startString;var stImgIndex;var endImgIndex;var imgString;var stIndex=0;var tagObjs;while((stImgIndex=content.indexOf('<img',stIndex))!=-1){startString=content.substring(stIndex,stImgIndex);newContent=newContent.concat(startString);endImgIndex=content.indexOf('/>',stImgIndex);if(endImgIndex==-1)break;stIndex=endImgIndex+"/>".length;imgString=content.substring(stImgIndex,stIndex);var tagObj=new TagObject();tagObj.populate(imgString);if(tagObj.getAttributeValue("name")=='"mce_plugin_flash"'){var width=tagObj.getAttributeValue("width");var height=tagObj.getAttributeValue("height");var src=tagObj.getAttributeValue("alt");var objTags=decodeAttributes(tagObj);var obj=getTagByName(objTags,"object");obj.setAttributeValue("width",width);obj.setAttributeValue("height",height);var embed=getTagByName(objTags,"embed");embed.setAttributeValue("width",width);embed.setAttributeValue("height",height);embed.setAttributeValue("src",src);newContent=newContent.concat(objectTagsToHTML(objTags));}else{newContent=newContent.concat(imgString);}}newContent=newContent.concat(content.substring(stIndex,content.length));return newContent;}function replace(content){content=content.replace(new RegExp('<[ ]*object','gi'),'<object');content=content.replace(new RegExp('<[ ]*/object[ ]*>','gi'),'</object>');var newContent="";var startString;var stObjIndex;var endObjIndex;var objString;var stIndex=0;var tagObjs;while((stObjIndex=content.indexOf('<object',stIndex))!=-1){startString=content.substring(stIndex,stObjIndex);newContent=newContent.concat(startString);endObjIndex=content.indexOf('</object>',stIndex);if(endObjIndex==-1)break;stIndex=endObjIndex+"</object>".length;objString=content.substring(stObjIndex,stIndex);tagObjs=getObjectTags(objString);if(tagObjs.length>0){var objTag=getTagByName(tagObjs,"object");var height=objTag.getAttributeValue("height");var width=objTag.getAttributeValue("width");var embedTag=getTagByName(tagObjs,"embed");var src=embedTag.getAttributeValue("src");var imgAttr=encodeObjectTags(tagObjs);var imgTag='<img width='+width+' height='+height+' alt='+src+' title='+src+' '+imgAttr+' name="mce_plugin_flash" class="mce_plugin_flash" '+'src="'+(tinyMCE.getParam("theme_href")+'/images/spacer.gif" />');newContent=newContent.concat(imgTag);}else{newContent=newContent.concat(objString);}}newContent=newContent.concat(content.substring(stIndex,content.length));return newContent;}function getObjectTags(objStr){var tagObjs=new Array();var tagObject;var stIndex=0;var endIndex=0;stIndex=objStr.indexOf("<object");if(stIndex==-1)return tagObjs;endIndex=objStr.indexOf(">");tagObject=new TagObject();tagObject.populate(objStr.substring(stIndex,endIndex+1));if(tagObject.getAttributeValue("classid")!="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000")return tagObjs;tagObjs[tagObjs.length]=tagObject;objStr=objStr.replace(new RegExp('<[ ]*param','gi'),'<param');objStr=objStr.replace(new RegExp('<[ ]*/param[ ]*>','gi'),'</param>');objStr=objStr.replace(new RegExp('<[ ]*embed','gi'),'<embed');objStr=objStr.replace(new RegExp('<[ ]*/embed[ ]*>','gi'),'</embed>');stIndex=endIndex;while((endIndex=objStr.indexOf("<param",stIndex))!=-1){stIndex=endIndex;endIndex=objStr.indexOf(">",stIndex);tagObject=new TagObject();tagObject.populate(objStr.substring(stIndex,endIndex+1));tagObjs[tagObjs.length]=tagObject;stIndex=endIndex;}endIndex=objStr.indexOf("<embed",stIndex);if(endIndex!=-1){stIndex=endIndex;endIndex=objStr.indexOf(">",stIndex);tagObject=new TagObject();tagObject.populate(objStr.substring(stIndex,endIndex+1));tagObjs[tagObjs.length]=tagObject;stIndex=endIndex;}return tagObjs;}function objectTagsToHTML(objTags){var htmlStr="";for(var i=0;i<objTags.length;i++){var tag=objTags[i];var tagAttrs=tag.getAttributeNames();var tagValues=tag.getAttributeValues();htmlStr=htmlStr.concat('<',tag.getTagName(),' ');for(var j=0;j<tagAttrs.length;j++){htmlStr=htmlStr.concat(tagAttrs[j],'=',tagValues[j],(j<tagAttrs.length-1)?' ':'');}if(tag.getTagName()=="param")htmlStr=htmlStr.concat(' />\n');else htmlStr=htmlStr.concat('>\n');}htmlStr=htmlStr.concat('</embed>\n');htmlStr=htmlStr.concat('</object>\n');return htmlStr;}function encodeObjectTags(objTags){var equal="&eqs;";var quote="&quot;";var question="&quest;";var equalReplace=new RegExp('=','g');var quoteReplace=new RegExp('"','g');var questionReplace=new RegExp("[\?]",'g');var objAttr='obj="';var paramAttr='param="';var embedAttr='embed="';for(var i=0;i<objTags.length;i++){var tagObj=objTags[i];var attrNames=tagObj.getAttributeNames();var attrValues=tagObj.getAttributeValues();if(tagObj.getTagName()=='object'){for(var j=0;j<attrNames.length;j++){var v=attrValues[j];v=v.replace(equalReplace,equal);v=v.replace(quoteReplace,quote);v=v.replace(questionReplace,question);objAttr=objAttr.concat('?',attrNames[j],'=',v);}}else if(tagObj.getTagName()=='param'){var n=tagObj.getAttributeValue("name");var v=tagObj.getAttributeValue("value");n=n.replace(quoteReplace,quote);v=v.replace(equalReplace,equal);v=v.replace(quoteReplace,quote);v=v.replace(questionReplace,question);paramAttr=paramAttr.concat('?',n,'=',v);}else if(tagObj.getTagName()=='embed'){for(var j=0;j<attrNames.length;j++){var v=attrValues[j];v=v.replace(equalReplace,equal);v=v.replace(quoteReplace,quote);v=v.replace(questionReplace,question);embedAttr=embedAttr.concat('?',attrNames[j],'=',v);}}}objAttr=objAttr.concat('"');paramAttr=paramAttr.concat('"');embedAttr=embedAttr.concat('"');var imageAttr=objAttr+" "+paramAttr+" "+embedAttr;return imageAttr;}function decodeAttributes(tagObj){var objAttr=tagObj.getAttributeValue("obj");if(objAttr==null)return creatDefaultFlashObjectTags();var paramAttr=tagObj.getAttributeValue("param");var embedAttr=tagObj.getAttributeValue("embed");var pArray=new Array(objAttr,paramAttr,embedAttr);var tagArray=new Array();var equal="&eqs;";var quote="&quot;";var question="&quest;";var equalReplace=new RegExp(equal,'g');var quoteReplace=new RegExp(quote,'g');var questionReplace=new RegExp(question,'g');for(var i=0;i<pArray.length;i++){var tObj;if(i==0){tObj=new TagObject();tObj.setTagName("object");}else if(i==2){tObj=new TagObject();tObj.setTagName("embed");}var attr=pArray[i].substring(2,pArray[i].length-1);var pairs=attr.split('?');for(var j=0;j<pairs.length;j++){var nvpair=pairs[j].split('=');var name=nvpair[0];name=name.replace(quoteReplace,'"');var value=nvpair[1];value=value.replace(equalReplace,'=');value=value.replace(quoteReplace,'"');value=value.replace(questionReplace,'?');if(i==0||i==2){tObj.addAttribute(name,value);}else{tObj=new TagObject();tObj.setTagName("param");tObj.addAttribute('name',name);tObj.addAttribute('value',value);tagArray[tagArray.length]=tObj;}}if(i!=1)tagArray[tagArray.length]=tObj;}return tagArray;}function getTagByName(tagObjs,tagName){for(var i=0;i<tagObjs.length;i++){var tObj=tagObjs[i];if(tObj.getTagName()==tagName)return tObj;}return null;}function getParameterTagWithName(tagObjs,paramName){paramName=paramName.toLowerCase();for(var i=0;i<tagObjs.length;i++){var tObj=tagObjs[i];if(tObj.getTagName()!='param')continue;var name=tObj.getAttributeValue('name');name=name.toLowerCase();if(name!=paramName)continue;return tObj;}return null;}function creatDefaultFlashObjectTags(){var tagObjs=new Array();var objTag=new TagObject();objTag.setTagName('object');objTag.addAttribute('classid','"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"');objTag.addAttribute('codebase','"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"');tagObjs[tagObjs.length]=objTag;var paramTag=new TagObject();paramTag.setTagName('param');paramTag.addAttribute('name','"quality"');paramTag.addAttribute('value','"high"');tagObjs[tagObjs.length]=paramTag;paramTag=new TagObject();paramTag.setTagName('param');paramTag.addAttribute('name','"menu"');paramTag.addAttribute('value','"false"');tagObjs[tagObjs.length]=paramTag;var embedTag=new TagObject();embedTag.setTagName('embed');embedTag.addAttribute('quality','"high"');embedTag.addAttribute('type','"application/x-shockwave-flash"');embedTag.addAttribute('pluginspace','"http://www.macromedia.com/go/getflashplayer"');tagObjs[tagObjs.length]=embedTag;return tagObjs;}
meta: 5314	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/5314/914f29b169169eaf678616905b5062afd73de30a/editor_plugin.js/buggy/www/extras/tinymce/jscripts/tiny_mce/plugins/flash/editor_plugin.js