﻿
        function fnCeateToolsRoller()
        {
            window.Tcontent=$('Tcontent');
            window.TcontentRoller=new Aladdincn.Web.Animation.Roller($('Tcontent'),2);
            TcontentRoller.AccFunction=AccelerationFunctions.CrazyElevator;
            TcontentRoller.onafterrollin=function(tm)
            {
	            Tcontent.className='collapsed';
	            TcontentRoller.LeaveAmount=2;
	            $('bm').className='max';
            };
            TcontentRoller.onafterrollout=function(um)
            {
	            Tcontent.className='expanded';
	            $('bm').className='min';
            };
        };   
                
         function fnToolsExd()
        {
            var ani=Aladdincn.Web.Animation;
            if(Tcontent.className=='collapsed')
            {
             //   $('Tcontentbg').style.display='none';     
                TcontentRoller.rollOut(ani.RollDirection.TopDown);
            }	
        }
         function fnToolsEx()
        {
            var ani=Aladdincn.Web.Animation;
	        if(!TcontentRoller.isExpanded()){
	           // $('Tcontentbg').style.display='none';
	            TcontentRoller.rollOut(ani.RollDirection.TopDown);
	            
            }else{
                TcontentRoller.rollIn(ani.RollDirection.BottomUp);
              //  $('Tcontentbg').style.display='block';
            }
        }

		function fnCeateToolsRoller2()
        {
            window.Tcontent2=$('Tcontent2');
            window.TcontentRoller2=new Aladdincn.Web.Animation.Roller($('Tcontent2'),2);
            TcontentRoller2.AccFunction=AccelerationFunctions.CrazyElevator;
            TcontentRoller2.onafterrollin=function(tm)
            {
	            Tcontent2.className='collapsed';
	            TcontentRoller2.LeaveAmount=2;
	            $('bm2').className='max';
            };
            TcontentRoller2.onafterrollout=function(um)
            {
	            Tcontent2.className='expanded';
	            $('bm2').className='min';
            };
        };   
                
         function fnToolsExd2()
        {
            var ani=Aladdincn.Web.Animation;
            if(Tcontent2.className=='collapsed')
            {
             //   $('Tcontentbg').style.display='none';     
                TcontentRoller2.rollOut(ani.RollDirection.TopDown);
            }	
        }
         function fnToolsEx2()
        {
            var ani=Aladdincn.Web.Animation;
	        if(!TcontentRoller2.isExpanded()){
	           // $('Tcontentbg').style.display='none';
	            TcontentRoller2.rollOut(ani.RollDirection.TopDown);
	            
            }else{
                TcontentRoller2.rollIn(ani.RollDirection.BottomUp);
              //  $('Tcontentbg').style.display='block';
            }
        }

