// JavaScript Document controls.js
/*************************************************
* 控件基类，全局文件
* code by lzz ver1.0 update at 07-09-26
*************************************************/



//控件基类参数对象
var MapContrlObj = {ID:null,Parent:null};

// 控件基类
var MapContrlBase = Class.create();
Object.extend(MapContrlBase.prototype, {
    //构造
    initialize : function(obj){
        try
        {
            if(obj)
            {
                
                if(obj.Parent)
                {
                    
                    this.Body = obj.Parent.$C('IFRAME');
                }
                else
                {
                    this.Body = $C('IFRAME');
                }
                if(obj.ID)
                {
                    this.Body.id = obj.ID;
                }
                else
                {
                    this.Body.id = '_iframe'+$Rnd();
                }
            }
            else
            {
                this.Body = $C('IFRAME');
                this.Body.id = '_iframe'+$Rnd();
            }
            this.Body.frameBorder = '0';
            this.Body.scrolling = "no";
            this.Body.style.overflow = 'hidden';
            this.Body.allowTransparency = 'true';
            this.Body.style.display = 'none';
            this.Body.style.width = this.Width + 'px';
            this.Body.style.height = this.Height + 'px';
            this.Config = GlobalConfig;     //附加全局Config对象
            this._loadUI();
            
            //绑定事件
            if (GetBrowserInfo()[0]=='IE'){
                this.Body.attachEvent("onload",this._loadComplete.bindAsEventListener(this));
            }
            else {
                this.Body.onload = this._loadComplete.bindAsEventListener(this);
            }
            
        }
        catch (ex)
        {
            alert('脚本出错' + ex.message);
            _loadError(ex.message);
        }
    },
    
    //公有方法
    $: function(sID){
        return this.Body.contentWindow.document.getElementById(sID);
    },
    LoadUI: function(sControlName){          //载入UI
        //this.Body.src = this.Config._ControlsUIPath + sControlName + '.aspx';
		this.Body.src = this.Config._ControlsUIPath + sControlName + '.aspx';
    },
    ResumeLayout: function(){   //重做布局，位置大小
//        this.Body.style.top = this.Y + 'px';
//        this.Body.style.left = this.X + 'px';
        this.Body.style.width = this.Width + 'px';
        this.Body.style.height = this.Height + 'px';
    },
    Show: function(){         //显示控件，控件创建完（new）不会显示，需调用Show方法后才会显示
        // .. .. .. 此处可做一些数据加载的逻辑 .. .. .. 
        this.Body.style.display = 'block';
    },
    Hide: function(){         //隐藏控件
        this.Body.style.display = 'none';
    },
    Dispose: function(){      //销毁控件，释放所有占用的资源
        this.parentNode.removeNode(this.Body);
    },
    MoveTo: function(x, y){   //移动控件到指定位置
        this.Body.style.position = 'absolute';
        this.Body.style.top = y + 'px';
        this.Body.style.left = x + 'px';
    },
    
    
    //对外提供的公共事件接口
    onLoadComplete: function(source){
    },
    onLoadError: function(source, msg){
    },
    
    //共同属性
    Body: null,         //IFrame
    Config: null,
    X: 0,
    Y: 0,
    Width: 303,
    Height: 418,
    
    //私有接口，子类必须实现，可调用LoadUI方法，或则自己指定this.Body.src
    _loadUI: function(){
    },
    //私有事件
    _loadComplete: function(){
        // .. .. .. 此事可以托管该事件，执行一些附加操作，再将事件抛出 .. .. .. 
        this.onLoadComplete(this);
    },
    _loadError: function(msg){
        // .. .. .. 此事可以托管该事件，执行一些附加操作，再将事件抛出 .. .. .. 
        this.onLoadError(this, msg);
    }
    
});
/*
    搜索结果页卡和地图PoP的基类
*/
var OptionCardContrlBase;
if(!OptionCardContrlBase)
    OptionCardContrlBase= Class.create();
    
Object.extend(OptionCardContrlBase.prototype,MapContrlBase.prototype);

/*
初始化选项卡和选项卡对应的Iframe的容器
iframebody：父级容器，ulId：选项卡容器，cardId：Iframe容器
*/
OptionCardContrlBase.ItemsPanel=function(iframebody,ulId,cardId)
{
    this.Piframe = iframebody;
    this.Pelement=iframebody.contentWindow.document.getElementById(ulId);
    if(!this.Pelement)
    {
        //alert(ulId+'不存在');
        return;
    }
    this.elementlist = new Array();
    this.register=new Array();
    this.currentElement=null;
    this.PcardFrame=iframebody.contentWindow.document.getElementById(cardId);
    if(!this.PcardFrame)
    {
        //alert(cardId+'不存在');
        return;
    }
    this.currentCardframe=null;
}
/*
*增加一个选项卡和内容页
*/
OptionCardContrlBase.ItemsPanel.prototype.addItem=function(item)
{
    if(this.validateExist(item.url))
    {
        return;
    }
    item.panel=this;
    this.Pelement.appendChild(item.element);
    this.PcardFrame.appendChild(item.cardFrame);  
    this.visitedRegister(item,'add');
    item.ExpendOut();
}
/*
*删除选项卡和内容页
*/
OptionCardContrlBase.ItemsPanel.prototype.deleteItem=function(item)
{                        
    
    this.visitedRegister(item,'delete');
    if(this.register.length>0)
    {
        this.Pelement.removeChild(item.element);
        this.PcardFrame.removeChild(item.cardFrame);
    }
}
/*
清除所有选项卡和内容页
*/
OptionCardContrlBase.ItemsPanel.prototype.clearItem=function()
{                        
    this.visitedRegister(null,'clear');
}
/*
选项卡更改后执行的页面布局的更改
*/
OptionCardContrlBase.ItemsPanel.prototype.changeSubPage=function()
{
    if(this.register.length==0)
    {
        for(var i=0;i<this.Pelement.childNodes.length;i++)
        {
           this.Pelement.removeChild(this.Pelement.childNodes[i]);
           this.PcardFrame.removeChild(this.PcardFrame.childNodes[i]);
           i--;
        }
        this.Piframe.style.display = 'none'; 
        this.Pelement.style.width='0px';
    }
    else
    {
        var pWidth = 0;
        for(var i=0;i<this.register.length;i++)
        {
            pWidth += this.register[i].elementWidth;
        }
        this.Pelement.style.width = (pWidth+5) + 'px';
    }
    
    if(this.Piframe.contentWindow.document.getElementById('Bar_L')&&this.Piframe.contentWindow.document.getElementById('Bar_R'))
    {   
        if(parseInt(this.Pelement.style.width.replace('px',''),10)>parseInt(this.Pelement.parentNode.style.width.replace('px',''),10))
        {
            var LWidth=0
            var i = 0;
            var j = 0;
            for(i;i<this.elementlist.length;i++)
            {
                if(this.elementlist[i].element==this.currentElement)
                {
                    for(j=i;j>=0;j--)
                    {
                        LWidth+=this.elementlist[j].elementWidth
                    }
                    if(LWidth>parseInt(this.Pelement.parentNode.style.width.replace('px',''),10))
                    {
                        this.Pelement.style.left=-(LWidth-parseInt(this.Pelement.parentNode.style.width.replace('px',''),10)) + 'px';
                    }
                    else
                    {
                        this.Pelement.style.left='0px';
                    }
	                break;
	            }
            }
            if(this.Pelement.style.left=='0px')
            {
                this.Piframe.contentWindow.document.getElementById('Bar_L').style.display = 'none';
            }
            else
            {
                this.Piframe.contentWindow.document.getElementById('Bar_L').style.display = 'block';
            }
            if((parseInt(this.Pelement.style.width.replace('px',''),10)+parseInt(this.Pelement.style.left.replace('px',''),10))>parseInt(this.Pelement.parentNode.style.width.replace('px',''),10)+5)
            {
                this.Piframe.contentWindow.document.getElementById('Bar_R').style.display = 'block';
            }
            else
            {
                this.Piframe.contentWindow.document.getElementById('Bar_R').style.display = 'none';
            }
        }
        else
        {
            this.Pelement.style.left='0px';
            this.Piframe.contentWindow.document.getElementById('Bar_L').style.display = 'none';
            this.Piframe.contentWindow.document.getElementById('Bar_R').style.display = 'none';
        }
    }
}

/*判断当前URL是否在搜索结果页中打开*/
OptionCardContrlBase.ItemsPanel.prototype.validateExist=function(url)
{
    for(var i=0;i<this.register.length;i++)
    {
        if(this.register[i].url==url)
        {
            this.register[i].activeItem();
            return true;
        }
    }        
    return false;
}
/*
*   选项卡的操作
*   type：add | delete | active | clear
*
*/
OptionCardContrlBase.ItemsPanel.prototype.visitedRegister=function(item,type)
{
    var i=this.register.length;
    if(type=='add')
    {                
        for(var k=0;k<i;k++)
        {
            this.register[k].resetItem();
        }
        this.elementlist[i]=item;
        this.register[i]=item;
        this.currentElement=item.element;
        this.currentElement.className='active';
        this.currentCardframe = item.cardFrame
        this.currentCardframe.className = 'iframevis';
        this.changeSubPage();
    }
    else if(type=='delete')
    {         
        /*选项卡关闭页面时候执行的方法*/
        if(typeof item.cardFrame.contentWindow.fnExit=='function')
        {
            item.cardFrame.contentWindow.fnExit();
        }                                
        for(k=0;k<i;k++)
        {
            if(this.register[k]==item)
            {
                this.register.splice(k,1);
            }
            if(this.elementlist[k]==item)
            {
                this.elementlist.splice(k,1);
            }
        }
        if(item.element==this.currentElement)
        {
            i=this.register.length;
            if(i>0)
            {
                this.currentElement=this.register[i-1].element;
                this.currentCardframe=this.register[i-1].cardFrame;
                this.register[i-1].activeItem();
            }
            else
                this.currentElement=null;
        }
        this.changeSubPage();
    }
    else if(type=='active')
    {
        /*选项卡激活时候的页面初始化方法*/
        if(typeof item.cardFrame.contentWindow.fnInit=='function')
        {
            item.cardFrame.contentWindow.fnInit();
        }   
        if(this.currentElement==item.element)
            return;
        else
        {                                        
            for(k=0;k<i;k++)
            {
                if(this.register[k]==item)
                {
                    this.register.splice(k,1);
                    break;
                }
            }
            i=this.register.length;
            for(k=0;k<i;k++)
            {
                this.register[k].resetItem();
            }
            this.currentElement=item.element;
            this.currentCardframe=item.cardFrame;
            this.register.push(item);
            
        }
        
        this.changeSubPage();
    }
    else if(type=='clear')
    {
        this.register.splice(0,this.register.length);
        this.changeSubPage();
    }
}
/*
*初始化选项卡和内容页
*/
OptionCardContrlBase.Item=function(iframebody,id,title,url,allowclose,autoactive,width)
{      
    this.Piframe = iframebody;  
    this.element=this.$C(iframebody,'li');
    if(width==null)
    {
        this.elementWidth = 80;
    }
    else
    {
        this.element.style.width =width + 'px';
        this.elementWidth = width;
    }
    this.panel={};
    this.id=id+$Rnd();
    this.title=title;
    this.url=url;
    this.autoactive = autoactive;
    this.allowclose=allowclose;
    this.cardFrame = this.$C(iframebody,'iframe');
    this.cardFrame.frameBorder = '0';
    this.cardFrame.scrolling = 'no';
    this.cardFrame.allowTransparency = 'true';
    if (GetBrowserInfo()[0]=='IE'){
        this.cardFrame.attachEvent("onload",this._loadComplete.bindAsEventListener(this.cardFrame));
    }
    else {
        this.cardFrame.onload = this._loadComplete.bindAsEventListener(this.cardFrame);
    }
    this.init();
};
OptionCardContrlBase.Item.prototype._loadComplete = function()
{
    try
    {
        this.contentWindow.Config = GlobalConfig;
    }
    catch(e)
    {}
};
/*
*初始化选项卡和内容页
*/
OptionCardContrlBase.Item.prototype.init=function()
{
    this.element.setAttribute('id',this.id);
    this.element.className='default';   
    this.cardFrame.className = 'iframehid';
    if(this.autoactive)
    {
        this.cardFrame.src = this.url;   
    }          
    var mirror=this;
    if(this.allowclose)
    {
        this.element.innerHTML='<nobr class="title" title="'+this.title.replace(/<[^>]+?>/gi,'')+'">'+this.title+'</nobr><a class="close" title="关闭"></a>';                
        this.addEventListener(this.$ES(this.element,'nobr')[0],'click',function(){mirror.activeItem();});
        this.addEventListener(this.$ES(this.element,'a')[0],'click',function(){mirror.destroyItem();});
    }
    else
    {
        this.element.innerHTML='<nobr class="title" title="'+this.title+'">'+this.title+'</nobr>';        
        this.addEventListener(this.$ES(this.element,'nobr')[0],'click',function(){mirror.activeItem();});
    }
        
}
/*
*选项卡激活
*/
OptionCardContrlBase.Item.prototype.activeItem=function()
{
    if(this.cardFrame.src=='')
    {
        this.cardFrame.src = this.url;
    }
    if(typeof this.panel.visitedRegister =='function')
    {
        this.panel.visitedRegister(this,'active');
        this.element.className='active';  
        this.cardFrame.className='iframevis'; 
    }
    this.ExpendOut();
}
/*选项卡添加和激活时，当搜索结果控件最小化时展开搜索结果控件*/
OptionCardContrlBase.Item.prototype.ExpendOut = function()
{
    
}

