/* ! Copyright 2009 Webroot Software, Inc. All rights reserved */
var out = [];
function getPrice(options) {
   var prodID = (typeof options[0] == "undefined") ? "WAV" : options[0];
   var prod = prodID.toLowerCase();
   var sliderInputs = (typeof options[1] == "undefined") ? [ 
   "div#"+prod+"_num_years", 
   "div#"+prod+"_num_comp", 
   "div#"+prod+"_num_storage" 
   ] : options[1];
   
   var cartBase = 'http://www.webroot.com/shoppingcart/update_cart.php?';
   
   var totalPrice = null,
   totalPPU = null,
   cartLink = null;
   
   switch(prodID) {
   
   case "WISE":
      var yp = null,
      nYears = null,
      nComp = null,
      nStorage = null;
      
      nYears = $(sliderInputs[0]).slider("value");
      nComp = $(sliderInputs[1]).slider("value");
      nStorage = $(sliderInputs[2]).slider("value");
      
      yp = ''+nYears+ ''+nComp+ ''+nStorage;
      totalPrice = arWISEPrice[yp];
      totalPPU = arWISEPPU[yp];
      cartLink = cartBase + arWISECartLink[yp]; 
      
      out = [ totalPrice,totalPPU,cartLink ];
   break; 
   
   case "WAV":
   
      var yp = null,
      nYears = null,
      nComp = null,
      nStorage = null;
      
      nYears = $(sliderInputs[0]).slider("value");
      nComp = $(sliderInputs[1]).slider("value");
      nStorage = $(sliderInputs[2]).slider("value");
      
      yp = ''+nYears+''+nComp+''+nStorage;
      totalPrice = arWAVPrice[yp];
      totalPPU = arWAVPPU[yp];
      cartLink = cartBase + arWAVCartLink[yp]; 
      
      out = [ totalPrice,totalPPU,cartLink ];
   break; 
      
      
   case "WSS":
      var yp = null,
      nYears = null,
      nComp = null;
      
      nYears = $(sliderInputs[0]).slider("value");
      nComp  = $(sliderInputs[1]).slider("value");
      
      yp = ''+nYears+''+nComp;
      totalPrice = arSSPrice[yp];
      totalPPU = arSSPPU[yp];
      cartLink = cartBase + arSSCartLink[yp]; 
      
      out = [ totalPrice,totalPPU,cartLink ];
   break; 
   
   }
   return out;
}