//<!--- Used in case old browsers need to ignore it ---
//---  Manages always on top window (BODY) ---

function compatibilityMode()
{
	//var browser   = navigator.appName;
	//var b_version = navigator.appVersion;
	//alert (browser);
	//var version   = parseFloat(b_version); document.write("Browser name: "+ browser);
	//document.write("<br />");
	//document.write("Browser version: "+ version);

	// returns the compatibility mode for the document
	if (document.compatMode && document.compatMode != "BackCompat")
	{
		// This is what Mozilla and Safari get when HTML page set to CSS1 compatible
		//alert (document.documentElement);
		return (document.documentElement);  // original 
	}
	else
	{
		// This is what IE gets for either BackCompat or CSS1
		return (document.body);  // original
		//return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body;
	}
}

// --- December 30, 2007 ---
// Declare and initialize the Left and Top variables to determine where 
// the window will initially be positioned when the document loads.
var LeftPos = compatibilityMode().clientWidth-160;
var TopPos = 10;

LeftPos += compatibilityMode().scrollLeft;
TopPos  += compatibilityMode().scrollTop;

// Sets in the "elemMain" element the left and top positions of the cart window
document.getElementById("elemMain").style.left = LeftPos;
document.getElementById("elemMain").style.top  = TopPos;

// reposition the window due to page scroll or page width change
function repositionElement()
{
	// reposition the element orizontally in case the page width was modified
	var NewLeftPos = compatibilityMode().clientWidth-160;
	NewLeftPos += compatibilityMode().scrollLeft;

	// Now reposition the element vertically
	var TempLeftPos = compatibilityMode().scrollLeft + NewLeftPos;
	var TempTopPos  = compatibilityMode().scrollTop  + TopPos;

	// set the new positions to "elemMain"
	document.getElementById("elemMain").style.left = TempLeftPos;
	document.getElementById("elemMain").style.top  = TempTopPos;
}

// turns OFF display Element contents
function reduceWindow()
{
	if (document.getElementById("elemMain").style.display == '') 
		document.getElementById("elemMain").style.display = 'none';
	else
		document.getElementById("elemMain").style.display = '';
}
//--- Used in case old browsers need to ignore it //--->
