function addEvent(elm, evType, fn, useCapture) {
  // cross-browser event handling for IE5+, NS6 and Mozilla 
  // By Scott Andrew 
  if (elm.addEventListener) { 
    elm.addEventListener(evType, fn, useCapture); 
    return true; 
  } else if (elm.attachEvent) { 
    var r = elm.attachEvent('on' + evType, fn); 
    return r; 
  } else {
    elm['on' + evType] = fn;
  }
}

function swapContent(e){
	if (window.event && window.event.srcElement)
    	el = window.event.srcElement.className;
	if (e && e.target)
		el = e.target.className;
	if (!el)
    	return;
	//parent retrieves the div that will hold the visible content	
	var parent = document.getElementById('contentArea');
	//content is the div that holds the class name of the links which are then used to fetch the divs by the same id name
	var content = document.getElementById(el);

	parent.innerHTML="";
	parent.innerHTML=content.innerHTML;
}
function addListeners() {
  if (!document.getElementById)
    return;

//this grabs all the links in the page
var links = $('swapLinks').select('a');
//this iterates through all the links and finds the on
for(i=0;i<links.length;i++){
addEvent(links[i], 'click', swapContent, false);
}

}

addEvent(window, 'load', addListeners, false);
