For starters, I have no clue where you got that code from, but I think what
you should have tried more is to understand how AJAX works instead of resorting to a simple Ctrl+C & Ctrl+V
Anyways, some errors I can already point out are:
1) Are you even defining the method "getHttpObject()" anywhere?
2)
xmlHttp.readyState=="complete" has no relevance. Infact it's not even correct.
xmlHttp.readyState==4 (the first condition you use) is more like it.
3) You're not even checking whether the response status is correct (=200).
Before you start of implementing the cascaded dropdowns, it would hold you in good stead if you brushed up the fundamentals of AJAX.
For starters, here's how your showState() method should have looked like:
Thereof, I think a tutorial like
this will help you complete the remaning part easily.