// Form initialization
function initialize() {
	
	// Need a better interface for this
	if (typeof(procedures) != 'undefined') {
		for (var p = 0; p < procedures.length; p++) {
			procedures[p]();
		}
	}
	
	if (!document.getElementsByTagName) return;
	
	var anchors = document.getElementsByTagName('a');
	
	var path = window.location.pathname;
	
	var page = path.substring(path.lastIndexOf('/') + 1);
	
	for (var i = 0; i < anchors.length; i++) {
		var anchor = anchors[i];
		
		if (anchor.getAttribute('href')
				&& (
						anchor.getAttribute('href') == page
						|| page.match(/(.*?)_/) && anchor.getAttribute('href').match(/(.*?)\./)[1] == page.match(/(.*?)_/)[1]
						|| anchor.getAttribute('href') == 'index.html' && page.length == 0
						)) {
			anchor.className = 'current';
		}
		
		// Set popup links
		if (anchor.getAttribute('href') && anchor.getAttribute('rel') == 'external') anchor.target = '_blank';
	}
	
}
