//防盗链
var links = new Array("www.moc.gov.cn","www.mot.gov.cn","www.chinahighway.gov.cn");
var refer = "" + document.referrer;
var canRefer = false;
if(refer != ""){
	for(var i=0;i<links.length;i++){
		if(refer.indexOf(links[i]) >= 0){
			canRefer = true;
			break;
		}
	}
}
else{
	canRefer = true;
}

var subsa_array = new Array("cxlx","zjgh","zhss","dlss","jtss");

function displaySubsa(the_suba){
	if (document.getElementById(the_suba).style.display==""){
		document.getElementById(the_suba).style.display = "none";
  }

  for (i=0;i<subsa_array.length;i++){
		var my_suba = document.getElementById(subsa_array[i]);
		my_suba.style.display = "none";
	}
	document.getElementById(the_suba).style.display = "";
}
//切换显示层  
function _swithDiv(id){
	Zoom10.style.color='000000';
	Zoom11.style.color='000000';
	Zoom12.style.color='000000';
	Zoom13.style.color='000000';
	Zoom14.style.color='000000';
	Zoom21.style.color='000000';
	Zoom22.style.color='000000';
	Zoom23.style.color='000000';
	Zoom24.style.color='000000';
	Zoom25.style.color='000000';
	
	document.all(id).style.color = "#880C02";
}

function _openDiv(id){
	var lkkx = document.all('lkkx');
	var lwdt = document.all('lwdt');
	var ztxx = document.all('ztxx');
	if(id == 'lkkx'){
		lkkx.style.display = '';
		lwdt.style.display = 'none';
		ztxx.style.display = 'none';
	}
	else if(id == 'lwdt'){
		lkkx.style.display = 'none';
		lwdt.style.display = '';
		ztxx.style.display = 'none';
	}
	else if(id == 'ztxx'){
		lkkx.style.display = 'none';
		lwdt.style.display = 'none';
		ztxx.style.display = '';
	}
}

function _showInfo(id){
	var iWidth=600; //窗口宽度
    var iHeight=600;//窗口高度
    var iTop=(window.screen.height-iHeight)/2;
    var iLeft=(window.screen.width-iWidth)/2;
    window.open(rpath + "/roadmanage/RoadTransferAction/information.do?infoId=" + id);
}

function _openWeb(id){
	var URL = "";
	if(id == 'gllk'){
		URL = rpath + '/roadmanager/qglk.jsp';
	}
	else if(id == 'glqx'){
		URL = rpath + '/roadmanage/display/action/disModelNew.do';
	}
	else if(id == 'lkdt'){
		URL = rpath + '/roadMap.jsp';
	}
	else if(id == 'cxcs'){
		URL = rpath + '/roadInfo/cxckFontPageManageAction.do';
	}
	else if(id == 'hjzgljt'){
		URL = 'http://jd.tpri.gov.cn/index.jsp';
	}
	else if(id == 'lkbs'){
		URL = 'http://219.143.235.85/login.aspx';
	}
	
	window.open(URL,"","");
}
function _zhss(){
//综合搜索
	var g_SearchCityID = document.all("spanSearchCityId");
	var g_SearchCityNm = escape( document.getElementById("spanSearchCityId").options[window.document.getElementById("spanSearchCityId").selectedIndex].text);
	var kw = document.all("txtKw").value;
  var params = "tab=3"
      + "&kw=" + escape(kw)
      + "&cityid=" + g_SearchCityID.value
      + "&citynm=" + g_SearchCityNm
      + "&stype=1";
  
  //setCookie('kw',kw);
  //setCookie('g_SearchCityID',g_SearchCityID);
  //setCookie('g_SearchCityNm',g_SearchCityNm);
  
  window.open(rpath + "/roadMap.jsp?" + params);
}

