//var shade_warned = 0;

//MessageAlert() is the MessageCallBack function designated in the
//embed tags which invoke Chime.  All of Chime's messages are sent
//here.  Unexpected messages generate a javascript alert.

function MessageAlert(buttonname, message)
{
	if (message.indexOf("atoms selected!") != -1)
		return;
	else if(message.indexOf("atom selected!") != -1)
		return;
	else if (!(message.length))
		return;
	else if(message.indexOf("script <exiting>") == 0) // Must be leading string.
		return;
	else if(message.indexOf("Rotating about") == 0)
		return;
	else if(message.indexOf("Unable to allocate shade!") == 0)
		return;
	else if(message.indexOf("Requesting ") == 0)
		return;
	else if(message.indexOf("Chime script completed.") == 0)
		return;

// In an earlier version, a single 'Unable to allocate shade!' was passed
// through.  In the present version this message is thrown away.
// The code below is left here in case it is wanted in the future.
//
// This occurs when group coloring is applied to Hb, so we'll spare the
// client.
//	{
		// give this warning just once
//		if (shade_warned)
//			return;
//		else
//			shade_warned = 1;
//	}

	alert(message);
}
