function $(elemId){
	if(document.getElementById)
		return document.getElementById(elemId);
	else
		return false;
}

window.addListener = function(eventName,listener){
	if(eventName.length > 2 && eventName.substring(0,2) == 'on') eventName = eventName.substring(2,eventName.length);
	if (window.addEventListener) window.addEventListener(eventName, listener, false);
	else if(window.attachEvent) window.attachEvent('on' + eventName, listener);
}

var nstep = 25;
function pageLoad(){
	if(document.getElementById){
		var navDivs = $('nav').getElementsByTagName('div');
		for(var d=0; d<navDivs.length; d++){
			navDivs[d].onmouseover = mkbutton;
		}
		
		if(document.all){
			fadeIn();
		}
	}
}

function fadeIn(){
	var shwobj = $('shadow');
	if(shwobj.filters){
		if(nstep < 100){
			shwobj.filters.alpha.opacity = nstep;
			shwobj.filters.blur.add = true;
			shwobj.filters.blur.strength = Math.floor(30-(nstep*.3));
			nstep++;
			start = setTimeout('fadeIn()',50);
		}
	}
}

function mkbutton(){
	var moClass = 'nav2';
	this.oldClass =  this.className;
	this.className = moClass;
	this.lastChild.className = moClass;
	this.style.cursor = "pointer";
	this.onmouseout = function(){
								this.className =  this.oldClass;
								this.lastChild.className = this.oldClass;
							}
	this.onclick = function(){window.location.href=this.lastChild.href};
}

var lastname = "a0"
function showlyr(q){
	var objName = 'a' + q.id.substring(2,1);
	var obj = $(objName);
	var objlast = $(lastname);
	if(obj){
		objlast.style.display='none';
		obj.style.display='block';
		lastname = objName;
	}
}  

window.addListener('onload', pageLoad);