/*
*选项卡重置为初始状态
*/
OptionCardContrlBase.Item.prototype.resetItem=function()
{
    this.element.className='default'; 
    this.cardFrame.className = 'iframehid';       
}
/*
*选项卡自身销毁
*/
OptionCardContrlBase.Item.prototype.destroyItem=function()
{
    //this.panel.visitedRegister(this,'delete');
    this.panel.deleteItem(this);
}
/*
*选项卡添加事件
*/
OptionCardContrlBase.Item.prototype.addEventListener=function(element,type,handler)
{
    if(element.addEventListener)
        element.addEventListener(type,handler,true);
    else
        element.attachEvent('on'+type,handler,true);
}
/*
*新建HTML元素
*/
OptionCardContrlBase.Item.prototype.$C=function(iframebody,tag)
{
    if(tag && typeof tag =='string')
        return iframebody.contentWindow.document.createElement(tag);
    else
        return iframebody.contentWindow.document.createElement('li');
}
/*
*根据TagName获取HTML元素
*/
OptionCardContrlBase.Item.prototype.$ES=function(element,tag)
{
    return element.getElementsByTagName(tag);
}

/*************************************************
* 公交站控件
* code by lzz ver1.0 update at 07-10-29
*************************************************/

var BusStationControl = Class.create();
Object.extend(BusStationControl.prototype, MapContrlBase.prototype);
BusStationControl.prototype._loadUI = function(){
    this.LoadUI('BusStationControl');
};
//显示指定站点的公交信息，id：公交站点id
BusStationControl.prototype.ShowBusStation = function(id){
    this.$('divStationName').innerHTML = 'loading...';
    this.$('divBusList').innerHTML = 'loading...';
    var url = this.Config._DataCenterUrl + 'CommMap/bus.aspx?node='+this.Config._Node+'&l=' + this.Config._L + '&req=9&v=1.0&id=' + id; 
    ENetwork.DownloadScript
    (
        url,function()
        {
            if(typeof s =='undefined' || s == null)
            {
                this.$('divStationName').innerHTML = '无公交站点信息';
                this.$('divBusList').innerHTML = '<li style="width:100%">很抱歉，该站点公交数据正在完善中</li>';
                this.Show();
            }
            else
            {
                if(typeof busGroup =='undefined' || busGroup == null)
                {
                    this.$('divStationName').innerHTML = s.StationName;
                    this.$('divBusList').innerHTML = '<li style="width:100%">很抱歉，该站点公交数据正在完善中</li>';
                    this.Show();
                }
                else
                {
                    this.$('divStationName').innerHTML = s.StationName;
                    //append bus list
                    var sHtml = '';
                    for (var k=0; k<busGroup.length; k++)
                    {
                        sHtml += '<li><a href="javascript:;" onclick="window.BusStationControl.onBusClick('+ busGroup[k].BusID +',\''+busGroup[k].BusName+'\')">' + busGroup[k].BusName + '</a></li>';
                    }
                    this.$('divBusList').innerHTML = sHtml;
                    busGroup = null;
                    delete busGroup;
                    this.Show();
                }
            }
            
        }.bindAsEventListener(this)
    );
};
//重载控件加载完毕后的事件
BusStationControl.prototype._loadComplete= function(){
    this.Body.contentWindow.BusStationControl = this;
    this.onLoadComplete(this);
};

BusStationControl.prototype.onDataLoadComplete = function(){
};

//公交线路点击 , busid：公交线路ID, busname：公交线路名
BusStationControl.prototype.onBusClick = function(busid, busname){
};

/*************************************************
* 城市列表控件
* code by lzz ver1.0 update at 07-10-10
*************************************************/

var CityListControl = Class.create();
Object.extend(CityListControl.prototype, MapContrlBase.prototype);
CityListControl.prototype._loadUI = function(){
    this.LoadUI('CityListControl');
};

//关闭城市列表事件
CityListControl.prototype.onClose = function(){
};

//重载控件加载完毕后的事件
CityListControl.prototype._loadComplete= function()
{
    this.Body.contentWindow.CityListControl = this;
    this.onLoadComplete(this);
};
/*************************************************
* 推荐泡泡控件
* code by lzz ver1.0 update at 07-10-26
*************************************************/

var CommendPopControl = Class.create();
Object.extend(CommendPopControl.prototype, MapContrlBase.prototype);
CommendPopControl.prototype._loadUI = function(){
    this.LoadUI('CommendPopControl');
};

//显示推荐泡泡
CommendPopControl.prototype.ShowCommendPop = function(sTitle, sContent)
{
    this.$('tjgg-1').innerHTML = unescape(sTitle);
    this.$('tjgg-4').innerHTML = unescape(sContent).replaceAll('/cityresource2/', this.Config._PicUrl);;
    this.Show();
};

//重载控件加载完毕后的事件
CommendPopControl.prototype._loadComplete= function(){
    this.Body.contentWindow.CommendPopControl = this;
    this.onLoadComplete(this);
};
/*************************************************
* 纠错控件
* code by lzz ver1.0 update at 07-10-16
*************************************************/

var DebugControl = Class.create();
Object.extend(DebugControl.prototype, MapContrlBase.prototype);
DebugControl.prototype.LoadUI = function(){
    this.Body.src = this.Config._ControlsUIPath + 'DebugControl.aspx?ID=' + this.DebugID + '&Name=' + escape(this.DebugName) + '&Flag=' + this.DebugFlag;
};
//纠错 id:纠错ID name:纠错名称 flag:纠错类型
DebugControl.prototype.Debug = function(id, name, flag){
    this.DebugID = id;
    this.DebugName = name;
    this.DebugFlag = flag;
    this.LoadUI();
    this.Show();
};

//重载控件加载完毕后的事件
DebugControl.prototype._loadComplete= function()
{
    if (this.DebugName.length > 0){
        this.$('txtContent').value = this.DebugName + '有错：';
    }
    this.Body.contentWindow.DebugControl = this;
    this.onLoadComplete(this);
};

DebugControl.prototype.DebugID = 0;     //纠错ID
DebugControl.prototype.DebugName = '';  //纠错名称
DebugControl.prototype.DebugFlag = 0;   //纠错类型0-实体,1企业 

/*************************************************
* 实体泡泡控件
* code by xzx ver1.0 update at 07-09-26
*************************************************/
var EntityPopControl = Class.create();
Object.extend(EntityPopControl.prototype, OptionCardContrlBase.prototype);  //继承基类

//重写基类载入模板方法
EntityPopControl.prototype._loadUI = function(){
    this.LoadUI('EntityPopControl');
};
//重写控件加载完毕后的事件
EntityPopControl.prototype._loadComplete= function()
{
    this.Body.contentWindow.window.PopControlForm = this;
    this.ItemsPanel = new OptionCardContrlBase.ItemsPanel(this.Body,'itemsPanel','cardContent');
    this.onLoadComplete(this);
};
EntityPopControl.prototype.ClearData = function(){
    this.$('Entr_Title').innerHTML=_Lloading[this.Config._L].replace('images/','../images/');
//    this.$('Entro_yp').href = 'javascript:;';  
//    this.$('Entro_yp').target = '_self'; 
	//小鱼加
//	this.$('Entro_more').href = 'javascript:;';  
//    this.$('Entro_more').target = '_self'; 
//	this.$('Entro_photo').href = 'javascript:;';  
//    this.$('Entro_photo').target = '_self'; 	
//	this.$('Entro_mov').href = 'javascript:;';  
//    this.$('Entro_mov').target = '_self'; 	
	//小鱼加
    this.$('Entr_Add').innerHTML=_Ladd[this.Config._L]+_Lloading[this.Config._L].replace('images/','../images/');
    this.$('Entr_Tell').innerHTML=_Ltel[this.Config._L]+_Lloading[this.Config._L].replace('images/','../images/');
	this.$('Entr_P').innerHTML=_Ltel[this.Config._L]+_Lloading[this.Config._L].replace('images/','../images/');
    this.$('Entr_Edd').value='loading';
    this.$('Entr_img').src='../images/nophoto.jpg';
    this.$('Entr_img_a').href='javascript:;';
    this.$('Entr_img_a').target = '_self'; 
    //this.$('Entr_close').onclick = function(){};
    //this.$('Entro_mark').onclick = function(){};
    //this.$('Entro_error').onclick = function(){};
};


