
function doSubmit() {
    var fromDay =  document.prices.startday.options[document.prices.startday.options.selectedIndex].value;
    var fromMonth = document.prices.startmonth.options[document.prices.startmonth.options.selectedIndex].value;
    var fromYear =  document.prices.startyear.options[document.prices.startyear.options.selectedIndex].value;
    var toDay = document.prices.finishday.options[document.prices.finishday.options.selectedIndex].value;
    var toMonth = document.prices.finishmonth.options[document.prices.finishmonth.options.selectedIndex].value;
    var toYear = document.prices.finishyear.options[document.prices.finishyear.options.selectedIndex].value;
        //take note: month array starts from 0, so 0 = January, 1 = February, 2 = March etc.
        // ONLY the month array
    var firstDate = new Date(2006,10,24);
    var startDate = new Date(fromYear,fromMonth-1,fromDay);
    var endDate = new Date(toYear,toMonth-1,toDay);
    var localDate = new Date();

    if (startDate < firstDate) {
        alert('Please check the dates selected. Start date cannot be before the 24th November 2006.');
    }
    else if (startDate > endDate) {
        alert('Please check the dates selected. Start date cannot be after end date');
    }
    else if (endDate > localDate) {
        alert('Please check the dates selected. End date cannot be in the future');
    }
    else{
        top.location.href= "/servlet/HsPublic?context=ir.access\x26ir_client_id=5354\x26ir_option=CSVDOWNLOAD\x26fromDate="+fromDay+"-"+fromMonth+"-"+fromYear+"\x26toDate="+toDay+"-"+toMonth+"-"+toYear+"\x26transform=single"
    }
   }