You can use this function to check once every second for plugin support and if installed.
function googleEarthErrors() {
if (google.earth.isSupported()) {
alert('Google Earth Plugin is supported for this browser');
} else {
alert('Google Earth Plugin is NOT supported for this browser');
return false;
}
if (google.earth.isInstalled()) {
alert('Google Earth Plugin is installed');
} else {
alert('Google Earth Plugin is NOT installed');
setTimeout('googleEarthErrors()', 1000);
}
Obviously you will want to replace the alerts with something more useful and less annoying :)
Also, you should check out this answer -
How to check for presence of the google earth plugin using JavaScript?