var nSubtopics;
var nTopics;
var aTopicText;
var aTopicValue;
var aSubtopicText;
var aSubtopicValue;
var nSelectedTopic;
var nSelectedSubtopic;
function OnInitial()
{
//debugger;;
var i, j, n, strTopic, strSubtopic;
nTopics =document.getElementById("_ctl0_ContentPlaceHolder1_ddlTopic").options.length;
aTopicText = new Array(nTopics);
aTopicValue = new Array(nTopics);
for (i=0; i< nTopics; i++)
{
aTopicText[i] = document.getElementById("_ctl0_ContentPlaceHolder1_ddlTopic").options[i].text;
aTopicValue[i] = document.getElementById("_ctl0_ContentPlaceHolder1_ddlTopic").options[i].value;
}
nSubtopics = document.getElementById("_ctl0_ContentPlaceHolder1_ddlSubtopic").options.length;
aSubtopicText = new Array(nSubtopics);
aSubtopicValue = new Array(nSubtopics);
for (i = 0; i < nSubtopics; i++) {
aSubtopicText[i] = document.getElementById("_ctl0_ContentPlaceHolder1_ddlSubtopic").options[i].text;
aSubtopicValue[i] = document.getElementById("_ctl0_ContentPlaceHolder1_ddlSubtopic").options[i].value;
}
nSelectedTopic = document.getElementById("_ctl0_ContentPlaceHolder1_ddlTopic").selectedIndex;
nSelectedSubtopic = document.getElementById("_ctl0_ContentPlaceHolder1_ddlSubtopic").selectedIndex;
if (nSelectedTopic == 0) {
document.getElementById("_ctl0_ContentPlaceHolder1_ddlSubtopic").options.length = 1;
}
else {
strTopic = document.getElementById("_ctl0_ContentPlaceHolder1_ddlTopic").options[nSelectedTopic].text;
n = strTopic.length;
j = 0;
for (i = 1; i < nSubtopics; i++) {
strSubtopic = aSubtopicValue[i];
if (strTopic != strSubtopic.substring(0, n))
{
document.getElementById("_ctl0_ContentPlaceHolder1_ddlSubtopic").options[i - j] = null;
j++;
}
}
}
}
function OnChangeTopic()
{ var i, j, n, strTopic, strSubtopic,strSubtopicVal;
if (nSelectedTopic != document.getElementById("_ctl0_ContentPlaceHolder1_ddlTopic").selectedIndex)
{
nSelectedTopic = document.getElementById("_ctl0_ContentPlaceHolder1_ddlTopic").selectedIndex;
strTopic = document.getElementById("_ctl0_ContentPlaceHolder1_ddlTopic")[nSelectedTopic].text;
document.getElementById("_ctl0_ContentPlaceHolder1_ddlSubtopic").options.length = 1;
if (nSelectedTopic != 0)
{
j = 1;
n = strTopic.length;
for (i = 1; i < nSubtopics; i++)
{
//strSubtopic = aSubtopicValue[i];
strSubtopic = aSubtopicText[i];
strSubtopicVal = aSubtopicValue[i];
if (strTopic == strSubtopic.substring(0, n))
{
document.getElementById("_ctl0_ContentPlaceHolder1_ddlSubtopic").options[j] = new Option(strSubtopic.substring(n + 1, strSubtopic.length), strSubtopicVal);
if (nSelectedSubtopic == i) {
document.getElementById("_ctl0_ContentPlaceHolder1_ddlSubtopic").selectedIndex = j;
}
j++;
}
}
}
}
}
function OnChangeSubtopic()
{ var i, n, strSubtopic;
n = document.getElementById("_ctl0_ContentPlaceHolder1_ddlSubtopic").selectedIndex;
if (n == 0)
{
nSelectedSubtopic = 0;
}
else
{
strSubtopic = document.getElementById("_ctl0_ContentPlaceHolder1_ddlSubtopic")[n].value;
for (i = 1; i < nSubtopics; i++)
{
if (strSubtopic == aSubtopicValue[i])
{
nSelectedSubtopic = i;
break;
}
}
}
}
<!--
function MM_reloadPage(init) { //reloads the window if Nav4 resized
if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);
//-->
|