var l = new String(window.location);
if(l.indexOf('nfgis.nsdi.gov.cn/sms')>=0)
window.location=l.replace('nfgis.nsdi.gov.cn/sms','sms.webmap.cn');


function showDefaultMenu(visible) { //v2.0
/*  if ( document.body.clientWidth ) {
  	document.getElementById("defaultMenu").style.left=parseInt((document.body.clientWidth-750)/2);
  }else{
  	document.getElementById("defaultMenu").style.left=parseInt((innerWidth-750)/2);
  }
  document.getElementById("defaultMenu").style.visibility =visible;
*/
}
function showBrowseMenu(visible) { //v2.0
/*  if ( document.body.clientWidth ) {
  	document.getElementById("browseOps").style.left=parseInt((document.body.clientWidth-750)/2+245);
  }else{
  	document.getElementById("browseOps").style.left=parseInt((innerWidth-750)/2+245);
  }
  document.getElementById("browseOps").style.visibility =visible;
*/
}
function showDatadescMenu(visible) { //v2.0
/*  if ( document.body.clientWidth ) {
 	document.getElementById("datadesc").style.left=parseInt((document.body.clientWidth-750)/2+125);
  }else{
  	document.getElementById("datadesc").style.left=parseInt((innerWidth-750)/2+125);
  }
  document.getElementById("datadesc").style.visibility =visible;
*/
}
function hideSubMenus(){
//  document.getElementById("browseOps").style.visibility ="hidden";
//  document.getElementById("datadesc").style.visibility ="hidden";
//  document.getElementById("defaultMenu").style.visibility ="hidden";
}
function PopReadme(){
	window.open ("readme.htm","","scrollbars=yes,fullscreen=no,channelmode=no,location=no,toolbar=no,status=yes,menubar=no,resizable=yes,scrollbars=no,width=355,height=538,left=370,top=150");
}


function writeMenu(hotIndex)  {
		document.write('<table width="800" border="0" cellspacing="0"><tr  valign=top>'); 
            document.write('<td width="125" onmouseover=\'hideSubMenus();showDefaultMenu("visible")\' onmouseup=\'showDefaultMenu("hidden");\'class=');
			  if(hotIndex==1) document.write('"tsel"'); else document.write('"tun"'); 
			  document.write('><a class=');
			  if(hotIndex==1) document.write('"a2"'); else document.write('"a1"'); 
			document.write('href="default.asp">首页</a></td>');

//			document.write('<td  width="125" onmouseover=\'hideSubMenus();showDatadescMenu("visible");\'  onmouseup=\'showDatadescMenu("hidden");\' class=');
            document.write('<td  width="125" onmouseover=\'hideSubMenus();\'  class=');
			  if(hotIndex==2) document.write('"tsel"'); else document.write('"tun"'); 
			document.write('><a class=');
  		      if(hotIndex==2) document.write('"a2"'); else document.write('"a1"'); 
			document.write('href="search.asp">元数据检索</a></td>');
			
            document.write('<td width="125" onmouseover=\'hideSubMenus();\' onmouseup=\'showDefaultMenu("hidden");\'class=');
			  if(hotIndex==3) document.write('"tsel"'); else document.write('"tun"'); 
			  document.write('><a class=');
			  if(hotIndex==3) document.write('"a2"'); else document.write('"a1"'); 
			document.write('href="mapexplor/index.html">数据预览</a></td>');
            document.write('<td  width="125" onmouseover=\'hideSubMenus()\' class=');
			  if(hotIndex==4) document.write('"tsel"'); else document.write('"tun"'); 
			  document.write('><a class=');
			  if(hotIndex==4) document.write('"a2"'); else document.write('"a1"'); 
			document.write('href="dblist.asp">数据查询</a></td>');
			
            document.write('<td  width="125" onmouseover=\'hideSubMenus()\' class=');
			  if(hotIndex==5) document.write('"tsel"'); else document.write('"tun"'); 
			  document.write('><a class=');
			  if(hotIndex==5) document.write('"a2"'); else document.write('"a1"'); 
			document.write('href="standard.asp">相关规章</a></td>');

			document.write('<td  width="125" onmouseover=\'hideSubMenus()\' class=');
			  if(hotIndex==6) document.write('"tsel"'); else document.write('"tun"'); 
			  document.write('><a class=');
			  if(hotIndex==6) document.write('"a2"'); else document.write('"a1"'); 
			document.write('href="owshelp.asp">使用说明</a></td>');

			document.write('<td  width="125" onmouseover=\'hideSubMenus()\' class=');
			  if(hotIndex==7) document.write('"tsel"'); else document.write('"tun"'); 
			  document.write('><a class=');
			  if(hotIndex==7) document.write('"a2"'); else document.write('"a1"'); 
			document.write('href="link.asp">相关链接</a> </td>');
         document.write(' </tr></table>');		     
 }