//显示实体泡泡方法，o实体对象。
EntityPopControl.prototype.ShowEntityPop = function(oid)
{     
     this.$('PLeft').className='PLeft';
	 this.$('PHead').className='PHead';
	 this.$('PContent').className='PContent';
	 this.$('PFoot').className='PFoot';
	 this.$('AILeft').className='AILeft';
	 this.$('cardContent').className='show';
	 this.$('Photo').className='Photo';
   if(this.OID==oid)
    {
        this.Show();
        return;
    }
    else
    {  
        this.OID = oid;
    }
    
    this.ItemsPanel.clearItem();
    this.ClearData();
    this.Show();
    //var url=this.Config._DataCenterUrl2 + 'CommMap/HInfo.aspx?node='+this.Config._Node+'&l='+this.Config._L+'&v=1.0&req=2&id='+oid;
	var url='/datacenter/CommMap/HouseInfo.aspx?node='+this.Config._Node+'&l='+this.Config._L+'&v=1.0&req=2&id='+oid;
	
	//var url='/DTCenter/HInfo.aspx?node='+this.Config._Node+'&l='+this.Config._L+'&v=1.0&req=2&id='+oid;
	//window.open(url);
    ENetwork.DownloadScript(url,this.LoadEntityPopData.bindAsEventListener(this));
    
};
EntityPopControl.prototype.LoadEntityPopData = function()
{
   if (typeof o == 'undefined' || o == null)
    {
        this.Hide();
        this.OID = '';
        return;
    }
    if (this.OID != o.ID)
    {
        return;
    }
	
    this.$('Entr_Title').innerHTML=o.OwnerName;
    //this.$('Entro_yp').href = 'http://' + this.Config._AppDomain + '/yp/OwnerDetail.aspx?ID='+o.ID;
	//this.$('Entro_yp').href = 'http://www.ksald.com/v/tlgyx20080903/';
    //this.$('Entro_yp').target = '_blank'; 
	//小鱼
    //this.$('Entro_more').href = 'http://' + this.Config._AppDomain + '/yp/OwnerDetail.aspx?ID='+o.ID;  
//	this.$('Entro_more').href = '../../../Hshow.asp?Hid='+o.ID;  
//    this.$('Entro_more').target = '_blank'; 
//	this.$('Entro_photo').href = 'http://www.ksald.com/xc';  
//    this.$('Entro_photo').target = '_blank'; 	
//	this.$('Entro_mov').href = 'http://www.hqcbd.gov.cn/auto_show.aspx?id=805';  
//    this.$('Entro_mov').target = '_blank'; 	
	//
    //this.$('Entr_Add').innerHTML=_Ladd[this.Config._L]+o.Oaddress;
    //this.$('Entr_Tell').innerHTML=_Ltel[this.Config._L]+o.OPhone;
	 this.$('Entr_Add').innerHTML=o.Oaddress;
	 
    this.$('Entr_Tell').innerHTML=o.OPhone+'　<a href="/H'+o.ID.replace("c","")+'" target="_blank">详细>>></a>';
	this.$('Entr_P').innerHTML=o.OP;
    //this.$('Entr_Edd').value='http://'+o.OEddress+'.'+this.Config._AppDomain;
	//this.$('Entr_Edd').value='http://'+o.OEddress+'.3dkunshan.com';
	this.$('Entr_Edd').value='http://'+o.OImagePath+'/'+o.OEddress;
    if(o.OImage!=null&&o.OImage!='')
    {
		//this.$('Entr_img').src=this.Config._UpImagesUrl+'/'+this.Config._UpImages+'/'+o.OImagePath+'/s'+o.OImage;  
		this.$('Entr_img').src='/UploadFile/House/x_'+o.OImage;
        this.$('Entr_img').onerror = this._LoadImgErr.bindAsEventListener(this.$('Entr_img'),'/Images/no_image.gif');
        //this.$('Entr_img_a').href=this.Config._UpImagesUrl+'/'+this.Config._UpImages+'/'+o.OImagePath+'/'+o.OImage; 
		//this.$('Entr_img_a').href="http://www.ksald.com/xc"; 
		this.$('Entr_img_a').href='/UploadFile/House/'+o.OImage; 
        this.$('Entr_img_a').target = '_blank'; 
    }
    else
    {
        this.$('Entr_img_a').target ='_self';
    }
    this.$('Entr_close').onclick = this.Close.bindAsEventListener(this);
    //this.$('Entro_mark').onclick = this._sign.bindAsEventListener(this,o.CenterX,o.CenterY,o.OwnerName);
    //this.$('Entro_error').onclick = this._cavil.bindAsEventListener(this,0,o.ID,o.OwnerName,o.CenterX,o.CenterY);   
    
    //POP广告
//    if(window._isSourceUrl&&typeof SourceAd!='undefined'&&SourceAd!=null)
//    {
//        window._isSourceUrl = false;
//        this.$('PopADLink').href = 'http://'+SourceAd.Link.replace('http://','');
//        this.$('PopADImageSrc').src = this.Config._PicUrl + SourceAd.ImagePath+'/'+SourceAd.ImageName;
//		alert(this.Config._PicUrl + SourceAd.ImagePath+'/'+SourceAd.ImageName)
//        this.$('PopADImageSrc').style.display = 'block';
//    }
//    else if(typeof POPAd!='undefined'&&POPAd!=null)
//    {
//        this.$('PopADLink').href = 'http://'+POPAd.Link.replace('http://','');
//        this.$('PopADImageSrc').src = this.Config._PicUrl + POPAd.ImagePath+'/'+POPAd.ImageName;
//        this.$('PopADImageSrc').style.display = 'block';
//    }
//    else
//    {
//        this.$('PopADImageSrc').style.display = 'none';
//    }
//    
    
	var HouseJBurl = '/Fundation/HInfoShow.aspx?type=1&id=' + o.ID.replace("c","");
	//window.open(HouseJBurl)
	this.HouseJBItem = new OptionCardContrlBase.Item(this.Body,'HouseJB','基本信息',HouseJBurl,false,false,70);;
    this.ItemsPanel.addItem(this.HouseJBItem);
	
	var HouseUSERurl = '/Fundation/HInfoShow.aspx?type=2&id=' + o.ID.replace("c","");
	this.HouseUSERItem = new OptionCardContrlBase.Item(this.Body,'HouseUSER','联系信息',HouseUSERurl,false,false,70);;
    this.ItemsPanel.addItem(this.HouseUSERItem);
	
	var HouseBZurl = '/Fundation/HInfoShow.aspx?type=3&id=' + o.ID.replace("c","");
	this.HouseBZItem = new OptionCardContrlBase.Item(this.Body,'HouseBZ','信息备注',HouseBZurl,false,false,70);;
    this.ItemsPanel.addItem(this.HouseBZItem);
	
	//var HouseBookurl = '/Fundation/HInfoShow.asp?type=4&id=' + o.ID;
	//this.HouseBookItem = new OptionCardContrlBase.Item(this.Body,'HouseBook','用户留言',HouseBookurl,false,false,70);;
   // this.ItemsPanel.addItem(this.HouseBookItem);
	
	this.HouseJBItem.activeItem();
    this.onHistorySaved(1, o);
	
	//var bustransferurl = '../../../../../Fundation/BusTransfer.aspx?x='+o.CenterX +'&y='+o.CenterY;
//	var bustransferurl = '/Fundation/CompanyTransfer.asp?oid=' + o.ID;
//    //this.BusTransferItem = new OptionCardContrlBase.Item(this.Body,'bustransfer','公交换乘',bustransferurl,false,false,59)
//	this.BusTransferItem = new OptionCardContrlBase.Item(this.Body,'bustransfer','实体基本信息',bustransferurl,false,false,100);;
//    this.ItemsPanel.addItem(this.BusTransferItem);
//    //var companylisturl = '../../../../../Fundation/CompanyList.aspx?oid=' + o.ID + '&oname=' + escape(o.OwnerName);
//	var companylisturl = '/Fundation/CompanyList.asp?oid=' + o.ID + '&oname=' + escape(o.OwnerName);
//    this.CompanyListItem = new OptionCardContrlBase.Item(this.Body,'companylist','本建筑物内的企业',companylisturl,false,false,108);
//    this.ItemsPanel.addItem(this.CompanyListItem);
//    var nearbyurl = '../../../../../Fundation/NearBySearch.aspx?x='+o.CenterX +'&y='+o.CenterY;
//    this.NearByItem = new OptionCardContrlBase.Item(this.Body,'nearby','查找周边',nearbyurl,false,false,59);
//    this.ItemsPanel.addItem(this.NearByItem);
//    var nearbusurl = '../../../../../Fundation/PeripheralBus.aspx?x='+o.CenterX +'&y='+o.CenterY;
//    this.NearBusItem = new OptionCardContrlBase.Item(this.Body,'nearbus','周边公交',nearbusurl,false,false,59);
//    this.NearBusItem.cardFrame.scrolling = 'auto';
//    this.NearBusItem.cardFrame.style.height = '130px';
//    this.ItemsPanel.addItem(this.NearBusItem);
    //this.CompanyListItem.activeItem(); //　默认用第二项

}

