    function ValidateMarks()
    {
        var NumMarked=0;

        for( var i=0;i<document.forms[0].length;i++ )
        {
            if ( document.forms[0].elements[i].type == "checkbox" &&
                 document.forms[0].elements[i].checked )
            {
                NumMarked++;
            }
        }

        if ( NumMarked == 0 )
        {
            alert( "You have not marked any files for download" )
            return false;
        }
        else
        {
            return true;
        }
    }

    function MarkCheckboxes(InputForm, EndStr)
    {
        var NameLength = 0;
        var Extension = "";
		var re = new RegExp(EndStr, "i")

        for( var i=0;i<InputForm.length;i++ )
        {
            NameLength = InputForm.elements[i].name.length;
            Extension  = InputForm.elements[i].name.substring(NameLength-3,NameLength);

                if ( InputForm.elements[i].type == "checkbox" )
                {
                    target = InputForm.elements[i].name
                    if ( EndStr == "ALL")
                    {			
                        InputForm.elements[i].checked = true;
                        InputForm.elements[i].value   = "on";
                    }
                    else if ( result = re.test(target) )
                    {
                        InputForm.elements[i].checked = true;
                        InputForm.elements[i].value   = "on";
                    }
                    else
                    {
                        InputForm.elements[i].checked = false;
                        InputForm.elements[i].value   = null;
                    }
                }
            }
        }

		function go(ddl)
		{
			destination = ddl.options[ddl.selectedIndex].value;
			if (destination)
			{
				location.href = destination;
			}
		}