/*
*  Displays the content of 'url' in 'div'.  While 'url' is being created,
*  displays a 'loading' gif unless 'skip' is true.
*/
function procAjax(url, div, skip) {

   if(!skip){
    document.getElementById(div).innerHTML = '<img src="../images/spinglobe1.gif" id="loading" />'
    }
    if (window.XMLHttpRequest) { // Non-IE browsers
      req = new XMLHttpRequest();
      req.onreadystatechange = function(){targetDiv(div);};
      try {
        req.open("GET", url, true);
      } catch (e) {
        alert(e);
      }
      req.send(null);
    } 
    else if (window.ActiveXObject) { // IE
      req = new ActiveXObject("Microsoft.XMLHTTP");
      if (req) {
        req.onreadystatechange = function(){targetDiv(div);};
        req.open("GET", url, true);
        req.send();

      }
    }
}

/*
*  Waits for the page to be completed and fills 'div' with the content
*  on an OK response from the server
*/
function targetDiv(div) {

    if (req.readyState == 4) { // Complete
          if (req.status == 200) { // OK response
              document.getElementById(div).innerHTML = req.responseText; // The div you want the data to populate
          } else {
            alert("Problem: " + req.statusText);
          }
    }      
}

/*
 *  Shows the given branch info in "contact" div
 */
function contacts(branch){
    show = branch + ".php";
    procAjax(show, "contactshow", "skip");
}

function frpspecial(what){
  procAjax("special.php?what="+what, "frpshow", "skip");
}

function frpproducts(what){
  procAjax("prodinfo.php?what="+what, "frpshow", "skip");
}
/*
function acetone(prod,row){

  other=row % 2;
  other+=1;
  other="acetoneshow"+other;
  div="acetoneshow"+row;
  
  procAjax("aceprods.php?prod="+prod, div, "skip");

  document.getElementById(other).style.display="none";
  document.getElementById(div).style.display="block";

}
*/

function acetone(){
  tog=document.getElementById('toggle');
  prods=document.getElementById('acetoneprods');
  tests=document.getElementById('acetonetests');
  
  if(prods.style.display!="none"){
    prods.style.display="none";
    tests.style.display="inline";
    tog.src=tog.src.replace("testimonials","products");
  } else {
    prods.style.display="inline";
    tests.style.display="none";
    tog.src=tog.src.replace("products","testimonials");
  }

}