var attys=new Array(); // Number in original array + 1 // build the arrays for the dropdown options var groups=; // Number in original array + 1 var price=new Array(groups); var sprice=new Array(groups); var donation=new Array(groups); var reward=new Array(groups); var stock_status=new Array(); var group=new Array(groups); var group2=new Array(); var group3=new Array(); var i=1; attys[0] = Array(); attys[0]['groups'] = groups; attys[0]['group'] = group; attys[0]['group2'] = group2; attys[0]['group3'] = group3; attys[0]['prices'] = price; attys[0]['sprices'] = sprice; attys[0]['status'] = stock_status; attys[0]['donation'] = donation; attys[0]['reward'] = reward; function populate_options(pid,num,y) { var opt1='option1_'+pid; var opt2='option2_'+pid; var opt3='option3_'+pid; var opt4='option4_'+pid; x = document.getElementById(opt1).options.selectedIndex; w = y+2; var dropdowns=new Array(); dropdowns[3] = document.getElementById(opt3); dropdowns[4] = document.getElementById(opt4); while (w<=num) { dropdowns[w].options[0].selected=true; w++; } if (y==1) { tmp_group = attys[pid]['group'][x]; var formfield=document.getElementById(opt2); document.getElementById(opt2).options[0].selected=true; } else if (y==2) { z = document.getElementById(opt2).options.selectedIndex; tmp_group = attys[pid]['group2'][x][z]; var formfield=document.getElementById(opt3); } else if (y==3) { z = document.getElementById(opt2).options.selectedIndex; w = document.getElementById(opt3).options.selectedIndex; tmp_group = attys[pid]['group3'][x][z][w]; var formfield=document.getElementById(opt4); } for(m=formfield.options.length-1;m>0;m--) { formfield.options[m]=null; } if (typeof tmp_group != 'undefined') { for(i=0;i