﻿var _EntityPopControl;          //实体Pop
var _CompanyPopControl;         //企业Pop
var _EShopPopControl;           //E店Pop
var _BusStationControl;         //公交Pop
var _ThemePopControl;           //主题Pop
var _CommendPopControl;         //推荐Pop
var _DzcxPopControl;            //打折促销pop
var _FromSearchControl;         //这里出发Pop
var _ToSearchControl;           //到达这里Pop
var _HudongPopControl;
var _MapNewsPopControl;         //地图新闻

//初始化Pop
function fnInitPopControl() {
    //初始化实体Pop
    initEntityPop();
    initCompanyPop();
    initEShopPop();
    initThemePop();
    initCommendPop();
    //初始化打折促销pop
    //initDzcxPop();
    //initHudongPop();
    initMapNews();
}

//地图新闻Pop
function fnShowMapNewsPop(id, x, y) {
    MoveTo(x * 1, y * 1, true);
    //MoveTo(x * 1 + vM.GetMapPos(170), y * 1, true);
    vM.moveEntity(_MapNewsPopControl.ID, x * 1, y * 1);
    //debugger;
    _MapNewsPopControl.ShowPop(id);
}
//显示打折促销pop
function fnShowDzcxPop(id, x, y) {
    MoveTo(x * 1 + vM.GetMapPos(170), y * 1, true);
    vM.moveEntity(_DzcxPopControl.ID, x * 1, y * 1);
    _DzcxPopControl.ShowPop(id);
}
//显示互动pop
function fnShowHuDongPop(id, x, y) {
    MoveTo(x * 1 + vM.GetMapPos(170), y * 1, true);
    vM.moveEntity(_HudongPopControl.ID, x * 1, y * 1);
    _HudongPopControl.ShowPop(id);
}

