/*
Notes:

For crossbar rollovers to work
properly, the a tag must have the attribute
'name' set to the root name of the image (i.e. 
'foo' and the images are 'foo.gif' & 'foo-over.gif')
*/

function setUpROs () {
	var cb = document.getElementById('crossbar');
	if (cb) {
		var As = cb.getElementsByTagName("a");
		var AsL = As.length;
		for(i=0; i<AsL; i++) {
			if (As[i].getAttribute('name') != 'null') {
				As[i].onmouseover = function () {
					swapOver(this);
				}
				As[i].onmouseout = function () {
					swapOut(this);
				}
			}
		}
	}
}

window.onload = function () {
	setUpROs();
}

function swapOver (targ) {
	var n = targ.getAttribute('name');
	targ.firstChild.setAttribute('src', '/images/stories/logo_bar/'+n+'-over.gif');
}
function swapOut (targ) {
	var n = targ.getAttribute('name');
	targ.firstChild.setAttribute('src', '/images/stories/logo_bar/'+n+'.gif');
}


function setupDisclaimer() { 
	var disLink;
	if (disLink = document.getElementById("disclaimer_link")) {
		disLink.onclick = function () {
			 if (window.open(disLink.getAttribute("href"), 'Genesco Inc. News Disclaimer','width=600,height=400,scrollbars=no,status=no'))
			 return false; 
		}
	}
}
addLoadEvent(setupDisclaimer);

function addLoadEvent (func) {
	var oldonload = window.onload;
	if (typeof window.onload != "function") {
		window.onload = func();
	} else {
		window.onload = function() {
			oldonload();
			func();
		}
	}
}