//*****************************************************************************
// constants
//*****************************************************************************
/*
var OTHERS = 0;					// other browsers or platforms
var IE4UP = 1;					// IE4 and plus
var NS4UP = 2;					// NS4 and plus
var NS6UP = 3;					// NS6 and plus

var ISWIN = 1;					// windows platform 
var ISMAC = 2;					// Mac platform
*/
//*****************************************************************************
// global variables
//*****************************************************************************
var browser;					// browser			
var platform;					// platform

//LUX06: CHANGED POPUP DIMENSIONS
//var popupWidth=550;				// default width of popup window
//var popupHeight=550;			// default height of popup window	
var popupWidth=542;				// default width of popup window
var popupHeight=683;			// default height of popup window	
var popupLeft;
var popupTop;

//*****************************************************************************
// NAME:       initialize -- Determine browser and platform. We just concern  
//             whether the browser is IE4 plus, Netscape 4 plus or Netscape 6 
//             plus; and whether the platform is Windows or Mac.
// ARGUMENT:   none
// RETURN:     none
//*****************************************************************************
function initialize() {
    // convert all characters to lowercase to simplify testing
    var agt=navigator.userAgent.toLowerCase();

    // *** BROWSER VERSION ***
    // Note: On IE5, these return 4, so use is_ie5up to detect IE5.
    var is_major = parseInt(navigator.appVersion);
    var is_minor = parseFloat(navigator.appVersion);

    // Note: Opera and WebTV spoof Navigator.  We do strict client detection.
    // If you want to allow spoofing, take out the tests for opera and webtv.
    var is_nav  = ((agt.indexOf('mozilla')!=-1) && (agt.indexOf('spoofer')==-1)
                && (agt.indexOf('compatible') == -1) && (agt.indexOf('opera')==-1)
                && (agt.indexOf('webtv')==-1) && (agt.indexOf('hotjava')==-1));
    var is_nav4up = (is_nav && (is_major >= 4));
    var is_nav6up = (is_nav && (is_major >= 5));

    var is_ie     = ((agt.indexOf("msie") != -1) && (agt.indexOf("opera") == -1));
    var is_ie4up  = (is_ie && (is_major >= 4));

    // *** PLATFORM ***
    var is_win   = ( (agt.indexOf("win")!=-1) || (agt.indexOf("16bit")!=-1) );

    var is_mac    = (agt.indexOf("mac")!=-1);
    
    if(is_ie4up) browser = 'IE4UP';
    else if(is_nav6up) browser = 'NS6UP';
    else if(is_nav4up) browser = 'NS4UP';
    else browser = 'OTHERS';

	if(is_win) platform = 'ISWIN';
	else if(is_mac) platform = 'ISMAC';
	else platform = 'OTHERS';

	return browser;
}

//*****************************************************************************
// NAME:       popupWindow -- Pop up a window with the width, height specified 
//             in the global variables
// ARGUMENT:   url --
//             name --
// RETURN:     none
//*****************************************************************************	
function popupWindow(url, name, width, height)
{	
	var popupLeft = 10;
	var popupTop = 10;

	switch (browser)
	{
		case 'IE4UP':
			popupTop = window.screenTop + 10;
			popupLeft = window.screenLeft + 10;
			break;
		case 'NS4UP':
			popupTop = window.screenY + 10;
			popupLeft = window.screenX + 10;
			break;
		case 'NS6UP':
			popupTop = window.screenY + 10;
			popupLeft = window.screenX + 10;
			break;
		default:
			popupTop = 0;
			popupLeft = 0;
			break;
	}

	// set default width/height to popupWidth/popupHeight
	width = width == void 0 ? popupWidth : width;
	height = height == void 0 ? popupHeight : height;

	var popupWin = window.open(url, name, "scrollbars=1,resizable=0,height=" + height + ",width=" + width + ",screenX=" + popupLeft + ",screenY=" + popupTop + ",top=" + popupTop + ",left=" + popupLeft);
//	var popupWin = window.open(url, name, "scrollbars=1,resizable=0,height=" + popupHeight + ",width=" + popupWidth + ",screenX=" + popupLeft + ",screenY=" + popupTop + ",top=" + popupTop + ",left=" + popupLeft);
//  if (!popupWin.opener) popupWin.opener = self; 
	
	popupWin.opener = top;
	
	popupWin.focus();

	return;
}

