var navOpen = false;

function swapImg(inImage, t){
	if (t == 1){
		if (inImage.src.indexOf('_on.gif') == -1) {
			inImage.src = inImage.src.slice(0,inImage.src.length-4) + '_on.gif';
		}
	}
	else {
		inImage.src = inImage.src.slice(0,inImage.src.length-7) + '.gif';
	}
}
function swapJpgImg(inImage, t){
	if (t == 1){
		if (inImage.src.indexOf('_on.jpg') == -1) {
			inImage.src = inImage.src.slice(0,inImage.src.length-4) + '_on.jpg';
		}
	}
	else {
		inImage.src = inImage.src.slice(0,inImage.src.length-7) + '.jpg';
	}
}
function openWin(url, height, width) {
	var height = height;
	var width = width;
	var scroll = 0;
	var wleft = (screen.width - width-20) / 2;
	var wtop = (screen.height - height) / 2;
	window.open(url,'newwin','fullscreen=0,scrollbars='+scroll+',height='+height+',width='+width+',top='+wtop+',left='+wleft+'');
}
function openWin2(url, height, width) {
	var height = height;
	var width = width;
	var scroll = 1;
	var wleft = (screen.width - width-20) / 2;
	var wtop = (screen.height - height) / 2;
	window.open(url,'newwin','fullscreen=0,scrollbars='+scroll+',height='+height+',width='+width+',top='+wtop+',left='+wleft+'');
}
function showNav(inSection){
	var sect = document.getElementById(inSection);
	var offset = 15;
	if (inSection == 'aboutnav') {
		offset += 17;
	}
	sect.style.left = document.getElementById('nav').offsetLeft + document.getElementById(inSection + 'td').offsetLeft + offset;
	sect.style.visibility = 'visible';
}
function closeNav(inSection){
	if (!navOpen){
		document.getElementById(inSection).style.visibility = 'hidden';
	}
}
function openWin3 (url,width,height,extras) {
	if (width < 0 || height < 0) {
		newWin = window.open(url,"new_win",extras);
	} else {
		newWin = window.open(url,"new_win","width="+ width +",height="+ height +","+ extras);
	}
}