woofie's toolbox - webtv box detection

WebTV ships two different boxes currently. For various reasons, you may wish to know which box the viewer is using to load different files, images, multimedia, etc. The following code will determine the box. Put this code in between <head> and </head>.
  <SCRIPT Language=Javascript>
	
  userAgent=navigator.appName + " " + navigator.appVersion;

  if (userAgent.indexOf("WebTV") > 0) {

    if (userAgent.indexOf("Plus") >0 ) {
      kBox = "Plus"
    } else if (userAgent.indexOf("Terminal") >0 ) { 
      kBox = "FCS" 
    } else {
      kBox= "otherWebTVBox"
    }
		
  } else {
    kBox = "nonWebTV"
  }
  
  </SCRIPT>
Then where you want to have different features depending on the box type, use the following:
  <SCRIPT Language=Javascript>
  
  if (kBox=="FCS") {
    document.write("You are using the WebTV Internet Terminal.");
  } else if (kBox =="Plus") {
    document.write("You are using the WebTV Plus Receiver.");
  } else if (kBox =="otherWebTVBox" {
    document.write("You are using some new WebTV box.");
  } else if (kBox =="nonWebTV") {
    document.write("You are not using a WebTV box.");
  }
  document.write("<BR>kBox = " + kBox);
  				
  </SCRIPT>
The results of all this will generate the following.