// JavaScript Document

    var javawsInstalled="false";
    var javaws14Installed="false";
    var javaws15Installed="false";  
    
    isIE = "false"; 
    if (navigator.mimeTypes && navigator.mimeTypes.length) 
    { 
        x = navigator.mimeTypes['application/x-java-jnlp-file']; 
        if (x) 
        { 
            javawsInstalled="true";
            javaws14Installed="true";
            javaws15Installed="true";
        } 
    } 
    else 
    { 
       isIE = "true"; 
    } 


	

    function launchmpowerplayer( link )
    {
	    /* Note that the logic below always launches the JNLP application
	     * if the browser is Gecko based. This is because it is not possible
	     * to detect MIME type application/x-java-jnlp-file on Gecko-based browsers. 
	     */
// Seems to work just fine in Firefox.
//	    if (javawsInstalled == "true" || (navigator.userAgent.indexOf("Gecko") !=-1)) 
	    if ( ( javawsInstalled == "true" ) || ( javaws14Installed == "true" ) || ( javaws15Installed == "true" ) ) 
	    {
	    	window.open( link, "_parent" );
	    } 
	    else 
	    {
	        var width = 525;
	        var height = 150;
	        var x = ( screen.width / 2 ) - ( width / 2 );
	        var y = ( screen.height / 2 )  - ( height / 2 );

			noJavaWindow = window.open("", "noJavaWindow", "menubar=no,toolbar=no,resizable=no,status=no,width="+width+",height="+height+",left="+x+",top="+y);
			noJavaWindow.document.title="Java Web Start Not Found";
			noJavaWindow.document.write("<br><br><center>Java is not installed.  Click ");
            noJavaWindow.document.write("<a href=\"javascript:opener.location.href='http://www.java.com/en/download/';window.close();\">here</a>");
			noJavaWindow.document.write(" to download and install Java 5.0.</center>");
			noJavaWindow.document.close();
	    }
	}
