var selDistrict = new Array(); //行政区
var  selValley = new   Array(); //流域
var selJC = new Array(); //简称
var selValleyNum = new Array();//流域代码
selJC[0]="京";
selJC[1]="津";
selJC[2]="冀";
selJC[3]="晋";
selJC[4]="蒙";
selJC[5]="辽";
selJC[6]="吉";
selJC[7]="黑";
selJC[8]="沪";
selJC[9]="苏";
selJC[10]="浙";
selJC[11]="皖";
selJC[12]="闽";
selJC[13]="赣";
selJC[14]="鲁";
selJC[15]="豫";
selJC[16]="鄂";
selJC[17]="湘";
selJC[18]="粤";
selJC[19]="桂";
selJC[20]="琼";
selJC[21]="渝";
selJC[22]="川";
selJC[23]="黔";
selJC[24]="滇";
selJC[25]="藏";
selJC[26]="陕";
selJC[27]="甘";
selJC[28]="青";
selJC[29]="宁";
selJC[30]="新";
//行政区
selDistrict[0] = "北京";
selDistrict[1] = "天津";
selDistrict[2] = "河北";
selDistrict[3] = "山西";
selDistrict[4] = "内蒙古";
selDistrict[5] = "辽宁";
selDistrict[6] = "吉林";
selDistrict[7] = "黑龙江";
selDistrict[8] = "上海";
selDistrict[9] = "江苏";
selDistrict[10] = "浙江";
selDistrict[11] = "安徽";
selDistrict[12] = "福建";
selDistrict[13] = "江西";
selDistrict[14] = "山东";
selDistrict[15] = "河南";
selDistrict[16] = "湖北";
selDistrict[17] = "湖南";
selDistrict[18] = "广东";
selDistrict[19] = "广西";
selDistrict[20] = "海南";
selDistrict[21] =  "重庆";
selDistrict[22] = "四川";
selDistrict[23] = "贵州";
selDistrict[24] = "云南";
selDistrict[25] = "西藏";
selDistrict[26] = "陕西";
selDistrict[27] = "甘肃";
selDistrict[28] = "青海";
selDistrict[29] = "宁夏";
selDistrict[30] = "新疆";
//流域
selValley[0] = "松辽";
selValley[1] = "海河";
selValley[2] = "黄河";
selValley[3] = "淮河";
selValley[4] = "长江";
selValley[5] = "太湖浙闽";
selValley[6] = "珠江";
selValley[7] = "其他流域";
//流域代码
selValleyNum[0] = "0";
selValleyNum[1] = "1";
selValleyNum[2] = "2";
selValleyNum[3] = "3";
selValleyNum[4] = "4";
selValleyNum[5] = "5";
selValleyNum[6] = "6";
selValleyNum[7] = "7";
	function selectMode(strIndx){
		if(strIndx=='0'){
			selDivShow = document.getElementById("selShow");
			divSel = document.getElementById("divMode");
			var selVal = divSel.value;
			if(selVal == "1"){
				document.getElementById("bbt").innerHTML = "<select name=\"selShow\" style=\"width:65px;font-size:12px;color:#616161\"></select>";
				document.all("selShow").options.length=0;
				for(i=0;i<selValley.length;i++){
						document.all("selShow").options.add(new Option(selValley[i],selValleyNum[i]));
				}
			}
			else if(selVal == "2"){
				document.getElementById("bbt").innerHTML = "<select name=\"selShow\" style=\"width:65px;font-size:12px;color:#616161\"></select>";
				document.all("selShow").options.length=0;
				for(i=0;i<selDistrict.length;i++){
						document.all("selShow").options.add(new Option(selDistrict[i],selJC[i]));
				}
			}
			else if(selVal == "3"){
				document.getElementById("bbt").innerHTML = "<input type=\"text\" style=\"width:65px;font-size:12px;color:#616161\" name=\"bbtcx\" id=\"bbtcx\"/>";
			}
		}else if(strIndx=='1'){
			selDivShow = document.getElementById("selShow1");
			divSel = document.getElementById("divMode1");
			var selVal = divSel.value;
			if(selVal == "1"){
				document.getElementById("bbt1").innerHTML = "<select name=\"selShow1\" style=\"width:65px;font-size:12px;color:#616161\"></select>";
				document.all("selShow1").options.length=0;
				for(i=0;i<selValley.length;i++){
						document.all("selShow1").options.add(new Option(selValley[i],selValleyNum[i]));
				}
			}
			else if(selVal == "2"){
				document.getElementById("bbt1").innerHTML = "<select name=\"selShow1\" style=\"width:65px;font-size:12px;color:#616161\"></select>";
				document.all("selShow1").options.length=0;
				for(i=0;i<selDistrict.length;i++){
						document.all("selShow1").options.add(new Option(selDistrict[i],selJC[i]));
				}
			}
			else if(selVal == "3"){
				document.getElementById("bbt1").innerHTML = "<input type=\"text\" style=\"width:65px;font-size:12px;color:#616161\" name=\"bbtcx1\" id=\"bbtcx1\"/>";
			}
		}else{
			selDivShow = document.getElementById("selShow2");
			divSel = document.getElementById("divMode2");
			var selVal = divSel.value;
			if(selVal == "1"){
				document.getElementById("bbt2").innerHTML = "<select name=\"selShow2\" style=\"width:65px;font-size:12px;color:#616161\"></select>";
				document.all("selShow2").options.length=0;
				for(i=0;i<selValley.length;i++){
						document.all("selShow2").options.add(new Option(selValley[i],selValley[i]));
				}
			}
			else if(selVal == "2"){
				document.getElementById("bbt2").innerHTML = "<select name=\"selShow2\" style=\"width:65px;font-size:12px;color:#616161\"></select>";
				document.all("selShow2").options.length=0;
				for(i=0;i<selDistrict.length;i++){
						document.all("selShow2").options.add(new Option(selDistrict[i],selJC[i]));
				}
			}
			else if(selVal == "3"){
				document.getElementById("bbt2").innerHTML = "<input type=\"text\" style=\"width:65px;font-size:12px;color:#616161\" name=\"bbtcx2\" id=\"bbtcx2\"/>";
			}
		}
		
}
	function tableSel(){
		if(document.all.Radiobutton[0].checked){
			SearchName.action="index_dataList.jsp?type=1";
			SearchName.target="_blank";
			SearchName.submit();
		}
		else if(document.all.Radiobutton[1].checked){
			SearchName.action="index_dataList.jsp?type=2";
			SearchName.target="_blank";
			SearchName.submit();
		}
	}
	function liuyuSelect(sin){
		if(document.all.Radiobutton[0].checked){
			if(sin == 4){
				SearchName.action="index_dataList.jsp?type=1&divMode=2&strIndx=4";
			}
			else if(sin == 2){
				SearchName.action="index_dataList.jsp?type=1&divMode=2&strIndx=2";
			}
			else if(sin == 1){
				SearchName.action="index_dataList.jsp?type=1&divMode=2&strIndx=1";
			}
			else if(sin == 3){
				SearchName.action="index_dataList.jsp?type=1&divMode=2&strIndx=3";
			}
			else if(sin == 6){
				SearchName.action="index_dataList.jsp?type=1&divMode=2&strIndx=6";
			}
			else if(sin == 0){
				SearchName.action="index_dataList.jsp?type=1&divMode=2&strIndx=0";
			}
			else if(sin == 5){
				SearchName.action="index_dataList.jsp?type=1&divMode=2&strIndx=5";
			}
		}
		else if(document.all.Radiobutton[1].checked){
			if(sin == 4){
				SearchName.action="index_dataList.jsp?type=2&divMode=2&strIndx=4";
			}
			else if(sin == 2){
				SearchName.action="index_dataList.jsp?type=2&divMode=2&strIndx=2";
			}
			else if(sin == 1){
				SearchName.action="index_dataList.jsp?type=2&divMode=2&strIndx=1";
			}
			else if(sin == 3){
				SearchName.action="index_dataList.jsp?type=2&divMode=2&strIndx=3";
			}
			else if(sin == 6){
				SearchName.action="index_dataList.jsp?type=2&divMode=2&strIndx=6";
			}
			else if(sin == 0){
				SearchName.action="index_dataList.jsp?type=2&divMode=2&strIndx=0";
			}
			else if(sin == 5){
				SearchName.action="index_dataList.jsp?type=2&divMode=2&strIndx=5";
			}
		}
	    SearchName.target="_blank";
	    SearchName.submit();
	}
	function disVisibleItemopen(){
	    var divNode = document.getElementById("itemopen");
	    divNode.style.display = "none";
	}
	function rdtptShow(){
		SearchName.action="workdir/ntptRdShow.jsp";
		SearchName.target="_black";
		SearchName.submit();
	}
	function onOverHd(stcd,zhan_name){
		var url = "svg/svgrealtime4GM.jsp";
	    url += "?site=" + stcd;
	    url += "&site_name=" + zhan_name;
	    url += "&search_name=实时水文过程";
	    url += "&search_kind=河道水情";
	    var itemopenNode = window.document.getElementById("itemopen");
	    var container = document.compatMode == 'CSS1Compat' ? document.documentElement : document.body;
	    
	    var newX = window.event.x + document.body.scrollLeft + 80;
	    var newY = window.event.clientY + container.scrollTop;
	    if(newX + 400 > document.body.clientWidth)
	    	newX -= 400;

	    if(newY + 230 > window.screen.height)
	    	newY -= 230;

	    itemopenNode.style.pixelLeft = newX;
	    itemopenNode.style.pixelTop = newY;
	    itemopenNode.style.display = "block";
	    window.iName.document.location = url;
	}
	function onOverSk(stcd,zhan_name){
	    var url = "svg/svgrealtime4GM.jsp";
	    url += "?site=" + stcd;
	    url += "&site_name=" + zhan_name;
	    url += "&search_name=水位~蓄水量过程";
	    url += "&search_kind=水库水情";
	    window.iName.document.location = url;
	    var itemopenNode = window.document.getElementById("itemopen");
	    var container = document.compatMode == 'CSS1Compat' ? document.documentElement : document.body;
	    
	    var newX = window.event.x + document.body.scrollLeft + 80;
	    var newY = window.event.clientY + container.scrollTop;
	    if(newX + 400 > document.body.clientWidth)
	    	newX -= 400;

	    if(newY + 230 > window.screen.height)
	    	newY -= 230;
	    itemopenNode.style.pixelLeft = newX;
	    itemopenNode.style.pixelTop = newY;
	    itemopenNode.style.display = "block";
	}
	
	function switchJhTag(modtag,modcontent,modk) {
	    for(i=1; i <3; i++) {
	      if (i==modk) {
	        document.getElementById(modtag+i).src="images/newindex/jhsk" + i + "_on.jpg";
	        document.getElementById(modcontent+i).className="slidingList";}
	      else {
	        document.getElementById(modtag+i).src="images/newindex/jhsk" + i + "_off.jpg";
	        document.getElementById(modcontent+i).className="slidingList_none";}
	    }
	  }
	function docheck(type){
		if (type=="1"){
			var b = document.getElementById("selShow");
			if(document.getElementById("divMode").value==1){
				var url = "nindex_dataList.jsp?type="+type+"&divMode=2&strIndx="+b.value;
				window.open(url,"_blank","");
			}else if(document.getElementById("divMode").value==2){
				for(var i=0;i<b.options.length;i++){
					if(b.options[i].selected){
						var url = "nindex_dataList.jsp?type=5&divMode=3&selShow="+b.value+"&strIndx="+i;
					}
				}
				window.open(url,"_blank","");
			}else{
				var bbtname = document.getElementById("bbtcx").value;
				var url = "nindex_dataList.jsp?type=6&divMode=4&bbtname="+bbtname;
				window.open(url,"_blank","");
			}
		}else if (type=="2"){
			var b = document.getElementById("selShow1");
			if(document.getElementById("divMode1").value==1){
				var url = "nindex_dataList.jsp?type="+type+"&divMode=2&strIndx="+b.value;
				window.open(url,"_blank","");
			}else if(document.getElementById("divMode1").value==2){
				for(var i=0;i<b.options.length;i++){
					if(b.options[i].selected){
						var url = "nindex_dataList.jsp?type=4&divMode=3&selShow="+b.value+"&strIndx="+i;
					}
				}
				window.open(url,"_blank","");
			}else{
				var bbtname = document.getElementById("bbtcx1").value;
				var url = "nindex_dataList.jsp?type=7&divMode=4&bbtname="+bbtname;
				window.open(url,"_blank","");
			}
		}else{
			var b = document.getElementById("selShow2");
			if(document.getElementById("divMode2").value==1){
				for(var i=0;i<b.options.length;i++){
					if(b.options[i].selected){
						var url = "nindex_dataList.jsp?type="+type+"&divMode=2&selShow="+b.value+"&strIndx="+i;
					}
				}
				window.open(url,"_blank","");
			}else if(document.getElementById("divMode2").value==2){
				for(var i=0;i<b.options.length;i++){
					if(b.options[i].selected){
						var url = "nindex_dataList.jsp?type="+type+"&divMode=3&selShow="+b.value+"&strIndx="+i;
					}
				}
				window.open(url,"_blank","");
			}else{
				var bbtname = document.getElementById("bbtcx2").value;
				var url = "nindex_dataList.jsp?type=8&divMode=4&bbtname="+bbtname;
				window.open(url,"_blank","");
			}
		}
	}	 
