//芒果网页面的标签元素
var floatHint_index = parent.document.getElementById("floatHint_index");
//var floatParentHtml = parent.document.getElementById("holidaysQueryDataForm");
var floatParentHtml = parent.document.getElementById("hotaddressview");
var parentPosition = [0, 0];
if(floatHint_index){
	var tmpObj = floatParentHtml;
	var t = 0;
	var l = 0;
	do {
		t += tmpObj.offsetTop;
		l += tmpObj.offsetLeft;
	} while (tmpObj = tmpObj.offsetParent);
	parentPosition[0] = t;	
	parentPosition[1] = l;	
}
//srcTarget_id: input element id; scripTarget_id: float layer id.
function FloatHintA(srcTarget_id, scripTarget_id) {
	this.srcTarget = temp_AsrcTarget = document.getElementById(srcTarget_id);
	this.scripTarget = temp_AscripTarget = document
			.getElementById(scripTarget_id);
	this.old_doctop = temp_Aold_doctop = document.documentElement.clientTop;
	this.new_doctop = temp_Anew_doctop = document.documentElement.clientTop;
	this.old_docleft = temp_Aold_docleft = document.documentElement.clientLeft;
	this.new_docleft = temp_Anew_docleft = document.documentElement.clientLeft;
	// get parent position
	function getParePos(inObj) {
		var tmpObj = inObj;
		var t = 0;
		var l = 0;
		do {
			t += tmpObj.offsetTop;
			l += tmpObj.offsetLeft;
		} while (tmpObj = tmpObj.offsetParent);
		return tl = [ t, l ];
	}
	// click input event
	this.srcOnfocus = temp_AsrcOnclick = function(flagView) {
		if(floatHint_index){
			floatHint_index.style.top = getParePos(temp_AsrcTarget)[0] + parentPosition[0]
					+ temp_AsrcTarget.offsetHeight + temp_Anew_doctop
					- temp_Aold_doctop;
			floatHint_index.style.left = getParePos(temp_AsrcTarget)[1] + parentPosition[1]
					+ temp_Anew_docleft - temp_Aold_docleft;
		}
		else{
			temp_AscripTarget.style.top = getParePos(temp_AsrcTarget)[0] + parentPosition[0]
			                                                                            + temp_AsrcTarget.offsetHeight + temp_Anew_doctop
			                                                                            - temp_Aold_doctop;
			temp_AscripTarget.style.left = getParePos(temp_AsrcTarget)[1] + parentPosition[1]
			                                                                             + temp_Anew_docleft - temp_Aold_docleft;
		}
		temp_Aold_doctop = temp_Anew_doctop;
		temp_Aold_docleft = temp_Anew_docleft;
		if (!flagView){
			temp_AscripTarget.style.display = "block";
			if(floatHint_index){
				floatHint_index.innerHTML = temp_AscripTarget.innerHTML;
				floatHint_index.style.display = "block";
				temp_AscripTarget.style.display = "none";
			}
		}
		
		event.cancelBubble = true;
	}
	// window size change event
	this.flushPlace = function() {
		temp_Anew_doctop = document.documentElement.clientTop;
		temp_Anew_docleft = document.documentElement.clientLeft;
		temp_AsrcOnclick(true);
	}
	this.floatTable = this.scripTarget.firstChild;//this.scripTarget.all.tags("table")[0];
	this.floatTrs = temp_AfloatTrs = this.floatTable.rows;
	// each td event
	this.tdOnclick = temp_AtdOnclick = function(tdObj) {
		var tdObj = event.srcElement;
		if (!tdObj.ch){
			if(tdObj.innerText != temp_AsrcTarget.value){
				temp_AsrcTarget.value = tdObj.innerText;
				document.getElementById("fromCityId").value = tdObj.exParam;
				viewToCitys(temp_AsrcTarget);
			}
		}
		temp_AscripTarget.style.display = "none";
		if(floatHint_index) floatHint_index.style.display = "none";
	}
	this.floatTds = temp_AfloatTds = function() {
		var tdArray = [];
		for ( var i = 0; i < temp_AfloatTrs.length; i++) {
			temp_Atds = temp_AfloatTrs[i].cells;
			for ( var j = 0; j < temp_Atds.length; j++) {
				tdArray.push(temp_Atds[j]);
				temp_Atds[j].onclick = temp_AtdOnclick;
			}
		}
		return tdArray;
	}();
	// for float layer event
	this.scripOnblur = function() {
		var blurFlag = true;
		var flagLeft_s = parseInt(temp_AscripTarget.style.left.substr(0,
				temp_AscripTarget.style.left.length - 2));
		var flagLeft_e = flagLeft_s + temp_AscripTarget.clientWidth;
		var flagTop_s = parseInt(temp_AscripTarget.style.top.substr(0,
				temp_AscripTarget.style.top.length - 2));
		var flagTop_e = flagTop_s + temp_AscripTarget.clientHeight;
		// alert("左:" + flagLeft_s + "-------" + event.clientX + "-------" +
		// flagLeft_e);
		// alert("上:" + flagTop_s + "-------" + event.clientY + "-------" +
		// flagTop_e);
		if (event.clientX >= flagLeft_s && event.clientX <= flagLeft_e) {
			if (event.clientY >= flagTop_s && event.clientY <= flagTop_e) {
				blurFlag = false;
			}
		}
		if (blurFlag){
			temp_AscripTarget.style.display = "none";
			if(floatHint_index) floatHint_index.style.display = "none";
		}
	}
	// binding event
}
//srcTarget_id: input element id; scripTarget_id: float layer id.
function FloatHintB(srcTarget_id, scripTarget_id) {
	this.srcTarget = temp_BsrcTarget = document.getElementById(srcTarget_id);
	this.scripTarget = temp_BscripTarget = document
			.getElementById(scripTarget_id);
	this.old_doctop = temp_Bold_doctop = document.documentElement.clientTop;
	this.new_doctop = temp_Bnew_doctop = document.documentElement.clientTop;
	this.old_docleft = temp_Bold_docleft = document.documentElement.clientLeft;
	this.new_docleft = temp_Bnew_docleft = document.documentElement.clientLeft;
	// get parent position
	function getParePos(inObj) {
		var tmpObj = inObj;
		var t = 0;
		var l = 0;
		do {
			t += tmpObj.offsetTop;
			l += tmpObj.offsetLeft;
		} while (tmpObj = tmpObj.offsetParent);
		return tl = [ t, l ];
	}
	// click input event
	this.srcOnfocus = temp_BsrcOnclick = function(flagView) {
		if(floatHint_index){
			floatHint_index.style.top = getParePos(temp_BsrcTarget)[0] + parentPosition[0]
					+ temp_BsrcTarget.offsetHeight + temp_Bnew_doctop
					- temp_Bold_doctop;
			floatHint_index.style.left = getParePos(temp_BsrcTarget)[1] + parentPosition[1]
					+ temp_Bnew_docleft - temp_Bold_docleft;
		}
		else{
			temp_BscripTarget.style.top = getParePos(temp_BsrcTarget)[0] + parentPosition[0]
			                                                                            + temp_BsrcTarget.offsetHeight + temp_Bnew_doctop
			                                                                            - temp_Bold_doctop;
			temp_BscripTarget.style.left = getParePos(temp_BsrcTarget)[1] + parentPosition[1]
			                                                                             + temp_Bnew_docleft - temp_Bold_docleft;
		}
		temp_Bold_doctop = temp_Bnew_doctop;
		temp_Bold_docleft = temp_Bnew_docleft;
		if (!flagView){
			temp_BscripTarget.style.display = "block";
			if(floatHint_index){
				floatHint_index.innerHTML = temp_BscripTarget.outerHTML;
				floatHint_index.style.display = "block";
				temp_BscripTarget.style.display = "none";
			}			
		}
	}
	// window size change event
	this.flushPlace = function() {
		temp_Bnew_doctop = document.documentElement.clientTop;
		temp_Bnew_docleft = document.documentElement.clientLeft;
		temp_BsrcOnclick(true);
	}
	this.floatTableIn = document.getElementById("internalTable");
	this.floatTableAb = document.getElementById("abroadTable");
	this.floatTrsIn = temp_BfloatTrsIn = this.floatTableIn.rows;
	this.floatTrsAb = temp_BfloatTrsAb = this.floatTableAb.rows;
	// each td event
	this.tdOnclick = temp_BtdOnclick = function(tdObj) {
		var tdObj = event.srcElement;
		if (!tdObj.ch){
			if(tdObj.innerText != temp_BsrcTarget.value){
				temp_BsrcTarget.value = tdObj.innerText;
				document.getElementById("toProvinceId").value = tdObj.exParam;
			}
		}
		temp_BscripTarget.style.display = "none";
		if(floatHint_index) floatHint_index.style.display = "none";
	}
	this.floatTds = temp_BfloatTds = function() {
		var tdArray = [];
		for ( var i = 0; i < temp_BfloatTrsIn.length; i++) {
			temp_Btds = temp_BfloatTrsIn[i].cells;
			for ( var j = 0; j < temp_Btds.length; j++) {
				tdArray.push(temp_Btds[j]);
				temp_Btds[j].onclick = temp_BtdOnclick;
			}
		}
		for ( var i = 0; i < temp_BfloatTrsAb.length; i++) {
			temp_Btds = temp_BfloatTrsAb[i].cells;
			for ( var j = 0; j < temp_Btds.length; j++) {
				tdArray.push(temp_Btds[j]);
				temp_Btds[j].onclick = temp_BtdOnclick;
			}
		}
		return tdArray;
	}();
	// for float layer event
	this.scripOnblur = function() {
		var blurFlag = true;
		var flagLeft_s = parseInt(temp_BscripTarget.style.left.substr(0,
				temp_BscripTarget.style.left.length - 2));
		var flagLeft_e = flagLeft_s + temp_BscripTarget.clientWidth;
		var flagTop_s = parseInt(temp_BscripTarget.style.top.substr(0,
				temp_BscripTarget.style.top.length - 2));
		var flagTop_e = flagTop_s + temp_BscripTarget.clientHeight;
		// alert("左:" + flagLeft_s + "-------" + event.clientX + "-------" +
		// flagLeft_e);
		// alert("上:" + flagTop_s + "-------" + event.clientY + "-------" +
		// flagTop_e);
		if (event.clientX >= flagLeft_s && event.clientX <= flagLeft_e) {
			if (event.clientY >= flagTop_s && event.clientY <= flagTop_e) {
				blurFlag = false;
			}
		}
		if (blurFlag){
			temp_BscripTarget.style.display = "none";
			if(floatHint_index) floatHint_index.style.display = "none";
		}
	}
	// binding event
}
//srcTarget_id: input element id; scripTarget_id: float layer id.
function FloatHintC(srcTarget_id, scripTarget_id) {
	this.srcTarget = temp_CsrcTarget = document.getElementById(srcTarget_id);
	this.scripTarget = temp_CscripTarget = document
			.getElementById(scripTarget_id);
	this.old_doctop = temp_Cold_doctop = document.documentElement.clientTop;
	this.new_doctop = temp_Cnew_doctop = document.documentElement.clientTop;
	this.old_docleft = temp_Cold_docleft = document.documentElement.clientLeft;
	this.new_docleft = temp_Cnew_docleft = document.documentElement.clientLeft;
	// get parent position
	function getParePos(inObj) {
		var tmpObj = inObj;
		var t = 0;
		var l = 0;
		do {
			t += tmpObj.offsetTop;
			l += tmpObj.offsetLeft;
		} while (tmpObj = tmpObj.offsetParent);
		return tl = [ t, l ];
	}
	// click input event
	this.srcOnfocus = temp_CsrcOnclick = function(flagView) {
		if(floatHint_index){
			floatHint_index.style.top = getParePos(temp_CsrcTarget)[0] + parentPosition[0]
					+ temp_CsrcTarget.offsetHeight + temp_Cnew_doctop
					- temp_Cold_doctop;
			floatHint_index.style.left = getParePos(temp_CsrcTarget)[1] + parentPosition[1]
					+ temp_Cnew_docleft - temp_Cold_docleft;
		}
		else{
			temp_CscripTarget.style.top = getParePos(temp_CsrcTarget)[0] + parentPosition[0]
			                                                                            + temp_CsrcTarget.offsetHeight + temp_Cnew_doctop
			                                                                            - temp_Cold_doctop;
			temp_CscripTarget.style.left = getParePos(temp_CsrcTarget)[1] + parentPosition[1]
			                                                                             + temp_Cnew_docleft - temp_Cold_docleft;
		}
		temp_Cold_doctop = temp_Cnew_doctop;
		temp_Cold_docleft = temp_Cnew_docleft;
		if (!flagView){
			temp_CscripTarget.style.display = "block";
			if(floatHint_index){
				floatHint_index.innerHTML = temp_CscripTarget.outerHTML;
				floatHint_index.style.display = "block";
				temp_CscripTarget.style.display = "none";
			}				
		}
	}
	// window size change event
	this.flushPlace = function() {
		temp_Cnew_doctop = document.documentElement.clientTop;
		temp_Cnew_docleft = document.documentElement.clientLeft;
		temp_CsrcOnclick(true);
	}
	this.floatTable = this.scripTarget.firstChild;//this.scripTarget.all.tags("table")[0];
	this.floatTrs = temp_CfloatTrs = this.floatTable.rows;
	// each td event
	this.tdOnclick = temp_CtdOnclick = function(tdObj) {
		var tdObj = event.srcElement;
		if (!tdObj.ch){
			if(tdObj.innerText != temp_CsrcTarget.value){
				temp_CsrcTarget.value = tdObj.innerText;
				document.getElementById("productlineTypeId").value = tdObj.exParam;
			}
		}
		temp_CscripTarget.style.display = "none";
		if(floatHint_index) floatHint_index.style.display = "none";
	}
	this.floatTds = temp_CfloatTds = function() {
		var tdArray = [];
		for ( var i = 0; i < temp_CfloatTrs.length; i++) {
			temp_Ctds = temp_CfloatTrs[i].cells;
			for ( var j = 0; j < temp_Ctds.length; j++) {
				tdArray.push(temp_Ctds[j]);
				temp_Ctds[j].onclick = temp_CtdOnclick;
			}
		}
		return tdArray;
	}();
	// for float layer event
	this.scripOnblur = function() {
		var blurFlag = true;
		var flagLeft_s = parseInt(temp_CscripTarget.style.left.substr(0,
				temp_CscripTarget.style.left.length - 2));
		var flagLeft_e = flagLeft_s + temp_CscripTarget.clientWidth;
		var flagTop_s = parseInt(temp_CscripTarget.style.top.substr(0,
				temp_CscripTarget.style.top.length - 2));
		var flagTop_e = flagTop_s + temp_CscripTarget.clientHeight;
		// alert("左:" + flagLeft_s + "-------" + event.clientX + "-------" +
		// flagLeft_e);
		// alert("上:" + flagTop_s + "-------" + event.clientY + "-------" +
		// flagTop_e);
		if (event.clientX >= flagLeft_s && event.clientX <= flagLeft_e) {
			if (event.clientY >= flagTop_s && event.clientY <= flagTop_e) {
				blurFlag = false;
			}
		}
		if (blurFlag){
			temp_CscripTarget.style.display = "none";
			if(floatHint_index) floatHint_index.style.display = "none";
		}
	}
}
// binding event
//srcTarget_id: input element id; scripTarget_id: float layer id.
function FloatHintD(srcTarget_id, scripTarget_id) {
	this.srcTarget = temp_DsrcTarget = document.getElementById(srcTarget_id);
	this.scripTarget = temp_DscripTarget = document
			.getElementById(scripTarget_id);
	this.old_doctop = temp_Dold_doctop = document.documentElement.clientTop;
	this.new_doctop = temp_Dnew_doctop = document.documentElement.clientTop;
	this.old_docleft = temp_Dold_docleft = document.documentElement.clientLeft;
	this.new_docleft = temp_Dnew_docleft = document.documentElement.clientLeft;
	// get parent position
	function getParePos(inObj) {
		var tmpObj = inObj;
		var t = 0;
		var l = 0;
		do {
			t += tmpObj.offsetTop;
			l += tmpObj.offsetLeft;
		} while (tmpObj = tmpObj.offsetParent);
		return tl = [ t, l ];
	}
	// click input event
	this.srcOnfocus = temp_DsrcOnclick = function(flagView) {
		if(floatHint_index){
			floatHint_index.style.top = getParePos(temp_DsrcTarget)[0] + parentPosition[0]
					+ temp_DsrcTarget.offsetHeight + temp_Dnew_doctop
					- temp_Dold_doctop;
			floatHint_index.style.left = getParePos(temp_DsrcTarget)[1] + parentPosition[1]
					+ temp_Dnew_docleft - temp_Dold_docleft;
		}
		else{
			temp_DscripTarget.style.top = getParePos(temp_DsrcTarget)[0] + parentPosition[0]
			                                                                            + temp_DsrcTarget.offsetHeight + temp_Dnew_doctop
			                                                                            - temp_Dold_doctop;
			temp_DscripTarget.style.left = getParePos(temp_DsrcTarget)[1] + parentPosition[1]
			                                                                             + temp_Dnew_docleft - temp_Dold_docleft;
		}
		temp_Dold_doctop = temp_Dnew_doctop;
		temp_Dold_docleft = temp_Dnew_docleft;
		if (!flagView){
			temp_DscripTarget.style.display = "block";
			if(floatHint_index){
				floatHint_index.innerHTML = temp_DscripTarget.outerHTML;
				floatHint_index.style.display = "block";
				temp_DscripTarget.style.display = "none";
			}			
		}
	}
	// window size change event
	this.flushPlace = function() {
		temp_Dnew_doctop = document.documentElement.clientTop;
		temp_Dnew_docleft = document.documentElement.clientLeft;
		temp_DsrcOnclick(true);
	}
	this.floatTable = this.scripTarget.firstChild;//this.scripTarget.all.tags("table")[0];
	this.floatTrs = temp_DfloatTrs = this.floatTable.rows;
	// each td event
	this.tdOnclick = temp_DtdOnclick = function(tdObj) {
		var tdObj = event.srcElement;
		if (!tdObj.ch){
			if(tdObj.innerText != temp_DsrcTarget.value){
				temp_DsrcTarget.value = tdObj.innerText;
				document.getElementById("topicholidaysHiddenId").value = tdObj.exParam;
			}
		}
		temp_DscripTarget.style.display = "none";
		if(floatHint_index) floatHint_index.style.display = "none";
	}
	this.floatTds = temp_DfloatTds = function() {
		var tdArray = [];
		for ( var i = 0; i < temp_DfloatTrs.length; i++) {
			temp_Dtds = temp_DfloatTrs[i].cells;
			for ( var j = 0; j < temp_Dtds.length; j++) {
				tdArray.push(temp_Dtds[j]);
				temp_Dtds[j].onclick = temp_DtdOnclick;
			}
		}
		return tdArray;
	}();
	// for float layer event
	this.scripOnblur = function() {
		var blurFlag = true;
		var flagLeft_s = parseInt(temp_DscripTarget.style.left.substr(0,
				temp_DscripTarget.style.left.length - 2));
		var flagLeft_e = flagLeft_s + temp_DscripTarget.clientWidth;
		var flagTop_s = parseInt(temp_DscripTarget.style.top.substr(0,
				temp_DscripTarget.style.top.length - 2));
		var flagTop_e = flagTop_s + temp_DscripTarget.clientHeight;
		// alert("左:" + flagLeft_s + "-------" + event.clientX + "-------" +
		// flagLeft_e);
		// alert("上:" + flagTop_s + "-------" + event.clientY + "-------" +
		// flagTop_e);
		if (event.clientX >= flagLeft_s && event.clientX <= flagLeft_e) {
			if (event.clientY >= flagTop_s && event.clientY <= flagTop_e) {
				blurFlag = false;
			}
		}
		if (blurFlag){
			temp_DscripTarget.style.display = "none";
			if(floatHint_index) floatHint_index.style.display = "none";
		}
	}
	// binding event
}