//小区点击：显flash泡泡方法，o实体对象　。小鱼复改================================
EntityPopControl.prototype.ShowEntityPop2 = function(oid)
{     
	 this.$('PLeft').className='PLeft2';
	 this.$('PHead').className='PHead2';
	 this.$('PContent').className='PContent2';
	 this.$('PFoot').className='PFoot2';
	 this.$('AILeft').className='AILeft2';
	 this.$('cardContent').className='show2';
	 this.$('Photo').className='Photo2';
   if(this.OID==oid)
    {
        this.Show();
        return;
    }
    else
    {  
        this.OID = oid;
    }
    
    this.ItemsPanel.clearItem();
    this.ClearData();
    this.Show();
    //var url=this.Config._DataCenterUrl2 + 'CommMap/CellInfo.aspx?Htype=2&node='+this.Config._Node+'&l='+this.Config._L+'&v=1.0&req=1&id='+oid;
	var url='/datacenter/CommMap/CellInfo.aspx?Htype=2&node='+this.Config._Node+'&l='+this.Config._L+'&v=1.0&req=1&id='+oid;
	//window.open(url);
    ENetwork.DownloadScript(url,this.LoadEntityPopData2.bindAsEventListener(this));
    
};
EntityPopControl.prototype.LoadEntityPopData2 = function()
{

	if (typeof o == 'undefined' || o == null)
    {
        this.Hide();
        this.OID = '';
        return;
    }
    if (this.OID != o.ID)
    {
        return;
    }

    this.$('Entr_Title').innerHTML=o.OwnerName;
    //this.$('Entro_yp').href = 'http://' + this.Config._AppDomain + '/yp/OwnerDetail.aspx?ID='+o.ID;
//	this.$('Entro_yp').href = 'http://www.ksald.com/v/tlgyx20080903/';
//    this.$('Entro_yp').target = '_blank'; 
//	//小鱼
//    //this.$('Entro_more').href = 'http://' + this.Config._AppDomain + '/yp/OwnerDetail.aspx?ID='+o.ID;  
//	this.$('Entro_more').href = 'http://yp.3dkunshan.com/CompanyDetail.asp?ID=9329';  
//    this.$('Entro_more').target = '_blank'; 
//	this.$('Entro_photo').href = 'http://www.ksald.com/xc';  
//    this.$('Entro_photo').target = '_blank'; 	
//	this.$('Entro_mov').href = 'http://www.hqcbd.gov.cn/auto_show.aspx?id=805';  
//    this.$('Entro_mov').target = '_blank'; 	

    this.$('Entr_Add').innerHTML=_Ladd[this.Config._L]+o.Oaddress;
    this.$('Entr_Tell').innerHTML=o.OPhone;
	//<a id="Entro_yp" title="全景" target="_blank"></a>
    this.$('Entr_P').innerHTML='<a id="Entro_mov" title="视频"  href="/house/new/Video_' + o.ID.replace('a','') + '.html" target="_blank"></a><a id="Entro_photo" title="相册" style="margin-left: 25px " href="/house/new/Picture_' + o.ID.replace('a','') + '_.html" target="_blank"></a><a id="Entro_more" title="详情" style="margin-left: 47px" href="/house/new/details_' + o.ID.replace('a','') + '.html" target="_blank"></a>';
	//this.$('Entr_Edd').value='http://'+o.OEddress+'.3dkunshan.com';
	this.$('Entr_Edd').value='http://'+o.OImagePath+'/'+o.OEddress;
    if(o.OImage!=null&&o.OImage!='')
    {
		//this.$('Entr_img').src=this.Config._UpImagesUrl+'/'+this.Config._UpImages+'/'+o.OImagePath+'/s'+o.OImage;   
		this.$('Entr_img').src='/UploadFile/FloorPic/x_'+o.OImage;
        this.$('Entr_img').onerror = this._LoadImgErr.bindAsEventListener(this.$('Entr_img'),'/Images/no_image.gif');
        //this.$('Entr_img_a').href=this.Config._UpImagesUrl+'/'+this.Config._UpImages+'/'+o.OImagePath+'/'+o.OImage; 
		 this.$('Entr_img_a').href='/UploadFile/FloorPic/'+o.OImage;
		//this.$('Entr_img_a').href="http://www.ksald.com/xc"; 
        this.$('Entr_img_a').target = '_blank'; 
    }
    else
    {
        this.$('Entr_img_a').target ='_self';
    }
    this.$('Entr_close').onclick = this.Close.bindAsEventListener(this);
    //this.$('Entro_mark').onclick = this._sign.bindAsEventListener(this,o.CenterX,o.CenterY,o.OwnerName);
    //this.$('Entro_error').onclick = this._cavil.bindAsEventListener(this,0,o.ID,o.OwnerName,o.CenterX,o.CenterY);   
    
    //POP广告
//    if(window._isSourceUrl&&typeof SourceAd!='undefined'&&SourceAd!=null)
//    {
//        window._isSourceUrl = false;
//        this.$('PopADLink').href = 'http://'+SourceAd.Link.replace('http://','');
//        this.$('PopADImageSrc').src = this.Config._PicUrl + SourceAd.ImagePath+'/'+SourceAd.ImageName;
//		alert(this.Config._PicUrl + SourceAd.ImagePath+'/'+SourceAd.ImageName)
//        this.$('PopADImageSrc').style.display = 'block';
//    }
//    else if(typeof POPAd!='undefined'&&POPAd!=null)
//    {
//        this.$('PopADLink').href = 'http://'+POPAd.Link.replace('http://','');
//        this.$('PopADImageSrc').src = this.Config._PicUrl + POPAd.ImagePath+'/'+POPAd.ImageName;
//        this.$('PopADImageSrc').style.display = 'block';
//    }
//    else
//    {
//        this.$('PopADImageSrc').style.display = 'none';
//    }
//  所属大类 1二手房2出租房3旺铺4写字楼5合租  
    //var bustransferurl = '../../../../../Fundation/BusTransfer.aspx?x='+o.CenterX +'&y='+o.CenterY;
	var bustransferurl = '/datacenter/CommMap/HouseList.aspx?Htype=1&oid=' + o.ID.replace('a','') + '&oname=' + escape(o.OwnerName);
	this.BusTransferItem = new OptionCardContrlBase.Item(this.Body,'bustransfer','出租('+o.Cz+')',bustransferurl,false,false,60);;
    //if(o.Cz!=0) 升级用
	//{
	this.ItemsPanel.addItem(this.BusTransferItem);
	//}
	
    //var companylisturl = '../../../../../Fundation/CompanyList.aspx?oid=' + o.ID + '&oname=' + escape(o.OwnerName);
	var companylisturl = '/datacenter/CommMap/HouseList.aspx?Htype=3&oid=' + o.ID.replace('a','') + '&oname=' + escape(o.OwnerName);
    this.CompanyListItem = new OptionCardContrlBase.Item(this.Body,'companylist','合租('+o.Hz+')',companylisturl,false,false,60);
    this.ItemsPanel.addItem(this.CompanyListItem);
	
    var nearbyurl = '/datacenter/CommMap/HouseList.aspx?Htype=2&oid=' + o.ID.replace('a','') + '&oname=' + escape(o.OwnerName);
    this.NearByItem = new OptionCardContrlBase.Item(this.Body,'nearby','二手('+o.Es+')',nearbyurl,false,false,60);
    this.ItemsPanel.addItem(this.NearByItem);
	
    var XZLurl = '/datacenter/CommMap/HouseList.aspx?Htype=4&oid=' + o.ID.replace('a','') + '&oname=' + escape(o.OwnerName);
    this.XZLItem = new OptionCardContrlBase.Item(this.Body,'XZL','专家房源('+o.Xzl+')',XZLurl,false,false,90);
    this.ItemsPanel.addItem(this.XZLItem);
	
//    var nearbusurl = '/datacenter/CommMap/HouseList.aspx?Htype=3&oid=' + o.ID.replace('a','') + '&oname=' + escape(o.OwnerName);
//    this.NearBusItem = new OptionCardContrlBase.Item(this.Body,'nearbus','商铺('+o.Sp+')',nearbusurl,false,false,54);
//   // this.NearBusItem.cardFrame.scrolling = 'auto';
//    //this.NearBusItem.cardFrame.style.height = '130px';
//    this.ItemsPanel.addItem(this.NearBusItem);
    //this.CompanyListItem.activeItem(); //　默认用第二项
	if(FCConfig.houType==1){
	this.BusTransferItem.activeItem();
	}
	else if(FCConfig.houType==2){
	this.NearByItem.activeItem();
	}
	else if(FCConfig.houType==3){
	this.CompanyListItem.activeItem();
	}
	else if(FCConfig.houType==4){
	this.XZLItem.activeItem();
    }
//	else if(FCConfig.houType==5){
//	this.CompanyListItem.activeItem();
//    }
	else {
	this.BusTransferItem.activeItem();
	}
    this.onHistorySaved(1, o);
	//更新信息条数
	//this.$('cz').innerHTML = '('+o.Cz+')';
//	this.$('hz').innerHTML = '('+o.Hz+')';
//	this.$('es').innerHTML = '('+o.Es+')';
//	this.$('xzl').innerHTML = '('+o.Xzl+')';
//	this.$('sp').innerHTML = '('+o.Sp+')';
}
//房编号点击：显flash泡泡方法，o实体对象　。小鱼复改================================
EntityPopControl.prototype.ShowEntityPop3 = function(oid)
{     
     this.$('PLeft').className='PLeft3';
	 this.$('PHead').className='PHead3';
	 this.$('PContent').className='PContent3';
	 this.$('PFoot').className='PFoot3';
	 this.$('AILeft').className='AILeft3';
	 this.$('cardContent').className='show3';
	 this.$('Photo').className='Photo3';
   if(this.OID==oid)
    {
        this.Show();
        return;
    }
    else
    {  
        this.OID = oid;
    }
    
    this.ItemsPanel.clearItem();
    this.ClearData();
    this.Show();
    var url=this.Config._DataCenterUrl2 + 'CommMap/HouseInfo.asp?Htype=2&node='+this.Config._Node+'&l='+this.Config._L+'&v=1.0&req=1&id='+oid;
	//window.open(url);
    ENetwork.DownloadScript(url,this.LoadEntityPopData3.bindAsEventListener(this));
    
};
EntityPopControl.prototype.LoadEntityPopData3 = function()
{

	//replacejscssfile("EntityPopControl.css", "EntityPopControl2", "css")
	if (typeof o == 'undefined' || o == null)
    {
        this.Hide();
        this.OID = '';
        return;
    }
    if (this.OID != o.ID)
    {
        return;
    }
   //this.$('Jt_image').src="../Images/newmap38-2.png";
   this.$('Entr_Title').innerHTML=o.OwnerName;
    //this.$('Entro_yp').href = 'http://' + this.Config._AppDomain + '/yp/OwnerDetail.aspx?ID='+o.ID;
//	this.$('Entro_yp').href = 'http://www.ksald.com/v/tlgyx20080903/';
//    this.$('Entro_yp').target = '_blank'; 
//	//小鱼
//    //this.$('Entro_more').href = 'http://' + this.Config._AppDomain + '/yp/OwnerDetail.aspx?ID='+o.ID;  
//	this.$('Entro_more').href = 'http://yp.3dkunshan.com/CompanyDetail.asp?ID=9329';  
//    this.$('Entro_more').target = '_blank'; 
//	this.$('Entro_photo').href = 'http://www.ksald.com/xc';  
//    this.$('Entro_photo').target = '_blank'; 	
//	this.$('Entro_mov').href = 'http://www.hqcbd.gov.cn/auto_show.aspx?id=805';  
//    this.$('Entro_mov').target = '_blank'; 	
	//
    this.$('Entr_Add').innerHTML=_Ladd[this.Config._L]+o.Oaddress;
    this.$('Entr_Tell').innerHTML=o.OPhone;
	//this.$('Entr_P').innerHTML=o.OPhone;
    //this.$('Entr_Edd').value='http://'+o.OEddress+'.'+this.Config._AppDomain;
	//this.$('Entr_Edd').value='http://'+o.OEddress+'.3dkunshan.com';
	this.$('Entr_Edd').value='http://'+o.OEddress+'.kshot.net';

    if(o.OImage!=null&&o.OImage!='')
    {
        this.$('Entr_img').src=this.Config._UpImagesUrl+'/'+this.Config._UpImages+'/'+o.OImagePath+'/s'+o.OImage;    
        this.$('Entr_img').onerror = this._LoadImgErr.bindAsEventListener(this.$('Entr_img'),'../images/nophoto.jpg');
        //this.$('Entr_img_a').href=this.Config._UpImagesUrl+'/'+this.Config._UpImages+'/'+o.OImagePath+'/'+o.OImage; 
		this.$('Entr_img_a').href="http://www.ksald.com/xc"; 
        this.$('Entr_img_a').target = '_blank'; 
    }
    else
    {
        this.$('Entr_img_a').target ='_self';
    }
	this.$('Entr_close').onclick = this.Close.bindAsEventListener(this);
    //this.$('Entro_mark').onclick = this._sign.bindAsEventListener(this,o.CenterX,o.CenterY,o.OwnerName);
    //this.$('Entro_error').onclick = this._cavil.bindAsEventListener(this,0,o.ID,o.OwnerName,o.CenterX,o.CenterY);   
    
    //POP广告
//    if(window._isSourceUrl&&typeof SourceAd!='undefined'&&SourceAd!=null)
//    {
//        window._isSourceUrl = false;
//        this.$('PopADLink').href = 'http://'+SourceAd.Link.replace('http://','');
//        this.$('PopADImageSrc').src = this.Config._PicUrl + SourceAd.ImagePath+'/'+SourceAd.ImageName;
//		alert(this.Config._PicUrl + SourceAd.ImagePath+'/'+SourceAd.ImageName)
//        this.$('PopADImageSrc').style.display = 'block';
//    }
//    else if(typeof POPAd!='undefined'&&POPAd!=null)
//    {
//        this.$('PopADLink').href = 'http://'+POPAd.Link.replace('http://','');
//        this.$('PopADImageSrc').src = this.Config._PicUrl + POPAd.ImagePath+'/'+POPAd.ImageName;
//        this.$('PopADImageSrc').style.display = 'block';
//    }
//    else
//    {
//        this.$('PopADImageSrc').style.display = 'none';
//    }
//  所属大类 1二手房2出租房3旺铺4写字楼5合租  
    //var bustransferurl = '../../../../../Fundation/BusTransfer.aspx?x='+o.CenterX +'&y='+o.CenterY;
	var bustransferurl = '/Fundation/HouseList.aspx?Ctype=2&Htype=2&oid=' + o.ID.replace('b','') + '&oname=' + escape(o.OwnerName);
    //this.BusTransferItem = new OptionCardContrlBase.Item(this.Body,'bustransfer','公交换乘',bustransferurl,false,false,59)
	this.BusTransferItem = new OptionCardContrlBase.Item(this.Body,'bustransfer','出租('+o.Cz+')',bustransferurl,false,false,54);;
    this.ItemsPanel.addItem(this.BusTransferItem);
    //var companylisturl = '../../../../../Fundation/CompanyList.aspx?oid=' + o.ID + '&oname=' + escape(o.OwnerName);
	var companylisturl = '/Fundation/HouseList.aspx?Ctype=2&Htype=5&oid=' + o.ID.replace('b','') + '&oname=' + escape(o.OwnerName);
    this.CompanyListItem = new OptionCardContrlBase.Item(this.Body,'companylist','合租('+o.Hz+')',companylisturl,false,false,54);
    this.ItemsPanel.addItem(this.CompanyListItem);
    var nearbyurl = '/Fundation/HouseList.aspx?Ctype=2&Htype=1&oid=' + o.ID.replace('b','') + '&oname=' + escape(o.OwnerName);
    this.NearByItem = new OptionCardContrlBase.Item(this.Body,'nearby','二手('+o.Es+')',nearbyurl,false,false,54);
    this.ItemsPanel.addItem(this.NearByItem);
    var XZLurl = '/Fundation/HouseList.aspx?Ctype=2&Htype=4&oid=' + o.ID.replace('b','') + '&oname=' + escape(o.OwnerName);
    this.XZLItem = new OptionCardContrlBase.Item(this.Body,'XZL','写字楼('+o.Xzl+')',XZLurl,false,false,65);
    this.ItemsPanel.addItem(this.XZLItem);
    var nearbusurl = '/Fundation/HouseList.aspx?Ctype=2&Htype=3&oid=' + o.ID.replace('b','') + '&oname=' + escape(o.OwnerName);
    this.NearBusItem = new OptionCardContrlBase.Item(this.Body,'nearbus','商铺('+o.Sp+')',nearbusurl,false,false,54);
   // this.NearBusItem.cardFrame.scrolling = 'auto';
    //this.NearBusItem.cardFrame.style.height = '130px';
    this.ItemsPanel.addItem(this.NearBusItem);
    //this.CompanyListItem.activeItem(); //　默认用第二项
	if(FCConfig.houType==1){
	this.NearByItem.activeItem();
	}
	else if(FCConfig.houType==2){
	this.BusTransferItem.activeItem();
	}
	else if(FCConfig.houType==3){
	this.NearBusItem.activeItem();
	}
	else if(FCConfig.houType==4){
	this.XZLItem.activeItem();
    }
	else if(FCConfig.houType==5){
	this.CompanyListItem.activeItem();
    }
	else {
	this.BusTransferItem.activeItem();
	}
    
    this.onHistorySaved(1, o);
	//更新信息条数
	//this.$('cz').innerHTML = '('+o.Cz+')';
//	this.$('hz').innerHTML = '('+o.Hz+')';
//	this.$('es').innerHTML = '('+o.Es+')';
//	this.$('xzl').innerHTML = '('+o.Xzl+')';
//	this.$('sp').innerHTML = '('+o.Sp+')';
}
//====================================================================================
//显示企业泡泡方法，c企业对象。
EntityPopControl.prototype.ShowComanyPop = function(cid)
{
    if(this.CID==cid)
    {
        this.Show();
        return;
    }
    else
    {  
        this.CID = cid;
    }
    this.ItemsPanel.clearItem();
    this.ClearData();
    this.Show();
    //var url=this.Config._DataCenterUrl + 'CommMap/CompanyInfo.aspx?node='+this.Config._Node+'&l='+this.Config._L+'&v=1.0&req=1&id='+cid;
	var url=this.Config._DataCenterUrl2 + 'CommMap/CompanyInfo.asp?node='+this.Config._Node+'&l='+this.Config._L+'&v=1.0&req=1&id='+cid;
	//window.open(url)
    ENetwork.DownloadScript(url,this.LoadComanyPopData.bindAsEventListener(this));
}

