
var agent_hForm = null;
var hForm_open = false;

function openHoverForm(optionalURL,optionalParameters)
{

	if (!(hForm_open))
	{

		agent_hForm = document.createElement("div");
		agent_hForm.style.display = "block";
		agent_hForm.style.position = "absolute";
		var spY = 0;
		try { spY = window.pageYOffset ? window.pageYOffset : document.documentElement.scrollTop; } catch(er) { }
		agent_hForm.style.top = Math.max(50,spY+50) + "px";
		agent_hForm.style.left = "50px";
//		agent_hForm.style.width = (getWindowWidth() - 120) + "px";
		agent_hForm.style.width = "90%";
		agent_hForm.style.border = "3px solid #666";
		agent_hForm.style.backgroundColor = "#eee";
		agent_hForm.style.padding = "10px";
		agent_hForm.style.zIndex = 1000;
		agent_hForm.innerHTML += "<div style='clear:both;'></div>";
		document.body.appendChild(agent_hForm);

		hForm_open = true;
	
		try
		{
			if (!(optionalURL)) {}
			else
			{
				var p = "";
				if (!(optionalParameters))
				{
					p = "";
				}
				else
				{
					p = optionalParameters;
				}
				agent_hForm.innerHTML = "<p style='border-bottom:1px solid #aaa; padding-bottom:5px; margin-bottom:5px;'><a href=\"javascript:;\" onclick=\"cancelHoverForm();\">[X] Close</a></p>" + ajax("post",optionalURL,p);
			}
		}
		catch (er) {}

	}
	
	return agent_hForm;
	
}

function resizeHoverForm()
{
	if (agent_hForm!=null)
	{
		agent_hForm.style.width = (getWindowWidth() - 120) + "px";
	}
}

function cancelHoverForm()
{
	if (confirm("Are you sure you want to close this form?"))
	{
		closeHoverForm();
		return true;
	}
	else
	{
		return false;
	}
}

function closeHoverForm()
{
	try
	{
		if (agent_hForm!=null)
		{
			document.body.removeChild(agent_hForm);
			hForm_open = false;
			agent_hForm = null;
		}
	} catch(er) {}
}




