function writeSelect()
{
    //todo: get the date from server later
    var theDate = new Date();
    var theYear = theDate.getFullYear();
    var theMonth = theDate.getMonth(); // stay with 0-11 for now
    document.write("<select class=\"n11\" name=\"PressData.publish\" id=\"PressData.publish\">");
    document.write("<option value=\"" + subtractMonth(0,2) + "\">Most recent 3 months\n"); // only -2 because include current month
    document.write("<option value=\"" + subtractMonth(0,5) + "\">Within the last 6 months\n"); // only -5 because we include current month
    document.write("<option value=\"" + subtractMonth(1,0) + "\">Within the last year\n");
    document.write("<option value=\"" + subtractMonth(2,0) + "\">Within the last 2 years\n");       
    document.write("<\/select>");

    // function only works properly when supplying year or month, not both
    function subtractMonth(year, month)
    {               
        var newYear = theYear - year;
        var newMonth = theMonth - month;                          
        if (newMonth < 0)
        {                    
            newYear = newYear - 1;
            newMonth = 12 + newMonth;
        }
        newMonth++; // convert month from 0-11 to 1-12
        if (month == 0)
        {
            // If we want the last year or two only, we don't
            // include this month last year (that would be 13
            // or 25 months, not 12 or 24, since we include the
            // current month this year).
            newMonth++;
            if (newMonth == 13)
            {
                newMonth = 1;
                newYear++;
            }
        }
        if (newMonth < 10)
        {
            newMonth = "0" + newMonth;
        }
        var theFull = "";
        return theFull.concat(newYear, newMonth, "00");
    }
}

function filterArchive()
{
	var theIDArray = ["PressData.category","PressData.publish","PressData.language",];
	var theQuery = DOMExtractor.extractPropertiesFromFormElements(document, theIDArray);

	document.getElementById("criteria").firstChild.nodeValue = setFilterCriteria(theQuery, true);
	filterPressAchiveByProperties(theQuery);
	
	return false;
}