/**
*  搜索
**/
function esf_search(){
	if (document.form1.minprice.value!= null){
		if (!isFloat(document.form1.minprice.value)) {
	        	alert('价格必须为数字型');
	        	return false;
	    }  
    }
    if (document.form1.maxprice.value!= null){
		if (!isFloat(document.form1.maxprice.value)) {
	        	alert('价格必须为数字型');
	        	return false;
	    }  
    }
    if (document.form1.minarea.value!= null){
		if (!isFloat(document.form1.minarea.value)) {
	        	alert('面积必须为数字型');
	        	return false;
	    }  
    }
    if (document.form1.maxarea.value!= null){
		if (!isFloat(document.form1.maxarea.value)) {
	        	alert('面积必须为数字型');
	        	return false;
	    }  
    }
    document.form1.target="_blank";
	if (document.form1.different.value == 0){  //求购        
	    document.form1.opt.value = "searchQG";
	    document.form1.action = "/esf/qg_list.jsp?service=ls";
    } else if (document.form1.different.value == 2){  //评估
        document.form1.opt.value = "search";
        document.form1.action = "/esf/eval_list.jsp?service=ls";
    } else{                                     //出售  
    	document.form1.opt.value = "searchCS";
    	 document.form1.action = "/esf/cs_list.jsp?service=ls";
    }
    if (document.form1.xqinfo && document.form1.xqinfo.value == "小区地址或名称") {
        document.form1.xqinfo.value = "";
    }
   try {
			paginationGotoPage(0);
		} catch(e) {
			document.form1.submit();
		}
}

/**
*  城区快捷搜索
**/
function cityzone_search(id){
    clearEsfForm();
	if (id == -1){
		document.form1.cityzone.value = id;
	}else{
		document.form1.cityzoneid.value = id;
	}
    if (document.form1.xqinfo && document.form1.xqinfo.value == "小区地址或名称") {
        document.form1.xqinfo.value = "";
    }
	document.form1.target="_blank";
	if (document.form1.different.value == 0){  //求购
	    document.form1.opt.value = "searchQG";
	    document.form1.action = "/esf/qg_list.jsp?service=ls";
    } else if (document.form1.different.value == 2){//评估
        document.form1.opt.value = "search";
        document.form1.action = "/esf/eval_list.jsp?service=ls";
    } else {                                     //出售  
    	document.form1.opt.value = "searchCS";
    	document.form1.action = "/esf/cs_list.jsp?service=ls";
    }
   try {
			paginationGotoPage(0);
		} catch(e) {
			document.form1.submit();
		}
}

/**
 * 城区快捷搜索
 * falg: 0 为求购
 */
function cityzone_consearch(id, flag) {
    if (flag == 0) {
        document.form1.different.value = 0;
    }
    cityzone_search(id);
}

/**
 * 价格快捷搜索
 * 
 */
function price_search(lowprice, hightprice) {
    clearEsfForm();
    if (lowprice != '') {
        document.form1.minprice.value = lowprice;
    }
    if (hightprice != '') {
        document.form1.maxprice.value = hightprice;
    }
    if (document.form1.xqinfo && document.form1.xqinfo.value == "小区地址或名称") {
        document.form1.xqinfo.value = "";
    }
    document.form1.target="_blank";
    document.form1.opt.value = "searchCS";
    document.form1.action = "/esf/cs_list.jsp?service=ls";
    document.form1.submit();
}

/**
*  物业类型快捷搜索
**/
function type_search(id){
    clearEsfForm();
    document.form1.typeid.value = id;
    document.form1.target="_blank";
	if (document.form1.different.value == 0){  //求购
	    document.form1.opt.value = "searchQG";
	    document.form1.action = "/esf/qg_list.jsp?service=ls";
    }else{                                     //出售  
    	document.form1.opt.value = "searchCS";
    	document.form1.action = "/esf/cs_list.jsp?service=ls";
    }
    if (document.form1.xqinfo && document.form1.xqinfo.value == "小区地址或名称") {
        document.form1.xqinfo.value = "";
    }
   try {
			paginationGotoPage(0);
		} catch(e) {
			document.form1.submit();
		}
}

/**
*  左侧菜单城区快捷搜索
**/
function cityzone_menusearch(id){
    clearEsfForm();
	if (id == -1){
		document.form1.cityzone.value = id;
	}else{
		document.form1.cityzoneid.value = id;
	}
    if (document.form1.xqinfo && document.form1.xqinfo.value == "小区地址或名称") {
        document.form1.xqinfo.value = "";
    }
    document.form1.opt.value = "searchCS";
    document.form1.action = "/esf/cs_list.jsp?service=ls";
   try {
			paginationGotoPage(0);
		} catch(e) {
			document.form1.submit();
		}
}

/**
*  左侧评估列表城区快捷搜索
**/
function cityzone_evalsearch(id){
    clearEsfForm();
	if (id == -1){
		document.form1.cityzone.value = id;
	}else{
		document.form1.cityzoneid.value = id;
	}
    document.form1.opt.value = "search";
    document.form1.action = "/esf/eval_list.jsp?service=ls";
    if (document.form1.xqinfo && document.form1.xqinfo.value == "小区地址或名称") {
        document.form1.xqinfo.value = "";
    }
   try {
			paginationGotoPage(0);
		} catch(e) {
			document.form1.submit();
		}
}

/**
* 首页评估列表城区快捷搜索,要打开新页面
**/
function cityzone_eval(id){
    clearEsfForm();
	if (id == -1){
		document.form1.cityzone.value = id;
	}else{
		document.form1.cityzoneid.value = id;
	}
	document.form1.target="_blank";
    document.form1.opt.value = "search";
    document.form1.action = "/esf/eval_list.jsp?service=ls";
    if (document.form1.xqinfo && document.form1.xqinfo.value == "小区地址或名称") {
        document.form1.xqinfo.value = "";
    }
   try {
			paginationGotoPage(0);
		} catch(e) {
			document.form1.submit();
		}
}

/**
 * 只能输入实数
 */ 
function FloatKeyPress() {
    if((event.keyCode<48 || event.keyCode>57) && event.keyCode!=46)
	    event.keyCode=0;
}

/**
 * 判断参数是否为数值(含整型和浮点型)类型
 */
function isFloat(str) {
   if(!isNaN(str)) {
      return true;
	} else {
	   return false;   
	}
}

/**
 *  城区搜索
 */
function zonePage(cityzoneid) {
    //location.href = "/xf/xf_list.jsp?cityzoneid=" + cityzoneid + "&cq=1";
    var url = "/xf/xf_list.jsp?cityzoneid=" + cityzoneid + "&cq=1";
    window.open(url);
}

/**
 *
 */
function defaultKey(obj) {
    if (obj.value == "小区地址或名称") {
        obj.value = "";
    }
    obj.select(); 
}

function showMenuInformation() {  
	var oBox1 = document.getElementById("showInfomation");
	if (document.form1.different.value && document.form1.different.value == 2) {
		oBox1.style.display = 'none';
	} else {
		oBox1.style.display = '';
	} 
}
function clearEsfForm() {
    document.form1.minprice.value = "";
    document.form1.maxprice.value = "";
    document.form1.minarea.value = "";
    document.form1.maxarea.value = "";
    document.form1.xqinfo.value = "";
    document.form1.oldxxh.value = "";
    document.form1.typeid.value = "";
    document.form1.cityzoneid.value = "";
    document.form1.cityzone.value = "";
    document.form1.room.value = "";
    document.form1.hall.value = "";
}