var bIEFlashEnabled;

var vBrowserContent;
var vOpSystem;

var req_WIN_IE    = "5.5/6.0/7.0";
var req_WIN_IE_MP = "6.4/7.0/9.0/10.0/11.0";
var req_WIN_IE_SW = "5.0";

var req_WIN_NN    = "7.2";
var req_WIN_NN_SW = "5.0";
var req_WIN_NN_MP = "9.0/10.0/11.0";

var req_WIN_FF    = "1.0/2.0/3.0";
var req_WIN_FF_SW = "5.0";
var req_WIN_FF_MP = "9.0/10.0/11.0";

var req_MAC_IE    = "5.2";
var req_MAC_IE_MP = "6.4/7.1/9.0";
var req_MAC_IE_SW = "5.0";

var req_MAC_NN    = "7.2";
var req_MAC_NN_SW = "5.0";
var req_MAC_NN_QT = "6.4";

var req_MAC_FF    = "2.0/3.0";
var req_MAC_FF_SW = "5.0";
var req_MAC_FF_QT = "7.1";

var req_MAC_SF    = "3.0";
var req_MAC_SF_SW = "5.0";
var req_MAC_SF_QT = "7.1";

var flashversion;
var vToDo;
var vToDoAlert;

var BROWSER;

var bBrowserCont = true;

function BrowserConfig()
{
  this.appName = navigator.userAgent;
  this.appVer  = navigator.appVersion;
  this.dom  = document.getElementById ? 1 : 0;
  this.ostype = "UN";
  this.bwinfo = "";
  this.flashInfo = "";
  this.audInfo = "";

  this.type = ( this.appName.indexOf( 'MSIE' ) != -1 ? 'IE' : ( this.appName.indexOf( 'Netscape' ) != -1 || this.appName.indexOf( 'Navigator' ) != -1 )? 'NN' : this.appName.indexOf( 'Firefox' ) != -1 ? 'FF': this.appName.indexOf( 'Safari' ) != -1 ? 'SF' : 'UN' );

  if( this.type == 'IE' )
  {
    this.verno = this.appVer.indexOf( "MSIE 5.5" ) > -1 ? '5.5' : this.appVer.indexOf( "MSIE 6.0" ) > -1 ? '6.0' : this.appVer.indexOf( "MSIE 7.0" ) > -1 ? '7.0' : this.appVer.indexOf( "MSIE 8.0" ) > -1 ? '8.0' : '0.0';
    this.bwinfo = "Microsoft Internet Explorer ( Version " + this.verinfo + " )";
    this.verinfo = this.verno;
  }
  else if( this.type == 'NN' ) 
  {
    this.verinfo = navigator.userAgent.split('/')[4];
    this.bwinfo = "Netscape Navigator ( Version " + this.verinfo + " )";
    this.verno = parseInt( this.verinfo );
  }
  else if( this.type == 'FF' ) 
  {
    this.verinfo = navigator.userAgent.split('/')[3];
    this.bwinfo = "Mozilla Firefox ( Version " + this.verinfo + " )";
    this.verno = parseInt( this.verinfo );
  }
  else if( this.type == 'SF' ) 
  {
    this.verinfo = navigator.userAgent.split('/')[3];
    this.verinfo = this.verinfo.replace( " Safari", "" );
    this.bwinfo = "Safari ( Version " + this.verinfo + " )";
    this.verno = parseInt( this.verinfo );
  }

  if ( this.appVer.indexOf( "Win" ) != -1 )
  {
    this.osname = "Microsoft Windows";
    this.ostype = "WIN";
  }

  if ( this.appVer.indexOf( "Mac" ) != -1 )
  {
    this.osname = "Macintosh";
    this.ostype = "MAC";
  }

  if ( this.ostype == 'WIN' )
  {
	  this.ie = this.type == 'IE' && parseFloat( this.verno ) >= 5.5 && this.dom ? 1 : 0;
	  this.ns = this.type == 'NN' && ( parseFloat( this.verno ) <= 7.2 && parseFloat( this.verno ) > 4.0 ) && this.dom ? 1 : 0;
	  this.ff = this.type == 'FF' && parseFloat( this.verno ) >= 1.0 && this.dom ? 1 : 0;
  }
  else if ( this.ostype == 'MAC' )
  {
	  this.ff = this.type == 'FF' && parseFloat( this.verno ) >= 2.0 && this.dom ? 1 : 0;
	  this.sf = this.type == 'SF' && parseFloat( this.verno ) >= 3.0 && this.dom ? 1 : 0;
  }
  
  return this
}

var bw = BrowserConfig();

// Check for OS
function isOpSystemOK()
{
  bw = BrowserConfig()

  vOpSystem = "Operating System detected : " + bw.osname;

  vBrowserContent = "<tr bgcolor=\"#AEAEFF\"><td><font style=\"font-family:verdana;font-size:8pt;font-weight:bold;\">Course Requirements</font></td><td ><font style=\"font-family:verdana;font-size:8pt;font-weight:bold;\">Course requires...</font></td><td ><font style=\"font-family:verdana;font-size:8pt;font-weight:bold;\">Your system has...</font></td><td ><font style=\"font-family:verdana;font-size:8pt;font-weight:bold;\">Status </font></td></tr>";

  vToDo = "";

  if( bw.ostype == 'WIN' || bw.ostype == 'MAC' )
    return true;
  else
  {
    vBrowserContent = "";
    vToDo += "<p align=center><font style=\"font-family:verdana;font-size:10pt;\">WTDS Courseware is supported on <br><b>\\'Microsoft Windows 2000\\'</b> and <b>\\'Microsoft Windows XP\\'</b> <br>operating Systems only.<br><br> Please check the WTDS Compatibility Table below.</font>";
    return false;
  }
}

