Hey,

I am trying to right some javascript that only shows if the user is using Internet Explorer or an internet explorer bassed browser. Not sure why it's not working. The code is below. Yes only for ie browser, nothing else. Since my code only works in ie anyways, unless someone can figure out how to make it work in all browsers.

I know the button code is fine for all browsers since it shows up in all browsers but the javascript does not work in all browsers.

Thanks for you help,
Will

Code:
 
<INPUT TYPE=BUTTON VALUE="Check Spelling"
onclick='checkspell()'>
<SCRIPT Language="Javascript">
var myAgent = navigator.userAgent.toLowerCase();
var myVersion = parseInt(navigator.appVersion);
var is_ie = ((myAgent.indexOf("msie") != -1) &&
(myAgent.indexOf("opera") == -1));
var is_nav = ((myAgent.indexOf('mozilla')!=-1) &&
(myAgent.indexOf('spoofer')==-1)
&& (myAgent.indexOf('compatible') == -1) &&
(myAgent.indexOf('opera')==-1)
&& (myAgent.indexOf('webtv') ==-1) &&
(myAgent.indexOf('hotjava')==-1));
var is_win = ((myAgent.indexOf("win")!=-1) ||
(myAgent.indexOf("16bit")!=-1));
var is_mac = (myAgent.indexOf("mac")!=-1);
function checkspells() {
try {
 var tmpis = new ActiveXObject("ieSpell.ieSpellExtension");
 document.write("&nbsp;<input type='button' name='btnSpell' value='Check Spelling' onclick='checkspell()'>");
}
catch(exception) {
 if (is_ie&&is_win) {
  document.write("&nbsp;<input type='button' name='btnSpell' value='Get ieSpell' onclick='checkspell()'>");
 }
}
}
function checkspell() {
try {
 var tmpis = new ActiveXObject("ieSpell.ieSpellExtension");
 tmpis.CheckAllLinkedDocuments(document);
}
catch(exception) {
 if (is_ie&&is_win) {
  window.open("http://www.iespell.com/download.php","DownLoad");
 }
}
}
</SCRIPT>