//images[id's] to get rollovers
var over = new Array();
var out = new Array();
function addRollovers(idArr) {
	var imgs, a
	if (!document.images) return;

	for (i = 0; i < idArr.length; i++) {
		imgs = getObj(idArr[i]);
		if (!imgs) continue;
		a = imgs.parentNode;
		if (a && a.tagName == 'A'){
			over[i] = new Image();
			out[i] = new Image();
			over[i].src = getRollSrc(imgs.src,"gif",1);
			out[i].src = imgs.src;
			imgs.setAttribute('ro_index',i);
			a.onmouseover = function() { this.childNodes[0].src = over[this.childNodes[0].getAttribute('ro_index')].src; }
			a.onfocus = function() { this.childNodes[0].src = over[this.childNodes[0].getAttribute('ro_index')].src; }
			a.onmouseout = function() { this.childNodes[0].src = out[this.childNodes[0].getAttribute('ro_index')].src; }
			a.onblur = function() { this.childNodes[0].src = out[this.childNodes[0].getAttribute('ro_index')].src; }
		}
	}
}
function getRollSrc(src, ext, hover) {
	return (hover) ? src.replace("."+ext,"_m."+ext) : src.replace("_m."+ext,"."+ext);
}

function initPage() {
	if (document.images) {
	
		addRollovers(arRoll);

		el = getObj('search');
		if (el) {
			shover = function() { this.src = getRollSrc(this.src,"gif",1); }
			snohover = function() { this.src = getRollSrc(this.src,"gif",0); }
			el.onmouseover = shover;
			//el.onfocus = shover;
			el.onmouseout = snohover;
			//el.onblur = snohover;
		}
		el = getObj('enewsgo');
		if (el) { 
			ehover = function() { this.src = getRollSrc(this.src,"gif",1); }
			enohover = function() { this.src = getRollSrc(this.src,"gif",0); }
			el.onmouseover = ehover;
			//el.onfocus = ehover;
			el.onmouseout = enohover;
			//el.onblur = enohover;
		}
		if (document.getElementsByTagName)
			Popper(document.getElementsByTagName('A'));
		else if (document.all.tags)
			Popper(document.all.tags('A'));
		
	}
}

function Popper(els) {
	for (var i = 0; i < els.length; i++) {
	//add event only to those <A>'s with appropriate "rel" attribute
		if (els[i].rel.indexOf("external") >= 0 ) {
			if(els[i].rel.indexOf(':') < 0) {
				els[i].onclick = function() { return PopWin(this.href,'newwindow',650,530); }
			}
			else {
				args = els[i].rel.split(':');
				els[i].onclick = function() { return PopWin(this.href,'newwindow',args[1],args[2]); }
			}
		}
	}// for
}// Popper()

//preload the int nav hover images
images_array = new Array(11);
images_array_r = new Array(11);
for (i=1; i<12; i++)
{
    images_array[i]=new Image();
    images_array[i].src="/images/int/sbb_int_nav_" + i + "b.gif";
}

