function attributeController(){

  var iCountValue = 0;
  var iCount = 1;
  for(var i=1; i<iCount; i++)
  {
    //FIND OUT IF NO ATTRIBUTES ARE SELECTED
    if(document.getElementById('dropdown'+i).value == "not_an_option")
    {
      iCountValue++;
    }
  }

  //IF NO ATTRIBUTES ARE SELECTED, ALERT, ELSE SUBMIT
  if(iCountValue==(iCount-1))
  {
    alert("No product option selected, please choose from a dropdown menu to continue..");
  }
  else
  {
    cart_quantity.submit();
  }
}

function adjustPrice(id){

  function GetXmlHttpObject() { if (typeof XMLHttpRequest != 'undefined') { return new XMLHttpRequest(); } try { return new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { try { return new ActiveXObject("Microsoft.XMLHTTP"); } catch (e) {} } return false; }

  var optionvalue = document.getElementById('dropdown'+id).value;
  var optionvalueTEXT = document.getElementById('dropdown'+id).options[document.getElementById('dropdown'+id).selectedIndex].text
  //alert(optionvalueTEST);
  var iCount = 1;
  pos = optionvalueTEXT.indexOf('*OUT OF STOCK');

  if (pos == -1)
  {
    //document.getElementById('outOfStockButton').style.display = 'none';
    //document.getElementById('displayCartSubmit').style.display = '';


    //start ajax
    var xmlHttp;
    xmlHttp=GetXmlHttpObject();
    if (xmlHttp==null)
    {
      //alert ("Your browser does not support AJAX!");
      return;
    }
    var url = "http://www.buyhair.co.uk/ajax_getproductprice.php";

    url=url+"?poid="+optionvalue+"&pid="+2924+"&sid="+Math.random();
    xmlHttp.onreadystatechange=
    function()
    {
      if (this.readyState==4)
      {
        document.getElementById("products_price").innerHTML = this.responseText;
      }
    };
    xmlHttp.open("GET",url,true);
    xmlHttp.send(null);
    //end ajax

    //start ajax
    var xmlHttp;
    xmlHttp=GetXmlHttpObject();
    if (xmlHttp==null)
    {
      //alert ("Your browser does not support AJAX!");
      return;
    }
    var url = "http://www.buyhair.co.uk/ajax_getproductpriceForg.php";

    url=url+"?poid="+optionvalue+"&pid="+2924+"&sid="+Math.random();
    xmlHttp.onreadystatechange=
    function()
    {
      if (this.readyState==4)
      {
        document.getElementById("incVATfs").innerHTML = this.responseText;
      }
    };
    xmlHttp.open("GET",url,true);
    xmlHttp.send(null);
    //end ajax

  }
  else
  {
    alert("Product option out of stock");
    document.getElementById('dropdown'+id).selectedIndex = 0;
    //document.getElementById('outOfStockButton').style.display = '';
    //document.getElementById('displayCartSubmit').style.display = 'none';

  }

}