EntityPopControl.prototype.LoadComanyPopData = function()
{
    if (typeof c == 'undefined' || c == null)
    {
        this.Hide();
        this.CID = '';
        return;
    }
    if (this.CID != c.ComID)
    {
        return;
    }
    this.$('Entr_Title').innerHTML=c.CompanyName;  
//    this.$('Entro_yp').href = 'http://' + this.Config._AppDomain + '/yp/CompanyDetail.aspx?ID='+c.ComID;
//    this.$('Entro_yp').target = '_blank'; 
//小鱼动
//	this.$('Entro_yp').href = 'http://www.ksald.com/v/tlgyx20080903/';
//    this.$('Entro_yp').target = '_blank'; 
//	this.$('Entro_more').href = 'http://yp.3dkunshan.com/CompanyDetail.asp?ID=9329';  
//    this.$('Entro_more').target = '_blank'; 
//	this.$('Entro_photo').href = 'http://www.ksald.com/xc';  
//    this.$('Entro_photo').target = '_blank'; 	
//	this.$('Entro_mov').href = 'http://www.hqcbd.gov.cn/auto_show.aspx?id=805';  
//    this.$('Entro_mov').target = '_blank'; 	
//小鱼动
    this.$('Entr_Add').innerHTML='地址：' + c.ComAddress;
    this.$('Entr_Tell').innerHTML='电话：' + c.ComPhone;
	this.$('Entr_P').innerHTML='价格：' + c.ComPhone;
    //this.$('Entr_Edd').value='http://'+c.ComEaddress+'.'+this.Config._AppDomain;
	this.$('Entr_Edd').value='http://'+c.ComEaddress+'.kshot.net';
    
    if(c.ComImage!=null&&c.ComImage!='')
    {
        this.$('Entr_img').src=this.Config._UpImagesUrl+'/'+this.Config._UpImages+'/'+c.ComImagePath+'/s'+c.ComImage; 
        //this.$('Entr_img_a').href=this.Config._UpImagesUrl+'/'+this.Config._UpImages+'/'+c.ComImagePath+'/'+c.ComImage;
		this.$('Entr_img_a').href="http://www.ksald.com/xc"; 
        this.$('Entr_img').onerror = this._LoadImgErr.bindAsEventListener(this.$('Entr_img'),'../images/nophoto.jpg');
        this.$('Entr_img_a').target = '_blank';
    }
    else
    {
        this.$('Entr_img_a').target ='_self';
    }
    this.$('Entr_close').onclick = this.Close.bindAsEventListener(this);
    //this.$('Entro_mark').onclick = this._sign.bindAsEventListener(this,c.ComX,c.ComY,c.CompanyName);
    //this.$('Entro_error').onclick = this._cavil.bindAsEventListener(this,1,c.ComID,c.CompanyName,c.ComX,c.ComY);
	//this.$('Entro_error').onclick = alert();
 //广告暂未起作用  
//    if(window._isSourceUrl&&typeof SourceAd!='undefined'&&SourceAd!=null)
//    {
//        window._isSourceUrl = false;
//        this.$('PopADLink').href = 'http://'+SourceAd.Link.replace('http://','');
//        this.$('PopADImageSrc').src = this.Config._PicUrl + SourceAd.ImagePath+'/'+SourceAd.ImageName;
//        this.$('PopADImageSrc').style.display = 'block';
//    }
//    else if(typeof POPAd!='undefined'&&POPAd!=null)
//    {
//        this.$('PopADLink').href = 'http://'+POPAd.Link.replace('http://','');
//        this.$('PopADImageSrc').src = this.Config._PicUrl + POPAd.ImagePath+'/'+POPAd.ImageName;
//        this.$('PopADImageSrc').style.display = 'block';
//    }
//    else
//    {
//        this.$('PopADImageSrc').style.display = 'none';
//    }
 //广告暂未起作用 	
//小鱼隐，暂时用下面的
//    //搜索时POP对应
//    //var bustransferurl = '../../../../../Fundation/BusTransfer.aspxd?x='+c.ComX +'&y='+c.ComY;
//	var bustransferurl = '/Fundation/CompanyTransfer.asp?oid=' + o.ID;
//    this.BusTransferItem = new OptionCardContrlBase.Item(this.Body,'bustransfer','公交换乘',bustransferurl,false,false,59);
//    this.ItemsPanel.addItem(this.BusTransferItem);
//    var nearbyurl = '../../../../../Fundation/NearBySearch.aspx?x='+c.ComX +'&y='+c.ComY;
//    this.NearByItem = new OptionCardContrlBase.Item(this.Body,'nearby','查找周边',nearbyurl,false,false,59);
//    this.ItemsPanel.addItem(this.NearByItem);
//    var nearbusurl = '../../../../../Fundation/PeripheralBus.aspx?x='+c.ComX +'&y='+c.ComY;
//    this.NearBusItem = new OptionCardContrlBase.Item(this.Body,'nearbus','周边公交',nearbusurl,false,false,59);
//    this.NearBusItem.cardFrame.scrolling = 'auto';
//    this.NearBusItem.cardFrame.style.height = '130px';
//    this.ItemsPanel.addItem(this.NearBusItem);
//    this.BusTransferItem.activeItem();
//    this.onHistorySaved(2, c);
	
	var bustransferurl = '/Fundation/CompanyTransfer.asp?oid=' + o.ID;
	this.BusTransferItem = new OptionCardContrlBase.Item(this.Body,'bustransfer','实体基本信息',bustransferurl,false,false,100);;
    this.ItemsPanel.addItem(this.BusTransferItem);
	var companylisturl = '/Fundation/CompanyList.asp?oid=' + o.ID + '&oname=' + escape(o.OwnerName);
    this.CompanyListItem = new OptionCardContrlBase.Item(this.Body,'companylist','本建筑物内的企业',companylisturl,false,false,108);
    this.ItemsPanel.addItem(this.CompanyListItem);
	this.BusTransferItem.activeItem();
    this.onHistorySaved(2, c);	
	
}


//内部事件
EntityPopControl.prototype.fnCopyCode = function (strUrl, msg)
{
	var txt = this.$(strUrl).value;
	fnCopyToClipboard(txt,msg);
}
//图像加载三次仍然失败则移除
EntityPopControl.prototype._LoadImgErr = function(e,imgpath){
    if(this.c=='undefined'||this.c==null){
        this.c=0;
    }
    else{
        this.c++;
    }
    if(this.c>3){
        if (this.src == imgpath)
        {
            return; //默认图片加载失败则不再触发 , ie7光设置 this.onerror=null; 无效
        }
        this.src=imgpath;
        this.onerror=null;
        this.parentNode.href = 'javascript:;';
        this.parentNode.target = '_self';
    }
    else{
        this.src=this.src;
    }
}
EntityPopControl.prototype.Close=function(e)
{
    this.Hide();
}