// this function was used to replace the url in the popup window
// when we maxmize it. we may not need it any more because we won't
// replcase the url and resize the popup window. instead of we will
// close the popup window and opwn a new window with maximum size
//*****************************************************************************
// NAME:       replacePopupWindow -- Make the enlarged popup window reduse to 
//                                   the original size, and replace the window 
//                                   location to the argument URL
// ARGUMENT:   url -- the location of the popup window
//             
// RETURN:     none
//*****************************************************************************	
function replacePopupWindow(url)
{	
	var popupWindow = top;

	popupWindow.location.replace(url);

	if (browser == 'IE4UP') { 
		popupWindow.moveTo(opener.screenLeft+10, opener.screenTop+10);
		popupWindow.resizeTo(popupWidth,popupHeight);
	} 
	if (browser == 'NS4UP' || browser == 'NS6UP') { 
		popupWindow.moveTo(opener.screenX+10, opener.screenY+10);
		popupWindow.outerHeight = 400; 
		popupWindow.outerWidth = 550; 
	}
	popupWindow.focus();

	return;
}
	
//*****************************************************************************
// NAME:       maxPopupWindow -- Maxmize the popup window 
// ARGUMENT:   imagePath --
//             
// RETURN:     none
//*****************************************************************************	
function maxPopupWindow(imagePath)
{
	var width, height;

	if (browser == 'IE4UP') { 
		width = screen.availWidth;
		height = screen.availHeight;
	}
	else if (browser == 'NS4UP' || browser == 'NS6UP') {
		width = screen.availWidth - 10;
		height = screen.availHeight - 10;
	}
	// because the popup window is non-resizable, then we cannot resize it. 
	// we have to close it and open a new window with thw maximum size
	var maxWin = window.open(imagePath, "Maximize", "scrollbars=1,resizable=0,height=" + height + ",width=" + width + ",screenX=0,screenY=0,top=0,left=0");
	top.close();
	maxWin.focus();
  	return;
}

//*****************************************************************************
// NAME:       closeWindow -- Close window
// ARGUMENT:   none
// RETURN:     none
//*****************************************************************************	
function closeWindow()
{
//	self.close();
	top.close();
}