// Check for Browser
function isBrowserOK()
{
  bw = BrowserConfig()

  vToDo = "";
  vCheck = "";

  if ( bw.ostype == 'MAC' )
  {
    if(  bw.type == 'UN' || bw.type == 'IE' || ( bw.type == 'NN' && bw.verno == undefined ) )
    {
      bBrowserCont = false;
      vToDo = "<p align=center><font style=\"font-family:verdana;font-size:10pt;\">The browser your are using is not supported for WTDS Courseware. <br><br>Please install <a href=\\'http://channels.netscape.com/ns/browsers/download.jsp\\' target=new>Netscape Navigator</a> ( version "+eval( "req_"+bw.ostype+"_NN" )+" ) OR <a href=\\'http://www.mozilla-europe.org/en/products/firefox/\\' target=new>FireFox</a> ( version "+eval( "req_"+bw.ostype+"_FF" )+" ).<br><br> For more details, please check compatibility table below.</font></p>";
    }
    else if ( bw.type == 'NN' && !bw.ns )
    {
      bBrowserCont = false;
      vToDo = "<p align=center><font style=\"font-family:verdana;font-size:10pt;\">The Netscape Navigator( version "+bw.verinfo+") browser your are using is not supported for WTDS Courseware. <br><br>Please install <a href=\\'http://channels.netscape.com/ns/browsers/download.jsp\\' target=new>Netscape Navigator</a> ( version "+eval( "req_"+bw.ostype+"_NN" )+" ).<br><br> For more details, please check compatibility table below.</font></p>";
    }
    else
      vBrowserContent += "<tr><td><font style=\"font-family:verdana;font-size:8pt;\">"+bw.appName+"</font></td><td><font style=\"font-family:verdana;font-size:8pt;\">Version "+ eval( "req_"+bw.ostype+"_"+bw.type ) +"</font></td><td ><font style=\"font-family:verdana;font-size:8pt;\">Version "+ bw.verinfo +"</font></td><td><font style=\"font-family:verdana;color:green;font-size:8pt;\">OK</font></td></tr>";
  }

  if ( bw.ostype == 'WIN' )
  {
    if( bw.ns || bw.ie || bw.ff )
      vBrowserContent += "<tr><td><font style=\"font-family:verdana;font-size:8pt;\">"+bw.appName+"</font></td><td><font style=\"font-family:verdana;font-size:8pt;\">Version "+ eval( "req_"+bw.ostype+"_"+bw.type ) +"</font></td><td ><font style=\"font-family:verdana;font-size:8pt;\">Version "+ bw.verinfo +"</font></td><td><font style=\"font-family:verdana;color:green;font-size:8pt;\">OK</font></td></tr>";
    else
    {
      vBrowserContent += "<tr><td><font style=\"font-family:verdana;font-size:8pt;\">"+bw.appName+"</font></td><td><font style=\"font-family:verdana;font-size:8pt;\">Version "+ bw.appVer +"</font></td><td ><font style=\"font-family:verdana;font-size:8pt;\">Version "+ bw.verinfo +"</font></td><td><font style=\"font-family:verdana;color:red;font-size:8pt;\">NOT OK</font></td></tr>";
      vToDo += "<p align=left><font style=\"font-family:verdana;font-size:8pt;font-weight:bold;\">For browser</font><br><font style=\"font-family:verdana;font-size:8pt;\">You need one of the following browsers for WTDS courses.<br>&nbsp;&nbsp;-&nbsp;<a href=\\'http://www.microsoft.com/windows/ie/downloads/default.mspx\\' target=new>Microsoft Internet Explorer</a> ( Version "+eval( "req_"+bw.ostype+"_IE" )+" )<br>&nbsp;&nbsp;-&nbsp;<a href=\\'http://channels.netscape.com/ns/browsers/download.jsp\\' target=new>Netscape Navigator</a> ( Version "+eval( "req_"+bw.ostype+"_NN" )+" ).<br>&nbsp;&nbsp;-&nbsp;<a href=\\'http://www.mozilla.com/firefox/\\' target=new>Mozilla Firefox</a> ( Version "+eval( "req_"+bw.ostype+"_FF" )+" ).<br>For more details, please check compatibility table below.</font></p>";
    }
  }
  
  return ( bw.ns || bw.ie || bw.ff || bw.sf )
}

// Check for Browser
function isBrowserOKStart()
{
  bw = BrowserConfig()

  vToDo = "";
  vToDoAlert = "";

  if( !( bw.ns || bw.ie || bw.ff ) )
  {
    vToDo += "<font style=\"font-family:verdana;font-size:8pt;font-weight:bold;color:red;\">Incompatible Browser</font><br><font style=\"font-family:verdana;font-size:8pt;\">You need one of the following browsers for WTDS courses.<br>&nbsp;&nbsp;-&nbsp;Microsoft Internet Explorer ( Version "+eval( "req_"+bw.ostype+"_IE" )+" ) for Microsoft Windows 2000, XP<br>&nbsp;&nbsp;-&nbsp;Netscape Navigator ( Version "+eval( "req_"+bw.ostype+"_NN" )+" ) for Microsoft Windows 2000, XP<br>&nbsp;&nbsp;-&nbsp;Netscape Navigator ( Version "+eval( "req_"+bw.ostype+"_NN" )+" ) for Macintosh</font><br><br>";

    vToDoAlert += "Incompatible Browser\n\nYou need one of the following browsers for WTDS courses.\n\t- Microsoft Internet Explorer ( Version "+eval( "req_"+bw.ostype+"_IE" )+" ) for Microsoft Windows 2000, XP\n\t- Netscape Navigator ( Version "+eval( "req_"+bw.ostype+"_NN" )+" ) for Microsoft Windows 2000, XP\n\t- Netscape Navigator ( Version "+eval( "req_"+bw.ostype+"_NN" )+" ) for Macintosh";
  }

  return ( bw.ns || bw.ie || bw.ff )
}