//左边面板
		function fnCeateToolsRoller3()
        {
            window.Tcontent3=$('Tcontent3');
            window.TcontentRoller3=new Aladdincn.Web.Animation.Roller($('Tcontent3'),2);
            TcontentRoller3.AccFunction=AccelerationFunctions.CrazyElevator;
            TcontentRoller3.onafterrollin=function(tm)
            {
	            Tcontent3.className='collapsed';
	            TcontentRoller3.LeaveAmount=2;
	         //   $('bm3').className='leftmin';
            };
            TcontentRoller3.onafterrollout=function(um)
            {
	            Tcontent3.className='expanded';
	            $('bm3').className='leftmax';
            };
        };   
                
         function fnToolsExd3()
        {
            var ani=Aladdincn.Web.Animation;
            if(Tcontent3.className=='collapsed')
            {
                TcontentRoller3.rollOut(ani.RollDirection.LeftRight);
            }	
        }
         function fnToolsEx3()
        {
            var ani=Aladdincn.Web.Animation;
	        if(!TcontentRoller3.isExpanded()){
	            TcontentRoller3.rollOut(ani.RollDirection.LeftRight);
	            
            }else{
                TcontentRoller3.rollIn(ani.RollDirection.RightLeft);
				 $('fristclick').style.display='none';
            }
        }

		 function fnToolsFirstEx3()
        {
            var ani=Aladdincn.Web.Animation;
	      
                TcontentRoller3.rollIn(ani.RollDirection.RightLeft);
        }



         
         
              function fnSearchLoadInit()
        {
           // fnLoadHotKey();
            fnCeateToolsRoller();
			fnCeateToolsRoller2();
			fnCeateToolsRoller3();
			fnNewDragControl($('Tool'),$('Tool2'),-2,88);
			fnNewDragControl($('Tool3'),$('Tool4'),0,230);
        }  
    
        function fnToolHeadChange(o)
        {
            switch (o.id)
            {
                case 'blocal':
                    $('blocal').className   = 'Action';
                    $('bbus').className     = 'UnAction';  
					$('bent').className     = 'UnAction';
                    $('clocal').style.display   = 'block';
                    $('cbus').style.display     = 'none';
					$('cent').style.display     = 'none';
					$('bmytophome2').className     = 'UnAction'; 
					$('cmytophome2').style.display   = 'none';
					 fnToolsExd();
                    break;
                case 'bbus':
					 $('bbus').className     = 'Action';
                    $('blocal').className   = 'UnAction';
					$('bent').className     = 'UnAction';
					$('cbus').style.display     = 'block';
                    $('clocal').style.display   = 'none';
					$('cent').style.display     = 'none';
					$('bmytophome2').className     = 'UnAction'; 
					$('cmytophome2').style.display   = 'none';
					 fnToolsExd();
                    break;
				  case 'bent':
                    $('blocal').className   = 'UnAction';
                    $('bbus').className     = 'UnAction';
					$('bent').className     = 'Action';
                    $('clocal').style.display   = 'none';
                    $('cbus').style.display     = 'none';
					$('cent').style.display     = 'block';
					$('bmytophome2').className     = 'UnAction'; 
					$('cmytophome2').style.display   = 'none';
					 fnToolsExd();
                    break;
				case 'blocal2':
                    $('blocal2').className   = 'Action';
				     $('blocal2').style.display   = 'block';
					 $('clocal2').style.display   = 'block';
				    $('chotel2').style.display   = 'none';
					$('bhotel2').style.display   = 'none';
                    $('bbus2').className     = 'UnAction'; 
					$('bhotel2').className     = 'UnAction'; 
                    $('cbus2').style.display     = 'none';
					$('chotel2').style.display     = 'none';
					$('bmytophome2').className     = 'UnAction'; 
					$('cmytophome2').style.display   = 'none';
					 fnToolsExd2();
                    break;
               case 'bbus2':
					$('bbus2').className     = 'Action';
                    $('blocal2').className   = 'UnAction';
					$('bhotel2').className     = 'UnAction';
					$('cbus2').style.display     = 'block';
                    $('clocal2').style.display   = 'none';
					$('chotel2').style.display     = 'none';
					$('bmytophome2').className     = 'UnAction'; 
					$('cmytophome2').style.display   = 'none';
					 fnToolsExd2();
					break;         
			    case 'onlybbus2':
					$('bbus2').className     = 'Action';
                    $('blocal2').className   = 'UnAction';
					$('bhotel2').className     = 'UnAction';
					$('blocal2').style.display   = 'block';
					$('bbus2').style.display     = 'block';
					$('cbus2').style.display     = 'block';
                    $('clocal2').style.display   = 'none';
					$('blocal2').style.display   = 'none';
					$('chotel2').style.display     = 'none';
					$('bmytophome2').className     = 'UnAction'; 
					$('cmytophome2').style.display   = 'none';
					$('bmytophome2').style.display   = 'none';
					 fnToolsExd2();
					break;
				case 'bhotel2':
					$('bhotel2').className     = 'Action'; 
					$('chotel2').style.display   = 'block';
					$('bhotel2').style.display   = 'block';
                    $('blocal2').className   = 'UnAction';
                    $('bbus2').className     = 'UnAction';
                    $('clocal2').style.display   = 'none';
					$('blocal2').style.display   = 'none';
                    $('cbus2').style.display     = 'none';
					$('bbus2').style.display     = 'none';
					
					$('bmytophome2').className     = 'UnAction'; 
					$('cmytophome2').style.display   = 'none';
					$('bmytophome2').style.display   = 'none';
					 fnToolsExd2();
                    break;
				case 'bmytophome2':
					$('bmytophome2').className     = 'Action'; 
					$('cmytophome2').style.display   = 'block';
                    $('blocal2').className   = 'UnAction';
					$('bhotel2').className     = 'UnAction'; 
                    $('blocal2').className   = 'UnAction';
                    $('bbus2').className     = 'UnAction';
                    $('clocal2').style.display   = 'none';
                    $('cbus2').style.display     = 'none';
					$('chotel2').style.display   = 'none';
					 fnToolsExd2();
                    break;
					
             }
           
			
        }
         
        function fnToolSelectChange(flag)
        {   
            switch (flag)
            {
                case '0':
                    $('txtLineSearch').value = '请输入要搜索的线路';
                    $('stext').style.display='block';
                    $('sbusse').style.display='none';
                    break;
                case '1':
                    $('txtLineSearch').value = '请输入站点名';
                    $('stext').style.display='block';
                    $('sbusse').style.display='none';
                    break;
                case '2':
                    $('txtBusstart').value = '起点';
                    $('txtBusend').value = '终点';
                    $('stext').style.display='none';
                    $('sbusse').style.display='block';
                    break;
            }
        }  


        function fnListSelectChange(flag)
        {   
            switch (flag)
            {
                case '0':
                    $('bbus2').className     = 'Action';
                    $('blocal2').className   = 'UnAction';
					$('bhotel2').className     = 'UnAction';
					$('bmytophome2').className     = 'UnAction';
					$('cbus2').style.display     = 'block';
					$('bbus2').style.display     = 'block';
					$('cmytophome2').style.display     = 'none';
					$('bmytophome2').style.display     = 'block';
                    $('clocal2').style.display   = 'none';
					$('chotel2').style.display     = 'none';
					
				//	$('iframelist4').src="../getmytophome.jsp";
			//self.frames["iframelist2"].channgeWhere("qy_3052","PARENTNAME=粤电广场");

				//	alert(document.getElementById("bbus2").style.display='block');
                    break;

					   case '1':
                    $('bbus2').className     = 'Action';
                    $('blocal2').className   = 'UnAction';
					$('bhotel2').className     = 'UnAction';
					$('bmytophome2').className     = 'UnAction';
					$('cbus2').style.display     = 'block';
					$('bbus2').style.display     = 'block';
					$('cmytophome2').style.display     = 'none';
					//$('bmytophome2').style.display     = 'block';
                    $('clocal2').style.display   = 'none';
					$('chotel2').style.display     = 'none';
					
				//	$('iframelist4').src="../getmytophome.jsp";
			//self.frames["iframelist2"].channgeWhere("qy_3052","PARENTNAME=粤电广场");

				//	alert(document.getElementById("bbus2").style.display='block');
                    break;
                
            }
        }  
         

        function fnKeySearch(fn, evt){
            evt = window.event ? window.event : evt;
            if (evt.keyCode == 13){
                eval(fn);
            }
        }
 function MoveTo(x, y){   //移动控件到指定位置
        this.Tool.style.position = 'absolute';
        this.Tool.style.top = y + 'px';
        this.Tool.style.left = x + 'px';
    }



