// get browser type
var isNS4;
var isNS6;
var isIE4;
var isIE5;
var strPlatform;

isNS4 = (document.layers) ? true : false;
isIE4 = (document.all && !document.getElementById) ? true : false;
isIE5 = (document.all && document.getElementById) ? true : false;
isNS6 = (!document.all && document.getElementById) ? true : false;

Browser = navigator.appName
Net = Browser.indexOf("Netscape")
Micro = Browser.indexOf("Microsoft")
Netscape = false
IE = false

if(Net >= 0) {
	Netscape = true
	
	
}

if(Micro >= 0) {
	IE = true
}

if (!IE) document.captureEvents(Event.MOUSEMOVE)

document.onmousemove = getMouseXY;

var xPos;
var yPos;

function getMouseXY(e) {
  if (IE) { // grab the x-y pos.s if browser is IE
    xPos = event.clientX + document.body.scrollLeft
    yPos = event.clientY + document.body.scrollTop
  } else {  // grab the x-y pos.s if browser is NS
    xPos = e.pageX
    yPos = e.pageY
  }  
  // catch possible negative values in NS4
  if (xPos < 0){xPos = 0}
  if (yPos < 0){yPos = 0}  
  return true
}


function changeActionDiv(content, visibleStatus, leftPos, topPos, visible)
{
	handle = document.getElementById("actionDiv");
	handle.innerHTML = content;
	handle.style.visibility = visibleStatus;
	handle.style.top = topPos;
	handle.style.left = leftPos;

	if(visible)
	{
		handle = document.getElementById(visible);
		
		if(handle)
		{
			handle.style.visibility = "visible";
		}
	}
}


function hideActionDiv()
{
	handle = document.getElementById("actionDiv");
	handle.style.visibility = "hidden";
}

function createHTML(type)
{
	if(type == 1)
	{
		strText = '<table width="250" height="50" cellpadding="3" cellspacing="0" class="blackBorder" bgcolor="white"><tr><td class="padded" bgcolor="white"><span class="frontTextBold">Confirmation</span></td></tr><tr><td class="padded"><span class="frontText">Your settings have been successfully changed</span></td></tr><tr><td align="center"><a href=\"javascript:hideActionDiv()\"><img src=\"images/close_layer_white.gif\" alt=\"close\" border=\"0\"></a></td></tr></table>';	
	}

	return strText;
	
}

function doDiv(type)
{
	strCode = createHTML(type);
	
	iLeft	= 15;
	iTop	= 15;

	if(!ValidObject(xPos))
	{
		xPos = '380';
	}

	if(!ValidObject(yPos))
	{
		yPos = '200';
	}

	changeActionDiv(strCode, 'visible', (xPos - iLeft), (yPos - iTop));
}

function ValidObject(Object) 
{
	if(Object == null)
	{
		return false;
	}
	
	if(typeof(Object) == "undefined") 
	{
		return false;
	}
	
	return true;
}