// calculates the value for each table row - each library material // has two lines of code below function doCalculator(){ var booksValue = document.calculatorform.books.value * 20.76; document.getElementById("booksResult").value = booksValue.toFixed(2); var yabooksValue = document.calculatorform.yabooks.value * 19.71; document.getElementById("yabooksResult").value = yabooksValue.toFixed(2); var childrensbooksValue = document.calculatorform.childrensbooks.value * 18.72; document.getElementById("childrensbooksResult").value = childrensbooksValue.toFixed(2); var audiobooksValue = document.calculatorform.audiobooks.value * 27.00; document.getElementById("audiobooksResult").value = audiobooksValue.toFixed(2); var ebooksValue = document.calculatorform.ebooks.value * 10.00; document.getElementById("ebooksResult").value = ebooksValue.toFixed(2); var moviesValue = document.calculatorform.movies.value * 18.00; document.getElementById("moviesResult").value = moviesValue.toFixed(2); var cdsValue = document.calculatorform.cds.value * 13.00; document.getElementById("cdsResult").value = cdsValue.toFixed(2); var musicdownloadsValue = document.calculatorform.musicdownloads.value * 1.29; document.getElementById("musicdownloadsResult").value = musicdownloadsValue.toFixed(2); var newspapersValue = document.calculatorform.newspapers.value * 8.99; document.getElementById("newspapersResult").value = newspapersValue.toFixed(2); var magazinesValue = document.calculatorform.magazines.value * 5.00; document.getElementById("magazinesResult").value = magazinesValue.toFixed(2); var databasesValue = document.calculatorform.databases.value * 19.95; document.getElementById("databasesResult").value = databasesValue.toFixed(2); var hotspotsValue = document.calculatorform.hotspots.value * 7.75; document.getElementById("hotspotsResult").value = hotspotsValue.toFixed(2); var computerValue = document.calculatorform.computer.value * 23.40; document.getElementById("computerResult").value = computerValue.toFixed(2); var printedValue = document.calculatorform.printed.value * .60; document.getElementById("printedResult").value = databasesValue.toFixed(2); var wifiValue = document.calculatorform.wifi.value * 2.75; document.getElementById("wifiResult").value = wifiValue.toFixed(2); var museumpassesValue = document.calculatorform.museumpasses.value * 30.00; document.getElementById("museumpassesResult").value = museumpassesValue.toFixed(2); var illValue = document.calculatorform.ill.value * 24.00; document.getElementById("illResult").value = illValue.toFixed(2); var referenceValue = document.calculatorform.reference.value * 21.00; document.getElementById("referenceResult").value = referenceValue.toFixed(2); var adultprogramValue = document.calculatorform.adultprogram.value * 15.00; document.getElementById("adultprogramResult").value = adultprogramValue.toFixed(2); var childrensprogramValue = document.calculatorform.childrensprogram.value * 12.00; document.getElementById("childrensprogramResult").value = childrensprogramValue.toFixed(2); var meetingroomValue = document.calculatorform.meetingroom.value * 25.00; document.getElementById("meetingroomResult").value = meetingroomValue.toFixed(2); var curbsideValue = document.calculatorform.curbside.value * 2.50; document.getElementById("curbsideResult").value = curbsideValue.toFixed(2); // these last two lines adds up all the values for the total value var totalValue = (document.calculatorform.booksResult.value*1)+(document.calculatorform.yabooksResult.value*1)+(document.calculatorform.childrensbooksResult.value*1)+(document.calculatorform.audiobooksResult.value*1)+(document.calculatorform.ebooksResult.value*1)+(document.calculatorform.moviesResult.value*1)+(document.calculatorform.cdsResult.value*1)+(document.calculatorform.musicdownloadsResult.value*1)+(document.calculatorform.newspapersResult.value*1)+(document.calculatorform.magazinesResult.value*1)+(document.calculatorform.databasesResult.value*1)+(document.calculatorform.hotspots.value*1)+(document.calculatorform.computerResult.value*1)+(document.calculatorform.printedResult.value*1)+(document.calculatorform.wifiResult.value*1)+(document.calculatorform.museumpassesResult.value*1)+(document.calculatorform.illResult.value*1)+(document.calculatorform.referenceResult.value*1)+(document.calculatorform.adultprogramResult.value*1)+(document.calculatorform.childrensprogramResult.value*1)+(document.calculatorform.meetingroomResult.value*1)+(document.calculatorform.curbsideResult.value*1); document.getElementById("totalResult").value = totalValue.toFixed(2); } // launches popup window for value explaination function popUp(url, name, w, h){ popupWin = window.open(url, name, 'resizable,scrollbars,menubar=0,WIDTH=' + w + ',HEIGHT=' + h); } var stdvaluecalc; stdvaluecalc = "" + "