<!--hide this script from non-javascript-enabled browsers

//////////////////////////////////////////////////////////
//
// Chemistry for Biologists Jmol / CHIME pop-up window
//
// Produced by Presenting Science
//  www.PresentingScience.com
//
// Copyright (C) Royal Society of Chemistry
//
//////////////////////////////////////////////////////////


var chimeWin= null;


function doJmol(folder_path, molecule) {
        if (molecule.length==0)
            url = folder_path+"/index.htm";
        else
            url = folder_path+"/index.htm?molecule="+molecule+"&display=jmol";

	if (chimeWin && !chimeWin.closed) {
                chimeWin.location = url;
		chimeWin.focus();
        }
	else {
                var w = 520;
                var h = 480;
                var l = (screen.width - w)/2;
                var t = (screen.height - h)/2;
		chimeWin = window.open(url,
			"structure",
			"status=no,scrollbars=yes,resizable=yes,"+
			"width="+w+",height="+h+
			",top="+t+",left="+l+
                        ",screenY="+t+",screenX="+l);

       		chimeWin.focus();
	}
	
}

function doChime(folder_path, molecule) {
        if (molecule.length==0)
            url = folder_path+"/index.htm";
        else
            url = folder_path+"/index.htm?molecule="+molecule+"&display=chime";

	if (chimeWin && !chimeWin.closed) {
                chimeWin.location = url;
		chimeWin.focus();
        }
	else {
                var w = 520;
                var h = 480;
                var l = (screen.width - w)/2;
                var t = (screen.height - h)/2;
		chimeWin = window.open(url,
			"structure",
			"status=no,scrollbars=yes,resizable=yes,"+
			"width="+w+",height="+h+
			",top="+t+",left="+l+
                        ",screenY="+t+",screenX="+l);

       		chimeWin.focus();
	}
}

function closePopUps() {
	if (chimeWin && !chimeWin.closed) {
            chimeWin.close();
        }
}

// stop hiding -->