//拖动控件 o:控件父容器DIV对象, w, h:供拖动的手柄宽高
function fnNewDragControl(o,o2,w,h)  
{  
    if (typeof o == "string") o = document.getElementById(o);   
    o.orig_x = parseInt(o.style.left) - document.body.scrollLeft;  
    o.orig_y = parseInt(o.style.top) - document.body.scrollTop;   
	o.style.left = w + 'px';  
    o.style.top = h + 'px';
	o2.style.left = w + 'px';  
    o2.style.top = h + 'px';  
    o.orig_index = o.style.zIndex;   
          
    o.onmousedown = function(a)  
    {  
        this.style.cursor = "move";  
        this.style.zIndex = 10000;  
        var d=document;  
        if(!a)a=window.event;  
        var x = a.clientX+d.body.scrollLeft-o.offsetLeft;  
        var y = a.clientY+d.body.scrollTop-o.offsetTop;  
        //author: www.longbill.cn  
        d.ondragstart = "return false;"  
        d.onselectstart = "return false;"  
        d.onselect = "document.selection.empty();"  
        if (a.target)
        {
            fnSetDragFlag(a.target, 1, w, h)
        }
        if(o.setCapture)  
            o.setCapture();  
        else if(window.captureEvents)  
            window.captureEvents(Event.MOUSEMOVE|Event.MOUSEUP);  

        d.onmousemove = function(a)  
        {  
            if(!a)a=window.event;  
            o.style.left = a.clientX+document.body.scrollLeft-x + 'px';  
            o.style.top = a.clientY+document.body.scrollTop-y + 'px';
			o2.style.left = a.clientX+document.body.scrollLeft-x + 'px';  
            o2.style.top = a.clientY+document.body.scrollTop-y + 'px';  
            o.orig_x = parseInt(o.style.left) - document.body.scrollLeft;  
            o.orig_y = parseInt(o.style.top) - document.body.scrollTop;  
        }  

        d.onmouseup = function()  
        {  
           
            if(o.releaseCapture)  
                o.releaseCapture();  
            else if(window.captureEvents)  
                window.captureEvents(Event.MOUSEMOVE|Event.MOUSEUP);  
            d.onmousemove = null;  
            d.onmouseup = null;  
            d.ondragstart = null;  
            d.onselectstart = null;  
            d.onselect = null;  
            o.style.cursor = "normal";  
            o.style.zIndex = o.orig_index;  
            if (a.target)
            {
                fnSetDragFlag(a.target, 0, w, h)
            }
        }  
    }  
}

