﻿// JScript 文件
//得到导行目录
function FillMapMenu()
{   
    var value="";
    var url="Handler/MapMenuHandler.ashx?type=big&t="+new Date().getTime();    
    var xmlHttp=createXMLHTTP();
    xmlHttp.open("post",url,true);
    xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
	xmlHttp.onreadystatechange=function(){
	if(xmlHttp.readyState==4)//判断对象状态
    	{
	     if(xmlHttp.status==200)
	        {	            
		       document.getElementById("Menu").innerHTML=xmlHttp.responseText;
		   	}
            xmlHttp.onreadystatechange=function(){};
            xmlHttp=null;
       }	
	};
	xmlHttp.send(null);	
	//document.getElementById("Menu").innerHTML=value;
}
//得到了类
function GetFillMapMenu(Type_Number,Type_Name)
{   
    var city=clearNbsp($("MapCityName").innerHTML);
    var url="Handler/MapMenuHandler.ashx?type=small&Type_Number="+escape(Type_Number)+"&Type_Name="+escape(Type_Name)+"&city="+escape(city)+"&t="+new Date().getTime(); 
    var xmlHttp=createXMLHTTP();
    xmlHttp.open("post",url,true);
    xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
	xmlHttp.onreadystatechange=function(){
	if(xmlHttp.readyState==4)//判断对象状态
    	{
	     if(xmlHttp.status==200)
	        {	            
		        //参数：id 层唯一的标识； left 与父容器左边距 ；top 与父容器上边距；width 层的宽度；height 层的高度；content 内容
                //      bgcolor 背景颜色；fontcolor字体的颜色；  bordercolor 边框颜色；opacity 透明度；zIndex Z轴
                
		        var div = document.getElementById("MapMenuChild");
		        if(!div){
			        new createDiv("MapMenuChild",10,106,600,30,xmlHttp.responseText,"White","#fe4d01","#005963",1,"0.8",13);
			        document.getElementById("MapMenuChild").onmouseover=On_MapMenuChild_MouseOver;//向小类的层加入鼠标经过事件
			        document.getElementById("MapMenuChild").onmouseout=On_MapMenuChild_MouseOut;//向小类的层加入的鼠标离开的事件
		            }
		            else{
			            div.innerHTML = xmlHttp.responseText;
			            document.getElementById("MapMenuChild").style.display="";			          
		            }
		   	}
        xmlHttp=null;
	    }
	};
		xmlHttp.send(null);
		
}

//向小类的层加入的鼠标经过事件
function On_MapMenuChild_MouseOver(e)
{
    document.getElementById("MapMenuChild").style.display="";
    MapTypeTabShow(MapTypeTabShowName);
}
//向小类的层加入的鼠标离开的事件
function On_MapMenuChild_MouseOut(e)
{
    hideMapMenuChild();
}
function hideMapMenuChild()
{
    document.getElementById("MapMenuChild").style.display="none";
     MapTypeTabHide();
}

//点击类 ID 要查的ID；name 要查的类名
function MenuTypeSearch(id,name)
{
     
     Topmenu('img4',4);
     document.getElementById("TypeSearchName").value=name;
     document.getElementById("TypeSearchNumber").value=id;
     document.getElementById('comTypeDiv').style.display='none'
     MapTypeTabHide();
     TypeSearch();
}

//加载地图城市列表事件
function mapCityListInit()
{
    var X,Y;
    var str = window.showModalDialog("AjaxHtml/MapList.aspx","Date","dialogWidth=600px;dialogHeight=500px;status=no;scrollbars=no");
    if(typeof(str)!="undefined")
    {
        X=str.split(',')[0];
        Y=str.split(',')[1];
        var i=str.split(',')[2];
        moveMap(X,Y,i);
        
    }
   
}

function MapTypeTabHide(){    
    //document.getElementsByName("MapTypeTab").className="MapTypeTab_1";
    //得到有多少个快速分类查询的大类
    var count= window.document.getElementById("MapTypeTab").getElementsByTagName("Table").length;
    
    for(var i=0;i<count;i++)
    {        
        window.document.getElementById("MapTypeTab"+i).className="MapTypeTab_1";
    }    
}
var MapTypeTabShowName;
function MapTypeTabShow(name){
    MapTypeTabShowName=name;
    MapTypeTabHide();   
    document.getElementById(name).className="MapTypeTab_2";
}
