rem: if (parentNode.nodeType == 1) { 
add: if (parentNode.nodeType == 1) { 
context: function TinyMCE_advanced_handleNodeChange (editor_id, node, undo_index,															  undo_levels, visual_aid, any_selection){	function selectByValue(select_elm, value)	{		if (select_elm)		{			for (var i=0; i<select_elm.options.length; i++)			{				if (select_elm.options[i].value == value)				{					select_elm.selectedIndex = i;					return true;				}			}		}		return false;	};	function getAttrib(elm, name)	{		return elm.getAttribute(name) ? elm.getAttribute(name) : "";	};	// No node provided	if (node == null)	{		return;	}	// Update path	var pathElm = document.getElementById(editor_id + "_path");		if (pathElm)	{		// Get node path		var parentNode = node;		var path = new Array();				while (parentNode)		{			if (parentNode.nodeName.toLowerCase() == "body")			{				break;			}			// Only append element nodes to path			if (parentNode.nodeType == 1)			{				path[path.length] = parentNode;			}			parentNode = parentNode.parentNode;		}		// Setup HTML		var html = "";		for (var i=path.length-1; i>=0; i--)		{			var nodeName = path[i].nodeName.toLowerCase();			var nodeData = "";			if (nodeName == "b")			{				nodeName = "strong";			}			if (nodeName == "i")			{				nodeName = "em";			}			if (getAttrib(path[i], 'id') != "")			{				nodeData += "id: " + path[i].getAttribute('id') + " ";			}			var className = tinyMCE.getVisualAidClass(tinyMCE.getAttrib(path[i], "class"), false);			if (className != "" && className.indexOf('mceItem') == -1)				nodeData += "class: " + className + " ";			if (getAttrib(path[i], 'src') != "")			{				nodeData += "src: " + path[i].getAttribute('src') + " ";			}			if (getAttrib(path[i], 'href') != "")			{				nodeData += "href: " + path[i].getAttribute('href') + " ";			}			if (nodeName == "img" && tinyMCE.getAttrib(path[i], "class").indexOf('mceItemFlash') != -1)			{				nodeName = "flash";				nodeData = "";			}			if (nodeName == "a" && (anchor = tinyMCE.getAttrib(path[i], "name")) != "")			{				nodeName = "a";				nodeName += "#" + anchor;				nodeData = "";			}			if (getAttrib(path[i], 'name').indexOf("mce_") != 0)			{				var className = tinyMCE.getVisualAidClass(tinyMCE.getAttrib(path[i], "class"), false);				if (className != "" && className.indexOf('mceItem') == -1)					nodeName += "." + className;			}			if (tinyMCE.isMSIE)			{				html += '<a title="' + nodeData + '" href="javascript:void(0);" onmousedown="tinyMCE.execInstanceCommand(\'' + editor_id + '\',\'mceSelectNodeDepth\',false,\'' + i + '\');return false;" class="mcePathItem">' + nodeName + '</a>';			}			else			{				html += '<a title="' + nodeData + '" href="javascript:tinyMCE.execInstanceCommand(\'' + editor_id + '\',\'mceSelectNodeDepth\',false,\'' + i + '\');" class="mcePathItem">' + nodeName + '</a>';			}			if (i > 0)			{				html += " &raquo; ";			}		}		pathElm.innerHTML = tinyMCE.getLang('lang_theme_path') + ": " + html + '&nbsp;';	}	// Reset old states	tinyMCE.switchClassSticky(editor_id + '_justifyleft', 'mceButtonNormal');	tinyMCE.switchClassSticky(editor_id + '_justifyright', 'mceButtonNormal');	tinyMCE.switchClassSticky(editor_id + '_justifycenter', 'mceButtonNormal');	tinyMCE.switchClassSticky(editor_id + '_justifyfull', 'mceButtonNormal');	tinyMCE.switchClassSticky(editor_id + '_bold', 'mceButtonNormal');	tinyMCE.switchClassSticky(editor_id + '_italic', 'mceButtonNormal');	tinyMCE.switchClassSticky(editor_id + '_underline', 'mceButtonNormal');	tinyMCE.switchClassSticky(editor_id + '_strikethrough', 'mceButtonNormal');	tinyMCE.switchClassSticky(editor_id + '_bullist', 'mceButtonNormal');	tinyMCE.switchClassSticky(editor_id + '_numlist', 'mceButtonNormal');	tinyMCE.switchClassSticky(editor_id + '_sub', 'mceButtonNormal');	tinyMCE.switchClassSticky(editor_id + '_sup', 'mceButtonNormal');	tinyMCE.switchClassSticky(editor_id + '_anchor', 'mceButtonNormal');	tinyMCE.switchClassSticky(editor_id + '_link', 'mceButtonDisabled', true);	tinyMCE.switchClassSticky(editor_id + '_unlink', 'mceButtonDisabled', true);	tinyMCE.switchClassSticky(editor_id + '_outdent', 'mceButtonDisabled', true);	tinyMCE.switchClassSticky(editor_id + '_image', 'mceButtonNormal');	tinyMCE.switchClassSticky(editor_id + '_hr', 'mceButtonNormal');	if (node.nodeName == "A" && tinyMCE.getAttrib(node, "class").indexOf('mceItemAnchor') != -1)		tinyMCE.switchClassSticky(editor_id + '_anchor', 'mceButtonSelected');	// Get link	var anchorLink = tinyMCE.getParentElement(node, "a", "href");	if (anchorLink || any_selection)	{		tinyMCE.switchClassSticky(editor_id + '_link', anchorLink ? 'mceButtonSelected' : 'mceButtonNormal', false);		tinyMCE.switchClassSticky(editor_id + '_unlink', anchorLink ? 'mceButtonSelected' : 'mceButtonNormal', false);	}	// Handle visual aid	tinyMCE.switchClassSticky(editor_id + '_visualaid', visual_aid ? 'mceButtonSelected' : 'mceButtonNormal', false);	if (undo_levels != -1)	{		tinyMCE.switchClassSticky(editor_id + '_undo', 'mceButtonDisabled', true);		tinyMCE.switchClassSticky(editor_id + '_redo', 'mceButtonDisabled', true);	}	// Within li, blockquote	if (tinyMCE.getParentElement(node, "li,blockquote"))	{		tinyMCE.switchClassSticky(editor_id + '_outdent', 'mceButtonNormal', false);	}	// Has redo levels	if (undo_index != -1 && (undo_index < undo_levels-1 && undo_levels > 0))	{		tinyMCE.switchClassSticky(editor_id + '_redo', 'mceButtonNormal', false);	}	// Has undo levels	if (undo_index != -1 && (undo_index > 0 && undo_levels > 0))	{		tinyMCE.switchClassSticky(editor_id + '_undo', 'mceButtonNormal', false);	}	// Select class in select box	var selectElm = document.getElementById(editor_id + "_styleSelect");		if (selectElm)	{		TinyMCE_advanced_setupCSSClasses(editor_id);		classNode = node;		breakOut = false;		var index = 0;		do		{			if (classNode && classNode.className)			{				for (var i=0; i<selectElm.options.length; i++)				{					if (selectElm.options[i].value == classNode.className)					{						index = i;						breakOut = true;						break;					}				}			}		} while (!breakOut && classNode != null && (classNode = classNode.parentNode));		selectElm.selectedIndex = index;	}	// Select formatblock	var selectElm = document.getElementById(editor_id + "_formatSelect");		if (selectElm)	{		var elm = tinyMCE.getParentElement(node, "p,div,h1,h2,h3,h4,h5,h6,pre,address");				if (elm)		{			selectByValue(selectElm, "<" + elm.nodeName.toLowerCase() + ">");		}		else		{			selectByValue(selectElm, "");		}	}	// Select fontselect	var selectElm = document.getElementById(editor_id + "_fontNameSelect");	if (selectElm) {		var elm = tinyMCE.getParentElement(node);		if (elm) {			var family = tinyMCE.getAttrib(elm, "face");			if (family == '')				family = '' + elm.style.fontFamily;			if (!selectByValue(selectElm, family))				selectByValue(selectElm, "");		} else			selectByValue(selectElm, "");	}	// Select fontsize	var selectElm = document.getElementById(editor_id + "_fontSizeSelect");	if (selectElm) {		var elm = tinyMCE.getParentElement(node);		if (elm) {			var size = tinyMCE.getAttrib(elm, "size");			if (size == '') {				var sizes = new Array('', '8px', '10px', '12px', '14px', '18px', '24px', '36px');				size = '' + elm.style.fontSize;				for (var i=0; i<sizes.length; i++) {					if (('' + sizes[i]) == size) {						size = i;						break;					}				}			}			if (!selectByValue(selectElm, size))				selectByValue(selectElm, "");		} else			selectByValue(selectElm, "0");	}	// Handle align attributes	alignNode = node;	breakOut = false;	do	{		if (!alignNode.getAttribute || !alignNode.getAttribute('align'))		{			continue;		}		switch (alignNode.getAttribute('align').toLowerCase())		{			case "left":				tinyMCE.switchClassSticky(editor_id + '_justifyleft', 'mceButtonSelected');				breakOut = true;			break;			case "right":				tinyMCE.switchClassSticky(editor_id + '_justifyright', 'mceButtonSelected');				breakOut = true;			break;			case "middle":			case "center":				tinyMCE.switchClassSticky(editor_id + '_justifycenter', 'mceButtonSelected');				breakOut = true;			break;			case "justify":				tinyMCE.switchClassSticky(editor_id + '_justifyfull', 'mceButtonSelected');				breakOut = true;			break;		}	} while (!breakOut && (alignNode = alignNode.parentNode));	// Div justification	var div = tinyMCE.getParentElement(node, "div");	if (div && div.style.textAlign == "center")		tinyMCE.switchClassSticky(editor_id + '_justifycenter', 'mceButtonSelected');	// Do special text	if (tinyMCE.isGecko && node.nodeType == 3)	{		var inst = tinyMCE.getInstanceById(editor_id);		var doc = inst.getDoc();		if (doc.queryCommandState("Bold"))		{			tinyMCE.switchClassSticky(editor_id + '_bold', 'mceButtonSelected');		}		if (doc.queryCommandState("Italic"))		{			tinyMCE.switchClassSticky(editor_id + '_italic', 'mceButtonSelected');		}		if (doc.queryCommandState("Underline") &&										  (node.parentNode == null || node.parentNode.nodeName != "A"))		{			tinyMCE.switchClassSticky(editor_id + '_underline', 'mceButtonSelected');		}		if (doc.queryCommandState("Strikethrough"))		{			tinyMCE.switchClassSticky(editor_id + '_strikethrough', 'mceButtonSelected');		}	}	// Handle elements	do	{		switch (node.nodeName.toLowerCase())		{			case "b":			case "strong":				tinyMCE.switchClassSticky(editor_id + '_bold', 'mceButtonSelected');			break;			case "i":			case "em":				tinyMCE.switchClassSticky(editor_id + '_italic', 'mceButtonSelected');			break;			case "u":				tinyMCE.switchClassSticky(editor_id + '_underline', 'mceButtonSelected');			break;			case "strike":				tinyMCE.switchClassSticky(editor_id + '_strikethrough', 'mceButtonSelected');			break;			case "ul":				tinyMCE.switchClassSticky(editor_id + '_bullist', 'mceButtonSelected');			break;			case "ol":				tinyMCE.switchClassSticky(editor_id + '_numlist', 'mceButtonSelected');			break;			case "sub":				tinyMCE.switchClassSticky(editor_id + '_sub', 'mceButtonSelected');			break;			case "sup":				tinyMCE.switchClassSticky(editor_id + '_sup', 'mceButtonSelected');			break;			case "hr":				 tinyMCE.switchClassSticky(editor_id + '_hr', 'mceButtonSelected');			break;			case "img":			if (getAttrib(node, 'name').indexOf('mce_') != 0)			{				tinyMCE.switchClassSticky(editor_id + '_image', 'mceButtonSelected');			}			break;		}	} while ((node = node.parentNode));};
meta: 6462	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/6462/085aef5dcbdbb71d5b97c329c5eed76a4b72c02f/editor_template_src.js/buggy/wp-includes/js/tinymce/themes/advanced/editor_template_src.js