//*****************************************************************************
// NAME:       constructPlayers -- Populates page with appropriate RealMedia 
//             Player version depending on DHTML model
// ARGUMENT:   state -- str representing display mode 
//             'still': base state displaying still image  
//             'video': high-bandwidth full-video stream presentation
//             'audio': low-bandwidth audio-only presentation
//             player -- indicates using RealPlayer or WindowsMediaPlayer to play
//             the video/audio files
// RETURN:     none
//*****************************************************************************	
function constructPlayers(state, player) {
	var autoStart = "true";
	var returnString = "";

	browser = initialize();

	switch (state) {

		case "still" :
			returnString = "<img src=\"" + document.forms.clipdefinition.still.value + "\" height=\"240\" width=\"320\" alt=\"Narrator Photo\">";
			break;

		case "video" :
			// Constructs complete html stream output for ImageWindow and ControlPanel controls.
			// using RealPlayer
			if (player == "real") {
				// RealPlayer object
				returnString = "<object width=\"320\" height=\"240\" id=\"video1\" classid=\"clsid:CFCDAA03-8BE4-11CF-B84B-0020AFBBCCFA\">";
				returnString += "<PARAM NAME=\"autostart\" VALUE=\"" + autoStart + "\">";
				returnString += "<PARAM NAME=\"backgroundcolor\" VALUE=\"black\">";
				returnString += "<PARAM NAME=\"center\" VALUE=\"true\">";
				returnString += "<PARAM NAME=\"console\" VALUE=\"Clip1\">";
				returnString += "<PARAM NAME=\"controls\" VALUE=\"ImageWindow\">";
				returnString += "<PARAM NAME=\"src\" VALUE=\"" + document.forms["clipdefinition"].clip.value + "\">";
				returnString += "<PARAM NAME=\"nologo\" VALUE=\"true\">";
				// embed Real Player plugin for Netscape and IE5/Mac
				returnString += "<embed src=\"" + document.forms["clipdefinition"].clip.value + "\" width=\"320\" height=\"240\" autostart=\"" + autoStart + "\" backgroundcolor=\"black\" center=\"true\" console=\"Clip1\" controls=\"ImageWindow\" nojava=\"false\" nologo=\"true\" pluginspage=\"http://www.real.com/player/\" type=\"audio/x-pn-realaudio-plugin\">";
				returnString += "</embed></object>";
				// RealPlayer control panel object
				returnString += "<br><object classid=\"clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA\" width=\"320\" height=\"36\" id=\"video1\">";
				returnString += "<param name=\"controls\" value=\"ControlPanel\">";
				returnString += "<param name=\"console\" value=\"Clip1\">";
				returnString += "<param name=\"nologo\" value=\"true\">";
				// embed Real Player plugin for Netscape
				returnString += "<embed src=\"" + document.forms["clipdefinition"].clip.value + "\" width=\"320\" height=\"36\" autostart=\"" + autoStart + "\" backgroundcolor=\"black\" center=\"true\" console=\"Clip1\" controls=\"ControlPanel\" nojava=\"false\" nologo=\"true\" pluginspage=\"http://www.real.com/player/\" type=\"audio/x-pn-realaudio-plugin\">";
				returnString += "</embed></object>";
			} else {
				// object of Windows Media Player
				if(browser == "IE4UP") {
					// IE 4 and up on Windows -- using Window Media Player 7.01
					if(platform == 'ISWIN') {
						returnString = "<OBJECT ID=\"Player\" CLASSID=\"CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6\" height=\"280\" width=\"320\">"
//						returnString = "<OBJECT ID=\"Player\" CLASSID=\"CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95\" height=\"310\" width=\"320\">"
						returnString += "<PARAM name=\"autoStart\" value=\"1\">";
						returnString += "<PARAM name=\"showStatusBar\" value=\"0\">";
						returnString += "<PARAM NAME=\"AnimationatStart\" VALUE=\"1\">";
						returnString += "<PARAM NAME=\"ShowControls\" VALUE=\"1\">";
						returnString += "<PARAM name=\"URL\" value=\"" + document.forms["clipdefinition"].clip.value + "\">";
						returnString += "</OBJECT>";
					} else {
						// embed Windows Media Player plugin for IE5/Mac
//						returnString += "<EMBED type=\"application/x-mplayer2\" pluginspage=\"http://www.microsoft.com/Windows/MediaPlayer/\" SRC=\"" + document.forms["clipdefinition"].clip.value + "\" name=\"Player\" width=320 height=280 AutoStart=true>";
						returnString += "<EMBED type=\"video/x-ms-asf-plugin\" pluginspage=\"http://www.microsoft.com/Windows/MediaPlayer/\" SRC=\"" + document.forms["clipdefinition"].clip.value + "\" name=\"Player\" width=\"320\" height=\"287\" AutoStart=\"true\">";
						returnString += "</EMBED></OBJECT>";
					}
				} else {	// Netscape 4 and up -- using Windows Media Player 6.4
					returnString = "<OBJECT ID=\"Player\" width=\"320\" height=\"287\" classid=\"CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95\" standby=\"Loading components...\" type=\"application/x-oleobject\">";
					returnString += "<PARAM NAME=\"FileName\" VALUE=\"" + document.forms["clipdefinition"].clip.value + "\">";
					returnString += "<PARAM NAME=\"AnimationatStart\" VALUE=\"1\">";
					returnString += "<PARAM NAME=\"AutoStart\" VALUE=\"" + autoStart + "\">";
					// embed Windows Media Player plugin for Netscape
					returnString += "<EMBED type=\"application/x-mplayer2\" pluginspage=\"http://www.microsoft.com/Windows/MediaPlayer/\" SRC=\"" + document.forms["clipdefinition"].clip.value + "\" name=\"Player\" width=\"320\" height=\"287\" AutoStart=\"true\">";
					returnString += "</EMBED></OBJECT>";
				}
			}
			break;

		case "audio" :
			returnString = "<img src=\"" + document.forms.clipdefinition.still.value + "\" height=\"240\" width=\"320\" alt=\"Narrator Photo\"><br>";
			if(player == "real") {
				// Real Player control panel only
				returnString += "<object classid=\"clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA\" width=\"320\" height=\"36\" id=\"video1\">";
				returnString += "<param name=\"controls\" value=\"ControlPanel\">";
				returnString += "<param name=\"nologo\" value=\"true\">";
				returnString += "<PARAM NAME=\"autostart\" VALUE=\"" + autoStart + "\">";
				returnString += "<PARAM NAME=\"src\" VALUE=\"" + document.forms["clipdefinition"].clip.value + "\">";
				returnString += "<embed src=\"" + document.forms["clipdefinition"].clip.value + "\" width=\"320\" height=\"36\" autostart=\"" + autoStart + "\" type=\"audio/x-pn-realaudio-plugin\" controls=\"ControlPanel\" nojava=\"false\" nologo=\"true\"></embed></object>";
				returnString += "<br \/><img src=\"/assets/images/spacer.gif\" height=\"24\" width=\"1\" border=\"0\" alt=\"\">"
			} else {
				// Using WindowsMediaPlayer
				if(browser == "IE4UP") {
					if(platform == 'ISWIN') {
						// IE 4 and up -- control panel only
						returnString += "<OBJECT ID=\"Player\" CLASSID=\"CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6\" height=\"40\" width=\"320\">"
						returnString += "<PARAM name=\"autoStart\" value=\"" + autoStart + "\">";
						returnString += "<PARAM NAME=\"AnimationatStart\" VALUE=\"1\">";
						returnString += "<PARAM NAME=\"ShowStatusBar\" VALUE=\"0\">";
						returnString += "<PARAM name=\"URL\" value=\"" + document.forms["clipdefinition"].clip.value + "\">";
						returnString += "</OBJECT>";
						returnString += "<br \/><img src=\"/assets/images/spacer.gif\" height=\"20\" width=\"1\" border=\"0\" alt=\"\">"
					} else {
						// embed Windows Media Player plugin for IE5/Mac
//						returnString += "<EMBED type=\"application/x-mplayer2\" pluginspage=\"http://www.microsoft.com/Windows/MediaPlayer/\" SRC=\"" + document.forms["clipdefinition"].clip.value + "\" name=\"Player\" width=320 height=40 AutoStart=true>";
						returnString += "<EMBED type=\"video/x-ms-asf-plugin\" pluginspage=\"http://www.microsoft.com/Windows/MediaPlayer/\" SRC=\"" + document.forms["clipdefinition"].clip.value + "\" name=\"Player\" width=320 height=40 AutoStart=true>";
						returnString += "</EMBED></OBJECT>";
					}
				} else {	// Netscape 4 and up -- using Windows Media Player 6.4
					returnString += "<OBJECT ID=\"Player\" width=320 height=40 classid=\"CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95\" standby=\"Loading components...\" type=\"application/x-oleobject\">";
					returnString += "<PARAM NAME=\"FileName\" VALUE=\"" + document.forms["clipdefinition"].clip.value + "\">";
					returnString += "<PARAM NAME=\"AnimationatStart\" VALUE=\"1\">";
					returnString += "<PARAM NAME=\"AutoStart\" VALUE=\"" + autoStart + "\">";
					// embed Windows Media Player plugin for Netscape
					returnString += "<EMBED type=\"application/x-mplayer2\" pluginspage=\"http://www.microsoft.com/Windows/MediaPlayer/\" SRC=\"" + document.forms["clipdefinition"].clip.value + "\" name=\"Player\" width=320 height=40 AutoStart=true>";
					returnString += "</EMBED></OBJECT>";
				}
			}
			break;

		default :
		returnString = "<img src=\"" + document.forms.clipdefinition.still.value + "\" height=\"240\" width=\"320\" alt=\"Narrator Photo\">";			
	}

	switch (browser) {
		case 'IE4UP':
			if(state == 'still')
				document.images['Narrator'].src = document.forms.clipdefinition.still.value;
			else
				document.all.divPlayer.innerHTML = returnString;
			break;
		case 'NS6UP':
			if(state == 'still')
				document.images['Narrator'].src = document.forms.clipdefinition.still.value;
			else {
				// dom 1 compliant (NS6+)
				var x = document.getElementById("divPlayer");
				x.innerHTML = returnString;
			}
			break;
		case 'NS4UP':
			// <layer> compatible (NS4+)
			document.layerPlayer.document.open();
			if(state == 'still')
				document.images['Narrator'].src = document.forms.clipdefinition.still.value;
			else {
				document.images['Narrator'].src = "/assets/images/spacer.gif";
    			document.layerPlayer.document.write( "<layer height=\"287px\" width=\"320px\" pagex=\"20\" pagey=\"42\">" + returnString + "</layer>");
			}
			document.layerPlayer.visibility = "visible";
    		document.layerPlayer.document.close();
    		break;

    	default:
   		break;
	}

	return;
}

