function GetCPU(familySelect) { 
  var index = familySelect.selectedIndex;
  var family = familySelect[index].text;

  var formContents = document.forms["CalculatorForm"];
  var formElements = formContents.elements;
  var cpuSelect = formElements["cpu"];

  var xmlHttp;
  var url = "http://www.power-on.com/ajax/calculator/ajax-cpu.php?value="+family;
  try {   
    xmlHttp=new XMLHttpRequest();    
  }
  catch (e) {    
    try {      
      xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");      
    }
    catch (e) {      
      try {        
        xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");        
      }
      catch (e) {              
        return false;        
      }      
    }    
  }
  xmlHttp.onreadystatechange=function() {
    if (xmlHttp.readyState==4) {
      //var xmlDoc=xmlHttp.responseXML.documentElement;
      x=xmlHttp.responseXML.documentElement.childNodes;
      var sectionValue = " ";
      cpuSelect.length = x.length;
      for (i=0;i<x.length;i++)
      {
        if (x[i].nodeName == "section")
        {
          if (sectionValue == " ")
          { // Initialize first section value
            sectionValue = x[i].childNodes[0].nodeValue;
          }
          else if (sectionValue != x[i].childNodes[0].nodeValue)
          { // New section value
            sectionValue = x[i].childNodes[0].nodeValue;
          }
          cpuSelect[i].text = "--- " + x[i].childNodes[0].nodeValue + " ---";
          cpuSelect[i].value = sectionValue + "|" + sectionValue;
        }
        else
        {
          cpuSelect[i].text = x[i].childNodes[0].nodeValue;
          cpuSelect[i].value = x[i].childNodes[0].nodeValue+"|"+sectionValue;
        }
      } 
    }
  }
  xmlHttp.open("GET",url,true);
  xmlHttp.send(null);  
} 

function GetHardDrive() { 
  var formContents = document.forms["CalculatorForm"];
  var formElements = formContents.elements;
  var driveSelect = formElements["hard_drive"];

  var xmlHttp;
  var url = "http://www.power-on.com/ajax/calculator/ajax-drive.php";
  try {   
    xmlHttp=new XMLHttpRequest();    
  }
  catch (e) {    
    try {      
      xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");      
    }
    catch (e) {      
      try {        
        xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");        
      }
      catch (e) {              
        return false;        
      }      
    }    
  }
  xmlHttp.onreadystatechange=function() {
    if (xmlHttp.readyState==4) {
      //var xmlDoc=xmlHttp.responseXML.documentElement;
      x=xmlHttp.responseXML.documentElement.childNodes;
      driveSelect.length = x.length/2;
      var sIndex = 0;
      var power = " ";
      for (i=0;i<x.length;i++)
      {
        if (x[i].nodeName == "name")
        {
          driveSelect[sIndex].text = x[i].childNodes[0].nodeValue;
          driveSelect[sIndex].value = power+"|"+x[i].childNodes[0].nodeValue;
          sIndex++;
        }
        else
        {
          power = x[i].childNodes[0].nodeValue;
        }
      }  
      //driveSelect.selectedIndex=0;
      //driveSelect.size=6 
    }
  }
  xmlHttp.open("GET",url,true);
  xmlHttp.send(null);  
}
