function confirmBids(f)
{

      var formElements = "";
      var numBids = 0;
      var bidAmount = 0;
      var totalBidAmount = 0;
      var minBid = 0;
      var maxBid = 0;
      var wireBid = 0;
      var domainName = "";
      var overWireAmount = false;
      
      for (var n=0; n < f.elements.length; n++)
      {
          if(f.elements[n].name.indexOf("hidMB") > -1)
          {
              maxBid = parseInt(f.elements[n].value);
              
          }
          
          if(f.elements[n].name.indexOf("hidwireBid") > -1)
          {
              wireBid = parseInt(f.elements[n].value);
              
          }
          
          if(f.elements[n].name.indexOf("hidDomain") > -1)
          {
            domainName = f.elements[n].value;
            
          }
          
          if(f.elements[n].name.indexOf("hidMinBid") > -1)
          {
            minBid = f.elements[n].value;
            minBid = minBid.replace("US $", "");
            minBid = minBid.replace(",", "");
            minBid = minBid.replace("$", "");
            minBid = parseInt(minBid);
            
          }
          
          if(f.elements[n].name.indexOf("TextBox1") > -1 || f.elements[n].name.indexOf("txtNewBid") > -1 || f.elements[n].name.indexOf("txtBidAmount") > -1)
          {
                bidAmount = f.elements[n].value;
                if(bidAmount.indexOf(",") > -1)
                {
                    bidAmount = bidAmount.replace(",", "");
                }   
                if(bidAmount.indexOf(".00") > -1)
                {
                    bidAmount = bidAmount.replace(".00", "");
                }
                if(bidAmount.indexOf("$") > -1)
                {
                    bidAmount = bidAmount.replace("$", "");
                }
                   
                //bidAmount = bidAmount.replace(",", "").replace(".00", "");
                numBids++;
                totalBidAmount += parseInt(bidAmount);
                
                if(bidAmount >= wireBid)
                {
                    overWireAmount = true;
                }
                
                if(totalBidAmount > maxBid)
                {
                    alert("Your total bid amount is greater than $" + maxBid + ". Please lower your bid amount to less than $" + maxBid + ".");
                    return false;
                }
                //check single bid amount to see if it is greater than 10 times the minimum bid amount
                if(minBid > 0)
                {
                    if(parseInt(bidAmount) >= parseInt(minBid) * 10)
                    {
                        var confirmStr;
                        
                        if(domainName != "")
                            confirmStr = "Bid a maximum of $" + bidAmount + " on " + domainName + "? \nThis is SIGNIFICANTLY HIGHER than the previous bid. Is this correct?";
                        else
                            confirmStr = "Bid a maximum of $" + bidAmount + "? \nThis is SIGNIFICANTLY HIGHER than the previous bid. Is this correct?";
              
                        if(overWireAmount)
                            confirmStr += "\nPlease be aware that purchases of $" + wireBid + " and above can only be processed with a wire transfer to your account.";
          
                        return confirm(confirmStr);
                    }
                }
                
                
          }        
      }
      
      if(overWireAmount)
         return confirm("Please be aware that purchases of $" + wireBid + " and above can only be processed with a wire transfer to your account.");
      
      
      if(maxBid == 0)
        maxBid = 100;      
      
//      if(totalBidAmount > 0 && totalBidAmount <= maxBid)
//      {
//        var confirmStr = "You are about to place " + numBids + " bid(s) for a total amount of $" + totalBidAmount + ". Would you like to continue?";
//        
//        if(overWireAmount)
//            confirmStr += "\nPlease be aware that purchases of $" + wireBid + " and above can only be processed with a wire transfer to your account.";
//      
//        return confirm(confirmStr);
//      }
//      else
//      {
        if(totalBidAmount > maxBid)
        {
            alert("Your total bid amount is greater than " + maxBid + ". Please lower your bid amount to less than $" + maxBid + ".");
            return false;
        }
        
       
//        else
//        {
//            return true;
//        }
        //else
        //    alert("Please enter a valid bid amount in all bid fields.");
      //return true;
//      }
    
}

