It generates the selects, but when i change the values intead hide/replace them it fails.
Living example here: http://jsfiddle.net/seinoxygen/aLfZT/
(the second selectors)
It could be good merge both functions in just one.
The idea is generate them on change (like is working print_cat(cat, 0);) but if value is passed as default generate the selects until reach the value passed like the second. But the second doent work properly when is changed.
So, if i pass print_cat(cat, 0); print just the fisrt combo with all categories with parent 0. And If i pass print_cat(cat, 35); print the categorie and the parents luke the second select groups.