var testsuccess = 0;
function categorylist(url)
  {
  self.location = url;
  }
  
var getresults=function(results)
  {
  document.getElementById('shoppingcartcontents').innerHTML = results;
   document.getElementById('loadingindicator').style.visibility = 'hidden';
  }

function submitform(prodid)
  {
  ajax.post("index.php",getresults,"ajax=true&user=true&prodid="+prodid+"");
  document.getElementById('loadingimage').src = './wp-content/plugins/wp-shopping-cart/images/indicator.gif';
  document.getElementById('loadingindicator').style.visibility = 'visible';
  }

function emptycart()
  {
  ajax.post("index.php",getresults,"ajax=true&user=true&emptycart=true");
  document.getElementById('loadingimage').src = './wp-content/plugins/wp-shopping-cart/images/indicator.gif';
  document.getElementById('loadingindicator').style.visibility = 'visible';
  }

function show_additional_description(id)
  {
  currentstate = document.getElementById(id).style.display;
  document.getElementById(id).style.display = 'inline';
  if(currentstate != 'inline')
    {
    document.getElementById(id).style.display = 'inline';
    }
    else
      {
      document.getElementById(id).style.display = 'none';
      }
  return false;
  }

function prodgroupswitch(state)
  {
  if(state == 'brands')
    {
    document.getElementById('categorydisplay').style.display = 'none';
    document.getElementById('branddisplay').style.display = 'block';
    }
    else if(state == 'categories')
      {
      document.getElementById('branddisplay').style.display = 'none';
      document.getElementById('categorydisplay').style.display = 'block';
      }
  return false;
  }