var NN3 = false;

image1= new Image();
image1.src = "/button1.jpg";
image1on = new Image();
image1on.src = "/button1dn.jpg";

image2= new Image();
image2.src = "/button2.jpg";
image2on = new Image();
image2on.src = "/button2dn.jpg";

image3= new Image();
image3.src = "/button3.jpg";
image3on = new Image();
image3on.src = "/button3dn.jpg";

image4= new Image();
image4.src = "/button4.jpg";
image4on = new Image();
image4on.src = "/button4dn.jpg";

image5= new Image();
image5.src = "/button5.jpg";
image5on = new Image();
image5on.src = "/button5dn.jpg";

image6= new Image();
image6.src = "/button6.jpg";
image6on = new Image();
image6on.src = "/button6dn.jpg";

image7= new Image();
image7.src = "/button7.jpg";
image7on = new Image();
image7on.src = "/button7dn.jpg";

image8= new Image();
image8.src = "/button8.jpg";
image8on = new Image();
image8on.src = "/button8dn.jpg";

image9= new Image();
image9.src = "/button9.jpg";
image9on = new Image();
image9on.src = "/button9dn.jpg";

image10= new Image();
image10.src = "/button10.jpg";
image10on = new Image();
image10on.src = "/button10dn.jpg";

image11= new Image();
image11.src = "/button11.jpg";
image11on = new Image();
image11on.src = "/button11dn.jpg";

image12= new Image();
image12.src = "/button12.jpg";
image12on = new Image();
image12on.src = "/button12dn.jpg";

function on3(name)   {
        document[name].src = eval(name + "on.src");
}
function off3(name)  {
        document[name].src = eval(name + ".src");
}

NN3 = true;

function on(name)  {
        if (NN3) on3(name);
}
function off(name)  {
        if (NN3) off3(name);
}

function jumpTo(where) {

// get present location

var presentLoc=""
var baseURL = ""
var endLoc = ""

for (var k = document.location.href.lastIndexOf(",")-1; k>0 ;k--) {
	if(!k || document.location.href.charAt(k)==','){
	break
	}
	endLoc = document.location.href.charAt(k)+endLoc
	}
for (var j = 0; j < document.location.href.lastIndexOf(",")+1; j++) {
	baseURL += document.location.href.charAt(j)
	}

for (var i = document.location.href.lastIndexOf(",")+1; i < document.location.href.lastIndexOf("."); i++) {
	presentLoc = presentLoc + document.location.href.charAt(i)
	}

newLoc = eval(parseInt(presentLoc)+parseInt(where))

var presentURL = baseURL + presentLoc + ".shtml"
var newURL = baseURL + newLoc + ".shtml"
var startURL = baseURL + "1.shtml"
var endURL = baseURL + endLoc + ".shtml"

if (newLoc > endLoc){
	alert ("End of Series. Going back to beginning")
	document.location.href = startURL
	return
	}

if (where == 'start') {
	if (presentURL == startURL){
		alert ("Already at the beginning.")
		return
	}
	document.location.href = startURL
	return
	}

if (isNaN(newLoc)) {
	alert ("Going to first article.")
	document.location.href = startURL
	return
	}

if (presentURL == startURL && where == -1) {
	alert ("Going to last article.")
	document.location.href = endURL
	return
	}

document.location.href = newURL

}

function popViewer(chart) {
    var chartConsole = null
    chartConsole = window.open(chart, "Chart", "scrollbars,resizable,width=320,height=240")
}

function newViewer(url,features) {
    if (console != null) { console.close() }
    var console = window.open(url, "console", features);
    console.focus()
}