//*****************************************************************************
// NAME:       showTranscript -- shows and hides transcript with either iframe 
//             or popup support depending on browser
// ARGUMENT:   state -- Boolean. Show or hide the transcript.
// RETURN:     none
//*****************************************************************************	
function showTranscript(state)
{
	// using frame 'Transcript'
	browser = initialize();
	if (state == 1) {
		switch (browser) {
			case 'IE4UP':
				document.all.divTranscript.innerHTML = "<a href=\"javascript:showTranscript(0);\">Hide Transcript</a>";
				break;
			case 'NS6UP':
				var y = document.getElementById("divTranscript");
				y.innerHTML = "<a href=\"javascript:showTranscript(0);\">Hide Transcript</a>";
				break;
			case 'NS4UP':
	    		document.layerTranscript.document.write("<a href=\"javascript:showTranscript(0);\">Hide Transcript</a>");
				document.layerTranscript.document.close();
				break;
		}
		parent.Transcript.location.replace(document.forms.clipdefinition.transcript.value);
	} 
	else {
		switch (browser) {
			case 'IE4UP':
				document.all.divTranscript.innerHTML = "<a href=\"javascript:showTranscript(1);\">Show Transcript</a>";
				break;
			case 'NS6UP':
				var y = document.getElementById("divTranscript");
				y.innerHTML = "<a href=\"javascript:showTranscript(1);\">Show Transcript</a>";
				break;
			case 'NS4UP':
	    		document.layerTranscript.document.write("<a href=\"javascript:showTranscript(1);\">Show Transcript</a>");
				document.layerTranscript.document.close();
		}
		parent.Transcript.location.replace(document.forms.clipdefinition.blank.value);
	}
	return;
}