//对内接口
//公交ID，Name搜索公交线路的事件
EntityPopControl.prototype._sign = function(e,x,y,sName)
{
    this.onSign(x,y,sName)
};
//纠错事件
EntityPopControl.prototype._cavil = function(e,type,nID,sName,x, y)
{          
    this.onCavil(type,nID,sName,x, y);         
};
EntityPopControl.prototype._busIdSearch = function(nID,sName)
{   
    this.onBusIDSearch(nID,sName);                 
};
//从这里出发，如何到达这里公交搜索,action:1从怎么出发，2如何到达这里
EntityPopControl.prototype._busSEXYSearch = function(action,x,y,sKeyword)
{   
    this.onBusSEXYSearch(action,x,y,sKeyword);                 
};
//周边搜索的事件
EntityPopControl.prototype._nearbySearch = function(sKeyword,x,y,len)
{                   
    this.onLocalNearBySearch(sKeyword,x,y,len);
};
//对外接口
//标记该位置的事件
EntityPopControl.prototype.onSign = function(x,y,sName)
{
    alert('未实现标记方法');            
};
//纠错事件
EntityPopControl.prototype.onCavil = function(type,nID,sName,x, y)
{        
    alert('未实现纠错方法');          
};
//公交ID，Name搜索公交线路的事件
EntityPopControl.prototype.onBusIDSearch = function(nID,sName)
{                    
};
//从这里出发，如何到达这里公交搜索
EntityPopControl.prototype.onBusSEXYSearch = function(action,x,y,sKeyword)
{                    
};
//周边搜索的事件
EntityPopControl.prototype.onLocalNearBySearch = function(sKeyword,x,y,len)
{                   
};
//保存历史记录
EntityPopControl.prototype.onHistorySaved = function(type,spot){
};

/*************************************************
* 从这里出发搜索控件
* code by lzz ver1.0 update at 07-10-17
*************************************************/

var FromSearchControl = Class.create();
Object.extend(FromSearchControl.prototype, MapContrlBase.prototype);
FromSearchControl.prototype._loadUI = function(){
    this.LoadUI('FromSearchControl');
};

FromSearchControl.prototype.ShowFromHereSearch = function(x, y){
    this.$('btnSearch').onclick = function(){
        this.onShowFromHereSearch(this.$('popbusnametxt1').value, x, y);
    }.bindAsEventListener(this);
    this.Show();
};

//重载控件加载完毕后的事件
FromSearchControl.prototype._loadComplete= function(){
    this.Body.contentWindow.FromSearchControl = this;
    this.onLoadComplete(this);
};

//从这里出发事件 , keyword：目的地
FromSearchControl.prototype.onShowFromHereSearch = function(keyword, x, y){
};

/*************************************************
* 引导图控件
* code by lzz ver1.0 update at 07-10-10
*************************************************/

var NavigationControl = Class.create();
Object.extend(NavigationControl.prototype, MapContrlBase.prototype);
NavigationControl.prototype._loadUI = function(){
    //this.Body.src = this.Config._RealCityUIPath + 'Controls/NavigationControl.aspx';
	//window.open(this.Config._RealCityUIPath + 'Controls/NavigationControl.aspx')
	this.Body.src = '/skins/Controls/NavigationControl.aspx';
};

//关闭事件
NavigationControl.prototype.onClose = function(){
};
//热点点击事件,type: 0:实体 1:企业
NavigationControl.prototype.onNavClick = function(type, id, x, y){  
};

//重载控件加载完毕后的事件
NavigationControl.prototype._loadComplete= function()
{
    this.Body.contentWindow.NavigationControl = this;
    this.onLoadComplete(this);
};

/*************************************************
* 拉框搜索控件
* code by lzz ver1.0 update at 07-10-16
*************************************************/

var PaneSearchControl = Class.create();
Object.extend(PaneSearchControl.prototype, MapContrlBase.prototype);
PaneSearchControl.prototype._loadUI = function(){
    this.LoadUI('PaneSearchControl');
};
//显示拉框范围
PaneSearchControl.prototype.ShowPane = function(x1, y1, x2, y2){
    //如果拉框结束点坐标小于起始点坐标，则互换两点
    if (x1 > x2)
    {
        x1 = x1 + x2;
        x2 = x1 - x2;
        x1 = x1 - x2;
    }
    if (y1 > y2)
    {
        y1 = y1 + y2;
        y2 = y1 - y2;
        y1 = y1 - y2;
    }
    this.$('btnSearch').onclick = function(){
        this.onPaneSearch(this.$('Paneltxt').value, x1, y1, x2, y2);
    }.bindAsEventListener(this);
    this.$('divHotKeyWords').innerHTML = '';
    for(var i=0;i<SearchHotKeyWords.length;i++)
    {
        this.$('divHotKeyWords').innerHTML += '<a class="keyword" href="#;" onclick="PaneSearchControl.onPaneSearch(\''+SearchHotKeyWords[i]+'\',' + x1 + ',' + y1 + ',' + x2 + ',' + y2 + ')">'+SearchHotKeyWords[i]+'</a>&nbsp;&nbsp;';
    }
    this.Show();
};

//重载控件加载完毕后的事件
PaneSearchControl.prototype._loadComplete= function()
{
    this.Body.contentWindow.PaneSearchControl = this;
    this.onLoadComplete(this);
};
//重新拉框事件
PaneSearchControl.prototype.onRePane = function(){
};
//拉框结束事件
PaneSearchControl.prototype.onPaneClose = function(){
};
PaneSearchControl.prototype.onPaneSearch = function(keyword,x1,y1,x2,y2){
};

PaneSearchControl.prototype.HotKeywords = '';
/*************************************************
* 周边公交搜索控件
* code by lzz ver1.0 update at 07-10-17
*************************************************/

var PeripheralBusControl = Class.create();
Object.extend(PeripheralBusControl.prototype, MapContrlBase.prototype);
PeripheralBusControl.prototype._loadUI = function(){
    this.LoadUI('PeripheralBusControl');
};

PeripheralBusControl.prototype.ShowPeripheralBus = function(x, y){
    this.$('fraBus').src = '../../../../../Fundation/PeripheralBus.aspx?x=' + x + '&y=' + y;
    this.Show();
};


PeripheralBusControl.prototype._busIdSearch = function(busid, busname){
    this.onBusClick(busid, busname);
};

//重载控件加载完毕后的事件
PeripheralBusControl.prototype._loadComplete= function(){
    this.Body.contentWindow.PopControlForm = this;
    //绑定事件
    if (GetBrowserInfo()[0]=='IE'){
        this.$('fraBus').attachEvent("onload",this._FraLoad.bindAsEventListener(this));
    }
    else {
        this.$('fraBus').onload = this._FraLoad.bindAsEventListener(this);
    }
    this.onLoadComplete(this);
};
PeripheralBusControl.prototype._FraLoad = function(){
    this.$('fraBus').contentWindow.Config = this.Config;
};

//公交线路点击 , busid：公交线路ID, busname：公交线路名
PeripheralBusControl.prototype.onBusClick = function(busid, busname){
};

/*************************************************
* 查找周边控件
* code by lzz ver1.0 update at 07-10-17
*************************************************/

var PeripheralSearchControl = Class.create();
Object.extend(PeripheralSearchControl.prototype, MapContrlBase.prototype);
PeripheralSearchControl.prototype._loadUI = function(){
    this.LoadUI('PeripheralSearchControl');
};

//显示查找周边窗体
PeripheralSearchControl.prototype.ShowPeripheralSearch = function(x, y){
    this.$('btnSearch').onclick = function(){
        var area = 500;
        if (this.$('maxArea').checked)
        {
            area = 1000;
        }
        this.onPeripheralSearch(this.$('txtPlace').value, x, y, area);
    }.bindAsEventListener(this);
    this.$('divHotKeyWords').innerHTML = '';
    if (typeof SearchHotKeyWords != 'undefined')
    {
        for(var i=0;i<SearchHotKeyWords.length;i++)
        {
            this.$('divHotKeyWords').innerHTML += '<a class="keyword" href="javascript:PeripheralSearchControl._onPeripheralSearch(\''+SearchHotKeyWords[i]+'\',' + x + ',' + y + ');">'+SearchHotKeyWords[i]+'</a>&nbsp;&nbsp;';
        }
    }
    this.Show();
};
PeripheralSearchControl.prototype._onPeripheralSearch = function(keyword, x, y){
    var area = 500;
    this.$('txtPlace').value = keyword;
    if (this.$('maxArea').checked)
    {
        area = 1000;
    }
    this.onPeripheralSearch(keyword, x, y, area);
};

//重载控件加载完毕后的事件
PeripheralSearchControl.prototype._loadComplete= function(){
    this.Body.contentWindow.PeripheralSearchControl = this;
    this.onLoadComplete(this);
};
//周边查找事件
PeripheralSearchControl.prototype.onPeripheralSearch = function(keyword, x, y, area){
};
PeripheralSearchControl.prototype.HotKeywords = '';
/*************************************************
* 视窗广告控件
* code by lzz ver1.0 update at 07-10-25
*************************************************/

var RotaryPictureControl = Class.create();
Object.extend(RotaryPictureControl.prototype, MapContrlBase.prototype);
RotaryPictureControl.prototype._loadUI = function(){
    this.LoadUI('RotaryPictureControl');
};

//重载控件加载完毕后的事件
RotaryPictureControl.prototype._loadComplete= function(){
    this.Body.contentWindow.RotaryPictureControl = this;
    this.onLoadComplete(this);
};

RotaryPictureControl.prototype.onDataLoadComplete = function(){
};
/*************************************************
* 搜索控件
* code by xzx ver1.0 update at 07-09-27
*************************************************/

var SearchControl = Class.create();
Object.extend(SearchControl.prototype, MapContrlBase.prototype);
SearchControl.prototype._loadUI = function(){
    this.LoadUI('SearchControl');
};
SearchControl.prototype.Width = 600;
SearchControl.prototype.Height = 600;

//此事可以托管该事件，执行一些附加操作，再将事件抛出
SearchControl.prototype._loadComplete = function(){
   // '本地搜索' 给'btnLocalSearch'帮定事件
   this.$('btnLocalSearch').onclick = this._LocalSearch.bindAsEventListener(this);
   // '黄页搜索' 给'btnYellowSearch'帮定事件
   this.$('btnYellowSearch').onclick = this._onYellowPageSearch.bindAsEventListener(this);
   //'工交搜索' 给'btnBusSearch'帮定事件
   this.$('btnBusSearch').onclick = this._onBusSearch.bindAsEventListener(this);
   this.Body.contentWindow.SearchControl = this;
   this.onLoadComplete(this);
};