// Check for Browser Cookie Enabled
function isCookiesEnabled()
{
  bw = BrowserConfig()

  bRet = navigator.cookieEnabled
  if ( bRet )
    bRet = cookiesEnabled();

  vBrowserContent += "<tr><td><font style=\"font-family:verdana;font-size:8pt;\">Browser Cookies Enabled</font></td><td ><font style=\"font-family:verdana;font-size:8pt;\">Yes</font></td><td ><font style=\"font-family:verdana;font-size:8pt;\">"+ ( bRet ? "Yes" : "No" ) +"</font></td>";
  if ( bRet )
  {
    vBrowserContent += "<td><font style=\"font-family:verdana;color:green;font-size:8pt;\">OK</font></td></tr>";
  }
  else
  {
    vToDo += "<p align=left><font style=\"font-family:verdana;font-size:8pt;font-weight:bold;\">For browser cookies</font><br><font style=\"font-family:verdana;font-size:8pt;\">Cookies are disabled for your "+bw.bwinfo+" broswer. Please enable them. Help available on <a href=# onclick=\"window.open(\\'http://www.trainurself.de/offline/htm/faqs/faqs.htm#Q_2\\')\", \\'faq\\', \\'left=50,top=50,width=750,height=600,channelmode=0,dependent=0,directories=0,fullscreen=0,location=0,menubar=0,resizable=1,scrollbars=1,status=0,toolbar=0\\' )> FAQs.</a><br>For more details, please check compatibility table below. </font><br>";
    vBrowserContent += "<td><font style=\"font-family:verdana;color:red;font-size:8pt;\">Not OK</font></td></tr>";
  }

  return bRet;
}

// Check for Browser Java Enabled
function isJavaEnabled() {

  bw = BrowserConfig()

  if ( bw.ostype == "MAC" ) return true;

  vBrowserContent += "<tr><td><font style=\"font-family:verdana;font-size:8pt;\">Browser Java Enabled</font></td><td ><font style=\"font-family:verdana;font-size:8pt;\">Yes</font></td><td ><font style=\"font-family:verdana;font-size:8pt;\">"+ ( navigator.javaEnabled() ? "Yes" : "No" ) +"</font></td>";

  if ( navigator.javaEnabled() )
  {
    vBrowserContent += "<td><font style=\"font-family:verdana;color:green;font-size:8pt;\">OK</font></td></tr>";
  }
  else
  {
    vToDo += "<p align=left><font style=\"font-family:verdana;font-size:8pt;font-weight:bold;\">For browser JAVA</font><br><font style=\"font-family:verdana;font-size:8pt;\">JAVA is disabled for your "+bw.bwinfo+" broswer. Please enable it. Help available on <a href=# onclick=\"window.open(\\'http://www.trainurself.de/offline/htm/faqs/faqs.htm#Q_4\\')\", \\'faq\\', \\'left=50,top=50,width=750,height=600,channelmode=0,dependent=0,directories=0,fullscreen=0,location=0,menubar=0,resizable=1,scrollbars=1,status=0,toolbar=0\\' )> FAQs.</a><br>For more details, please check compatibility table below. </font><br>";
    vBrowserContent += "<td><font style=\"font-family:verdana;color:red;font-size:8pt;\">Not OK</font></td></tr>";
  }

  return navigator.javaEnabled();
}

// Check for Browser Sockwave Flash Enabled
function isFlashEnabled()
{
  bw = BrowserConfig()

  var isFlashOk = true;

  vBrowserContent += "<tr><td><font style=\"font-family:verdana;font-size:8pt;\">Macromedia Shockwave Flash Plugin</font></td><td ><font style=\"font-family:verdana;font-size:8pt;\">Version "+ eval( "req_"+bw.ostype+"_"+bw.type+"_SW" ) +" and above</font></td>";

  var flashinstalled = false;
  MSDetect = "false";

  if ( bw.type == 'IE' )
  {
    flashinstalled = CheckIEActiveXForFlash();
    bw.flashInfo = "Shockwave Flash " + flashversion
  }
  else
  {
    flashObj = detectPlugin( 'Shockwave Flash' );
    if ( flashObj )
	{
      flashinstalled = true;
      if ( flashObj.description )
      {
        flashDesc = flashObj.description;
        flashversion = parseFloat( flashDesc.replace( "Shockwave Flash ", "" ) )
        bw.flashInfo = flashDesc
      }
    }
    else
      flashinstalled = false;
  }  

  vBrowserContent += "<td><font style=\"font-family:verdana;font-size:8pt;\">Version "+ flashversion +"</font></td>";
  if ( flashinstalled )
  {
    if ( flashversion >= parseFloat( eval( "req_"+bw.ostype+"_"+bw.type+"_SW" ) ) )
    {
      vBrowserContent += "<td><font style=\"font-family:verdana;color:green;font-size:8pt;\">OK</font></td></tr>";
    }
    else
    {
      isFlashOk = false;
      vBrowserContent += "<td><font style=\"font-family:verdana;color:red;font-size:8pt;\">Not OK</font></td></tr>";
    }
  }
  else
  {
    isFlashOk = false;
    vBrowserContent += "<td><font style=\"font-family:verdana;color:red;font-size:8pt;\">Not OK</font></td></tr>";
  }

  if ( !isFlashOk )
  {
    if ( bw.ie )
    {
      vToDo += "<p align=left><font style=\"font-family:verdana;font-size:8pt;font-weight:bold;\">For Shockwave Flash</font><br><font style=\"font-family:verdana;font-size:8pt;\">You do not have right version of Shockwave flash plugin installed OR your browser may be having difficulty locating the Macromedia Shockwave Flash plugin.<br>To check for the installed version, <br>&nbsp;&nbsp;-&nbsp;Under the <b>Tools</b> menu, choose <b>Internet Options</b>.<br>&nbsp;&nbsp;-&nbsp;Click the <b>Security</b> tab at the top of the <b>Internet Options</b> panel.<br>&nbsp;&nbsp;-&nbsp;Click <b>Settings</b> button and then <b>View Objects</b> button. Here you can see the activex installed for Explorer.<br>&nbsp;&nbsp;-&nbsp;Check for <b>Shockwave Flash Object</b>, if present <b>right click</b> on it and select <b>Properties</b> from menu.<br>&nbsp;&nbsp;-&nbsp;Check the <b>Version</b> tab on newly opened window</font><br><font style=\"font-family:verdana;font-size:8pt;\">If you do not have the right version of Macromedia Shockwave Flash plugin installed. Go to the <a href=\\'http://www.macromedia.com\\' target=new>Macromedia Website</a> and install the right version as listed.<br>For more details, please check compatibility table below.</font>"
    }
    if ( bw.ns )
    {
      vToDo += "<p align=left><font style=\"font-family:verdana;font-size:8pt;font-weight:bold;\">For Shockwave Flash</font><br><font style=\"font-family:verdana;font-size:8pt;\">You do not have right version of Shockwave flash plugin installed OR your browser may be having difficulty locating the Macromedia Shockwave Flash plugin. <br>To check for the installed version, <br>&nbsp;&nbsp;-&nbsp;Under the <b>Help</b> menu, choose <b>About Plug-ins</b>. This will show the list of Installed plug-ins for Netscape. <br>&nbsp;&nbsp;-&nbsp;Now search for Shockwave Flash entry.<br>If you do not have the right version of Macromedia Shockwave Flash plugin installed. Go to the <a href=\\'http://www.macromedia.com\\' target=new>Macromedia Website</a> and install the right version as listed.<br>For more details, please check compatibility table below.</font>"
    }
  }
  return isFlashOk;
}

