context:     function(image)     {    	if (!image)    		return;                  if(HTMLArea.is_gecko)      {  			parent = editor.getParentElement();		      	              // delete selected content and replace with image        if (parent.tagName == 'IMG')          editor.execCommand('Delete');                selection = editor._getSelection();        range = editor._createRange(selection);   			var img_element = editor._doc.createElement("IMG");                img_element.src = '/root?node_id=' + image['node_id'] + '&' + image['type'];        img_element.setAttribute('limb_attributes', image['node_id'] + ':' + image['type'] + ':' + image['link_to']);        img_element.border = image['border'];        img_element.alt = image['alt'];        img_element.align = image['align'];        img_element.hspace = image['hspace'];        img_element.vspace = image['vspace'];        new_width = parseInt(image['width']);        new_height = parseInt(image['height']);        if (new_width != 0 && !isNaN(new_width))        	img_element.width = image['width'];        if (new_height != 0 && !isNaN(new_height))        	img_element.height = image['height'];  			        if (image['link_to'])        {          var a = editor._doc.createElement("A");            			  a.href = '/root?node_id=' + image['node_id'] + '&' + image['link_to'];  			  a.target = '_blank';  			  a.appendChild(img_element);  			  node = a;          			}  		  else  		    node = img_element;  			  			editor.insertNodeAtSelection(node);  		}  	  else//IE dirty hack!  	  {        var range = editor._doc.selection.createRange();                // delete selected content and replace with image        if (editor._doc.selection.type == "Control")        {          range.execCommand('Delete');          range = editor._doc.selection.createRange();        }        if (image['link_to'])        {        	idstr = "556e697175657e537472696e67";      	  range.execCommand("CreateLink", null, idstr);      	  coll = editor._doc.getElementsByTagName("A");      	  for(i=0; i<coll.length; i++)      	  {      	  	if (coll[i].href == idstr)      	  	{      			  link_element = coll[i];      			  link_element.href = '/root?node_id=' + image['node_id'] + '&' + image['link_to'];      			  link_element.target = '_blank';      			  img_element = editor._doc.createElement("IMG");      			  img_element.src = '/root?node_id=' + image['node_id'] + '&' + image['type'];      			  link_element.appendChild(img_element);      			}      			      		}      	}        else      	{      		idstr = "\" id=\"556e697175657e537472696e67";      	  range.execCommand("InsertImage", null, idstr);      	  img_element = editor._doc.all['556e697175657e537472696e67'];      	  img_element.removeAttribute("id");      	  img_element.src = '/root?node_id=' + image['node_id'] + '&' + image['type'];      	}      	        img_element.setAttribute('limb_attributes', image['node_id'] + ':' + image['type'] + ':' + image['link_to']);        img_element.border = image['border'];        img_element.alt = image['alt'];        img_element.align = image['align'];        img_element.hspace = image['hspace'];        img_element.vspace = image['vspace'];        new_width = parseInt(image['width']);        new_height = parseInt(image['height']);        if (new_width != 0 && !isNaN(new_width))        	img_element.width = image['width'];        if (new_height != 0 && !isNaN(new_height))        	img_element.height = image['height'];                range.collapse(false);  	  }    }	  
meta: 8196	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/8196/2a95aee0924e41cc8be71e53596a918d46619318/htmlarea_extension.js/buggy/trunk/shared/js/htmlarea_extension.js