I have been looking at other posts about Firefox and AJAX. I haven't found anything that will solve my problem.... not anything I've noticed anyways. My code works perfectly in IE but not Firefox. I am using version 2.0

here is my code
PHP Code:
<script language="javascript" type="text/javascript">
var 
XMLHttpRequestObject false;
try{
    
XMLHttpRequestObject = new ActiveXObject("MSXML2.XMLHTTP");
    } catch(
exception1) {
        try{
            
XMLHttpRequestObject = new ActiveXObject("Microsoft");
            } catch(
exception2) {
                
XMLHttpRequestObject false;
                }
        } 

if(
XMLHttpRequestObject && window.XMLHttpRequest) {
    
XMLHttpRequestObject = new XMLHttpRequest();
    }
    
function 
getValue(cat,id) {
    
clearList(cat,id);
    
getSub(cat,id);
    } 
    
function 
getSub(cat,id) {
    if(
XMLHttpRequestObject) {
        if(
cat == "Electronics") {
            
XMLHttpRequestObject.open("GET","electronics.xml",true);
            }
        if(
cat == "Medical") {
            
XMLHttpRequestObject.open("GET","medical.xml",true);
            }
        if(
cat == "Industrial") {
            
XMLHttpRequestObject.open("GET","industrial.xml",true);
            }
        if(
cat == "Nanotechnology") {
            
XMLHttpRequestObject.open("GET","nano.xml",true);
            }
        
alert(cat);
        var 
subId id;
        
        
XMLHttpRequestObject.onreadystatechange = function() {
            if(
XMLHttpRequestObject.readyState == && XMLHttpRequestObject.status == 200) {
                var 
xmlDocument XMLHttpRequestObject.responseXML;
                
                var 
subCategory xmlDocument.getElementsByTagName("subs");
                
listSubs(subCategory,subId);
                }
            }
        
XMLHttpRequestObject.send(null);
        }
    }
    
function 
listSubs(subCategory,subId) {
    var 
loopIndex;
    var 
subCat;
    if(
subId == "mainCat1") {
        
subCat "subCat1";
        }
    if(
subId == "mainCat2") {
        
subCat "subCat2";
        }
    var 
selectControl document.getElementById(subCat);
    
    for(
loopIndex=0;loopIndex<subCategory.length;loopIndex++) {
        
selectControl.options[loopIndex] = new
            
Option(subCategory[loopIndex].firstChild.data);
        }
    }
    
function 
clearList(cat,id) {
    var 
clearCat;
    if(
id == "mainCat1") {
        
clearCat "subCat1";
        }
    if(
id == "mainCat2") {
        
clearCat "subCat2";
        }
    var 
len document.getElementById(clearCat).options.length
      
for(0leni++) {
        
document.getElementById(clearCat).options[0] = null;
        }
    }
</script> 
I hope someone can spot something. Thanks for your help.