// JavaScript Document

//This launches the ArcIMS viewer.
function launchViewerWindow(address,vwindow)
{
	//If the viewer window isn't open...
	if(vwindow == null || vwindow.closed) vwindow = window.open(address,"_blank","directories=no,height=700,width=1000,left=10,right=10,location=no,menubar=no,resizeable=no,scrollbars=yes,status=no,toolbar=no");
	else 
	{
		vwindow.location = address;
		vwindow.focus();
	}
	return vwindow;
}

//This launches the database Window.
//It's kind of ugly to do it this way, but it's the only way to keep the database app from stealing the site's window, since I can't modify the database app directly.
function launchDatabaseWindow(dtype,vwindow)
{
	//Translate our little arg into one of the database app addresses.
	var address = "";
	switch(dtype)
	{
		case 0: address = "http://129.116.198.73/scripts/thscmp_cgi/requestProfile.exe";
				break;
		case 1: address = "http://129.116.198.73/scripts/thscmp_cgi/compareProfile.exe";
				break;
		case 2: address = "http://129.116.198.73/scripts/thscmp_cgi/requestProfileinfo.exe";
				break;
	}
	
	if(vwindow == null || vwindow.closed) vwindow = window.open(address,"_blank","directories=no,height=700,width=900,left=10,right=10,location=no,menubar=no,resizeable=no,scrollbars=yes,status=no,toolbar=yes");
	else 
	{
		vwindow.location = address;
		vwindow.focus();
	}
	return vwindow;
}

var viewerwindow = null;
