<html>
<head>
<title> New Document </title>
<meta name="Generator" content="EditPlus">
<meta name="Author" content="">
<meta name="Keywords" content="">
<meta name="Description" content="">
</head>
<BODY><table width="439" border="0" cellspacing="0" cellpadding="0">
<tr id="message" style="color:#AAD5FF"><td>位置:</td></tr>
</table>
<hr/><table id="level1" width="439" border="0" cellspacing="0" cellpadding="0">
<tr id="s1">
    </tr>
</table>
<hr/>
<table width="439" border="0" cellspacing="0" cellpadding="0">
<tr id="s2">
    </tr>
</table>
<hr/>
<table id=s3 width="439" border="0" cellspacing="0" cellpadding="0">
<tr>
    </tr>
</table>
<hr/>
<p/><table width="439" border="0" cellspacing="0" cellpadding="0">
<iframe id="iframe1" name="iframe1" src="b.htm" width=100% height=109 marginwidth=0 marginheight=0 frameborder=0 ></IFRAME>
</table>
<SCRIPT LANGUAGE="JavaScript">
<!--
//选择框的名字
selector = [ "s1", "s2", "s3"];
//选择项: "名字", "值", 子选择
menu = [
 "中国","86",
  [
  "北京","BJ",
   [
   "海淀","1","a.htm",
   "昌平","1","a.htm",
   "朝阳","2","a.htm"
   ],
  "四川","SC",
   [
   "成都","28","b.htm",
   "乐山","","b.htm",
   "攀枝花","","b.htm",
   "自贡","","b.htm",
   "德阳","","b.htm",
   "绵阳","","b.htm"
   ]
  ],
 "美国","1",
  [
  "加利福尼亚","CA",
   [
   "旧金山","1","a.htm",
   "伯克利","1","a.htm",
   "洛杉矶","2","a.htm"
   ],
  "华盛顿","WA",
   [
   "西雅图","seattle","b.htm",
   "华盛顿特区","seattle","b.htm"
   ]
  ]
 ];
 
function wizz(level, doAction)
{
if( level == 0 )
var a = menu;
else
{
str = "menu";
for( var i=0; i<level; i++ )
str += "[" + (((document.all[selector[i]].selectedIndex)?document.all[selector[i]].selectedIndex:0) * 3 + 2)  + "]";
var a = eval(str);
}
if( a.constructor == Array) 
{
var s = document.all[selector[level]];
if(s)
{
if (document.all[selector[level+1]])
{
var p = s.parentElement;
s.removeNode(true);
var s = document.createElement("<tr id="+selector[level]+"></tr>");
p.appendChild(s);
}
else
{
var nRows = s.rows.length
for (var i=0;i<nRows;i++)
s.rows[0].removeNode(true);
}

i=0;
if (i < Math.floor(a.length/3))
{
s.selectedIndex = 0;
//message.innerHTML=message.innerHTML.replace(/\|/, a[i*3]+">>\|")
}
while( i < Math.floor(a.length/3) )
{
if (document.all[selector[level+1]])
{
var o=document.createElement("<td style='wordBreak:keep-all;cursor:hand;color:blue' Index="+i+" onclick='this.parentElement.selectedIndex=this.Index;wizz(" + (level+1) + ",true)' value=" + a[i*3+1]+"></td>");
o.innerHTML=a[i++*3];
s.insertAdjacentElement("beforeEnd", o);
}
else
{
var o=document.createElement("<td style='wordBreak:keep-all;cursor:hand;color:blue' Index="+i+" onclick='this.parentElement.parentElement.parentElement.selectedIndex=this.Index;wizz(" + (level+1) + ",true)' value=" + a[i*3+1]+"></td>");
o.innerHTML=a[i++*3];
oTR = document.createElement("TR");
oTR.insertAdjacentElement("beforeEnd", o)
s.firstChild.insertAdjacentElement("beforeEnd", oTR)
}
}
}
}
else
  if (doAction){document.all.iframe1.src=a;alert(a)}; syncLocation();
if( !(a == null) && document.all[selector[level]]) 
wizz(level+1);
    
}wizz(0);
function syncLocation()
{
var p = message.parentElement;
message.removeNode(true);
oo = document.createElement("<tr id='message'></tr>");
p.appendChild(oo);
for (var i=0;i<selector.length;i++)
{
if(message.children[i-1])message.children[i-1].innerHTML+=">>";

if (document.all[selector[i]].tagName.toLowerCase() == "table")
{
if(!document.all[selector[i]].selectedIndex)document.all[selector[i]].selectedIndex=0;
var oP = document.all[selector[i]].children[0].children[document.all[selector[i]].selectedIndex].firstChild;
}
else
var oP = document.all[selector[i]].children[document.all[selector[i]].selectedIndex];
if(oP)
{
oClone=oP.cloneNode(true)
message.insertAdjacentElement("beforeEnd", oClone);
}
}
var oT = document.createElement("<td width='100'></td>")
oT.innerText = "位置:"
message.insertAdjacentElement("afterBegin", oT);
var oT = document.createElement("<td width='100'></td>")
oT.innerText = " "
message.insertAdjacentElement("beforeEnd", oT);
}
//-->
</SCRIPT>
</BODY>
</html>