Add Category well sorta

I need to use javascript to implement a dependent drop down list because
of that I need help on the on the insert statements as well