function updatebox() {
       var closeamount = document.getElementById('closeamount').value;
       var ratecardtotalprice = document.getElementById('ratecardtotalprice').value;
       if (closeamount == "")
           closeamount = 0;
       if (ratecardtotalprice == "")
           ratecardtotalprice = 0;

       var discount = parseInt(ratecardtotalprice) - parseInt(closeamount);
       var discountrate= (discount/parseInt(ratecardtotalprice)*100).toFixed(2);
       if (!isNaN(discount)) {
           document.getElementById('discountbox').value = discount;
           document.getElementById('discountrate').value = discountrate;
       }
   }


function sponsorask1() {
    var itembreakbox = document.getElementById("itembreakbox");
    var values = [];
if(document.getElementById('cb11').checked) {
  var ntvsponsor = prompt("Which NTV program/segment is sponsored");
  document.getElementById("sponsorbox").innerHTML = ntvsponsor;
  $("#sponsorbox").show();
 values.push("NTV Sponsorship");
  itembreakbox.value = values.join("                             ");

  }else{
  document.getElementById("sponsorbox").innerHTML = "";
  $("#sponsorbox").hide();
   itembreakbox.value = values.join("                             ");

  }
}

function sponsorask2() {
    var itembreakbox = document.getElementById("itembreakbox");
    var values = [];
if(document.getElementById('cb21').checked) {
  var sparksponsor = prompt("Which Spark program/segment is sponsored");
  document.getElementById("sponsorbox").innerHTML = sparksponsor;
  $("#sponsorbox").show();
 values.push("Spark Sponsorship");
  itembreakbox.value = values.join("                             ");

  }else{
  document.getElementById("sponsorbox").innerHTML = "";
  $("#sponsorbox").hide();
   itembreakbox.value = values.join("                             ");

  }
}

  function updatebreakdown() {
    var itembreakbox = document.getElementById("itembreakbox");
    var values = [];

  	   if(document.getElementById('cb11').checked) {
        values.push("NTV Sponsorship");
    }

    if(document.getElementById('cb12').checked) {
        values.push("NTV Spotbuys");
    }

    if(document.getElementById('cb13').checked) {
        values.push("NTV LiveBroadcast");
    }
    if(document.getElementById('cb14').checked) {
        values.push("NTV Documentary");
    }
    if(document.getElementById('cb15').checked) {
        values.push("NTV Talkshow");
    }
    if(document.getElementById('cb16').checked) {
        values.push("NTV SqueezeBack");
    }
    if(document.getElementById('cb17').checked) {
        values.push("NTV Scroll");
    }
    if(document.getElementById('cb18').checked) {
        values.push("NTV Feature");
    }
    if(document.getElementById('cb19').checked) {
        values.push("NTV Customized episode");
    }
    if(document.getElementById('cb111').checked) {
        values.push("NTV Mention");
    }
    if(document.getElementById('cb112').checked) {
        values.push("NTV Content-sales");
    }

  if(document.getElementById('cb21').checked) {
        values.push("Spark Sponsorship");
    }
    if(document.getElementById('cb22').checked) {
        values.push("Spark Spotbuys");
    }
    if(document.getElementById('cb23').checked) {
        values.push("Spark LiveBroadcast");
    }
    if(document.getElementById('cb24').checked) {
        values.push("Spark Documentary");
    }
    if(document.getElementById('cb25').checked) {
        values.push("Spark Talkshow");
    }
    if(document.getElementById('cb26').checked) {
        values.push("Spark SqueezeBack");
    }
    if(document.getElementById('cb27').checked) {
        values.push("Spark Scroll");
    }
    if(document.getElementById('cb28').checked) {
        values.push("Spark Feature");
    }
    if(document.getElementById('cb29').checked) {
        values.push("Spark Customized episode");
    }

if(document.getElementById('cb221').checked) {
        values.push("Spark Mention");
    }

if(document.getElementById('cb222').checked) {
        values.push("Spark Content-sales");
    }

if(document.getElementById('cb31').checked) {
        values.push("Digital - Website");
    }
    if(document.getElementById('cb32').checked) {
        values.push("Digital - Facebook");
    }
    if(document.getElementById('cb33').checked) {
        values.push("Digital - Streaming");
    }
    if(document.getElementById('cb34').checked) {
        values.push("Digital - VidTV");
    }
    if(document.getElementById('cb35').checked) {
        values.push("Digital - Banner");
    }
     if(document.getElementById('cb36').checked) {
        values.push("Digital - Scroll");
    }
    if(document.getElementById('cb37').checked) {
        values.push("Digital - Twitter");
    }
 itembreakbox.value = values.join("\n");
  }