// onload events
window.onload = function() {
	preparePromo();
}

//prepareGallery checks for DOM, gets all a tags within "gallery id," and overrides the click action with showPic.
function preparePromo() {
	if (!document.getElementsByTagName) return false;
	if (!document.getElementById) return false;
	if (!document.getElementById("tabspromo")) return false;
	var gallery = document.getElementById("tabspromo");
	var links = gallery.getElementsByTagName("a");
	for (var i=0; i<links.length; i++) {
			links[i].onmouseover = function() {
				return showPic(this);
		}
	}
}


//showPic swaps out images and cutlines based on the href and title of the link it is passed
function showPic(whichpic) {
	
	if (!document.getElementById("tab_blurbs")) return false;
	var text = whichpic.getAttribute("title") ?
	whichpic.getAttribute("title") : "";
	var tab_blurbs = document.getElementById("tab_blurbs");
	if (tab_blurbs.firstChild==undefined)
	{
		var txtnode=document.createTextNode("");
		tab_blurbs.appendChild(txtnode);
	}
	if (tab_blurbs.firstChild.nodeType == 3) {
		tab_blurbs.firstChild.nodeValue = text;
	}
}

