context: Wicket.replaceOuterHtml = function(element, text) {	    if (element.outerHTML) { // internet explorer or opera		var parent = element.parentNode;       		// find out the element's index and next element (if any). we need to access		// newly created elements to execute theirs <script elements		var i;		var next = null;		for (i = 0; i < parent.childNodes.length; ++i) {			if (parent.childNodes[i] == element) {				if (i != parent.childNodes.length - 1) {       				next = parent.childNodes[i+1]       			}       			break;       			       		}		}				// indicates whether we should manually invoke javascripts in the replaced content		var forceJavascriptExecution = true;	   		var tn = element.tagName;		if (tn != 'TBODY' && tn != 'TR' && tn != "TD" && tn != "THEAD") {						element.outerHTML = text;								} else {	  					// this is a hack to get around the fact that internet explorer doesn't allow the			// outerHtml attribute on table elements							var tempDiv = document.createElement("div");			tempDiv.innerHTML = '<table style="display: none">' + text + '</table>';						element.parentNode.replaceChild(tempDiv.getElementsByTagName(tn).item(0), element);									// this way opera already executes javascripts, so we don't want to execute javascripts later			if (Wicket.Browser.isOpera())				forceJavascriptExecution = false;						}       	    if (forceJavascriptExecution) {			for (var j = i; j < parent.childNodes.length && parent.childNodes[j] != next; ++j) {	   						Wicket.Head.addJavascripts(parent.childNodes[j]);       			}		}    } else {            	// create range and fragment        var range = element.ownerDocument.createRange();        range.selectNode(element);		var fragment = range.createContextualFragment(text);				// get the elements to be added		var elements = new Array();		for (var i = 0; i < fragment.childNodes.length; ++i)			elements.push(fragment.childNodes[i]);        element.parentNode.replaceChild(fragment, element);        		if (document.all != null) {			for (var i in elements) {				Wicket.Head.addJavascripts(elements[i]);			}		}    }		}	
meta: 1204	/local1/tlutelli/issta_data/temp/all_js/javascript/2007_temp/2007/1204/79e7ea8ebb0228537b934e8b370a1c028b489c0e/wicket-ajax.js/clean/wicket/src/main/java/wicket/ajax/wicket-ajax.js