//*****************************************************************************
// NAME:       showInfo -- Dynamically show the specified text information in the 
//             specified area. You have to define a <div>(IE4UP or NS6UP) or 
//             <layer>(NS4UP) in your HTML file with the specified IDs.
// ARGUMENT:   browser -- String. 'IE4UP', NS4UP, or 'NS6UP'. We only support
//             these browsers.
//             strInfo -- String. The text we will display in the specified 
//             area in navigation bar.
// RETURN:     none
//*****************************************************************************	
function showInfo(browser, strInfo) 
{
	// Writes output to <div id=divPlayer> if IE4+, 
	// to <div id=divPlayer> if dom 1 is supported (i.e. NS6) 
	// or to <layer id=layerPlayer> if NS 4. 

	switch (browser)
	{
		case 'IE4UP':
			document.all.divArea.innerHTML = strInfo;
			break;
		case 'NS4UP':
    		document.layerArea.document.write(strInfo);
    		document.layerArea.document.close();
    		break;
		case 'NS6UP':
			var x = document.getElementById("divArea");
			x.innerHTML = strInfo;
			break;
    	default:
    		break;
	}

	return;
}

//*****************************************************************************	
// NAME:       getCookie -- Get the cookie's value we stored before
// ARGUMENT:   name -- cookie's name
//*****************************************************************************	
function getCookie(name)
{
    var start = document.cookie.indexOf(name+"=");
    var len = start+name.length;

	if (start == -1) return null;
    if (name == document.cookie.substring(start,len++))
    {
		var end = document.cookie.indexOf(";",len);
		if (end == -1) end = document.cookie.length;
		return unescape(document.cookie.substring(len,end));
	}
}

//*****************************************************************************	
// NAME:       setCookie -- Set cookie
// ARGUMENT:   name -- cookie's name
//             value -- cookie's value
//             expires -- cookie's expiration date. Default is the current date
//             path -- Default is empty
//             domain -- Default is empty
//             secure -- Default is none
//*****************************************************************************	
function setCookie(name,value,expires,path,domain,secure)
{
    document.cookie = name + "=" + escape(value) +
        ( (expires) ? ";expires=" + expires.toGMTString() : "") +
        ( (path) ? ";path=" + path : "") + 
        ( (domain) ? ";domain=" + domain : "") +
        ( (secure) ? ";secure" : "");
}

