var moneyUnit = "万"; function searchTopicType(topicType) { if (topicType == "broker") { document.getElementById("searchHouseInfo").style.display = "none"; document.getElementById("searchBrokerInfo").style.display = ""; } if (topicType == 0) { switchprop('TopicType_Value','二手房','TopicType_List','TopicType','0'); } if (topicType == 1) { switchprop('TopicType_Value','租房','TopicType_List','TopicType','1'); } } function switchprop(ValueInputName,ValueText,ListInputName,HiddenInputName,HiddenInputValue) { switchprop(ValueInputName,ValueText,ListInputName,HiddenInputName,HiddenInputValue,'',''); } function switchprop(ValueInputName,ValueText,ListInputName,HiddenInputName1,HiddenInputValue1,HiddenInputName2,HiddenInputValue2) { document.getElementById(ValueInputName).innerHTML = ValueText; document.getElementById(ListInputName).style.display = "none"; if (document.getElementById(HiddenInputName1) != null) document.getElementById(HiddenInputName1).value = HiddenInputValue1; if (document.getElementById(HiddenInputName2) != null) document.getElementById(HiddenInputName2).value = HiddenInputValue2; if (ValueText == "租房") { if (document.getElementById("HouseMoney_Value") != null) document.getElementById("HouseMoney_Value").innerHTML = "租金"; if (document.getElementById("HouseMoneyMin") != null) document.getElementById("HouseMoneyMin").value = ""; if (document.getElementById("HouseMoneyMax") != null) document.getElementById("HouseMoneyMax").value = ""; ShowHidePropDiv(1); } if (ValueText == "二手房") { if (document.getElementById("HouseMoney_Value") != null) document.getElementById("HouseMoney_Value").innerHTML = "售价"; if (document.getElementById("HouseMoneyMin") != null) document.getElementById("HouseMoneyMin").value = ""; if (document.getElementById("HouseMoneyMax") != null) document.getElementById("HouseMoneyMax").value = ""; ShowHidePropDiv(0); } movePropDivLocation(); } function ShowHidePropDiv(topicType) { if (topicType == 0) { moneyUnit = "万"; if (document.getElementById("HouseMoneyRsou") != null) document.getElementById("HouseMoneyRsou").style.display = ""; if (document.getElementById("HouseMoneyZfan") != null) document.getElementById("HouseMoneyZfan").style.display = "none"; if (document.getElementById("quickSearchRsou") != null) document.getElementById("quickSearchRsou").style.display = ""; if (document.getElementById("quickSearchZfan") != null) document.getElementById("quickSearchZfan").style.display = "none"; } if (topicType == 1) { moneyUnit = "元"; if (document.getElementById("HouseMoneyRsou") != null) document.getElementById("HouseMoneyRsou").style.display = "none"; if (document.getElementById("HouseMoneyZfan") != null) document.getElementById("HouseMoneyZfan").style.display = ""; if (document.getElementById("quickSearchRsou") != null) document.getElementById("quickSearchRsou").style.display = "none"; if (document.getElementById("quickSearchZfan") != null) document.getElementById("quickSearchZfan").style.display = ""; } } function movePropDivLocation() { if (document.getElementById("BoroughID_List") != null) document.getElementById("BoroughID_List").style.left = GetObjPos(BoroughID_Value).x; if (document.getElementById("HouseType_List") != null) document.getElementById("HouseType_List").style.left = GetObjPos(HouseType_Value).x; if (document.getElementById("HouseRoom_List") != null) document.getElementById("HouseRoom_List").style.left = GetObjPos(HouseRoom_Value).x; if (document.getElementById("HouseFitment_List") != null) document.getElementById("HouseFitment_List").style.left = GetObjPos(HouseFitment_Value).x; if (document.getElementById("HouseArea_List") != null) document.getElementById("HouseArea_List").style.left = GetObjPos(HouseArea_Value).x; if (document.getElementById("HouseMoney_List") != null) document.getElementById("HouseMoney_List").style.left = GetObjPos(HouseMoney_Value).x; if (document.getElementById("autosuggest") != null) document.getElementById("autosuggest").style.left = GetObjPos(searchkey).x; if (GetObjPos(searchkey).x > 500) { if (document.getElementById("BoroughID_List") != null) document.getElementById("searchkey").style.width = "180px"; } else{ if (document.getElementById("BoroughID_List") != null) document.getElementById("searchkey").style.width = "260px"; } } function showprop(InputName) { if (document.getElementById("quicklySearch") != null) document.getElementById("quicklySearch").style.position = "relative"; document.getElementById(InputName).style.display = ""; } function hideprop(InputName) { if (document.getElementById("quicklySearch") != null) document.getElementById("quicklySearch").style.position = ""; document.getElementById(InputName).style.display = "none"; } function CPos(x, y) { this.x = x; this.y = y; } /*获取控件的相对位置*/ function GetObjPos(ATarget) { var target = ATarget; var pos = new CPos(target.offsetLeft, target.offsetTop); /* 这一段加上则是绝对位置 // var target = target.offsetParent; // while (target) // { // pos.x += target.offsetLeft; // pos.y += target.offsetTop; // // target = target.offsetParent // }*/ return pos; } function SetHouseArea(InputName) { if (document.getElementById("HouseArea1").value.length > 0 && document.getElementById("HouseArea2").value.length > 0) { document.getElementById("HouseAreaMin").value = document.getElementById("HouseArea1").value; document.getElementById("HouseAreaMax").value = document.getElementById("HouseArea2").value; document.getElementById("HouseArea_Value").innerHTML = document.getElementById("HouseArea1").value + "-" + document.getElementById("HouseArea2").value + "㎡"; hideprop(InputName); } else { alert("请输入面积！"); } } function SetHouseMoney(InputName) { if (document.getElementById("HouseMoney1").value.length > 0 && document.getElementById("HouseMoney2").value.length > 0) { document.getElementById("HouseMoneyMin").value = document.getElementById("HouseMoney1").value; document.getElementById("HouseMoneyMax").value = document.getElementById("HouseMoney2").value; document.getElementById("HouseMoney_Value").innerHTML = document.getElementById("HouseMoney1").value + "-" + document.getElementById("HouseMoney2").value + moneyUnit; hideprop(InputName); } else { alert("请输入价格！"); } } function SubmitHouseForm(cityID) { var TopicType = ""; var BoroughID = ""; var HouseType = ""; var HouseRoom = ""; var HouseFitment = ""; var HouseMoneyMin = ""; var HouseMoneyMax = ""; var HouseAreaMin = ""; var HouseAreaMax = ""; var SearchKey = ""; if (document.getElementById("TopicType") != null) TopicType = document.getElementById("TopicType").value; if (document.getElementById("BoroughID") != null) BoroughID = document.getElementById("BoroughID").value; if (document.getElementById("HouseType") != null) HouseType = document.getElementById("HouseType").value; if (document.getElementById("HouseRoom") != null) HouseRoom = document.getElementById("HouseRoom").value; if (document.getElementById("HouseFitment") != null) HouseFitment = document.getElementById("HouseFitment").value; if (document.getElementById("HouseMoneyMin") != null) HouseMoneyMin = document.getElementById("HouseMoneyMin").value; if (document.getElementById("HouseMoneyMax") != null) HouseMoneyMax = document.getElementById("HouseMoneyMax").value; if (document.getElementById("HouseAreaMin") != null) HouseAreaMin = document.getElementById("HouseAreaMin").value; if (document.getElementById("HouseAreaMax") != null) HouseAreaMax = document.getElementById("HouseAreaMax").value; if (document.getElementById("searchkey") != null) SearchKey = document.getElementById("searchkey").value; if (SearchKey == "楼盘或片区关键字") SearchKey = ""; if (SearchKey != "") SearchKey = encodeURIComponent(SearchKey); location.href = "http://"+ cityID +".taofw.cn/search/"+ BoroughID +"-"+ HouseType +"-"+ HouseRoom +"-"+ HouseFitment +"-"+ HouseMoneyMin +"-"+ HouseMoneyMax +"-"+ HouseAreaMin +"-"+ HouseAreaMax +"---"+ SearchKey + "--" + TopicType; } function SubmitBrokerForm(cityID) { var UserCName = document.getElementById("UserCName").value; var UserTel = document.getElementById("UserTel").value; var searchcorp = document.getElementById("searchcorp").value; var searchkey = document.getElementById("brokersearchkey").value; if (searchcorp == "经纪公司关键字") searchcorp = ""; if (searchkey == "楼盘或片区关键字") searchkey = ""; if (UserCName != "") UserCName = encodeURIComponent(UserCName); if (searchcorp != "") searchcorp = encodeURIComponent(searchcorp); if (searchkey != "") searchkey = encodeURIComponent(searchkey); location.href = "http://"+ cityID +".taofw.cn/broker/-"+ UserCName +"-"+ UserTel +"-"+ searchcorp +"-"+ searchkey +"-0"; }