function doTheMath()
{
    var numPages       = 0;
    var firstPage      = 3;
    var money          = 'n/a';
    var time           = 'n/a';
    var firstPagePrice = 300;
    var innerPages     = 150;
    var totalPrice     = firstPagePrice;

    numPages = parseInt(document.getElementById('query').value);
    if (!numPages) {
        document.getElementById('resultTime').value='';
        document.getElementById('resultValue').value='';
        exit();
    }

    document.getElementById('resultTime').value = (numPages+firstPage) + ' dias';

    if (numPages > 1)
        totalPrice += (innerPages * (numPages-1));
    document.getElementById('resultValue').value = totalPrice;
}
