var bakObj;		//定义一个空的全局变量；
function chooseCustomer(obj){
	bakObj = obj;	//把此方法传进来的参数即当前所点对象使bakObj初始化；
	var CustomerFram = document.getElementById("CustomerFram");		//获取弹出框对象
	var hidivmt = obj.offsetTop;	//获取当前对象居body顶部的高度
	var hidivml = obj.offsetLeft;	//获取当前对象居body左部的宽度
	var objWidth = obj.offsetWidth;		//获取当前对象的实际宽度
	var objHeight = obj.offsetHeight;	//获取当前对象的实际高度
	CustomerFram.style.display ="block";
	
	var aBox = obj;//需要获得位置的对象
	do {
		aBox = aBox.offsetParent;
		hidivml += aBox.offsetLeft;
		hidivmt += aBox.offsetTop;
		} 
	while( aBox.tagName != "BODY" );
	
	
	var cusHeight = CustomerFram.offsetHeight;		//获取弹出框的实际高度
	var cusWidth = CustomerFram.offsetWidth;		//获取弹出框的实宽度
	var bodyHeight = document.body.clientHeight;
	var bodyWidth = document.body.clientWidth;
	
	CustomerFram.style.left = hidivml-1;
	CustomerFram.style.top = hidivmt+objHeight;
	if(hidivml+cusWidth>=bodyWidth){
		CustomerFram.style.left = hidivml+objWidth-cusWidth+1;
	}
	if(hidivmt+cusHeight>=bodyHeight-objHeight){
		CustomerFram.style.top = hidivmt-cusHeight;
	}
}

function setValue(obj){
//alert(obj);
	bakObj.innerHTML = obj;
	document.getElementById("CustomerFram").style.display = 'none';
}