var its       = new its();
var strViewer = "Unrecognised browser or operating system";
var strUnableDetect = "Unable to detect Oracle IRM Desktop";

// Only run this code if we detect the blog page has any sample code on it.
// We do this by looking to see if a <div id="sealedcontent"> exists.
function fnDetectIRMDesktop () {
	// Netscape on Win32 -> search plugins array for Unsealer
	if (its.win32 && its.nn) {
		strViewer = strUnableDetect;
		for (var i=0; i<navigator.plugins.length; i++) {
			strName = " " + String(navigator.plugins[i].name);
			if (strName.indexOf("SealedMedia") > 0 && strName.indexOf("Unsealer") > 0) {
				strViewer = getVersionString(String(strName));
			}
			if (strName.indexOf("SoftSEAL") > 0 && strName.indexOf("Viewer") > 0) {
				strViewer = getVersionString(String(strName));
			}
		}
	}

	// Netscape or IE5+ on Mac -> search plugins array for Unsealer
	if (its.mac && (its.nn || its.ie5up)) {
		strViewer = strUnableDetect;
		for (var i=0; i<navigator.plugins.length; i++) {
			strName = " " + String(navigator.plugins[i].name);
			if (strName.indexOf("SealedMedia") > 0 && strName.indexOf("Plugin") > 0) {
				strViewer = getVersionString(String(strName));
			}
		}
	}

	// Firefox detection
	if (its.gecko) {
		strViewer = "Unsupported browser or operating system";
	}

	// IE on Win32 -> use ActiveX control to detect Unsealer
	// Tread carefully to handle security exceptions neatly
	if (its.win32 && its.ie) {
		strViewer = strUnableDetect;
		createUnsealerPlugin();
		if (bolUnsealerPluginCreated) {
			strViewer = objUnsealerPlugin.majorVersion + "."
			          + objUnsealerPlugin.minorVersion + "."
			          + objUnsealerPlugin.revisionNumber + "."
			          + objUnsealerPlugin.buildNumber;
		}
	}
}