function writeBottom(){
	document.write('<center><table width="800" border="0" cellpadding="0" cellspacing="0" class="bottom" align="center">\
          <tr> \
            <td rowspan="4" valign="top" class="topborder"><div align="left" valign="top"><a href="admin/"><img src="images/sbsm.gif" width="67" height="67" border="0"></a></div></td>\
            <td rowspan="4" valign="middle"  align="center" width="65%"><a href="http://www.miibeian.gov.cn">京ICP备05071671号</a><br></td>\
            <td  valign="bottom" class="topborder" nowrap> <div align="right">版权所有 \
                <script>document.write("&copy;")</script>\
                ：国家测绘局</div></td>\
          </tr>\
          <tr> \
            <td><div align="right">主页制作者：国家基础地理信息中心 </div></td>\
          </tr>\
          <tr> \
            <td> <div align="right"> \
                <script>\
     document.write("最后更新日期："+window.document.lastModified);\
    </script>\
              </div></td>\
          </tr>\
          <tr> \
            <td><div align="right"><img src="images/MAIL.gif" width="14" height="10">:<a href="mailto:xinxi@nsdi.gov.cn">apsdinode@nsdi.gov.cn</a></div></td>\
          </tr>\
        </table></center>');
}

function writeHead(hotindex,userName){
	document.write('<table width="800"  border="0" align="center" cellpadding="0" cellspacing="0">\
	    <tr> \
	      <td width="800" height="100" bgcolor="#aaaaFF">\
	      	<img src="./images/title.jpg" border="0" usemap="#sdsp">\
	      		<map name="sdsp">\
	      			<area shape="rect" coords="120,13,172,80" href="http://www.sciencedata.cn/" alt="科学数据共享工程" target="_blank">\
	      			 <area shape="rect" coords="177,0,799,102" href="http://sms.webmap.cn" alt="回首页">\
	      			 <area shape="circle" coords="69,49,36" href="http://www.sbsm.gov.cn" alt="国家测绘局" target="_blank">\
	      		</map>\
	      </td>\
			</tr>\
	    <tr valign="top"> \
	      <td bgcolor="#aaaaFF">\
	        <table width="790" border="0" cellspacing="0" cellpadding="0" height="25" background="images/memberbg.gif">\
			      <tr>\
					  <form name="form1" method="post" action="numer.asp">\
            <td width="23" height="25"></td>\
			      <td valign="top" nowrap>');
	 if(userName)
	 		document.write('<font color="1772BB">欢迎您,'+userName+'</font>\
					        <a href="login.asp?logout=1"><img src="images/logoff.gif" width="53" height="21" align="absbottom" border="0"></a>');			     
	 else 
	 		document.write('<font color="1772BB">用户名：</font><input type="text" name="UserName" size="7">\
					        <font color="1772BB">密 码：</font><input type="password" name="UserPass" size="7">\
					        <input type=image src="images/login.gif" width="53" height="21" align="absbottom" name="send">\
					        <a href="reg.asp"><img src="images/reg.gif" width="53" height="21" align="absbottom" border="0"></a>');
	 document.write('</td>\
					  </form>\
					  <form method="POST" action="find.asp">\
				    <td  valign="top" nowrap>数据类别\
								  <select size="1" name="fl">\
				            <option value="大地测量数据">大地测量数据</option>\
				            <option value="近代、当代地图数据">近代、当代地图数据</option>\
				            <option value="古地图">古地图</option>\
				            <option value="地理底图-中国">中国地理底图</option>\
				            <option value="电子栅格地图">电子栅格地图</option>\
				            <option value="世界地图数据">世界地图数据</option>\
				            <option value="基础地理数据">基础地理数据</option>\
					    <option value="遥感影像数据">遥感影像数据</option>\
					    <option value="专题地理数据">专题地理数据</option>\
				          </select>\
		              <input type="text" name="dbname"   value="关键词搜索" size="10">\
		              <input type="image" src="images/search.gif" align="absbottom">\
		              <a href="#" onclick="JavaScript:PopReadme()"><img src="images/help.gif" border="0" height="20" align="absbottom">使用说明</a>\
			       </td>\
					  </form>	   \
			    </tr>\
			  </table>\
				</td>\
	    </tr>\
	    <tr valign="top"> \
	      <td height="14">');
	      writeMenu(hotindex);
				document.write('</td>\
	    </tr>\
	    </table>');	
}