/****************本地搜索*****************/
SearchControl.prototype._LocalSearch = function(){
    var sKeyword = this.$('txtKeyword').value;
    sKeyword = sKeyword.replaceAll('\'', '').replaceAll('%', '').replaceAll(';', '');
    if (sKeyword.length > 0 && sKeyword != '请输入关键字，例如：亚太广场')
    {
        this.onLocalSearch(sKeyword);
    }
};
/****************黄页搜索*****************/
SearchControl.prototype._onYellowPageSearch = function(){
    var YellowKeyword = this.$('txtYellowKeyword').value;
    if (YellowKeyword.length > 0 && YellowKeyword != '请输入关键字，例如：超市')
    {
        this.onYellowPageSearch(YellowKeyword);
    }
}
/****************公交搜索*****************/
SearchControl.prototype._onBusSearch = function(){
    //线路搜索
    if (this.$('line0').checked)
    {
        var Param1 = this.$('txtLineSearch').value;
        if (Param1.length > 0 && Param1 != '请输入要搜索的线路')
        {
            this.onBusSearch(0,Param1,'');
        }        
    }
    //站点搜索
    else if(this.$('line1').checked)
    {
       var Param1 = this.$('txtLineSearch').value; 
       if (Param1.length > 0 && Param1 != '请输入站点名')
       {
            this.onBusSearch(1,Param1,'');
       }
    }
    //两点搜索
    else if(this.$('line2').checked)
    {
        var Param1 = this.$("txtBusstart").value;
        var Param2 = this.$("txtBusend").value; 
        if (Param1.length>0 && Param2.length>0)
        {
            this.onBusSearch(2,Param1,Param2); 
        }
    }
}


//外部调用本地搜索事件
SearchControl.prototype.onLocalSearch = function(sKeyword){
};


//外部调用黄页搜索事件
SearchControl.prototype.onYellowPageSearch = function(YellowKeyword){
};


//外部调用公交搜索事件
SearchControl.prototype.onBusSearch = function(iType,Param1,Param2){
};

/*
* Field Declare ^-^ 
*/
var SearchResultControl;
if(!SearchResultControl)
    SearchResultControl = Class.create();
        

Object.extend(SearchResultControl.prototype,OptionCardContrlBase.prototype);


SearchResultControl.prototype._loadUI = function(){
    this.LoadUI('SearchResultControl');
};


//重载控件加载完毕后的事件
SearchResultControl.prototype._loadComplete= function()
{
    this.Body.contentWindow.window.ResultControlForm = this;
    
    this.ItemsPanel = new OptionCardContrlBase.ItemsPanel(this.Body,'itemsPanel','cardContent');
    /*--begin MinMax*/
    //window.MContents=this.$('DragWindow');
	window.MContentsRoller=new Aladdincn.Web.Animation.Roller(this.Body,30);
	MContentsRoller.AccFunction=AccelerationFunctions.CrazyElevator;
	MContentsRoller.onafterrollin=function(tm){
		MContentsRoller.LeaveAmount=30;
		tm.contentWindow.document.getElementById('m_h_m').className='m_h_max';
	};
	MContentsRoller.onafterrollout=function(um){
		um.contentWindow.document.getElementById('m_h_m').className='m_h_m';
	};
	this.$('m_h_m').onclick = this.MinMax.bindAsEventListener(this);
	/*----end MinMax----*/
    this.$('m_h_c').onclick = this.Close.bindAsEventListener(this);
    this.$('Bar_L').onclick = this.ToLeft.bindAsEventListener(this.ItemsPanel);
    this.$('Bar_R').onclick = this.ToRight.bindAsEventListener(this.ItemsPanel);
    this.onLoadComplete(this);
    
}
//75行LoadUI
//本地搜索
SearchResultControl.prototype.LocalSearch= function(sKeyWord)
{
    if(sKeyWord!='')
    {
		//var url = '../../../../../Fundation/LocalSearch.aspx?key='+escape(sKeyWord);
		var url = '/Fundation/LocalSearch.asp?key='+escape(sKeyWord);
		//window.open(url)
        this.Item = new OptionCardContrlBase.Item(this.Body,'localsearch',sKeyWord,url,true,true);
        this.Item.ExpendOut = this.MinMax.bind(this,true);
        this.ItemsPanel.addItem(this.Item);//加上就有问题
        this.Show();
		
    }
}
//周边搜索
SearchResultControl.prototype.LocalNearBySearch= function(sKeyWord,x,y,len)
{
    if(sKeyWord!='')
    {
        var url = '../../../../../Fundation/LocalSearch.aspx?action=1&key='+escape(sKeyWord)+'&x='+x+'&y='+y+'&len='+len;
        this.Item = new OptionCardContrlBase.Item(this.Body,'nearBysearch',sKeyWord,url,true,true);
        this.Item.ExpendOut = this.MinMax.bind(this,true);
        this.ItemsPanel.addItem(this.Item);
        this.Show();
    }
}
//框选搜索
SearchResultControl.prototype.LocalXYSearch= function(sKeyWord,x1,y1,x2,y2)
{
    if(sKeyWord!='')
    {
        var url = '../../../../../Fundation/LocalSearch.aspx?action=2&key='+escape(sKeyWord)+'&x1='+x1+'&y1='+y1+'&x2='+x2+'&y2='+y2;
        this.Item = new OptionCardContrlBase.Item(this.Body,'localsearch',sKeyWord,url,true,true);
        this.Item.ExpendOut = this.MinMax.bind(this,true);
        this.ItemsPanel.addItem(this.Item);
        this.Show();
    }
}
//公交搜索
SearchResultControl.prototype.BusSearch= function(nType,  sParam1,  sParam2)
{
    if(sParam1=='')
    {
        return;
    }
    if(nType=='2'&&sParam2=='')
    {
        return;
    }
    var url = '';
    var title='';
    switch(nType)
    {
        case 0:
        url = '../../../../../Fundation/BusNoSearch.aspx?key='+escape(sParam1);
        title=sParam1;
        break;
        case 1:
        url = '../../../../../Fundation/BusStationSearch.aspx?key='+escape(sParam1);
        title=sParam1;
        break;
        case 2:
        url = '../../../../../Fundation/BusSESearch.aspx?s='+escape(sParam1)+'&e='+escape(sParam2);
        title=sParam1+'--'+sParam2;
        break;
        default:
        break;
    }
    if(title!='')
    {
        this.Item = new OptionCardContrlBase.Item(this.Body,'bussearch',title,url,true,true);
        this.Item.ExpendOut = this.MinMax.bind(this,true);
        this.ItemsPanel.addItem(this.Item);
        this.Show();
    }
}
//对BUSSearch的扩展，根据公交ID，Name查询公交线路
SearchResultControl.prototype.BusIDSearch= function(nID,sName)
{
    if(nID!=''&&sName!='')
    {
        var url =  '../../../../../Fundation/BusNoSearch.aspx?key='+nID+'&action=1';
        this.Item = new OptionCardContrlBase.Item(this.Body,'busnosearch',sName,url,true,true);
        this.Item.ExpendOut = this.MinMax.bind(this,true);
        this.ItemsPanel.addItem(this.Item);
        this.Show();
    }
}
//
//对BUSSearch的扩展，这个方法用在从这么出发，如何到达这里
//action 1从这里出发，2如何到达这里
SearchResultControl.prototype.BusSEXYSearch= function(action,x,y,sName)
{
    if(sName!=''&&sName!=null)
    {
        var url =  '../../../../../Fundation/BusSESearch.aspx?key='+escape(sName)+'&action='+action+'&x='+x+'&y='+y;
        this.Item = new OptionCardContrlBase.Item(this.Body,'bussearch',sName,url,true,true);
        this.Item.ExpendOut = this.MinMax.bind(this,true);
        this.ItemsPanel.addItem(this.Item);
        this.Show();
    }
}
//主题地图搜索
SearchResultControl.prototype.ClassSearch= function(nClassID,sClassName)
{
    if(sClassName==''||sClassName==null)
    {
        sClassName = '主题栏目';
    }
    //var url = '../../../../../Fundation/ProMap.aspx?classid='+nClassID;
	var url = '/Fundation/ProMap.asp?classid='+nClassID;
    this.Item = new OptionCardContrlBase.Item(this.Body,'classsearch',sClassName,url,true,true);
    this.Item.ExpendOut = this.MinMax.bind(this,true);
    this.ItemsPanel.addItem(this.Item);
    this.Show();
}
//新闻显示
SearchResultControl.prototype.NewsSearch= function(nNewsID,sNewsTitle)
{
    if(sNewsTitle==null||sNewsTitle=='')
    {
        sNewsTitle='系统公告';
    }
    var url ='../../../../../Fundation/News.asp?id='+nNewsID;
    this.Item = new OptionCardContrlBase.Item(this.Body,'new'+nNewsID,sNewsTitle,url,true,true);
    this.Item.ExpendOut = this.MinMax.bind(this,true);
    this.ItemsPanel.addItem(this.Item);
    this.Show();
}

//自定义显示内容
SearchResultControl.prototype.EdushiAnnounce= function(nID,sTitle)
{
    var url ='../../../../../Fundation/EdushiAnnounce.aspx?id='+nID;
    this.Item = new OptionCardContrlBase.Item(this.Body,'EdushiAnnounce'+nID,sTitle,url,true,true);
    this.Item.ExpendOut = this.MinMax.bind(this,true);
    this.ItemsPanel.addItem(this.Item);
    this.Show();
}

/*--------------------------对外事件begin------------------*/
//加载完成公交
SearchResultControl.prototype.onBusDataLoad= function(arrBusData,isPandN)
{
    //alert('还未加载公交事件');
}
//加载完成本地搜索
SearchResultControl.prototype.onLocalDataLoad = function(arrLocalData,nBegin,nEnd)
{
    //alert('还未加载本地搜索事件')
}
//加载完成主题地图搜索
SearchResultControl.prototype.onClassDataLoad = function(arrClassData,nBegin,nEnd)
{
    //alert('还未加载主题地图事件')
}
//定位
SearchResultControl.prototype.onGoToXY= function(x,y)
{
    //alert('还未加载定位事件');
}
//推荐POP
SearchResultControl.prototype.onVouchClick= function(title,content,x,y)
{
    //alert('还未加载推荐POP事件');
}
//点击实体或企业
SearchResultControl.prototype.onEntityClick= function(oid,cid,x,y)
{
    //alert('还未加载实体或企业POP事件');
}
//主题泡泡点击
SearchResultControl.prototype.onThemeClick= function(tid,x,y)
{
    //alert('还未加载实体或企业POP事件');
}

/*--------------------------对外事件end------------------*/


/*--------------------------私有事件begin-------------------*/
SearchResultControl.prototype._busDataLoad= function(arrBusData,isPandN)
{
    this.onBusDataLoad(arrBusData,isPandN);
}
SearchResultControl.prototype._localDataLoad = function(arrLocalData,nBegin,nEnd)
{
    //alert(arrLocalData)
	this.onLocalDataLoad(arrLocalData,nBegin,nEnd);
//	for (var i=0; i<1; i++)
//    {
//		alert(i);
//	}
}
SearchResultControl.prototype._classDataLoad = function(arrClassData,nBegin,nEnd)
{
	this.onClassDataLoad(arrClassData,nBegin,nEnd);
}
SearchResultControl.prototype._gotoXY= function(x,y)
{
    this.onGoToXY(x,y);
}
//推荐POP
SearchResultControl.prototype._vouchClick= function(title,content,x,y)
{
    this.onVouchClick(title,content,x,y);
}
//实体POP
SearchResultControl.prototype._entityClick= function(oid,cid,x,y)
{
	//alert()
	this.onEntityClick(oid,cid,x,y);
}
//主题POP
SearchResultControl.prototype._themeClick= function(tid,x,y)
{
    this.onThemeClick(tid,x,y);
}
/*--------------------------私有事件end-------------------*/