// Check for Browser Windows Media Player Enabled
function isAudioEnabled()
{
   bw = BrowserConfig()

   var vMpVersion = "";
   var quicktimeVersion = "";

   var isAudioOk = false;

   if ( bw.ostype == 'WIN' )
   {
     vBrowserContent += "<tr><td><font style=\"font-family:verdana;font-size:8pt;\">Microsoft Windwos Media player</font></td><td ><font style=\"font-family:verdana;font-size:8pt;\">Version "+ eval( "req_"+bw.ostype+"_"+bw.type+ "_MP" ) + "</font></td>";

     if( bw.ns )
     {
       if( bw.verno >= 7 && bw.verno < 9 )
       {
	       try
	       {
	         audioObject = new GeckoActiveXObject( "WMPlayer.OCX.7" );
	
	         if ( audioObject )
	         {
	           isAudioOk = true;
	           vMpVersion = audioObject.versionInfo
	         }
	       }
	       catch ( ex )
	       {
	         isAudioOk = false;
	       }
	
	       if ( !isAudioOk )
	       {
	         try
	         {
	          audioObject = GeckoActiveXObject( "MediaPlayer.MediaPlayer.1" );
			   if ( audioObject )
	           {
	             isAudioOk = true;
	             vMpVersion = "6.4";
	           }
	         }
	         catch ( ex )
	         {
			   alert(ex)
	           isAudioOk = false;
	         }
	       }
	
	       if ( !isAudioOk )
	         vToDo += "<p align=left><font style='font-family:verdana;font-size:8pt;font-weight:bold;'>For Windows Media player</font><br><font style='font-family:verdana;font-size:8pt;'>You do not have Windods Media Player installed on your system OR Netscape Navigator may be having difficulty locating the Windows Media player plugin.<br>&nbsp;&nbsp;1.&nbsp;If Windows Media player is not installed on your system, you can download it from <a href='http://www.microsoft.com/windows/windowsmedia/9series/player.aspx' target=new>here</a> and install.<br>&nbsp;&nbsp;2.&nbsp;If Windows Media player is installed on your system, check for the installed plugins for Netscape Navigator, <br>&nbsp;&nbsp;&nbsp;&nbsp;-&nbsp;Under the <b>Help</b> menu, choose <b>About Plug-ins</b>. This will show the list of Installed plug-ins for Netscape. <br>&nbsp;&nbsp;&nbsp;&nbsp;-&nbsp;Now search for Windows Media Player entry.<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;If not present, the problem can be solved by uninstalling and installing the Windows Media Player again.<br>&nbsp;&nbsp;3.&nbsp;If you have installed Netscape Navigator after Windows Media Player, you will need to re-install Windows Media Player again.<br>For more details, please check compatibility table below.</font>"
       } 
     }
     else if( bw.ff )
     {
       isAudioOk = false;

	   audioObj = detectPlugin( 'Windows Media Player Firefox Plugin' );
	   if( audioObj )
	     isAudioOk = true;

       if ( !isAudioOk )
       {
          vToDo += "<p align=left><font style='font-family:verdana;font-size:8pt;font-weight:bold;'>For Windows Media player</font><br><font style='font-family:verdana;font-size:8pt;'>You do not have Windods Media Player installed on your system OR Firefox browser may be having difficulty locating the Windows Media player plugin.<br>&nbsp;&nbsp;1.&nbsp;If Windows Media player is not installed on your system, you can download it from <a href='http://www.microsoft.com/windows/windowsmedia/9series/player.aspx' target=new>here</a> and install.<br>&nbsp;&nbsp;2.&nbsp;If Windows Media player is already installed on your system, check for the installed plugins for Firefox browser with the following steps. <br>&nbsp;&nbsp;&nbsp;&nbsp;-&nbsp;Type <b>about:plugins</b> into the address bar. This will show the list of Installed plug-ins for Firefox. <br>&nbsp;&nbsp;&nbsp;&nbsp;-&nbsp;Now search for <b>'Microsoft® Windows Media Player Firefox Plugin'</b> entry. If the <b>'application/x-ms-wmp'</b> is present under it, then the plugin is installed correctly <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;If not present, the problem can be solved by installing the plugin from <a href='http://port25.technet.com/pages/windows-media-player-firefox-plugin-download.aspx' target=new>this</a> website help link.<br>For more details, please check compatibility table below.</font>"
          vMpVersion = "<undefined>";
       }
       else
       {
      	 vMpVersion = "<Compatible>";	   
       }
     }
     else if( bw.ie )
     {
       try
       {
         audioObject = ActiveXObject( "MediaPlayer.MediaPlayer.1" );
         if ( audioObject )
         {
           isAudioOk = true;
           vMpVersion = "6.4";
         }
       }
       catch ( ex )
       {
         isAudioOk = false;
       }

       if ( !isAudioOk )
       {
         try
         {
           audioObject = new ActiveXObject( "WMPlayer.OCX.7" );

		   if ( audioObject )
           {
             isAudioOk = true;
             vMpVersion = audioObject.versionInfo
           }
         }
         catch ( ex )
         {
           isAudioOk = false;
         }
       }

       if( !isAudioOk )
       {
         isAudioOk = CheckIEActiveXForMedia()
         vMpVersion = "6.4";
       }

       if ( !isAudioOk )
       {
         vToDo += "<p align=left><font style='font-family:verdana;font-size:8pt;font-weight:bold;'>For Windows Media Player</font><br><font style='font-family:verdana;font-size:8pt;'>You do not have <b>Microsoft Windows Media player ActiveX</b> installed on your system. Please download it from <a href='http://www.microsoft.com/windows/windowsmedia/9series/player.aspx' target='new'>here</a> and install.<br>For more details, please check compatibility table below.</font>";
       }
     }

     vBrowserContent += "<td><font style=\"font-family:verdana;font-size:8pt;\">Version "+vMpVersion+"</font></td>";

     if ( !isAudioOk )
     {
       vBrowserContent += "<td><font style=\"font-family:verdana;color:red;font-size:8pt;\">Not OK</font></td></tr>";
       return false;
     }

     if ( ( ( bw.ie || bw.ns ) && isAudioOk && parseFloat( vMpVersion ) >= 6.4 ) || ( bw.ff && isAudioOk ) )
     {
       vBrowserContent += "<td><font style=\"font-family:verdana;color:green;font-size:8pt;\">OK</font></td></tr>";
     }
     else
     {
       vBrowserContent += "<td><font style=\"font-family:verdana;color:red;font-size:8pt;\">Not OK</font></td></tr>";
       vToDo += "<p align=left><font style='font-family:verdana;font-size:8pt;font-weight:bold;'>For Windows Media Player</font><br><font style='font-family:verdana;font-size:8pt;'>You do not have right version of 'Microsoft Windows Media player' installed on your system. Please download it from <a href='http://www.microsoft.com/windows/windowsmedia/9series/player.aspx' target='new'>here</a> and install.<br>For more details, please check compatibility table below.</font>";
     }

     bw.audInfo = "Windows Media Player ( Version " + vMpVersion + " )"
   }
   else if ( bw.ostype == 'MAC' )
   {
     vBrowserContent += "<tr><td><font style='font-family:verdana;font-size:8pt;'>QuickTime Media player</font></td><td ><font style='font-family:verdana;font-size:8pt;'>Version "+ eval( "req_"+bw.ostype+"_"+bw.type+ "_QT" ) + "</font></td>";
   
     if( bw.ff || bw.sf )
     {
       audioObj = detectPlugin( 'QuickTime Plug-in' );
	   if ( audioObj )
	   {
	     isAudioOk = true;
         vMpVersion = parseFloat( audioObj.name.replace( "QuickTime Plug-in ", "" ) )
	   }

       vBrowserContent += "<td><font style=\"font-family:verdana;color:black;font-size:8pt;\">Version "+vMpVersion+"</font></td>";
	   
       if ( !isAudioOk )
       {
          vToDo += "<p align=left><font style='font-family:verdana;font-size:8pt;font-weight:bold;'>For QuickTime Media Player</font><br><font style='font-family:verdana;font-size:8pt;'>You do not have QuickTime Media Player installed on your system OR Firefox browser may be having difficulty locating the QuickTime Media player plugin.<br>&nbsp;&nbsp;1.&nbsp;If QuickTime Media player is not installed on your system, you can download it from <a href='http://www.apple.com/de/quicktime' target=new>here</a> and install.<br>&nbsp;&nbsp;2.&nbsp;If QuickTime Media player is already installed on your system, check for the installed plugins for Firefox browser with the following steps. <br>&nbsp;&nbsp;&nbsp;&nbsp;-&nbsp;Type <b>about:plugins</b> into the address bar. This will show the list of Installed plug-ins for Firefox. <br>&nbsp;&nbsp;&nbsp;&nbsp;-&nbsp;Now search for <b>'QuickTime Plug-in'</b> entry. If the <b>'QuickTime Plug-in'</b> is present, then the plugin is installed correctly <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;If not present, the problem can be solved by installing the plugin from <a href='http://www.apple.com/quicktime/' target=new>this</a> website help link.<br>For more details, please check compatibility table below.</font>"
          vBrowserContent += "<td><font style=\"font-family:verdana;color:red;font-size:8pt;\">Not OK</font></td></tr>";
       }
       else if( vMpVersion < 7.1 )
       {
          vToDo += "<p align=left><font style='font-family:verdana;font-size:8pt;font-weight:bold;'>For QuickTime Media Player</font><br><font style='font-family:verdana;font-size:8pt;'>You do not have right version of 'QuickTime Media player' installed on your system. Please download it from <a href='http://www.apple.com/de/quicktime' target='new'>here</a> and install.<br>For more details, please check compatibility table below.</font>";
          vBrowserContent += "<td><font style=\"font-family:verdana;color:red;font-size:8pt;\">NOT OK</font></td></tr>";
       }
       else
       {
          vBrowserContent += "<td><font style=\"font-family:verdana;color:green;font-size:8pt;\">OK</font></td></tr>";
       }
     }
   }

   BROWSER = "#" + bw.ostype + "#" + bw.type + "#" + vMpVersion + "#";

   return isAudioOk;
}

