function urchin_hooks() {
	if (!document.getElementsByTagName){ return; }
		
	add_hooks('header');
	add_hooks('left_sidebar');
	add_hooks('right_content');
}
	
function add_hooks(container_element_id) {
	
	var test = new String();

	container_element = document.getElementById(container_element_id)
	
	// Get all anchors in this element
	var anchors = container_element.getElementsByTagName("a");
	
	// Get current document
	var current_document = location.href.substring(7).split("#");
	current_document = current_document[0];
	current_document = current_document.split("/");
	
	// Remove index.html if exists
	
	if(current_document[current_document.length-1] == "index.html")
	{
		current_document.pop();
	}
	
	
	// Remove the domain name
	
		current_document.shift();
		
	// Rejoin
	current_document = current_document.join("/");

	
	// Add trailiing slash if needed
	if(current_document.charAt(current_document.length-1) != "/") {
		current_document += "/"
	}
	
	
	for (var i=0; i<anchors.length; i++) {
		var anchor = anchors[i];
		var this_href = anchor.getAttribute("href");
		
		
		// Override for A/B testing
		if (anchor.getAttribute("rel") == "no_auto_hooks") {
			continue;
		}
		
		if (this_href){
			if(this_href.substring(0,7) == "http://") {
			//test += " " + this_href;
			anchor.onclick = 
				function() {
						var current_href = this.getAttribute("href");					
						urchinTracker('/outgoing/'+current_document+ container_element_id + '/' + current_href.substring(7));
						
						//alert('/outgoing/'+current_document+ container_element_id + '/' + current_href.substring(7));
						
					} 
			} // If external link 
		} // If Href
	} // For all anchors in this container
	
	//alert("External links found in " + container_element_id + ":\n" + test);

	
	
} // End function