function initEntityPop() {
    if (!_EntityPopControl) {
        _EntityPopControl = new EntityPopControl(vM.Body.document);
        _EntityPopControl.ID = vM.appendEntity(_EntityPopControl.Body, _PopLayer, false, 0, 0, 352, 210, 0, 121, false);
        _EntityPopControl.onLoadComplete = function() {
            fnGetPositionByOID();
            fnEaddGoto('');
            //绑定实体点击事件
            vM.onSpotClick = function(spot) {
                if (!_IsBeginSelectMark) {
                    fnShowEntityPop(spot.ID, spot.CenterX * 1, spot.CenterY * 1);
                }
            };
            vM.onSpotLabelClick = function(spot) {
                if (!_IsBeginSelectMark) {
                    fnShowEntityPop(spot.ID, spot.CenterX * 1, spot.CenterY * 1);
                }
            };
            vM.onSignClick = function(sign) {
                switch (sign.SortKey) {
                    case 'bus':
                        fnShowBusStation(sign.ID, sign.Title, vM.PointerX(), vM.PointerY());
                        break;
                    case 'vir':
                        window.open(GlobalConfig.WebRootPath + 'Vir/Vir.aspx?Image=' + escape(sign.Url), 'vir', 'width=520,height=400');
                        break;
                }
            };
            vM.onContextMenuClick = function(key, wx, wy, mx, my, spot) {
                switch (key) {
                    case 'spot':
                        if (spot) {
                            fnShowEntityPop(spot.ID, spot.CenterX, spot.CenterY);
                        }
                        break;
                    case 'center':
                        vM.MoveTo(mx, my, true);
                        break;
                    case 'zoomout':
                        vM.FlatZoom(vM.Zoom() + 1);
                        break;
                    case 'zoomin':
                        vM.FlatZoom(vM.Zoom() - 1);
                        break;
                    case 'start':
                        if (spot) {
                            fnShowFromHereSearch(spot.Title);
                        }
                        else {
                            fnShowFromHereSearch('');
                        }
                        break;
                    case 'end':
                        if (spot) {
                            fnShowToHereSearch(spot.Title);
                        }
                        else {
                            fnShowToHereSearch('');
                        }
                        break;
                    case 'cirbus':
                        if (spot) {
                            fnShowPeripheralBus(spot.CenterX, spot.CenterY, spot.Title);
                        }
                        else {
                            fnShowPeripheralBus(vM.PointerX(), vM.PointerY(), '');
                        }
                        break;
                    case 'cirsearch':
                        if (spot) {
                            fnShowPeripheralSearch(spot.CenterX, spot.CenterY, spot.Title);
                        }
                        else {
                            fnShowPeripheralSearch(vM.PointerX(), vM.PointerY(), '');
                        }
                        break;
                    case 'errors':
                        if (spot) {
                            fnShowDebugControl(vM.PointerX(), vM.PointerY(), spot.ID, spot.Title, 0);
                        }
                        else {
                            fnShowDebugControl(vM.PointerX(), vM.PointerY(), 0, '', 2);
                        }
                        break;
                    case 'sign':
                        if (spot) {
                            _Mark.Add(vM.PointerX(), vM.PointerY(), spot.Title);
                        }
                        else {
                            _Mark.Add(vM.PointerX(), vM.PointerY(), '');
                        }
                        break;
                    case 'about':
                        fnShowMessageBox('关于南昌之窗', '江西图讯信息科技有限公司<br />');
                        break;
                }
            }
        };
        _EntityPopControl.onCavil = function(x, y, id, name) {
            //重写纠错事件
            fnShowDebugControl(x * 1, y * 1, id, name, 0);
        };
        _EntityPopControl.onCompanyList = function(oid, ocname) {
            fnOpenTab();
            var tab = new TabControl.Tab(document, 'companyList', ocname, GlobalConfig.NewSkinPath + 'Fundation/CompanyList.html?ocname=' + escape(ocname) + '&oid=' + oid, true, true, 80);
            fnAddTab(tab);
        };
        _EntityPopControl.onBusTransfer = function(x, y, name) {
            fnShowBusTransfer(x, y, name);
        };
        _EntityPopControl.onNearBySearch = function(x, y, oname) {
            fnShowPeripheralSearch(x, y, oname);
        };
        _EntityPopControl.onNearByBus = function(x, y, oname) {
            fnShowPeripheralBus(x, y, oname);
        }
    }
}
function initCompanyPop() {
    //初始化企业POP
    if (!_CompanyPopControl) {
        _CompanyPopControl = new CompanyPopControl(vM.Body.document);
        _CompanyPopControl.ID = vM.appendEntity(_CompanyPopControl.Body, _PopLayer, false, 0, 0, 352, 210, 0, 121, false);
        _CompanyPopControl.onLoadComplete = function() {
            //加载完调用企业Pop定位方法
            fnGetPositionByCID();
            fnEaddGoto('');

        };
        _CompanyPopControl.onCavil = function(x, y, id, name) {
            //重写纠错事件
            fnShowDebugControl(x * 1, y * 1, id, name, 1);
        };
        _CompanyPopControl.onBusTransfer = function(x, y, oname) {
            fnShowBusTransfer(x, y, oname);
        };
        _CompanyPopControl.onNearBySearch = function(x, y, oname) {
            fnShowPeripheralSearch(x, y, oname);
        };
        _CompanyPopControl.onNearByBus = function(x, y, oname) {
            fnShowPeripheralBus(x, y, oname);
        }
    }
}
function initEShopPop() {
    //初始化E店Pop
    if (!_EShopPopControl) {
        _EShopPopControl = new EShopPopControl(vM.Body.document);
        _EShopPopControl.ID = vM.appendEntity(_EShopPopControl.Body, _PopLayer, false, 0, 0, 352, 210, 0, 121, false);
        _EShopPopControl.onLoadComplete = function() {
            fnGetPositionByEID();
        };
        _EShopPopControl.onCavil = function(x, y, id, name) {
            fnShowDebugControl(x * 1, y * 1, id, name, 1);
        };
        _EShopPopControl.onBusTransfer = function(x, y, oname) {
            fnShowBusTransfer(x, y, oname);
        };
        _EShopPopControl.onNearBySearch = function(x, y, oname) {
            fnShowPeripheralSearch(x, y, oname);
        };
        _EShopPopControl.onNearByBus = function(x, y, oname) {
            fnShowPeripheralBus(x, y, oname);
        }
    }
}
function initThemePop() {
    if (!_ThemePopControl) {
        _ThemePopControl = new ThemePopControl(vM.Body.document);
        _ThemePopControl.ID = vM.appendEntity(_ThemePopControl.Body, _PopLayer, false, 0, 0, 352, 210, 0, 121, false);
        _ThemePopControl.onLoadComplete = function() {
            fnGetPositionByTID();
        };
        _ThemePopControl.onCavil = function(x, y, id, name) {
            fnShowDebugControl(x * 1, y * 1, id, name, 1);
        };
        _ThemePopControl.onBusTransfer = function(x, y, oname) {
            fnShowBusTransfer(x, y, oname);
        };
        _ThemePopControl.onNearBySearch = function(x, y, oname) {
            fnShowPeripheralSearch(x, y, oname);
        };
        _ThemePopControl.onNearByBus = function(x, y, oname) {
            fnShowPeripheralBus(x, y, oname);
        }
    }
}
function initCommendPop() {
    if (!_CommendPopControl) {
        _CommendPopControl = new CommendPopControl(vM.Body.document);
        _CommendPopControl.ID = vM.appendEntity(_CommendPopControl.Body, _PopLayer, false, 0, 0, 352, 210, 0, 121, false);
    }
}
//初始化打折促销pop
function initDzcxPop() {
    if (!_DzcxPopControl) {
        _DzcxPopControl = new DzcxPopControl(vM.Body.document);
        _DzcxPopControl.ID = vM.appendEntity(_DzcxPopControl.Body, _PopLayer, false, 0, 0, 352, 210, 0, 121, false);
        _DzcxPopControl.onLoadComplete = function() {
            //加载完调用企业Pop定位方法
            fnGetPositionByGID();
        };
        _DzcxPopControl.onCavil = function(x, y, id, name) {
            //重写纠错事件
            fnShowDebugControl(x * 1, y * 1, id, name, 1);
        };
        _DzcxPopControl.onBusTransfer = function(x, y, oname) {
            fnShowBusTransfer(x, y, oname);
        };
        _DzcxPopControl.onNearBySearch = function(x, y, oname) {
            fnShowPeripheralSearch(x, y, oname);
        };
        _DzcxPopControl.onNearByBus = function(x, y, oname) {
            fnShowPeripheralBus(x, y, oname);
        }
    }
}
function initHudongPop() {
    if (!_HudongPopControl) {
        _HudongPopControl = new HudongPopControl(vM.Body.document);
        _HudongPopControl.ID = vM.appendEntity(_HudongPopControl.Body, _PopLayer, false, 0, 0, 452, 360, 0, 153, false);
        _HudongPopControl.onLoadComplete = function() {
            //加载完调用企业Pop定位方法
            fnGetPositionByHID();
        };
    }
}
//初始化地图新闻pop
function initMapNews() {
    if (!_MapNewsPopControl) {
        _MapNewsPopControl = new MapNewsPopControl(vM.Body.document);
        _MapNewsPopControl.ID = vM.appendEntity(_MapNewsPopControl.Body, _PopLayer, false, 0, 0, 282, 210, 141, 105, false);
        _MapNewsPopControl.onLoadComplete = function() {
            //加载完调用企业Pop定位方法
            //fnGetPositionByHID();
        };
    }
}