// Check for Screen resolution
function isResolutioinOK( pvBrowser, pvHeight, pvWidth )
{
   bw = BrowserConfig()

   vBrowserContent += "<tr><td><font style=\"font-family:verdana;font-size:8pt;\">Screen Resolution</font></td><td ><font style=\"font-family:verdana;font-size:8pt;\">"+ pvWidth + "x" + pvHeight +"</font></td><td ><font style=\"font-family:verdana;font-size:8pt;\">"+ screen.width + "x" + screen.height +"</font></td>";

   var bRet = true;

   if ( pvBrowser == "default" )
   {
     if( screen.width > pvWidth && screen.height > pvHeight )
     {
       vBrowserContent += "<td><font style=\"font-family:verdana;color:green;font-size:8pt;\">OK</font></td></tr>";
     }
     else
     {
       bRet = false;
       vBrowserContent += "<td><font style=\"font-family:verdana;color:red;font-size:8pt;\">Not OK</font></td></tr>";
       vToDo += "<p align=left><font style=\"font-family:verdana;font-size:8pt;font-weight:bold;\">For Screen resolution</font><br><font style=\"font-family:verdana;font-size:8pt;\">Screen resolution of your system is not compatible with this courseware. Please change them as per the compatibility table.<br>For more details, please check compatibility table below.</font>";
     }
   }

   if ( pvBrowser == "fullscreen" )
   {
     if( screen.width >= pvWidth && screen.height >= pvHeight )
     {
       vBrowserContent += "<td><font style=\"font-family:verdana;color:green;font-size:8pt;\">OK</font></td></tr>";
     }
     else
     {
       bRet = false;
       vBrowserContent += "<td><font style=\"font-family:verdana;color:red;font-size:8pt;\">Not OK</font></td></tr>";
       vToDo += "<p align=left><font style=\"font-family:verdana;font-size:8pt;font-weight:bold;\">For Screen resolution</font><br><font style=\"font-family:verdana;font-size:8pt;\">Screen resolution of your system is "+screen.width+"x"+screen.height+", which is not compatible with this course resolution <b>\""+pvWidth+"x"+pvHeight+"\"</b>. Please change them as per the compatibility table.<br>For more details, please check compatibility table below.</font>";
     }
   }

   return bRet;
}


