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(2001,10,27);
    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 27th November 2001.');
    }
    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\x26client=lyg\x26path=irCsvDownload\x26service=getPriceAndVolumeXml\x26companyId=1503\x26option=CSVDOWNLOAD\x26symbols=LYG@NYSE\x26fromDate="+fromDay+"-"+fromMonth+"-"+fromYear+"\x26toDate="+toDay+"-"+toMonth+"-"+toYear+"\x26transform=single"
    }
   }