function confirmListBid(f)
{

      var formElements = "";
      var numBids = 0;
      var bidAmount = 0;
      var totalBidAmount = 0;
      var minBid = 0;
      var maxBid = 0;
      var wireBid = 0;
      var domainName = "";
      var overWireAmount = false;
      
      for (var n=0; n < f.elements.length; n++)
      {
          if(f.elements[n].name.indexOf("hidMB") > -1)
          {
              maxBid = parseInt(f.elements[n].value);
          }
          
          if(f.elements[n].name.indexOf("hidwireBid") > -1)
          {
              wireBid = parseInt(f.elements[n].value);
          }
          
          if(f.elements[n].name.indexOf("hidDomain") > -1)
          {
            domainName = f.elements[n].value;
          }
          
          if(f.elements[n].name.indexOf("hidMinBid") > -1)
          {
            minBid = f.elements[n].value;
            minBid = minBid.replace("US $", "");
            minBid = minBid.replace(",", "");
            minBid = parseInt(minBid);
            
          }
          
          
          if(f.elements[n].name.indexOf("TextBox1") > -1 || f.elements[n].name.indexOf("txtNewBid") > -1 || f.elements[n].name.indexOf("txtBidAmount") > -1)
          {
                bidAmount = f.elements[n].value;
                
                if(bidAmount.indexOf(",") > -1)
                {
                    bidAmount = bidAmount.replace(",", "");
                }   
                if(bidAmount.indexOf(".00") > -1)
                {
                    bidAmount = bidAmount.replace(".00", "");
                }
                if(bidAmount.indexOf("$") > -1)
                {
                    bidAmount = bidAmount.replace("$", "");
                }
                
                if(bidAmount >= wireBid)
                    overWireAmount = true;
                
                numBids++;
                totalBidAmount += parseInt(bidAmount);
                
                if(totalBidAmount > maxBid)
                {
                    alert("Your total bid amount is greater than $" + maxBid + ". Please lower your bid amount to less than $" + maxBid + ".");
                    return false;
                }
                
                //check single bid amount to see if it is greater than 10 times the minimum bid amount
                if(minBid > 0)
                {
                    if(parseInt(bidAmount) >= parseInt(minBid) * 10)
                    {
                        var confirmStr;
                        
                        if(domainName != "")
                            confirmStr = "Bid a maximum of $" + bidAmount + " on " + domainName + "? \nThis is SIGNIFICANTLY HIGHER than the previous bid. Is this correct?";
                        else
                            confirmStr = "Bid a maximum of $" + bidAmount + "? \nThis is SIGNIFICANTLY HIGHER than the previous bid. Is this correct?";
              
                        if(overWireAmount)
                            confirmStr += "\nPlease be aware that purchases of $" + wireBid + " and above can only be processed with a wire transfer to your account.";
          
                        return confirm(confirmStr);
                    }
                }
                      
          }        
      }
      
      if(maxBid == 0)
        maxBid = 100;      
      
      if(totalBidAmount > 0 && totalBidAmount <= maxBid)
      {
        var confirmStr = "You are about to place " + numBids + " bid(s) for a total amount of $" + totalBidAmount + ". Would you like to continue?";
        
        if(overWireAmount)
            confirmStr += "\nPlease be aware that purchases of $" + wireBid + " and above can only be processed with a wire transfer to your account.";
      
        return confirm(confirmStr);
      }
      else
      {
        if(totalBidAmount > maxBid)
        {
            alert("Your total bid amount is greater than " + maxBid + ". Please lower your bid amount to less than $" + maxBid + ".");
        return false;
        }
//        else
//        {
//            return true;
//        }
        //else
        //    alert("Please enter a valid bid amount in all bid fields.");
//        return true;
      }
    
}