function isSystemOK( pvBrowser, pvHeight, pvWidth )
{
  var bIsSystemOK = true;

  if ( !isOpSystemOK() )
  {
    bBrowserCont = false;
    return false;
  }
  if ( !isBrowserOK() )
  {
    return false;
  }
  if ( !isResolutioinOK( pvBrowser, pvHeight, pvWidth ) )
  {
    bIsSystemOK = false;
  }

  if ( !isJavaEnabled() )
  {
    bIsSystemOK = false;
  }

  if ( !isCookiesEnabled() )
  {
    bIsSystemOK = false;
  }
  if ( !isFlashEnabled() )
  {
    bIsSystemOK = false;
  }
  if ( !isAudioEnabled() )
  {
    bIsSystemOK = false;
  }
  return bIsSystemOK;
}

function getBrowserContent()
{
  return '<HTML><HEAD>' +
         '<BODY>' +
         '<blink><FONT style="font-family:Verdana;font-size:12pt;font-weight:bold;color:red;">LMS System Check Failure</FONT></blink>' +
         '<br><br><font style="font-family:Verdana;font-size:8pt;font-weight:bold;color:black;">'+vOpSystem+'</b></font><br>' +   ( bBrowserCont ?
         '<br><table BORDER=1 CELLSPACING=0 CELLPADDING=5 COLS=1 WIDTH="70%" >' +
         vBrowserContent +
         '</table>' : "" ) + "<br>" + vToDo + "<br><br>" + 
         '<br><FONT style="font-family:Verdana;font-size:9pt;font-weight:bold;color:blue;">WTDS Compatibility Table</FONT>'+
         '<table><tr><td><div style="background-color:red;width:20;height:10"></div></td><td><font style="font-size: 8pt; font-family: verdana;" size="-1">Not supported</font></td></tr></table></div>'+
         '<table style="width: 100%; text-align: left;" border="1" cellpadding="2" cellspacing="0">' +
         '<tr bgcolor="#AEAEFF">' +
         '<td style="vertical-align: top;"><font style="font-weight: bold; font-size: 8pt; font-family: verdana;" size="-1">Operating System</font></td>' +
         '<td style="vertical-align: top;"><font style="font-weight: bold; font-size: 8pt; font-family: verdana;" size="-1">Browser</font></td>' +
         '<td style="vertical-align: top;"><font style="font-weight: bold; font-size: 8pt; font-family: verdana;" size="-1">Audio / Video Player</font></td>' +
         '<td style="vertical-align: top;"><font style="font-weight: bold; font-size: 8pt; font-family: verdana;" size="-1">Flash Activex</font></td>' +
         '<td width="10%" style="vertical-align: top;"><font style="font-weight: bold; font-size: 8pt; font-family: verdana;" size="-1">Browser Cookies Enabled</font></td>' +
         '<td width="10%" style="vertical-align: top;"><font style="font-weight: bold; font-size: 8pt; font-family: verdana;" size="-1">Browser Java Enabled</font></td>' +
         '<td width="10%" style="vertical-align: top;"><font style="font-weight: bold; font-size: 8pt; font-family: verdana;" size="-1">Browser Pop-up Enabled</font></td>' +
         '</tr>' +

         '<tr>' +
         '<td style="vertical-align: top;" rowspan="4"><font style="font-size: 8pt; font-family: verdana;" size="-1">Microsoft Windows 2000</font></td>' +
         '<td style="vertical-align: top;"><font style="font-size: 8pt; font-family: verdana;" size="-1">Microsoft Internet Explorer<br>Version: 5.5</font></td>' +
         '<td style="vertical-align: top;"><font style="font-size: 8pt; font-family: verdana;" size="-1">Windows Media Player 6.4<br>Windows Media Player 7.1<br>Windows Media Player 9<br><font style="color:red;">Windows Media Player 10</font></td>' +
         '<td style="vertical-align: top;"><font style="font-size: 8pt; font-family: verdana;" size="-1">Version 5.0 <br>and above</font></td>' +
         '<td style="vertical-align: top;"><font style="font-size: 8pt; font-family: verdana;" size="-1">Yes</font></td>' +
         '<td style="vertical-align: top;"><font style="font-size: 8pt; font-family: verdana;" size="-1">Yes</font></td>' +
         '<td style="vertical-align: top;"><font style="font-size: 8pt; font-family: verdana;" size="-1">Yes</font></td>' +
         '</tr>' +

         '<tr>' +
         '<td style="vertical-align: top;"><font style="font-size: 8pt; font-family: verdana;" size="-1">Microsoft Internet Explorer<br> Version: 6.0 with SP1, 7.0</font></td>' +
         '<td style="vertical-align: top;"><font style="font-size: 8pt; font-family: verdana;" size="-1">Windows Media Player 6.4<br>Windows Media Player 7.1<br>Windows Media Player 9<br>Windows Media Player 10</td>' +
         '<td style="vertical-align: top;"><font style="font-size: 8pt; font-family: verdana;" size="-1">Version 5.0 <br>and above</font></td>' +
         '<td style="vertical-align: top;"><font style="font-size: 8pt; font-family: verdana;" size="-1">Yes</font></td>' +
         '<td style="vertical-align: top;"><font style="font-size: 8pt; font-family: verdana;" size="-1">Yes</font></td>' +
         '<td style="vertical-align: top;"><font style="font-size: 8pt; font-family: verdana;" size="-1">Yes</font></td>' +
         '</tr>' +

         '<tr>' +
         '<td style="vertical-align: top;"><font style="font-size: 8pt; font-family: verdana;" size="-1">Netscape Navigator <br> Version: 7.2</font></td>' +
         '<td style="vertical-align: top;"><font style="font-size: 8pt; font-family: verdana;" size="-1">Windows Media Player 6.4<br>Windows Media Player 7.1<br>Windows Media Player 9<br>Windows Media Player 10</font></td>' +
         '<td style="vertical-align: top;"><font style="font-size: 8pt; font-family: verdana;" size="-1">Version 5.0 <br>and above</font></td>' +
         '<td style="vertical-align: top;"><font style="font-size: 8pt; font-family: verdana;" size="-1">Yes</font></td>' +
         '<td style="vertical-align: top;"><font style="font-size: 8pt; font-family: verdana;" size="-1">Yes</font></td>' +
         '<td style="vertical-align: top;"><font style="font-size: 8pt; font-family: verdana;" size="-1">Yes</font></td>' +
         '</tr>' +

         '<tr>' +
         '<td style="vertical-align: top;"><font style="font-size: 8pt; font-family: verdana;" size="-1">Mozilla Firefox <br> Version 1.x/2.0</font></td>' +
         '<td style="vertical-align: top;"><font style="font-size: 8pt; font-family: verdana;" size="-1"><font style="color:red;">Windows Media Player 6.4<br>Windows Media Player 7.1</font><br>Windows Media Player 9<br>Windows Media Player 10</td>' +
         '<td style="vertical-align: top;"><font style="font-size: 8pt; font-family: verdana;" size="-1">Version 5.0 <br>and above</font></td>' +
         '<td style="vertical-align: top;"><font style="font-size: 8pt; font-family: verdana;" size="-1">Yes</font></td>' +
         '<td style="vertical-align: top;"><font style="font-size: 8pt; font-family: verdana;" size="-1">Yes</font></td>' +
         '<td style="vertical-align: top;"><font style="font-size: 8pt; font-family: verdana;" size="-1">Yes</font></td>' +
         '</tr>' +

         '<tr>' +
         '<td style="vertical-align: top;" rowspan="4"><font style="font-size: 8pt; font-family: verdana;" size="-1">Microsoft Windows XP</font></td>' +
         '<td style="vertical-align: top;"><font style="font-size: 8pt; font-family: verdana;" size="-1">Microsoft Internet Explorer<br>Version: 5.5</font></td>' +
         '<td style="vertical-align: top;"><font style="font-size: 8pt; font-family: verdana;" size="-1"><font style="color:red;">Windows Media Player 6.4<br>Windows Media Player 7.1</font><br>Windows Media Player 9<br>Windows Media Player 10</font></td>' +
         '<td style="vertical-align: top;"><font style="font-size: 8pt; font-family: verdana;" size="-1">Version 5.0 <br>and above</font></td>' +
         '<td style="vertical-align: top;"><font style="font-size: 8pt; font-family: verdana;" size="-1">Yes</font></td>' +
         '<td style="vertical-align: top;"><font style="font-size: 8pt; font-family: verdana;" size="-1">Yes</font></td>' +
         '<td style="vertical-align: top;"><font style="font-size: 8pt; font-family: verdana;" size="-1">Yes</font></td>' +
         '</tr>' +

         '<tr>' +
         '<td style="vertical-align: top;"><font style="font-size: 8pt; font-family: verdana;" size="-1">Microsoft Internet Explorer<br> Version: 6.0 with SP1, 7.0</font></td>' +
         '<td style="vertical-align: top;"><font style="font-size: 8pt; font-family: verdana;" size="-1"><font style="color:red;">Windows Media Player 6.4<br>Windows Media Player 7.1</font><br>Windows Media Player 9<br>Windows Media Player 10<br>Windows Media Player 11</font></td>' +
         '<td style="vertical-align: top;"><font style="font-size: 8pt; font-family: verdana;" size="-1">Version 5.0 <br>and above</font></td>' +
         '<td style="vertical-align: top;"><font style="font-size: 8pt; font-family: verdana;" size="-1">Yes</font></td>' +
         '<td style="vertical-align: top;"><font style="font-size: 8pt; font-family: verdana;" size="-1">Yes</font></td>' +
         '<td style="vertical-align: top;"><font style="font-size: 8pt; font-family: verdana;" size="-1">Yes</font></td>' +
         '</tr>' +

         '<tr>' +
         '<td style="vertical-align: top;"><font style="font-size: 8pt; font-family: verdana;" size="-1">Netscape Navigator <br> Version: 7.2 only</font></td>' +
         '<td style="vertical-align: top;"><font style="font-size: 8pt; font-family: verdana;" size="-1"><font style="color:red;">Windows Media Player 6.4<br>Windows Media Player 7.1</font><br>Windows Media Player 9<br>Windows Media Player 10<br>Windows Media Player 11</font></td>' +
         '<td style="vertical-align: top;"><font style="font-size: 8pt; font-family: verdana;" size="-1">Version 5.0 <br>and above</font></td>' +
         '<td style="vertical-align: top;"><font style="font-size: 8pt; font-family: verdana;" size="-1">Yes</font></td>' +
         '<td style="vertical-align: top;"><font style="font-size: 8pt; font-family: verdana;" size="-1">Yes</font></td>' +
         '<td style="vertical-align: top;"><font style="font-size: 8pt; font-family: verdana;" size="-1">Yes</font></td>' +
         '</tr>' +

         '<tr>' +
         '<td style="vertical-align: top;"><font style="font-size: 8pt; font-family: verdana;" size="-1">Mozilla Firefox <br> Version 1.0/2.0/3.0</font></td>' +
         '<td style="vertical-align: top;"><font style="font-size: 8pt; font-family: verdana;" size="-1"><font style="color:red;">Windows Media Player 6.4<br>Windows Media Player 7.1</font><br>Windows Media Player 9<br>Windows Media Player 10<br>Windows Media Player 11</font></td>' +
         '<td style="vertical-align: top;"><font style="font-size: 8pt; font-family: verdana;" size="-1">Version 5.0 <br>and above</font></td>' +
         '<td style="vertical-align: top;"><font style="font-size: 8pt; font-family: verdana;" size="-1">Yes</font></td>' +
         '<td style="vertical-align: top;"><font style="font-size: 8pt; font-family: verdana;" size="-1">Yes</font></td>' +
         '<td style="vertical-align: top;"><font style="font-size: 8pt; font-family: verdana;" size="-1">Yes</font></td>' +
         '</tr>' +

         '<tr>' +
         '<td style="vertical-align: top;" rowspan="4"><font style="font-size: 8pt; font-family: verdana;" size="-1">Macintosh OS-X</font></td>' +
         '<td style="vertical-align: top;"><font style="font-size: 8pt; font-family: verdana;" size="-1">Netscape Navigator <br> Version: 7.2 only</font></td>' +
         '<td style="vertical-align: top;"><font style="font-size: 8pt; font-family: verdana;" size="-1">QuickTime Player 6.4</td>' +
         '<td style="vertical-align: top;"><font style="font-size: 8pt; font-family: verdana;" size="-1">Version 5.0 <br>and above</font></td>' +
         '<td style="vertical-align: top;"><font style="font-size: 8pt; font-family: verdana;" size="-1">Yes</font></td>' +
         '<td style="vertical-align: top;"><font style="font-size: 8pt; font-family: verdana;" size="-1">Yes</font></td>' +
         '<td style="vertical-align: top;"><font style="font-size: 8pt; font-family: verdana;" size="-1">Yes</font></td>' +
         '</tr>' +

         '<tr>' +
         '<td style="vertical-align: top;"><font style="font-size: 8pt; font-family: verdana;" size="-1">Firefox <br> Version: 2.0/3.0</font></td>' +
         '<td style="vertical-align: top;"><font style="font-size: 8pt; font-family: verdana;" size="-1">QuickTime Player 7.1</td>' +
         '<td style="vertical-align: top;"><font style="font-size: 8pt; font-family: verdana;" size="-1">Version 5.0 <br>and above</font></td>' +
         '<td style="vertical-align: top;"><font style="font-size: 8pt; font-family: verdana;" size="-1">Yes</font></td>' +
         '<td style="vertical-align: top;"><font style="font-size: 8pt; font-family: verdana;" size="-1">Yes</font></td>' +
         '<td style="vertical-align: top;"><font style="font-size: 8pt; font-family: verdana;" size="-1">Yes</font></td>' +
         '</tr>' +

         '<tr>' +
         '<td style="vertical-align: top;"><font style="font-size: 8pt; font-family: verdana;" size="-1">Safari <br> Version: 3.0</font></td>' +
         '<td style="vertical-align: top;"><font style="font-size: 8pt; font-family: verdana;" size="-1">QuickTime Player 7.1</td>' +
         '<td style="vertical-align: top;"><font style="font-size: 8pt; font-family: verdana;" size="-1">Version 5.0 <br>and above</font></td>' +
         '<td style="vertical-align: top;"><font style="font-size: 8pt; font-family: verdana;" size="-1">Yes</font></td>' +
         '<td style="vertical-align: top;"><font style="font-size: 8pt; font-family: verdana;" size="-1">Yes</font></td>' +
         '<td style="vertical-align: top;"><font style="font-size: 8pt; font-family: verdana;" size="-1">Yes</font></td>' +
         '</tr>' +

         '</table>' +

         '</BODY></HTML>';
}

