function addToCalculate() {
    document.getElementById("resources-box").style.display = 'none';
    document.forms.plantingRateCalc.action = "/dp/resources/plantingrate";
    if (parseInt(document.forms.plantingRateCalc.recordCount.value) >= 5) {
        alert("You are not allowed to add more than 5 varieties to create the report");
        return false;
    }
    return true;
    //else
    //    document.forms.columnarForm.submit();
}

function addToSeedCountTool() {
    document.forms.plantingRateCalc.action = "/dp/resources/seedcount";
    if (parseInt(document.forms.plantingRateCalc.recordCount.value) >= 5) {
        alert("You are not allowed to add more than 5 varieties to create the report");
        return false;
    }
    return true;
}


function createReport() {
    showContent("resources-box");
}

function downloadReport() {
    //document.forms.reportForm.submit();
    popUp("/dp/resources/plantingratereport");
}

function downloadSeedCountReport() {
    popUp("/dp/resources/seedcountreport");
}

function showContent(elementId) {
    document.getElementById(elementId).style.display = 'block';
    document.getElementById('myReport').focus();
}

function popUp(URL) {
    eval("window.open(URL, 'PlantingRateCalculator', 'toolbar=1,scrollbars=1,location=0,statusbar=1,menubar=0,resizable=1,width=700,height=700,left = 262,top = 134');");
}
