function setSubscriptionPrice(price) {
  subprice = price;
  setDescription();
}

function setPackagePrice(price) {
  packprice = price;
  setDescription();
}

function sendSubscriptionForm() {
  if(subprice>0 || packprice>0) {
    return true;
  } else {
    alert('Bitte wählen Sie zuerst ein Abonnement oder ein sales!perfect-Punkte-Guthaben aus!');
    return false;
  }
}

function setDescription() {
  price = subprice + packprice;
  taxprice = price * taxvalue;
  //format values
  var pattern = /(\d+)\.(\d*)/;
  subtext = subprice.toFixed(2);
  subtext = subtext.toString();
  pattern.exec(subtext);
  subtext = RegExp.$1 + "," + RegExp.$2;
  packtext = packprice.toFixed(2);
  packtext = packtext.toString();
  pattern.exec(packtext);
  packtext = RegExp.$1 + "," + RegExp.$2;
  pricetext = price.toFixed(2);
  pricetext = pricetext.toString();
  pattern.exec(pricetext);
  pricetext = RegExp.$1 + "," + RegExp.$2;
  taxtext = taxprice.toFixed(2);
  taxtext = taxtext.toString();
  pattern.exec(taxtext);
  taxtext = RegExp.$1 + "," + RegExp.$2;
  desctext = '';
  desctext += '<label>Coachingletter-Abonnement</label><span class="info">' + subtext + '&nbsp;EUR</span><br />';
  desctext += '<label>sales!perfect-Punkte-Guthaben</label><span class="info">' + packtext + '&nbsp;EUR</span><br />';
  desctext += '<div class="lightline"></div>';
  desctext += '<label>Gesamtpreis (ohne MwSt.)</label><span class="info">' + pricetext + '&nbsp;EUR</span><br />';
  desctext += '<label>Gesamtpreis (mit MwSt.)</label><span class="info">' + taxtext + '&nbsp;EUR</span><br />';
  changeContent('subdescription',desctext);
  if(subprice>0 || packprice>0) {
    document.getElementById('submitbutton').style.backgroundColor = '#e8e8e8';
    document.getElementById('submitbutton').style.borderTop = '#e8e8e8';
    document.getElementById('submitbutton').style.borderRight = '#e8e8e8';
    document.getElementById('submitbutton').style.borderBottom = '#e8e8e8';
    document.getElementById('submitbutton').style.color = '#000000';
  } else {
    document.getElementById('submitbutton').style.backgroundColor = 'white';
    document.getElementById('submitbutton').style.borderTop = 'white';
    document.getElementById('submitbutton').style.borderRight = 'white';
    document.getElementById('submitbutton').style.borderBottom = 'white';
    document.getElementById('submitbutton').style.color = '#e8e8e8';
  }
}


