/* <![CDATA[ */
function scanErrors() {
	bolds = document.getElementsByTagName('b');
	
	//alert("debug: " + bolds.length);
	
	for (index = 0; index < bolds.length; index++) {
		if(bolds[index].innerText != undefined){
			if (bolds[index].innerText.match('(Strict Standards|Warning|Notice|(Parse|Fatal) error)')) {
		 		current_node = bolds[index].previousSibling.previousSibling;
				wrapper = document.createElement('div');
		 		wrapper.className = 'php_error_wrapper';
				wrapper_parent = current_node.parentNode;
		 		wrapper_parent.appendChild(wrapper);

				for (child = 0; child < 7; child++) {
					if (current_node.tagName == 'A') child -= 2;
		 			next_node = current_node.nextSibling;
					wrapper.appendChild(current_node);
					if (!(current_node = next_node)) break;
		 		}
				link = document.createElement('a');
				link.href = 'txmt://open?url=file://' + bolds[index-0+1].innerText + '&line=' + bolds[index-0+2].innerText;
				link.innerText = '[Open in TextMate]';
				wrapper.appendChild(document.createTextNode(' '));
				wrapper.appendChild(link);
			}
		}
	}
}
var currentload = window.onload;
if (typeof window.onload != 'function') {
	window.onload = scanErrors;
} else {
	window.onload = function(){ currentload(); scanErrors();}
} /* ]]> */ 