/*IS 449 Group Project R. VanDaele 10/14/2006 A. Taylor 12/03/2006*/ // Create request variable var xmlhttp; // Create companyId array to store company objects var companyId = new Array(); // Constructor defining company objects function company(compId, compName, formType) { this.id=compId; this.name=compName; this.type=formType; } // Load an XML document function loadXMLDoc() { var url='http://people.emich.edu/rvandael/449.php' // Determine browser type for specific request object browserObjCheck(); // Object type identified if (xmlhttp!=null) { // Update page when ready xmlhttp.onreadystatechange=state_Change; xmlhttp.open("GET", url, true); xmlhttp.send(null); } // Alert user request object is null else { alert(" Your browser does not support XMLHTTP. "); } } // Determine type of request object needed based on browser function browserObjCheck() { // Mozilla, Safari, etc. if (window.XMLHttpRequest) { xmlhttp = new XMLHttpRequest(); } // Microsoft else if (window.ActiveXObject) { try { xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); } catch(otherMicrosoft) { xmlhttp = new ActiveXObject("Msxm12.XMLHTTP"); } } } // We got a response function state_Change() { // if xmlhttp shows "loaded" if (xmlhttp.readyState==4) { // if "OK" if (xmlhttp.status==200) { // Store response as xml xml=xmlhttp.responseXML; // Get company node list comp=xml.getElementsByTagName('company'); // Get company financial data webfin=xml.getElementsByTagName('filing'); // Populate drop down list if(comp[0]!=null) { // Store company identification information in object array companyLoad(comp); // Populate company drop down list companyList(); // Clear comp variable comp=null; } // Determine and Display financial data else if(webfin[0]!=null) { // Display financial summary information and compute ratio analysis financialData(webfin); // Clear webfin variable webfin=null; } } else { // Alert user that xml data was not retrieved alert(" Problem retrieving XML data: " + xmlhttp.statusText); } } // Clear xml variable xml=null; } // Load retrieved data into companyId array function companyLoad(data) { // Use tempData to store each company object var tempData = new Object(); // Traverse node tree and store data into array for(i=0;i=0;q--) { document.formDates.forms.options[q] = null; } // Add our default option opt=document.createElement('option'); opt.appendChild(document.createTextNode('Available Forms')); opt.setAttribute("value",'#'); document.formDates.forms.appendChild(opt); // Store selected index of company selected in drop-down var indexSelect=document.options.companies.selectedIndex; // Iterate through companyId array to determine which company is selected in drop-down for(index1=0;index1