function fnSetDragFlag(t, flag, w, h)
{
    if (flag == 1)
    {
        t.style.width = fnGetWindowWidth()*2 + 'px';
        t.style.height = fnGetWindowHeight()*2 + 'px';
        t.style.left = fnGetWindowWidth()*-1 + 'px';;
        t.style.top = fnGetWindowHeight()*-1 + 'px';
    }
    else
    {
        t.style.width = w + 'px';
        t.style.height = h + 'px';
        t.style.left = 0;
        t.style.top = 0;
    }
}

//检索窗提交
 function subsearch()
 {

 var doctitle="", cgroup="",roadinfo="",searchword="",doccontent="";
var listxzl,listxzlshow;
listxzl=self.frames["iframelist1"];
listxzlshow=listxzl.document.getElementById("loading").style.display;

if (listxzlshow=="block"){
alert("查询正在加载中。。。");
return false;
}

//searchword ="doctype=10"
//doctitle =encodeURIComponent(document.getElementById("doctitle").value);
//cgroup =encodeURIComponent(document.getElementById("cgroup").value);
//address=encodeURIComponent(document.getElementById("address").value);
doctitle =$('doctitle').value;
cgroup =$('cgroup').value;
roadinfo=$('roadinfo').value; 
doccontent=$('doccontent').value; 

if (doctitle!=""){
searchword =searchword+ "&doctitle="+doctitle+"";
}
if (cgroup!=""){
searchword =searchword+ "&cgroup="+cgroup+"";
}
if (doccontent!=""){
searchword =searchword+ "&doccontent="+doccontent+"&address="+doccontent+"";
}
if (roadinfo!=""){
searchword =searchword+ "&roadinfo="+roadinfo+"";
}
fnToolHeadChange($('blocal2'));
$('Tool3').style.display="block";
$('Tool4').style.display="block";
//fnDisplayTool('Tool4');
listxzl.channgeWhere("thxzl/ds",searchword);
listxzl.setHighligth(doctitle,doccontent);
 
//alert(searchword);
//window.location.href="http://www.thnet.gov.cn:8081/mapinfo/index.jsp?"+searchword;
//document.getElementById("entinfo").src="ent.jsp?"+searchword;
//alert(searchword);
}

 function subsearchHotel(){
var doctitle="", linkmen="",searchword="";
var listxzl,listxzlshow;
listxzl=self.frames["iframelist3"];
listxzlshow=listxzl.document.getElementById("loading").style.display;

if (listxzlshow=="block"){
alert("查询正在加载中。。。");
return false;
}

//searchword ="doctype=10"
//doctitle =encodeURIComponent(document.getElementById("doctitle").value);
//cgroup =encodeURIComponent(document.getElementById("cgroup").value);
//address=encodeURIComponent(document.getElementById("address").value);
doctitle =$('jddoctitle').value;
linkmen =$('jdlinkmen').value;

if (doctitle!=""){
searchword =searchword+ "&doctitle="+doctitle+"";
}
if (linkmen!=""){
searchword =searchword+ "&linkmen="+linkmen+"";
}
fnToolHeadChange($('bhotel2'));
$('Tool3').style.display="block";
$('Tool4').style.display="block";
//fnDisplayTool('Tool4');

listxzl.channgeWhere("thxjjd/xjjd",searchword);
listxzl.setHighligth(doctitle,"");
 


 }