//*****************************************************************************	
// NAME:       deleteCookie -- Set cookie
// ARGUMENT:   name -- cookie's name
//             path -- Default is empty
//             domain -- Default is empty
//*****************************************************************************	
function deleteCookie(name,path,domain)
{
    if (getCookie(name)) document.cookie = name + "=" +
       ( (path) ? ";path=" + path : "") +
       ( (domain) ? ";domain=" + domain : "") +
       ";expires=Thu, 01-Jan-70 00:00:01 GMT";
}

//*****************************************************************************	
// NAME:       setPreference -- Set user's preference for media format and media player
//*****************************************************************************	
function setPreference(msg)
{
	// get the values of media format and media player
	var format, player;
	var x=document.forms.Preference;
	var len = x.length;
	for(var i=0; i<len; i++)
	{
		if((x[i].type == "radio") && (x[i].name == "MediaFormat") && (x[i].checked == true))
			format = x[i].value;
		if((x[i].type == "radio") && (x[i].name == "MediaPlayer") && (x[i].checked == true))
			player = x[i].value;
	}

	// make the expiration date. it will be in next year the same day that user set preference
	var today = new Date();
	var expires_date = new Date(today.getYear()+1, today.getMonth(), today.getDate());

	setCookie("DenshoMediaPlayer",player,expires_date);
	setCookie("DenshoMediaFormat",format,expires_date);

	browser = initialize();
	strInfo = msg;
	switch (browser)
	{
		case 'IE4UP':
			document.all.divPreference.innerHTML = strInfo;
			break;
		case 'NS4UP':
    		document.layerPreference.document.open();
    		document.layerPreference.document.write(strInfo);
    		document.layerPreference.document.close();
    		break;
		case 'NS6UP':
			var x = document.getElementById("divPreference");
			x.innerHTML = strInfo;
			break;
    	default:
    		break;
	}
}



//*****************************************************************************	
// LUX06:ADDED Media detection. Called on /assets/sharedpages/primarysource/content.asp
//*****************************************************************************	

var agt=navigator.userAgent.toLowerCase();
var ie  = (agt.indexOf("msie") != -1);
var ns  = (navigator.appName.indexOf("Netscape") != -1);
var win = ((agt.indexOf("win")!=-1) || (agt.indexOf("32bit")!=-1));
var mac = (agt.indexOf("mac")!=-1);

if (ie && win) {
	pluginlist = detectIE("Adobe.SVGCtl","SVG Viewer") + detectIE("SWCtl.SWCtl.1","Shockwave Director") + detectIE("ShockwaveFlash.ShockwaveFlash.1","Shockwave Flash") + detectIE("rmocx.RealPlayer G2 Control.1","RealPlayer") + detectIE("QuickTimeCheckObject.QuickTimeCheck.1","QuickTime") + detectIE("MediaPlayer.MediaPlayer.1","Windows Media Player") + detectIE("PDF.PdfCtrl.5","Acrobat Reader");
}
if (ns || !win) {
	nse = "";
	for (var i=0;i<navigator.mimeTypes.length;i++) nse += navigator.mimeTypes[i].type.toLowerCase();
	pluginlist = detectNS("image/svg-xml","SVG Viewer") + detectNS("application/x-director","Shockwave Director") + detectNS("application/x-shockwave-flash","Shockwave Flash") + detectNS("audio/x-pn-realaudio-plugin","RealPlayer") + detectNS("video/quicktime","QuickTime") + detectNS("application/x-mplayer2","Windows Media Player") + detectNS("application/pdf","Acrobat Reader");
}

function detectIE(ClassID,name) {
	result = false;
	document.write('<SCRIPT LANGUAGE=VBScript>\n on error resume next \n result = IsObject(CreateObject("' + ClassID + '"))</SCRIPT>\n');
	if (result) return name+',';
	else return '';
}
function detectNS(ClassID,name) {
	n = "";
	if (nse.indexOf(ClassID) != -1) if (navigator.mimeTypes[ClassID].enabledPlugin != null) n = name+","; 
	return n;
}

pluginlist += navigator.javaEnabled() ? "Java," : "";

if (pluginlist.length > 0) pluginlist = pluginlist.substring(0,pluginlist.length-1);



