

function getSelectBox(frm, bAllsel1, bAllsel2, bAllsel3) {
    var j = 0;

    if (bAllsel3) {
        frm.cat_seq.options[j++] = new Option("-All-","");
    }

    for (var i = 0; i < cat_seq.length; i++) {
        frm.cat_seq.options[j] = new Option(cat_nm[i],cat_seq[i]);

		if(frm.cat_seq.options[j].value == bAllsel1){
			frm.cat_seq.options[j].selected = true;
		}		
        j++;
    }

    if (bAllsel3 && bAllsel1 == "%" && bAllsel2 == "%") frm.cat_seq.options(0).selected = true; 
	cateChanged(frm, bAllsel2,bAllsel3);
}

function cateChanged(frm, bAll ,bAllsel3) {

    if (frm.cat_seq.value == "%") {
        frm.cat_seq.length = 0;
        frm.cat_seq.options[0] = new Option("NON","%");
    } else {
        getselectCodes(frm,frm.cat_seq.value, bAll, bAllsel3);
    }
}
function getselectCodes(frm,cat_seq, bAll, bAllsel3) {

    j = 0;
    frm.pro_seq.length = 0;

    if (bAllsel3 && bAllsel3 == '%') {
        frm.pro_seq.options[j++] = new Option("-All-","");
	    frm.pro_seq.options(0).selected = true;
    }
    for (var i = 0; i < pro_seq.length; i++) {
        if (pro_seq[i] == cat_seq) {
            frm.pro_seq.options[j] = new Option(pro_no[i],pro_no[i]);

			if(frm.pro_seq.options[j].value == bAll){
				frm.pro_seq.options[j].selected = true;
			}
            j++;
        }
    }
    if (j == 0) {
	    if (cat_seq == null || cat_seq == "") {
	        frm.pro_seq.options[j++] = new Option("-All-","");
	    }else {
        	frm.pro_seq.options[0] = new Option('NonData', '');
       	}
    }
}
