<!--hide this script from non-javascript-enabled browsers

//////////////////////////////////////////////////////////
//
// Periodic Table of Data
//
// Produced by Presenting Science
//  www.PresentingScience.com
//
// Copyright (C) Royal Society of Chemistry &
//		 Presenting Science 2004
//
//////////////////////////////////////////////////////////

var theTable = null;

function initTable() {
	theTable = document.Table;

	if (theTable && theTable.isLoaded()) {
		theTable.setClickableElements(1, 1);
		theTable.setBack(0, 0, 0);
		theTable.setFore(255, 255, 255);
		theTable.selectAll(0);
		theTable.setClickMode(1);
		theTable.showElementDetail(0, 0);
		getDragMode();
	}
	else
		setTimeout("initTable()", 500);
}

function closePopups() {
    if (helpWindow && !helpWindow.closed) {
        helpWindow.close();
    }
}

var helpWindow = null;

function showHelp(helpFile) {
    if (helpWindow && !helpWindow.closed) {
        helpWindow.location = helpFile;
        helpWindow.focus();
    }
    else {
        var w = 700;
        var h = 600;
        var l = 0;
        var t = 0;
        helpWindow = window.open(helpFile,
            "helpWindow",
            "status=no,scrollbars=yes,resizable=yes,"+
            "width="+w+",height="+h+
            ",top="+t+",left="+l);
    }
}


function sortRAM() {
	theTable.sortRAM();
}

function shuffle() {
	theTable.shuffle();
}

function setDragMode(mode) {
	theTable.setDragMode(mode);
	getDragMode();
}

function getDragMode() {
    var mode = theTable.getDragMode();
	document.form.Mode0.checked = mode==0;
	document.form.Mode1.checked = mode==1;
}

function restore() {
	theTable.restore();
}

function save() {
	theTable.save();
}

// Called by the applet to refresh the list
function update() {
}

function setRAM() {
	var i = document.form.RAM.value - 0;
	theTable.setRAM(i);
	document.form.RAM.value = "";
}
function trace(msg)
{
    if (debug) alert(msg);
}
// stop hiding -->

