function getShotgunInfo(aControl, myclass) {
   var idx = aControl.selectedIndex;
   var caliber_id = aControl.options[idx].value; 
   var xmlhttp;

   if (window.XMLHttpRequest) {
      // code for IE7+, Firefox, Chrome, Opera, Safari
      xmlhttp=new XMLHttpRequest();
   }
   //else if (window.ActiveXObject) {
   else {
      // code for IE6, IE5
      // xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
      try { 
         xmlhttp = new ActiveXObject("Msxml2.XMLHTTP"); 
      } catch (e) {
         try { 
            xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
         } catch (E) { 
            xmlhttp = false; 
         }
      }
   }

   xmlhttp.onreadystatechange=function() {
      if(xmlhttp.readyState==4) {
         var response = xmlhttp.responseText;
         var popups=response.split("ZZZ_SEPARATOR_ZZZ");
         var ssp = popups[0];
         var slp = popups[1];
         document.getElementById('shot_size_popup').innerHTML=ssp;
         document.getElementById('shell_length_popup').innerHTML=slp;
      }
   }
   var url="/index.pl";
   url=url+"?getshotguninfo=1";
   url=url+"&cid=" + caliber_id;
   url=url+"&class=" + myclass;
   xmlhttp.open("GET",url,true);
   xmlhttp.send(null);
}


function getGrains(gun, aControl, myclass) {
   var caliber_id;

   if (aControl == null) {
      caliber_id=0;
   }
   else {
      var idx = aControl.selectedIndex;
      caliber_id = aControl.options[idx].value; 
   }
   var xmlhttp;

   // document.getElementById(gun + '_grains').style.display='none';
   if (window.XMLHttpRequest) {
      // code for IE7+, Firefox, Chrome, Opera, Safari
      xmlhttp=new XMLHttpRequest();
   }
   //else if (window.ActiveXObject) {
   else {
      // code for IE6, IE5
      // xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
      try { 
         xmlhttp = new ActiveXObject("Msxml2.XMLHTTP"); 
      } catch (e) {
         try { 
            xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
         } catch (E) { 
            xmlhttp = false; 
         }
      }
   }
   // else {
   //    alert("Sorry, this site does not support your browser.");
   // }

   // showspan('image_loading_' + id);

   xmlhttp.onreadystatechange=function() {
      if(xmlhttp.readyState==4) {
         var response = xmlhttp.responseText;
         document.getElementById(gun + '_grains').innerHTML=response;
         // document.getElementById(gun + '_grains').style.display='block';
      }
   }
   var url="/index.pl";
   url=url+"?getgrains=1";
   url=url+"&cid=" + caliber_id;
   url=url+"&gun=" + gun;
   url=url+"&class=" + myclass;
   xmlhttp.open("GET",url,true);
   xmlhttp.send(null);
}