function cookiesEnabled() {
  SetCookie( "foo", "bar" );
  if ( GetCookie( "foo" ) ) {
    DeleteCookie( "foo" );
    return true;
  } else {
    return false;
  }
}

function GetCookie( name ) {
  var arg = name + "=";
  var alen = arg.length;
  var clen = document.cookie.length;
  var i = 0;
  while ( i < clen ) {
    var j = i + alen;
    if ( document.cookie.substring(i, j) == arg ) return getCookieVal(j);
    i = document.cookie.indexOf( " ", i ) + 1;
    if ( i == 0 ) break;
  }
  return null;
}

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";
  }
}

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" : "" );
}

function getCookieVal( offset ) {
  var endstr = document.cookie.indexOf ( ";", offset );
  if ( endstr == -1 ) endstr = document.cookie.length;
  return unescape( document.cookie.substring( offset, endstr ) );
}


function detectPlugin() 
{
  var plugObj = "";
  
  // allow for multiple checks in a single pass
  var daPlugins = detectPlugin.arguments;
  // consider pluginFound to be false until proven true
  var pluginFound = false;
  // if plugins array is there and not fake
  if (navigator.plugins && navigator.plugins.length > 0) {
    var pluginsArrayLength = navigator.plugins.length;
    // for each plugin...
    for (pluginsArrayCounter=0; pluginsArrayCounter < pluginsArrayLength; pluginsArrayCounter++ ) 
    {
      // loop through all desired names and check each against the current plugin name
      var numFound = 0;
      for(namesCounter=0; namesCounter < daPlugins.length; namesCounter++) {
        // if desired plugin name is found in either plugin name or description
        if( ( navigator.plugins[pluginsArrayCounter].name.indexOf(daPlugins[namesCounter]) >= 0) || 
            ( navigator.plugins[pluginsArrayCounter].description.indexOf(daPlugins[namesCounter]) >= 0) ) 
        {
            // this name was found
            numFound++;
        }   
      }
      // now that we have checked all the required names against this one plugin,
      // if the number we found matches the total number provided then we were successful
      if(numFound == daPlugins.length) 
      {
        pluginFound = true;
        plugObj = navigator.plugins[pluginsArrayCounter];
        // if we've found the plugin, we can stop looking through at the rest of the plugins
        break;
      }
    }
  }

  return plugObj;
} // detectPlugin