function _zjgh(){
//自驾规划
	var g_StartCityID = document.all("idNavStart").value;
	var g_EndCityID = document.all("idNavEnd").value;
	var snm = escape( document.getElementById( "txtNavStart" ).value );
	var enm = escape( document.getElementById( "txtNavEnd" ).value );
	
	var spanStartCity = escape( document.getElementById("idNavStart").options[window.document.getElementById("idNavStart").selectedIndex].text);
	var spanEndCity = escape( document.getElementById("idNavEnd").options[window.document.getElementById("idNavEnd").selectedIndex].text);

	if(snm == null || snm == ''){
		alert('请输入起点地名');
		return;
	}
	if(enm == null || enm == ''){
		alert('请输入终点地名');
		return;
	}
  var params = "tab=1"
      + "&snm=" + snm
      + "&scityid=" + g_StartCityID
      + "&scitynm=" + spanStartCity
      + "&enm=" + enm
      + "&ecitynm=" + spanEndCity
      + "&ecityid=" + g_EndCityID
      + "&ttype=2";
  
  //setCookie('g_StartCityID',g_StartCityID);
  //setCookie('snm',unescape(snm));
  //setCookie('g_EndCityID',g_EndCityID);
  //setCookie('enm',unescape(enm));
  //setCookie('g_StartCityNm',$( "spanStartCity" ).innerHTML);
	//setCookie('g_EndCityNm',$( "spanEndCity" ).innerHTML);

  window.open(rpath + "/roadMap.jsp?" + params);
}

function _cxlx(){
//出行路线
	var c_StartCityID = document.all("c_StartCityID").value;
	var c_EndCityID = document.all("c_EndCityID").value;
	
	if(c_StartCityID == c_EndCityID){
			alert('起点和终点城市不能相同！');
			return;
	}
  var params = "tab=2&searchtype=1"
      + "&scityid=" + c_StartCityID
      + "&ecityid=" + c_EndCityID;

  //setCookie('c_StartCityID',c_StartCityID);
  //setCookie('c_EndCityID',c_EndCityID);
  //setCookie('c_StartCity',c_StartCity);
  //setCookie('c_EndCity',c_EndCity);

  window.open(rpath + "/roadMap.jsp?" + params);
}

function _dlss(){
//道路搜索
	var roadid = '';
	var t1 = document.all('roadtype');
	var t = '';
	for(var i=0;i<t1.length;i++){
		if(t1[i].checked){
			t = t1[i].value;
			break;
		}
	}
	
	if(t == 'gg'){
		roadid = document.getElementById("ROAD_GGW").value;;
	}
	else if(t == 'gd'){
		roadid = document.getElementById("ROAD_GD").value;;
	}
	else if(t == 'sd'){
		roadid = document.getElementById("roadSDId").value;;
	}
	var params = "tab=4&act=" + t + "&rkw=" + roadid + "&hostInfo=" + hostInfo;
  //setCookie('txtRoadKw',txtRoadKw);
	window.open(rpath + "/roadMap.jsp?" + params);
}

function _jtss(){
//交通设施
	var txtEquipKw = document.all( "txtEquipKw" ).value ;
	if(txtEquipKw != null && txtEquipKw != "")
		txtEquipKw = escape(txtEquipKw);
	var selectPOIType = document.all("selectPOIType").value;
	var g_EquipCityID = document.all("g_EquipCityID").value;
	var g_EquipCityNm = document.getElementById("g_EquipCityID").options[window.document.getElementById("g_EquipCityID").selectedIndex].text;
  
	var params = "tab=5&kw=" + txtEquipKw
					+ "&cityid=" + g_EquipCityID
					+ "&citynm=" + escape(g_EquipCityNm)
        	+ "&stype=3"
        	+ "&ptype=" + document.all("selectPOIType").value;
    //setCookie('g_EquipCityID',g_EquipCityID);
    //setCookie('g_EquipCityNm',g_EquipCityNm);
    //setCookie('txtEquipKw',txtEquipKw);
    //setCookie('selectPOIType',selectPOIType);
    
    window.open(rpath + "/roadMap.jsp?" + params);
}

function _showRoadInfo(id){
	var iWidth=600; //窗口宽度
    var iHeight=600;//窗口高度
    var iTop=(window.screen.height-iHeight)/2;
    var iLeft=(window.screen.width-iWidth)/2;
    //window.showModalDialog("/roadInfo/getIframeRoadInfo.do?roadInfoId=" + id,window,"dialogHeight: "+iHeight+"px; dialogWidth: "+iWidth+"px;dialogTop: "+iTop+"; dialogLeft: "+iLeft+"; resizable: no; status: no;scroll:no");
    window.open(rpath + "/roadInfo/getIframeRoadInfo.do?roadInfoId=" + id);
}