function confirmBulkBid(f)
{
    var formElements = "";
    var numBids = 0;
    var bidAmount = 0;
    var totalBidAmount = 0;
    var minBid = 0;
    var maxBid = 0;
    var wireBid = 0;
    var domainName = "";
    var overWireAmount = false;
    var confirmStr = "";
  
    for (var n=0; n < f.elements.length; n++)
    {
        if(f.elements[n].name.indexOf("hidMB") > -1)
        {
            maxBid = parseInt(f.elements[n].value);
        }
      
        if(f.elements[n].name.indexOf("hidwireBid") > -1)
        {
            wireBid = parseInt(f.elements[n].value);
        }
     
        if(f.elements[n].name.indexOf("hdnDomainName") > -1)
        {
          domainName = f.elements[n].value;
        }
      
        if(f.elements[n].name.indexOf("hdnMinBid") > -1)
        {
          minBid = f.elements[n].value;
          minBid = minBid.replace("US $", "");
          minBid = minBid.replace(",", "");
          minBid = minBid.replace("$", "");
          minBid = minBid.replace("Min.", "");
          minBid = minBid.replace(" ", "");
        
          minBid = parseInt(minBid);
      
        }
        
        if(f.elements[n].name.indexOf("TextBox1") > -1 || f.elements[n].name.indexOf("txtNewBid") > -1 || f.elements[n].name.indexOf("txtBidAmount") > -1)
        {
            bidAmount = f.elements[n].value;
            
            if(bidAmount > 0)
            {
                if(bidAmount.indexOf(",") > -1)
                {
                    bidAmount = bidAmount.replace(",", "");
                }   
                if(bidAmount.indexOf(".00") > -1)
                {
                    bidAmount = bidAmount.replace(".00", "");
                }
                if(bidAmount.indexOf("$") > -1)
                {
                    bidAmount = bidAmount.replace("$", "");
                }
                
                if(bidAmount >= wireBid)
                    overWireAmount = true;
                
                numBids++;
                totalBidAmount += parseInt(bidAmount);
                
                if(totalBidAmount > maxBid)
                {
                    alert("Your total bid amount is greater than $" + maxBid + ". Please lower your bid amount to less than $" + maxBid + ".");
                    return false;
                }
                
                //check single bid amount to see if it is greater than 10 times the minimum bid amount
                if(parseInt(bidAmount) >= parseInt(minBid) * 10)
                {
                    if(domainName != "")
                    {
                        if(confirmStr == "")
                            confirmStr += "Bid a maximum of $" + bidAmount + " on " + domainName + "? \nThis is SIGNIFICANTLY HIGHER than the previous bid.";
                        else
                            confirmStr += "\nBid a maximum of $" + bidAmount + " on " + domainName + "? \nThis is SIGNIFICANTLY HIGHER than the previous bid.";
                    }
                    else
                    {
                        if(confirmStr == "")
                            confirmStr += "Bid a maximum of $" + bidAmount + "? \nThis is SIGNIFICANTLY HIGHER than the previous bid.";
                        else
                            confirmStr += "\nBid a maximum of $" + bidAmount + "? \nThis is SIGNIFICANTLY HIGHER than the previous bid.";
                    }
          
      
                    
              }
          }
      }        
  }
//  
//  if(maxBid == 0)
//    maxBid = 100;      
//  
//  if(totalBidAmount > 0 && totalBidAmount <= maxBid)
//  {
//    if(confirmStr != "")
//    {
//        confirmStr += "\n\nYou are about to place " + numBids + " bid(s) for a total amount of $" + totalBidAmount + ". Would you like to continue?";
//    }
//    else
//    {
//        confirmStr = "You are about to place " + numBids + " bid(s) for a total amount of $" + totalBidAmount + ". Would you like to continue?";
//    }
//    
//    if(overWireAmount)
//        confirmStr += "\n\nPlease be aware that purchases of $" + wireBid + " and above can only be processed with a wire transfer to your account.";
//  
//    return confirm(confirmStr);
//  }
//  else
//  {
//    if(totalBidAmount > maxBid)
//    {
//        alert("Your total bid amount is greater than " + maxBid + ". Please lower your bid amount to less than $" + maxBid + ".");
//    return false;
//    }
//  }
  
   if(overWireAmount)
        confirmStr += "\n\nPlease be aware that purchases of $" + wireBid + " and above can only be processed with a wire transfer to your account.";
  
  if(confirmStr == "")
    return true;
  else
      return confirm(confirmStr);
  
}