//检索窗口提交
  function subsearchWinEnt(){
//alert("Title||"+spot['Title']);

var parentname="",doctitle="", linkmen="",mapid="",searchword="",doccontent="";
var listdlqy,listdlqyshow;
listdlqy=self.frames["iframelist2"];
listdlqyshow=listdlqy.document.getElementById("loading").style.display;

if (listdlqyshow=="block"){
alert("查询正在加载中。。。");
return false;
}

doctitle =$('entdoctitle').value;

doccontent=$('entdoccontent').value; 

if (doctitle!=""){
searchword =searchword+ "&doctitle="+doctitle+"";
}

if (doccontent!=""){
searchword =searchword+ "&doccontent="+doccontent+"&address="+doccontent+"";
}

fnToolHeadChange($('onlybbus2'));
$('Tool3').style.display="block";
$('Tool4').style.display="block";
//fnDisplayTool('Tool4');

listdlqy.channgeWhere("thqysj/qy",searchword);
listdlqy.setHighligth(doctitle,"");
 


 }




//点击实体ID提交
  function subsearchEnt(obj){
//alert("Title||"+spot['Title']);
var sSpot=obj;
var parentname="",doctitle="", linkmen="",mapid="",searchword="";
var listdlqy,listdlqyshow;
listdlqy=self.frames["iframelist2"];
listdlqyshow=listdlqy.document.getElementById("loading").style.display;

if (listdlqyshow=="block"){
alert("查询正在加载中。。。");
return false;
}

if (typeof sSpot=='undefined' || typeof sSpot.Title=='undefined')
{
alert("没有实体记录");
	return false;
}
  doctitle =sSpot.Title;
    mapid =sSpot.UnitID;

if (mapid!=""){
searchword =searchword+ "&mapid="+mapid+"";
}
fnToolHeadChange($('onlybbus2'));
$('Tool3').style.display="block";
$('Tool4').style.display="block";
//fnDisplayTool('Tool4');

listdlqy.channgeWhere("thqysj/qy",searchword);
listdlqy.setHighligth(doctitle,"");
 


 }


