<!-- hide from old browsers...

/*     dynamic select menus -- written by Matt Reinfeldt
        feel free to use, modify, copy, distribute, and otherwise abuse this code!
        if you find any problems, let me know, and I will try to find a fix for it.
*/

var info = new Array(
    //"Georgia Property Tax*Install Problem|Network Problem|Printing Problem|Report Errors/Problem[DR-15]|Runtime Errors|Start Up Problem|Validation Problem|Other Problem",
    //"Georgia Salestaxx*Data Entry Problem|Install Problem|Network Problem|Printing Problem|Runtime Errors|Start Up Problem|Validation Problem|Other Problem",
    "1099 Generator*Data Entry Problem|Importing Problem|Install Problem|Magnetic Media Problem|Network Problem|Printing Problem|Runtime Errors|Start Up Problem|Validation Problem|Other Problem",
	"W2 Generator*Data Entry Problem|Importing Problem|Install Problem|Magnetic Media Problem|Network Problem|Printing Problem|Runtime Errors|Start Up Problem|Validation Problem|Other Problem"
	//"GA Forms Pack*Opening Software|Data Entry Problem|Printing Problem|Form Problem"
	//"North Carolina Tax*Pawn of Prophesy|Queen of Sorcery|Magician's Gambit|Castle of Wizardry|Enchanters' End Game",
	//"Tennessee Tax*Pawn of Prophesy|Queen of Sorcery|Magician's Gambit|Castle of Wizardry|Enchanters' End Game"
);

/******************************************************************************************************/

function stringSplit ( string, delimiter ) { 
    if ( string == null || string == "" ) { 
        return null; 
    } else if ( string.split != null ) { 
        return string.split ( delimiter ); 
    } else { 
        var ar = new Array(); 
        var i = 0; 
        var start = 0; 
        while( start >= 0 && start < string.length ) { 
             var end = string.indexOf ( delimiter, start ) ; 
             if( end >= 0 ) { 
                 ar[i++] = string.substring ( start, end ); 
                 start = end+1; 
             } else { 
                 ar[i++] = string.substring ( start, string.length ); 
                 start = -1; 
             } 
        } 
        return ar; 
    } 
} 
/******************************************************************************************************/
var menu1 = new Array();
var menu2 = new Array();
/******************************************************************************************************/
function createMenus () {

    for ( var i=0; i < info.length; i++ ) {
        menu1[i] = stringSplit ( info[i], '*' );
        menu2[i] = stringSplit ( menu1[i][1], '|' );
    }

    var author = document.myForm.program;
    var book = document.myForm.errloc;

    author.length = menu1.length;
    book.length = menu2[0].length; 
    for ( var i=0; i < menu1.length; i++ ) {
         author.options[i].value  = menu1[i][0];
         author.options[i].text   = menu1[i][0];
    }
    document.myForm.program.selected = 0;
    for (var x=0; x < menu2[0].length; x++) {
         book.options[x].text = menu2[0][x];
         book.options[x].value = menu2[0][x];
    }         
    document.myForm.errloc.selected = 0;
}

/******************************************************************************************************/

function updateMenus ( what ) {
    var sel = what.selectedIndex;

    if ( sel >= 0 && sel < menu1.length ) 
        var temp = menu2[sel];
    else
        var temp = new Array ();
    
    what.form.errloc.length = temp.length;

    for ( var i = 0; i < temp.length; i++ ) {
        what.form.errloc.options[i].text  = temp[i];
        what.form.errloc.options[i].value = temp[i];
    }
    what.form.errloc.selected=0;
}
// end of hiding -->
