Topic=function(_1,_2,_3,_4){
this.optvalue=_1;
this.opttext=_2;
this.elems_to_show=_3;
this.subtopics=_4;
for(var _5=0;_4&&_5<_4.length;_5++){
if(!_4[_5]){
continue;
}
_4[_5].parent=this;
}
};
Topic.prototype.activate=function(_6){
if(this.parent){
this.parent.current_sub_topic=this;
}
if(_6){
this.populateSelect(_6);
this.select_elem_id=_6;
}
for(var _7=0;this.elems_to_show&&_7<this.elems_to_show.length;_7++){
if(!this.elems_to_show[_7]){
continue;
}
show(this.elems_to_show[_7]);
}
if(this.subtopics&&this.subtopics[0]){
this.subtopics[0].activate();
}
};
Topic.prototype.deactivate_all=function(){
this.deactivate();
for(var _8=0;this.subtopics&&_8<this.subtopics.length;_8++){
if(!this.subtopics[_8]){
continue;
}
this.subtopics[_8].deactivate_all();
}
};
Topic.prototype.deactivate=function(){
if(this.current_sub_topic){
this.current_sub_topic.deactivate();
}
if(this.select_elem_id){
this.clearSelect(this.select_elem_id);
}
for(var _9=0;this.elems_to_show&&_9<this.elems_to_show.length;_9++){
if(!this.elems_to_show[_9]){
continue;
}
hide(this.elems_to_show[_9]);
}
if(this.parent){
this.parent.current_sub_topic=undefined;
}
};
Topic.prototype.findAct=function(_a){
for(var _b=0;this.subtopics&&_b<this.subtopics.length;_b++){
if(!this.subtopics[_b]){
continue;
}
if(this.subtopics[_b].optvalue==_a){
return this.subtopics[_b];
}
}
return undefined;
};
Topic.prototype.populateSelect=function(_c){
var _d=(typeof (_c)=="string"?ss_getElementById(_c):_c);
this.clearSelect(_d);
if(!this.subtopics||this.subtopics.length==0){
hide(_d);
return;
}
show(_d);
for(var ii=0;this.subtopics&&ii<this.subtopics.length;ii++){
if(!this.subtopics[ii]){
continue;
}
var _f=this.subtopics[ii];
_d.options[ii]=new Option(_f.opttext,_f.optvalue);
}
};
Topic.prototype.clearSelect=function(_10){
var _11=(typeof (_10)=="string"?ss_getElementById(_10):_10);
for(var ii=_11.options.length-1;ii>=0;ii--){
_11.options[ii]=null;
}
_11.selectedIndex=0;
};
var global_topic=new Topic("global","global",undefined,[new Topic("","Please choose a topic",undefined,undefined),new Topic("membership","Login & Registration",["subtopic_div","browser_row","os_row"],[new Topic("cantregister","I can't register",["problem_instructions","isp_row"]),new Topic("cantlogin","I can't login",["problem_instructions","isp_row"]),new Topic("forgotpw","I forgot my password",["forgotpw_hint"]),new Topic("acctdisabled","My account is disabled"),new Topic("cancelme","Please cancel my account",["reason_for_cancel"]),new Topic("other","Other"),]),new Topic("shipnbill","Shipping & Billing",["subtopic_div"],[new Topic("tradefail","My order didn't arrive",["send_private_msg"]),new Topic("badcharge","I got charged the wrong amount"),new Topic("buycredits","I want to buy some credits",["buycredits_instructions"]),new Topic("other","Other"),]),new Topic("siteproblem","Report a website problem",["problem_instructions","isp_row","problem_url_row","problem_url_row2","browser_row","os_row"],undefined),new Topic("general","General Message",undefined,undefined)]);
function _onTopicChange(_13,_14){
var _15=_13[_13.selectedIndex].value;
var _16=_14.findAct(_15);
if(_14.current_sub_topic){
_14.current_sub_topic.deactivate();
}
_16.activate(_14==global_topic?"subtopic":undefined);
}
function onTopicChange(_17){
return _onTopicChange(_17,global_topic);
}
function onSubTopicChange(_18){
return _onTopicChange(_18,global_topic.current_sub_topic);
}

