/*--- Avanquest WebEasy Custom Script ---*/

function setPrice( frmForm ) 
{ 
    var tmpCost = 0; 
    var staticCost = 5; 
    var staticMulti = 2; 
    var intBasePrice; 
    var intQty; 
    var strName; 
 
   intQty = document.getElementById('e1').value;  
 
   if( document.getElementById('e2').value == "10") 
   { 
      staticCost = 3.50; 
      staticMulti = 1;  
      intBasePrice = 8; 
      strName = "10 metre cable"; 
   } 
 
   if( document.getElementById('e2').value == "20") 
   { 
      staticCost = 4;  
      staticMulti = 1;  
       intBasePrice = 12; 
      strName = "20 metre cable"; 
   } 
    
    if( document.getElementById('e2').value == "30") 
   { 
      staticCost = 5;  
      staticMulti = 1;  
      intBasePrice = 15; 
      strName = "30 metre cable"; 
   } 
  
   if( document.getElementById('e2').value > 1 )	 
   { 
      tmpCost =  staticCost + ((intQty-1) * staticMulti ) ; 
   }  
   else 
   { 
      tmpCost = staticCost; 
   }     
    
   frmForm.amount.value =  (intBasePrice * intQty ) + tmpCost; 
   frmForm.item_name.value = intQty + " x " + strName; 
   alert( tmpCost ); 
}

/*--- EndOfFile ---*/
