<!--hide this script from non-javascript-enabled browsers

//////////////////////////////////////////////////////////
//
// History of the Periodic Table
//
// Produced by Presenting Science
//  www.PresentingScience.com
//
// Copyright (C) Royal Society of Chemistry &
//		 Presenting Science 2003
//
//////////////////////////////////////////////////////////

function doPrint() {
	parent.contentsFrame.focus();
	parent.contentsFrame.print();
}


//////////////////////////////////////////////////////////
//
// Pop-up windows for scientists and Periodic Table
//
//////////////////////////////////////////////////////////

var tableWin = null;

function doTable(url) {
	if (tableWin && !tableWin.closed) {
		tableWin.focus();
		//tableWin.location = url;
	}
	else {
                var w = 680;
                var h = 480;
                var l = (screen.width - w)/2;
                var t = (screen.height - h)/2;
		tableWin = window.open(url,
			"table",
			"status=no,scrollbars=yes,resizable=yes,"+
			"width="+w+",height="+h+
			",top="+t+",left="+l+
                        ",screenY="+t+",screenX="+l);
	}
	tableWin.focus();
}

var scientistWin = null;

function doScientist(url, scientist) {
        var myurl = url+"?"+scientist;

	if (scientistWin && !scientistWin.closed) {
                scientistWin.location = myurl;
		scientistWin.focus();
        }
	else {
                var w = 640;
                var h = 550;
                var l = (screen.width - w)/2;
                var t = (screen.height - h)/2;
		scientistWin = window.open(myurl,
			"scientist",
			"status=no,scrollbars=yes,resizable=yes,"+
			"width="+w+",height="+h+
			",top="+t+",left="+l+
                        ",screenY="+t+",screenX="+l);

       		scientistWin.focus();
	}
        scientistWin.focus();
}

var answerWin = null;

function doAnswer(url) {
        var myurl = url;

	if (answerWin && !answerWin.closed) {
                answerWin.location = myurl;
		answerWin.focus();
        }
	else {
                var w = 640;
                var h = 480;
                var l = (screen.width - w)/2;
                var t = (screen.height - h)/2;
		answerWin = window.open(myurl,
			"answer",
			"status=no,scrollbars=yes,resizable=yes,"+
			"width="+w+",height="+h+
			",top="+t+",left="+l+
                        ",screenY="+t+",screenX="+l);

       		answerWin.focus();
	}
        answerWin.focus();
}

var popUpWin = null;

function doPopUp(url) {
        var myurl = url;

	if (popUpWin && !popUpWin.closed) {
                popUpWin.location = myurl;
		popUpWin.focus();
        }
	else {
                var w = 640;
                var h = 525;
                var l = (screen.width - w)/2;
                var t = (screen.height - h)/2;
		popUpWin = window.open(myurl,
			"pooup",
			"status=no,scrollbars=yes,resizable=yes,"+
			"width="+w+",height="+h+
			",top="+t+",left="+l+
                        ",screenY="+t+",screenX="+l);

       		popUpWin.focus();
	}
        popUpWin.focus();
}

function closePopUps() {
	if (scientistWin && !scientistWin.closed) {
            scientistWin.close();
        }
	if (tableWin && !tableWin.closed) {
           tableWin.close();
        }
	if (answerWin && !answerWin.closed) {
           answerWin.close();
        }
	if (popUpWin && !popUpWin.closed) {
           popUpWin.close();
        }
}

function doTopic()
{
    var f = document.form;

    if (f && f.topic) {
        var sel = f.topic.selectedIndex;
        if (sel > 0) {
            var folder = f.level[0].checked ? "pre16" : "post16";
            folder += "/" + f.topic.options[sel].value;

            if (parent && parent.contentsFrame)
                parent.contentsFrame.location = folder + "/index.htm";
        }
        else
            parent.contentsFrame.location = "home.htm";  
    }

}

// stop hiding -->
