var brwsVer=parseInt(navigator.appVersion);
var curSubMenu2='';
var globalTimer;

if(document.images) {
	ccover = new Array(9);
	ccout = new Array(9);
	ccover[1]=new Image;
	ccout[1]=new Image;
	for(var n=1;n<=8;n++) {
			ccover[n]=new Image;
			ccout[n]=new Image;
	}
	for(var n=1;n<=8;n++) {
			ccover[n].src="graphic2/menu"+n+"a.gif";
			ccout[n].src="graphic2/menu"+n+"b.gif";
	}
}

function ccOn(i) {
		if(document.images) document.images["cc" + i].src=ccover[i].src;
}
function ccOff(i) {
		if(document.images) document.images["cc" + i].src=ccout[i].src;
}

function TF_showBFlayer(LyID){

	if (brwsVer>=4) {

		if (top.visibleLy!='') { top.mouseonLy='';TF_hideBFlayer(top.visibleLy);}
		if (document.all) {
			pageScrollY = parent.frames["main"].document.body.scrollTop;
			eval('parent.frames["main"].document.all.'+LyID).style.top = pageScrollY;
			eval('top.frames["main"].document.all.'+LyID).style.visibility='visible';
			top.visibleLy=LyID;
		}
		else{
			/* code changed to work with Firefox Alexey Zaryaev */
			pageScrollY = parent.frames["main"].window.pageYOffset;
			parent.frames["main"].document.getElementById(LyID).style.top=pageScrollY;
			parent.frames["main"].document.getElementById(LyID).style.visibility='visible';
			/* end code changed */
			top.visibleLy=LyID;
		}
		clearTimeout(top.window.globalTimer);
		top.frames['main'].window.clearTimeout(top.frames['main'].window.btf_timer);
		top.mouseonLy='';
	}
}

function TF_hideBFlayer(LyID){
	if (brwsVer>=4) {
		if ( top.mouseonLy !='') return; //Case:mouseover layer

		if (document.all) {
			if (eval('top.frames["main"].document.all.'+LyID)){
				eval('top.frames["main"].document.all.'+LyID).style.visibility='hidden';
				top.visibleLy='';
			}
		}
		else {
			/* code changed to work with Firefox Alexey Zaryaev */
			if (top.frames["main"].document.getElementById(LyID))
			{
				top.frames["main"].document.getElementById(LyID).style.visibility='hidden';
			}
			/* end code changed */
			top.visibleLy='';
		}
	}
}

function mouseoutLayer(LyID) {
	window.btf_timer = setTimeout('hideself(\''+LyID+'\')',100);
}

function hideself(LyID){
	if (brwsVer>=4) {
		if (document.all) {
			if (eval('document.all.'+LyID).style.visibility == 'visible'){
				eval('document.all.'+LyID).style.visibility='hidden';
				top.visibleLy='';
				top.mouseonLy='';
			}
		}
		else{
			/* code changed to work with Firefox Alexey Zaryaev */
			if (document.getElementById(LyID).style.visibility == 'visible'){
				document.getElementById(LyID).style.visibility='hidden';
				top.visibleLy='';
				top.mouseonLy='';
			}	
			/* end code changed */
		}
	}
}


function mouseonLayer(LyID){
	top.window.clearTimeout(top.window.globalTimer);
	clearTimeout(window.btf_timer);
	top.mouseonLy=LyID;
}


/*------------for bottom frame ---------------------*/
var brwsVer=parseInt(navigator.appVersion);
var timer;
var curSubMenu='';

function showSubMenu(menuId){
	if (brwsVer>=4) {
		if (curSubMenu!='') hideSubMenu();
		if (document.all) {
			eval('document.all.'+menuId).style.visibility='visible';
		} else {
			/* code changed to work with Firefox Alexey Zaryaev */
			document.getElementById(menuId).style.visibility='visible';
			/* end code changed */
		}
		curSubMenu=menuId;
	}
}

function hideSubMenu(){
	if (brwsVer>=4) {
		if (document.all) {
			eval('document.all.'+curSubMenu).style.visibility='hidden';
		} else {
			/* code changed to work with Firefox Alexey Zaryaev */
			document.getElementById(curSubMenu).style.visibility='hidden';
			/* end code changed */
		}
		curSubMenu='';
	}
	top.curSubMenu = '';
}

function addfav(){
	if (document.all) window.external.AddFavorite("http://www.HURT911.org","HURT-911® Accident & Injury Research");
}

/*------------------end for bottom frame ---------------------*/