function expandContract(linkNode) {
	parentLi=linkNode.parentNode.parentNode;

	regExpClosed=/closed/
	regExpOpen=/open/
	
	if (parentLi.className.indexOf("closed")!=-1) {
		parentLi.className=parentLi.className.replace(regExpClosed, "open");
	} else {	
		parentLi.className=parentLi.className.replace(regExpOpen, "closed");
	}
}

function initExpandContract() {
	// Get all divs in the document.
	allDivs=document.getElementsByTagName("div");

	// Build an array of all divs with the classnames we're interested in.
	selectedDivs=new Array();
	for (i=0; i<allDivs.length; i++) {
		if ( (typeof allDivs[i].className!="undefined") && (allDivs[i].className!=null) ) {
			if ( (allDivs[i].className=="source_logo") || (allDivs[i].className=="source_name") ) {
				selectedDivs[selectedDivs.length]=allDivs[i];
			}
		}
	}

	// Find the a's within them and add onclick events
	for (i=0; i<selectedDivs.length; i++) {
		// Get all a's within the div
		allAs=selectedDivs[i].getElementsByTagName("a");
		if (allAs!=null) {
			// For every one of those a's
			for (j=0; j<allAs.length; j++) {
				// Attach the onclick event
				allAs[j].onclick=function() {
					expandContract(this);
					return false;
				}
			}
		}
	}
}
