﻿function lateResizeApp()
{
    resizeApp();
    toR();
    toR();
}

function resizeApp(){//用于自适应高度处理
	var bodyHeight  = getWindowHeight();
	if( bodyHeight - 96 - 5 > 0)
	{

//		if(document.getElementById("mid") != null){
//			document.getElementById("mid").style.height = bodyHeight -96-100 + "px" ;
//		}

		if(document.getElementById("mapObj") != null){
			document.getElementById("mapObj").style.height = bodyHeight -96-8 + "px" ;
		}
		
		if(document.getElementById("right_info_tree") != null){
			document.getElementById("right_info_tree").style.height = bodyHeight -96 -5 + "px" ;
		}

		if(document.getElementById("divHouseList2") != null){
			document.getElementById("divHouseList2").style.height = bodyHeight -96-166 -23 -22 -9+ "px" ;
		}
		
		if(document.getElementById("right_info_gj") != null){
			document.getElementById("right_info_gj").style.height = bodyHeight -96-10 -25 + "px" ;
		}
		
		if(document.getElementById("right_info_jc") != null){
			document.getElementById("right_info_jc").style.height = bodyHeight -96-10 -25 + "px" ;
		}

		if(document.getElementById("gj_result_div") != null){
			document.getElementById("gj_result_div").style.height = bodyHeight -96-10 -25 -126 + "px" ;
		}

		if(document.getElementById("jc_result_div") != null){
			document.getElementById("jc_result_div").style.height = bodyHeight -96-10 -25 -94 + "px" ;
		}

		if(document.getElementById("map_dt") != null){
			document.getElementById("map_dt").style.height = bodyHeight -96-10 -66-32 + "px" ;
		}

		if(document.getElementById("sb") != null){
			document.getElementById("sb").style.height = bodyHeight -96-10 + "px" ;
		}
	}
}

var a=0;

function toR() {
	    if(a==0){
	        document.getElementById("sads").style.display = "none";
			document.getElementById("sb").style.right = 0+"px";
            document.getElementById("alldivMap").style.marginRight = 5+"px";
			var myobj=document.getElementById("sb");
			myobj.style.backgroundImage="url(images/w2.gif)";
			$('sb').title = "显示搜索栏";
			a=1
            }
            else {
                document.getElementById("sads").style.display = "block";
				document.getElementById("sb").style.right = 350 +"px";
				document.getElementById("alldivMap").style.marginRight =355+"px";
				var myobj=document.getElementById("sb");
				myobj.style.backgroundImage="url(images/w1.gif)";
				$('sb').title = "向右扩展地图";
				a=0
            }
}

function getWindowHeight() {//获取页面显示区域高度
	if (window.self && self.innerHeight) {
		return self.innerHeight;
	}
	if (document.documentElement && document.documentElement.clientHeight) {
		return document.documentElement.clientHeight;
	}
	return 0;
}