/*测试加载选项卡*/
SearchResultControl.prototype.addItem= function(id,title,url,flag)
{
    this.Item = new OptionCardContrlBase.Item(this.Body,id,title,url,flag);
    this.ItemsPanel.addItem(this.Item);
    this.Show();
}

/*------------------------内部绑定事件begin-------------------------*/
/*页卡左移*/
SearchResultControl.prototype.ToLeft = function(e)
{
    for(var i=0;i<this.elementlist.length;i++)
    {
        if(this.elementlist[i].element==this.currentElement)
        {
            this.elementlist[i-1].activeItem();
            return;
        }
    }
}
/*页卡右移*/
SearchResultControl.prototype.ToRight = function(e)
{
    for(var i=0;i<this.elementlist.length;i++)
    {
        if(this.elementlist[i].element==this.currentElement)
        {
            this.elementlist[i+1].activeItem();
            return;
        }
    }
}
/*最大最小
IsActive:选项卡添加和激活时，当搜索结果控件最小化时展开搜索结果控件*/
SearchResultControl.prototype.MinMax=function(IsActive)
{
    var ani=Aladdincn.Web.Animation;
    if(IsActive)
    {
        
        if(!MContentsRoller.isExpanded())
        {
	        MContentsRoller.rollOut(ani.RollDirection.TopDown);
	    }
	}
	else
	{
	    if(!MContentsRoller.isExpanded())
	    {
	        MContentsRoller.rollOut(ani.RollDirection.TopDown);
        }
        else
        {
            MContentsRoller.rollIn(ani.RollDirection.BottomUp);
        }
    }
}
/*隐藏控件*/
SearchResultControl.prototype.Close=function(e)
{
    this.Hide();
    this.onBusDataLoad(null,1);
    this.onLocalDataLoad(null,0,0);
}
/*清除选项卡*/
SearchResultControl.prototype.Clear= function()
{
    this.ItemsPanel.clearItem();
    this.Hide();
}
/*------------------------内部绑定事件end-------------------------*/

/*************************************************
* 主题泡泡控件
* code by xzx ver1.0 update at 07-09-26
*************************************************/
var ThemePopControl = Class.create();
Object.extend(ThemePopControl.prototype, OptionCardContrlBase.prototype);  //继承基类

//重写基类载入模板方法
ThemePopControl.prototype._loadUI = function(){
    this.LoadUI('ThemePopControl');
};
//重写控件加载完毕后的事件
ThemePopControl.prototype._loadComplete= function()
{
    this.Body.contentWindow.window.PopControlForm = this;
    this.ItemsPanel = new OptionCardContrlBase.ItemsPanel(this.Body,'itemsPanel','cardContent');
    this.onLoadComplete(this);
};
ThemePopControl.prototype.ClearData = function(){
    this.$('Entr_Title').innerHTML=_Lloading[this.Config._L].replace('images/','../images/');
    this.$('Entr_Add').innerHTML=_Ladd[this.Config._L]+_Lloading[this.Config._L].replace('images/','../images/');
    this.$('Entr_Tell').innerHTML=_Ltel[this.Config._L]+_Lloading[this.Config._L].replace('images/','../images/');
    this.$('Entr_Edd').value='loading';
    this.$('Entr_img').src='../images/nophoto.jpg';
    this.$('Entr_img_a').href='javascript:;';
    this.$('Entr_img_a').target = '_self'; 
    //this.$('Entro_mark').onclick = function(){};
    //this.$('Entro_error').onclick = function(){};
    this.$('Entro_yp').style.display = 'none';
};

//显示主题泡泡
ThemePopControl.prototype.ShowThemePop = function(tid)
{
    if(this.TID==tid)
    {
        this.Show();
        return;
    }
    else
    {  
        this.TID = tid;
    }
    this.ItemsPanel.clearItem();
    this.ClearData();
    this.Show();
    var url= this.Config._DataCenterUrl + 'CommMap/CompanyInfo.aspx?node='+this.Config._Node+'&l='+this.Config._L+'&v=1.0&req=4&id='+tid;
    ENetwork.DownloadScript(url,this.LoadThemePopData.bindAsEventListener(this));
}

ThemePopControl.prototype.LoadThemePopData = function()
{
    if (typeof c == 'undefined' || c == null)
    {
        this.Hide();
        this.CID = '';
        return;
    }
    this.$('Entr_Title').innerHTML=c.CompanyName; 
    this.$('Entr_Add').innerHTML=_Ladd[this.Config._L]+c.ComAddress;
    this.$('Entr_Tell').innerHTML=_Ltel[this.Config._L]+c.ComPhone;
    //this.$('Entr_Edd').value='http://'+c.ComEaddress+'.'+this.Config._AppDomain;
	this.$('Entr_Edd').value='http://'+c.ComEaddress+'.kshot.net';
//    if (c.YPage.length > 0)
//    {
//        this.$('Entro_yp').style.display = 'block';
//        this.$('Entro_yp').href = c.YPage;
//        this.$('Entro_yp').target = '_blank'; 
//    }
    if(c.ComImage!=null&&c.ComImage!='')
    {
        this.$('Entr_img').src=this.Config._UpImagesUrl+'/'+this.Config._UpImages+'/'+c.ComImagePath+'/s'+c.ComImage; 
        this.$('Entr_img_a').href=this.Config._UpImagesUrl+'/'+this.Config._UpImages+'/'+c.ComImagePath+'/'+c.ComImage;  
        //this.$('Entr_img').onerror = this._LoadImgErr.bindAsEventListener(this.$('Entr_img'),'../images/nophoto.jpg');
        this.$('Entr_img_a').target ='_blank';
    }
    else
    {
        this.$('Entr_img_a').target ='_self';
    }
    this.$('Entr_close').onclick = this.Close.bindAsEventListener(this);
    //this.$('Entro_mark').onclick = this._sign.bindAsEventListener(this,c.ComX,c.ComY,c.CompanyName);
    //this.$('Entro_error').onclick = this._cavil.bindAsEventListener(this,2,c.ID,c.CompanyName,c.ComX,c.ComY);
    //搜索时直接点击对应
    //var bustransferurl = '../../../../../Fundation/BusTransfer.aspxe?x='+c.ComX +'&y='+c.ComY;
	var bustransferurl = '/Fundation/CompanyTransfer.asp?oid=' + o.ID;
    this.BusTransferItem = new OptionCardContrlBase.Item(this.Body,'bustransfer','公交换乘',bustransferurl,false,false,59);
    this.ItemsPanel.addItem(this.BusTransferItem);
    var nearbyurl = '../../../../../Fundation/NearBySearch.aspx?x='+c.ComX +'&y='+c.ComY;
    this.NearByItem = new OptionCardContrlBase.Item(this.Body,'nearby','查找周边',nearbyurl,false,false,59);
    this.ItemsPanel.addItem(this.NearByItem);
    var nearbusurl = '../../../../../Fundation/PeripheralBus.aspx?x='+c.ComX +'&y='+c.ComY;
    this.NearBusItem = new OptionCardContrlBase.Item(this.Body,'nearbus','周边公交',nearbusurl,false,false,59);
    this.NearBusItem.cardFrame.scrolling = 'auto';
    this.NearBusItem.cardFrame.style.height = '130px';
    this.ItemsPanel.addItem(this.NearBusItem);
    this.BusTransferItem.activeItem();
    this.onHistorySaved(3, c);
}


//内部事件
ThemePopControl.prototype.fnCopyCode = function (strUrl, msg){
	var txt = this.$(strUrl).value;
	fnCopyToClipboard(txt,msg);

	
}
//图像加载三次仍然失败则移除
ThemePopControl.prototype._LoadImgErr = function(e,imgpath){
    if(this.c=='undefined'||this.c==null){
        this.c=0;
    }
    else{
        this.c++;
    }
    if(this.c>3){
        if (this.src == imgpath)
        {
            return; //默认图片加载失败则不再触发 , ie7光设置 this.onerror=null; 无效
        }
        this.src=imgpath;
        this.onerror=null;
        this.parentNode.href = 'javascript:;';
        this.parentNode.target = '_self';
    }
    else{
        this.src=this.src;
    }
}
ThemePopControl.prototype.Close=function(e)
{
    this.Hide();
}

//对内接口
//公交ID，Name搜索公交线路的事件
ThemePopControl.prototype._sign = function(e,x,y,sName)
{
    this.onSign(x,y,sName)
};
//纠错事件
ThemePopControl.prototype._cavil = function(e,type,nID,sName,x, y)
{          
    this.onCavil(type,nID,sName,x, y);         
};
ThemePopControl.prototype._busIdSearch = function(nID,sName)
{   
    this.onBusIDSearch(nID,sName);                 
};
//从这里出发，如何到达这里公交搜索,action:1从怎么出发，2如何到达这里
ThemePopControl.prototype._busSEXYSearch = function(action,x,y,sKeyword)
{   
    this.onBusSEXYSearch(action,x,y,sKeyword);                 
};
//周边搜索的事件
ThemePopControl.prototype._nearbySearch = function(sKeyword,x,y,len)
{                   
    this.onLocalNearBySearch(sKeyword,x,y,len);
};
//对外接口
//标记该位置的事件
ThemePopControl.prototype.onSign = function(x,y,sName)
{
    alert('未实现标记方法');            
};
//纠错事件
ThemePopControl.prototype.onCavil = function(type,nID,sName,x, y)
{        
    alert('未实现纠错方法');          
};
//公交ID，Name搜索公交线路的事件
ThemePopControl.prototype.onBusIDSearch = function(nID,sName)
{                    
};
//从这里出发，如何到达这里公交搜索
ThemePopControl.prototype.onBusSEXYSearch = function(action,x,y,sKeyword)
{                    
};
//周边搜索的事件
ThemePopControl.prototype.onLocalNearBySearch = function(sKeyword,x,y,len)
{                   
};

ThemePopControl.prototype.onHistorySaved = function(type,spot){
};
/*************************************************
* 到这里搜索控件
* code by lzz ver1.0 update at 07-10-17
*************************************************/

var ToSearchControl = Class.create();
Object.extend(ToSearchControl.prototype, MapContrlBase.prototype);
ToSearchControl.prototype._loadUI = function(){
    this.LoadUI('ToSearchControl');
};

ToSearchControl.prototype.ShowToHereSearch = function(x, y){
    this.$('btnSearch').onclick = function(){
        this.onShowToHereSearch(this.$('popbusnametxt1').value, x, y);
    }.bindAsEventListener(this);
    this.Show();
};

//重载控件加载完毕后的事件
ToSearchControl.prototype._loadComplete= function(){
    this.Body.contentWindow.ToSearchControl = this;
    this.onLoadComplete(this);
};

//到这里事件 , keyword：来源地
ToSearchControl.prototype.onShowToHereSearch = function(keyword, x, y){
};