//房产出售列表显示
function showhouse_salelisttip(x, y, z, sale_title, sale_img, sale_url, sale_village, sale_address, sale_room, sale_unitprice, sale_currentfloor, sale_totalfloor, sale_price, sale_acreage) {
if(sale_title!=null&&sale_title.length>12)
	{
	sale_title=sale_title.substring(0,12);
	}
    if (x != null && x != "") {

        var MyDiv;

        MyDiv = vEdushiMap.$C("div");
        MyDiv.id = "MyDiv";


        var mystr2 = "<div style='float:left;width:282px;'>";
        mystr2 += "<div style='border:solid 1px ;display:black;background-color:yellow;color:black;height:19px;line-height:19px;float:left;padding-left:3px;padding-right:3px;'><a href='" + sale_url + "' style='cursor:hand;' target='_blank'>" + sale_title + "</a></div>";
        mystr2 += "<div style='float:left;color:red;width:60px;text-align:center;height:19px;line-height:19px;filter: glow(color=#FFFF33,strength=3);'>售 ￥" + sale_unitprice + "</div>";
        mystr2 += "<div style='float:left;width:282px;height:10px;background-image: url(" + "http://map.nc0791.cn/yp/images/left3.png" + ");background-repeat:no-repeat; margin-left:15px;margin-top:-1px;'></div>";
        mystr2 += "</div>";
        MyDiv.innerHTML = mystr2;
        vEdushiMap.appendEntity(MyDiv, _PopLayer, false, x, y, 282, 28, 15, 28, false);
        //vEdushiMap.appendEntity(MyDiv, _PopLayer, false, x, y, 24, 30, 0, 25, false);
    }
}
function closesalediv() {
    if (vEdushiMap.$("MyDiv_sale")) {
        var MyDiv = vEdushiMap.$("MyDiv_sale");
        MyDiv.innerHTML = "";
    }
}
//房产出售单点显示
function showhouse_salesingletip(x, y, z, sale_title, sale_img, sale_url, sale_village, sale_address, sale_room, sale_unitprice, sale_currentfloor, sale_totalfloor, sale_price, sale_acreage) {
if(sale_title!=null&&sale_title.length>12)
	{
	sale_title=sale_title.substring(0,12);
	}
	if(sale_address!=null&&sale_address.length>14)
	{
	sale_address=sale_address.substring(0,14);
	}
    if (x != null && x != "" && x != "null") {

        var MyDiv;
        if (!vEdushiMap.$("MyDiv_sale")) {
            MyDiv = vEdushiMap.$C("div");
            MyDiv.id = "MyDiv_sale";
        }
        else {
            MyDiv = vEdushiMap.$("MyDiv_sale");
            MyDiv.innerHTML = "";
        }
        var mystr2 = "<div style='float:left;width:300px;height:271px;background-image: url(" + "http://www.nc0791.cn/map/map/images/house_bg.png" + ");'>";
        mystr2 += "<div style='float:left;width:260px;height:40px;margin-left:20px;text-align:left; vertical-align:middle; line-height:40px;font-size:14px;font-weight:900;'>" + sale_title + "</div><img src='http://www.nc0791.cn/map/map/images/CloseBtn_house.gif' style='float:left;width:13px;height:13px;line-height:13px;vertical-align:middle;margin-top:6px;cursor:hand;' onclick=\"javascript:document.getElementById('MyDiv_sale').innerHTML='';\" />";
        mystr2 += "<div style='float:left;width:280px;height:40px;margin-left:10px;'>";
        mystr2 += "<div style='float:left;width:84px;height:57px;border:solid 1px #CBCDCC;padding:2px;'><img style='width:84px;height:57px;' src='http://www.nc0791.cn/" + sale_img + "' /></div>";
        mystr2 += "<div style='float:left;height:57px;line-height:19px;padding-left:20px;color:#FF7200'>" + sale_address + "<br />" + (sale_acreage == "" ? "未知  " : (sale_acreage + "M²  ")) + (sale_price == "" ? "面议" : (sale_price + "万")) + "<br /><a href='http://www.nc0791.cn/" + sale_url + "' style='cursor:hand;color:#FF7200;' target='_blank'>详细信息</a></div>";
        mystr2 += "</div>";
        mystr2 += "<div style='float:left;width:280px;height:1px;margin-left:10px;margin-top:2px;border-bottom:dotted 1px #505050;diplay:block;font-size:1px;'></div>";
        mystr2 += "<div style='float:left;width:280px;height:90px;margin-left:10px;margin-top:4px;border:solid 1px #CCCCCC;background-color:#F2F2F2;'>";
        mystr2 += "<span style='float:left;margin-left:10px;width:270px;height:29px;line-height:29px;text-align:left;vertical-align:middle;'>户型：" + sale_room + "</span>";
        mystr2 += "<span style='float:left;margin-left:10px;width:270px;height:29px;line-height:29px;text-align:left;vertical-align:middle;'>单价：" + (sale_unitprice == "" ? "面议" : (sale_unitprice + "元/平米")) + "</span>";
        mystr2 += "<span style='float:left;margin-left:10px;width:270px;height:29px;line-height:29px;text-align:left;vertical-align:middle;'>楼层：" + sale_currentfloor + "/" + sale_totalfloor + "层</span>";

        mystr2 += "</div>";
        mystr2 += "</div>";
        MyDiv.innerHTML = mystr2;
        vEdushiMap.appendEntity(MyDiv, _PopLayer, false, x, y, 300, 271, 35, 271, false);
//        if (z > -1 && z < 5 && z != "" && z != null) {
//            vEdushiMap.FlatZoom(z);
//        }
        vEdushiMap.MoveTo(x, y, true);
        //vEdushiMap.appendEntity(MyDiv, _PopLayer, false, x, y, 24, 30, 0, 25, false);
    }
}
//显示出租单点
function showsinglehousehire(x, y, z, subject, village, address, room, currentfloor, totalfloor, price, acreage, thumb, url) {
if(subject!=null&&subject.length>12)
	{
	subject=subject.substring(0,12);
	}
	if(address!=null&&address.length>14)
	{
	address=address.substring(0,14);
	}
    if (x != null && x != "" && x != "null") {

        var MyDiv;
        if (!vEdushiMap.$("MyDiv_sale")) {
            MyDiv = vEdushiMap.$C("div");
            MyDiv.id = "MyDiv_sale";
        }
        else {
            MyDiv = vEdushiMap.$("MyDiv_sale");
            MyDiv.innerHTML = "";
        }
        var mystr2 = "<div style='float:left;width:300px;height:271px;background-image: url(" + "http://www.nc0791.cn/map/map/images/house_bg.png" + ");z-index:999;'>";
        mystr2 += "<div style='float:left;width:260px;height:40px;margin-left:20px;text-align:left; vertical-align:middle; line-height:40px;font-size:14px;font-weight:900;'>" + subject + "</div><img src='http://www.nc0791.cn/map/map/images/CloseBtn_house.gif' style='float:left;width:13px;height:13px;line-height:13px;vertical-align:middle;margin-top:6px;cursor:hand;' onclick=\"javascript:document.getElementById('MyDiv_sale').innerHTML='';\" />";
        mystr2 += "<div style='float:left;width:280px;height:40px;margin-left:10px;'>";
        mystr2 += "<div style='float:left;width:84px;height:57px;border:solid 1px #CBCDCC;padding:2px;'><img style='width:84px;height:57px;' src='http://www.nc0791.cn/" + thumb + "' /></div>";
        mystr2 += "<div style='float:left;height:57px;line-height:19px;padding-left:20px;color:#FF7200'>" + address + "<br />" + (acreage == "" ? "未知  " : (acreage + "M²  ")) + (price == "" ? "面议" : (price + "元/月")) + "<br /><a href='http://www.nc0791.cn/" + url + "' style='cursor:hand;color:#FF7200;' target='_blank'>详细信息</a></div>";
        mystr2 += "</div>";
        mystr2 += "<div style='float:left;width:280px;height:1px;margin-left:10px;margin-top:2px;border-bottom:dotted 1px #505050;diplay:block;font-size:1px;'></div>";
        mystr2 += "<div style='float:left;width:280px;height:90px;margin-left:10px;margin-top:4px;border:solid 1px #CCCCCC;background-color:#F2F2F2;'>";
        mystr2 += "<span style='float:left;margin-left:10px;width:270px;height:29px;line-height:29px;text-align:left;vertical-align:middle;'>户型：" + room + "</span>";
        mystr2 += "<span style='float:left;margin-left:10px;width:270px;height:29px;line-height:29px;text-align:left;vertical-align:middle;'>小区：" + village + "</span>";
        mystr2 += "<span style='float:left;margin-left:10px;width:270px;height:29px;line-height:29px;text-align:left;vertical-align:middle;'>楼层：" + currentfloor + "/" + totalfloor + "层</span>";

        mystr2 += "</div>";
        mystr2 += "</div>";
        MyDiv.innerHTML = mystr2;
        vEdushiMap.appendEntity(MyDiv, _PopLayer, false, x, y, 300, 271, 35, 271, false);
//        if (z > -1 && z < 5 && z != ""&&z!=null) {
//            vEdushiMap.FlatZoom(z);
//        }
        vEdushiMap.MoveTo(x, y, true);
        //vEdushiMap.appendEntity(MyDiv, _PopLayer, false, x, y, 24, 30, 0, 25, false);
    }
}
//显示单个楼盘
function showsinglenewhouse(x, y, z, hid, title, status, area, plate, address, saletele, aveprice, url, logo) {
    if(title!=null&&title.length>12)
	{
	title=title.substring(0,12);
	}
	if (x != null && x != ""&&x!="null") {

        var MyDiv;
        if (!vEdushiMap.$("MyDiv_sale")) {
            MyDiv = vEdushiMap.$C("div");
            MyDiv.id = "MyDiv_sale";
        }
        else {
            MyDiv = vEdushiMap.$("MyDiv_sale");
            MyDiv.innerHTML = "";
        }
        if (status == 1) {
            status = "新房";
        }
        else if (status == 2) {
            status = "在售";
        }
        else if (status == 3) {
            status = "尾盘";
        }
        else if (status == 4) {
        status = "售空";
        }
        var mystr2 = "<div style='float:left;width:300px;height:271px;background-image: url(" + "http://www.nc0791.cn/map/map/images/house_bg.png" + ");z-index:999;'>";
        mystr2 += "<div style='float:left;width:260px;height:40px;margin-left:20px;text-align:left; vertical-align:middle; line-height:40px;font-size:14px;font-weight:900;'>" + title + "</div><img src='http://www.nc0791.cn/map/map/images/CloseBtn_house.gif' style='float:left;width:13px;height:13px;line-height:13px;vertical-align:middle;margin-top:6px;cursor:hand;' onclick=\"javascript:document.getElementById('MyDiv_sale').innerHTML='';\" />";
        mystr2 += "<div style='float:left;width:280px;height:40px;margin-left:10px;'>";
        mystr2 += "<div style='float:left;width:84px;height:57px;border:solid 1px #CBCDCC;padding:2px;'><img style='width:84px;height:57px;' src='http://www.nc0791.cn/" + logo + "' /></div>";
        mystr2 += "<div style='float:left;height:57px;line-height:19px;padding-left:20px;color:#FF7200'>" + area + plate + "<br />均价：" + (aveprice == "" ? "未知" : (aveprice + "元/平米")) + "<br /><a href='http://www.nc0791.cn/" + url + "' style='cursor:hand;color:#FF7200;' target='_blank'>详细信息</a></div>";
        mystr2 += "</div>";
        mystr2 += "<div style='float:left;width:280px;height:1px;margin-left:10px;margin-top:2px;border-bottom:dotted 1px #505050;diplay:block;font-size:1px;'></div>";
        mystr2 += "<div style='float:left;width:280px;height:90px;margin-left:10px;margin-top:4px;border:solid 1px #CCCCCC;background-color:#F2F2F2;'>";
        mystr2 += "<span style='float:left;margin-left:10px;width:270px;height:29px;line-height:29px;text-align:left;vertical-align:middle;'>地址：" + address + "</span>";
        mystr2 += "<span style='float:left;margin-left:10px;width:270px;height:29px;line-height:29px;text-align:left;vertical-align:middle;'>热线：" + saletele + "</span>";
        mystr2 += "<span style='float:left;margin-left:10px;width:270px;height:29px;line-height:29px;text-align:left;vertical-align:middle;'>状态：" + status + "</span>";

        mystr2 += "</div>";
        mystr2 += "</div>";
        MyDiv.innerHTML = mystr2;
        vEdushiMap.appendEntity(MyDiv, _PopLayer, false, x, y, 300, 271, 35, 271, false);
//        if (z > -1 && z < 5 && z != "" && z != null) {
//            vEdushiMap.FlatZoom(z);
//        }
        vEdushiMap.MoveTo(x, y, true);
    }
}
//在地图上显示全部楼盘
function showphpwindnewhouse() {
    var Digital = new Date();
    Digital = Digital + 40000;
    //var url = "http://www.nc0791.cn/map/map/imagerequest.aspx?action=phpwindqueryCompany&kw=" + mysearchstr + "&pagenum=" + pagenum + "&k=" + Digital;
    var url = "http://www.nc0791.cn/map/map/imagerequest.aspx?action=getphpnewhouse&k=" + Digital;
    xmlHttp = GetXmlHttpObject(edushiphpwindhousequery);
    xmlHttp.open("POST", url, true);
    xmlHttp.send(null);
}
//查询请求后事件
function edushiphpwindhousequery() {
    if (xmlHttp.readyState == 4 || xmlHttp.readyState == "complete") {
        if (xmlHttp.responseText == "") {
            return;
        }
        else {
            var str = xmlHttp.responseText;
            hiddenunitpoint();
			hiddenztfpop();
			showphphousetip(str);
			
            //ztf加 获取竞拍数据
            //showphpwindalljp();
        }
    }
}
//房产出售列表显示
function showphphousetip(str) {
    var str1 = str.split("_");
    if (str1.length > 0) {
        for (var i = 0; i < str1.length; i++) {
            var str2 = str1[i].split("|");
            var divid = "MyDiv";
            var x = str2[1];
            var y = str2[2];
            var sale_title = str2[4];
			if(sale_title!=null&&sale_title.length>16)
			{
			sale_title=sale_title.substring(0,16);
			}
            var sale_type = str2[5];
            var sale_price = str2[6];
            var sale_url = str2[7];
            if (sale_type == "新") {
                divid += "_new" + str2[0];
            }
            else if (sale_type == "售") {
                divid += "_sale" + str2[0];
            }
            else if (sale_type == "租") {
              divid += "_hire" + str2[0];
            }
            if (x != null && x != "" && x != "null") {
                var MyDiv;
                MyDiv = vEdushiMap.$C("div");
                MyDiv.id = divid;
                var mystr2 = "<div style='float:left;width:282px;'onmouseover='javascript:this.parentNode.style.zIndex=990' onmouseout='javascript:this.parentNode.style.zIndex=0'>";
                mystr2 += "<div style='border:solid 1px ;display:black;background-color:yellow;color:black;height:19px;line-height:19px;float:left;padding-left:3px;padding-right:3px;'><a href='" + sale_url + "' style='cursor:hand;' target='_blank'>" +  (sale_title.length > 15 ? sale_title.substring(0, 15) : (sale_title + "..."))+ "</a></div>";
                mystr2 += "<div style='float:left;color:red;width:60px;text-align:center;height:19px;line-height:19px;filter: glow(color=#FFFF33,strength=3);'>" + sale_type + sale_price + "</div>";
                mystr2 += "<div style='float:left;width:282px;height:10px;background-image: url(" + "http://map.nc0791.cn/yp/images/left3_2.png" + ");background-repeat:no-repeat; margin-left:15px;margin-top:-1px;'></div>";
                mystr2 += "</div>";
                MyDiv.innerHTML = mystr2;
                vEdushiMap.appendEntity(MyDiv, _PopLayer, false, x, y, 282, 28, 15, 28, false);
            }
        }
    }
}
//在地图上显示所有竞拍标签
function showphpwindalljp() {
    var Digital = new Date();
    Digital = Digital + 40000;
    //var url = "http://www.nc0791.cn/map/map/imagerequest.aspx?action=phpwindqueryCompany&kw=" + mysearchstr + "&pagenum=" + pagenum + "&k=" + Digital;
    var url = "http://www.nc0791.cn/map/map/imagerequest.aspx?action=getphpalljp&k=" + Digital;
    xmlHttp = GetXmlHttpObject(edushiphpwindalljp);
    xmlHttp.open("POST", url, true);
    xmlHttp.send(null);
}
//查询请求后事件
function edushiphpwindalljp() {
    if (xmlHttp.readyState == 4 || xmlHttp.readyState == "complete") {
        if (xmlHttp.responseText == "") {
            return;
        }
        else {
            var str = xmlHttp.responseText;
        }
		hiddenunitpoint();
			hiddenztfpop();
        //开始加载竟拍
        showphpjptip(str);
    }
}
//竟拍列表显示
function showphpjptip(str) {
    var str1 = str.split("_");
    if (str1.length > 0) {
        for (var i = 0; i < str1.length; i++) {
            var str2 = str1[i].split("|");
            var divid = "MyDiv";
            var x = str2[1];
            var y = str2[2];
            var gid = str2[0];
            var jptitle = str2[3];
			if(jptitle!=null&&jptitle.length>16)
			{
			jptitle=jptitle.substring(0,16);
			}
            var jptype = str2[4];
            if (jptype == "1") {
                divid += "_jp" + str2[0];
            }
            else {
                divid += "_ykj" + str2[0];
            }
           
            if (x != null && x != "" && x != "null") {
                var MyDiv;
                MyDiv = vEdushiMap.$C("div");
                MyDiv.id = divid;
                var mystr3 = "<div style='float:left;width:282px;height:30px;' onmouseover='javascript:this.parentNode.style.zIndex=990' onmouseout='javascript:this.parentNode.style.zIndex=0'>";
                mystr3 += "<div style='float:left;margin-left:5px;height:30px;width:20px;background-image:url(http://www.nc0791.cn/map/map/images/jptips2.png);background-repeat:norepeat;background-positon:bottom;'>";
                mystr3 += "</div>"
                mystr3 += "<div style='border-top:solid 1px #4693BD;border-bottom:solid 1px #4693BD;border-right:solid 1px #4693BD;display:black;color:#4693BD;height:19px;line-height:19px;float:left;background-color:#FFFFFF;overflow:hidden:display:block;float:left;'>";
                if (jptype == 1) {
                    mystr3 += "<a href='javascript:;' style='cursor:hand;margin-left:2px;overflow:hidden:text-overflow:ellipsis;white-space:nowrap;word-break:keep-all;max-width:258px;height:19px;display:block;float:left;'  onclick='javascript:parent.showjingpaisigle("+gid+","+x+","+y+")' >[抽奖]" + (jptitle.length > 15 ? jptitle.substring(0, 15) : (jptitle + "...")) + "</a>";
                }
                else {
                    mystr3 += "<a href='javascript:;' style='cursor:hand;margin-left:2px;overflow:hidden:text-overflow:ellipsis;white-space:nowrap;word-break:keep-all;max-width:258px;height:19px;display:block;float:left;'  onclick='javascript:parent.showjingpaisigle(" + gid + "," + x + "," + y + ")' >[竟拍]" + (jptitle.length > 15 ? jptitle.substring(0, 15) : (jptitle + "...")) + "</a>";
                }
                mystr3 += "</div>";
                mystr3 += "</div>";
                MyDiv.innerHTML = mystr3;
                vEdushiMap.appendEntity(MyDiv, _PopLayer, false, x, y, 282, 30, 15, 30, false);
            }
        }
    }
}
//显示单个竟拍
function showjingpaisigle(gid, x, y) {
    if (x != null && x != "" && x != "null") {

        var MyDiv;
        if (!vEdushiMap.$("MyDiv_sale")) {
            MyDiv = vEdushiMap.$C("div");
            MyDiv.id = "MyDiv_sale";
        }
        else {
            MyDiv = vEdushiMap.$("MyDiv_sale");
            MyDiv.innerHTML = "";
        }
        var mystr2 = "<div style='float:left;width:320px;height:300px;background-image: url(" + "http://www.nc0791.cn/map/map/images/jp_bg2.png" + ");z-index:999;'>";
        mystr2 += "<div style='z-index:999;'><iframe id='iframe_jingpai' name='iframe_jingpai' scroll='no' src='http://www.nc0791.cn/hack_mini.php?H_name=auction&action=detailmap&aid=" + gid + "' style='display:block; width:310px; height:235px; margin-left:5px;margin-top:10px;margin-right:5px; padding:0px; border-width:0px;' frameborder='0'></iframe></div>";
        mystr2 += "<div style='width:13px;height:13px;z-index:999;position:absolute; top:5px; left:300px;'><img src='http://www.nc0791.cn/map/map/images/CloseBtn_house.gif' style='float:left;width:13px;height:13px;line-height:13px;vertical-align:middle;margin-top:6px;cursor:hand;' onclick=\"javascript:document.getElementById('MyDiv_sale').innerHTML='';\" /></div>"
        mystr2 += "</div>";
        MyDiv.innerHTML = mystr2;
        vEdushiMap.appendEntity(MyDiv, _PopLayer, false, x, y, 320, 300, 35, 300, false);
        vEdushiMap.MoveTo(x, y-120, true);
    }
}
//显示新房楼盘
function phpwindshownewhouse(ztfflag)
{
var Digital = new Date();
    Digital = Digital + 40000;
    //var url = "http://www.nc0791.cn/map/map/imagerequest.aspx?action=phpwindqueryCompany&kw=" + mysearchstr + "&pagenum=" + pagenum + "&k=" + Digital;
    var url ="";
	if(ztfflag=="list_mini")
	{
	url="http://www.nc0791.cn/map/map/phpwindrequest.aspx?action=getphpnewhouse&k=" + Digital;
	xmlHttp = GetXmlHttpObject(edushiphpwindhousequery);
    xmlHttp.open("POST", url, true);
    xmlHttp.send(null);
	}
	else if(ztfflag=="sale")
	{
	url="http://www.nc0791.cn/map/map/phpwindrequest.aspx?action=getphpsalehouse&k=" + Digital;
	xmlHttp = GetXmlHttpObject(edushiphpwindhousequery);
    xmlHttp.open("POST", url, true);
    xmlHttp.send(null);
	}
	else if(ztfflag=="hire")
	{
	url="http://www.nc0791.cn/map/map/phpwindrequest.aspx?action=getphphirehouse&k=" + Digital;
	xmlHttp = GetXmlHttpObject(edushiphpwindhousequery);
    xmlHttp.open("POST", url, true);
    xmlHttp.send(null);
	}
	
    
}
//隐藏单位点
function hiddenunitpoint()
{
if (vEdushiMap.$("icon"))
 {
 vEdushiMap.$("icon").innerHTML="";
 }
 
}
//隐藏竞拍和楼盘
function hiddenztfpop()
{
 if (vEdushiMap.$("pop"))
 {
 var myztfpop=vEdushiMap.$("pop");
 if(myztfpop.childNodes)
 {
 var aDiv = [];
 for(var i=0; i<myztfpop.childNodes.length; i++){
  if(myztfpop.childNodes[i].nodeType != 1){
   continue; 
  }
  aDiv.push(myztfpop.childNodes[i]); 
 }
 for(var i=0; i<aDiv.length; i++){
  //alert(aDiv[i].id);
  if(aDiv[i].id.indexOf("MyDiv_")>-1)
  {
  aDiv[i].innerHTML="";
  }
 }

 }
 }
}
