var W3CDOM = (document.createElement && document.getElementsByTagName);
var mouseOvers = new Array();
var mouseOuts = new Array();
var mouseDowns = new Array();

window.onload = init;

function init(){
	if (!W3CDOM) return;
	var nav = document.getElementById('globalNav');
	var imgs = nav.getElementsByTagName('img');
		for (var i=0;i<imgs.length;i++){
			if(imgs[i].className=='inactive'){
			imgs[i].onclick = mouseGoesDown;
			imgs[i].onmouseover = mouseGoesOver;
			imgs[i].onmouseout = mouseGoesOut;
			var suffix = imgs[i].src.substring(imgs[i].src.lastIndexOf('.'));
			mouseOuts[i] = new Image();
			mouseOuts[i].src = imgs[i].src;
			mouseOvers[i] = new Image();
			mouseOvers[i].src = imgs[i].src.substring(0,imgs[i].src.lastIndexOf('-')) + "-hover" + suffix;
			mouseDowns[i] = new Image();
			mouseDowns[i].src = imgs[i].src.substring(0,imgs[i].src.lastIndexOf('-')) + "-click" + suffix;;
			imgs[i].number = i;
		}
	}
}

function mouseGoesOver(){
	this.src = mouseOvers[this.number].src;
}

function mouseGoesOut(){
	this.src = mouseOuts[this.number].src;
}

function mouseGoesDown(){
	this.src = mouseDowns[this.number].src;
}

function jump(targ,selObj,restore){
	eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
	if (restore) selObj.selectedIndex=0;
}

function redir(){
  location=document.quicklinks.jump.options[document.quicklinks.jump.selectedIndex].value;
}

function swap(city){
	document.world.src="/international/lib/img/"+city+"x.gif";
	document.local.src="/international/lib/img/"+city+".gif";
}

