//<!--
//  ____________________________________________________________ Initialize the global variables
//
var IE_4Plus = 0;			// IE 4+ browser flag
var NS_3Plus = 0;			// Netscape 3+ browser flag
var NS_7Plus = 0;			// Netscape 7+ browser flag
var FancyMode = 0;			// Image rollover capable flag
var OfferCode = "";			// Coupon code that can be remembered per page
var DiscountText = "";		// Used to provide feedback
var DiscountPercent = "";	// Used for calculations
var MaxDiscount = "";		// Used for calculations
var MaxDiscountText = "";	// Used to provide feedback
//
//  ____________________________________________________________ Get the browser and version
//
var BrowserName = navigator.appName.substring(0,7);
if (BrowserName == "Netscap") {
	var browserVer = parseFloat(navigator.appVersion);
	if (browserVer >= 3) { NS_3Plus = 1; }
}
if (BrowserName == "Mozilla") {
	var geckoIndex = navigator.appVersion.indexOf("Gecko",0);
	//var browserVer = parseFloat(navigator.appVersion.substring(versionIndex));
	if (geckoIndex > 0) { NS_7Plus = 1; }
}
if (BrowserName == "Microso") {
	var versionIndex = navigator.appVersion.indexOf("MSIE",0)+5;
	var browserVer = parseFloat(navigator.appVersion.substring(versionIndex));
	if (browserVer >= 4) { IE_4Plus = 1; }
}
if (NS_3Plus || IE_4Plus || NS_7Plus) { FancyMode = 1; }
//
// ____________________________________________________________ View cart submit
//
function ViewCart() {

	// Submit the item
	document.view_cart.business.value = "galatea@resonantenergies.com";
	document.view_cart.submit();
	document.view_cart.business.value = "";
}
//
// ____________________________________________________________ Weight based cart submit
//
function Send2PayPal(itemnum,name,sprice,avail,qty,weight,opn0,ops0,opn1,ops1) {

	if (isNaN(qty)) { qty = "1"; }
	
	// These variables are for doing a numeric comparison instead of string comparison
	// Force the input to integer
	var available = parseInt(avail,10);
	var quantity = parseInt(qty,10);
	
	// Set the pass-thru item number
	//document.paypal.item_number.value = itemnum;
	
	// Build the timestamp
	var currentTime = new Date();
	var hour = currentTime.getHours();
	if (hour < 10) {hour = "0" + hour;}
	var minute = currentTime.getMinutes();
	if (minute < 10) {minute = "0" + minute;}
	var year = currentTime.getFullYear().toString().slice(2);
	var month = currentTime.getMonth() + 1;
	if (month < 10) {month = "0" + month;}
	var day = currentTime.getDate();
	if (day < 10) {day = "0" + day;}
	var digi2qty = qty;
	if (digi2qty < 10) {digi2qty = "0" + digi2qty;}
	var timestamp = digi2qty.toString() + hour.toString() + minute.toString() + year.toString() + month.toString() + day.toString();
	
	// Set the item name
	document.paypal.item_name.value = name + "  (" + weight + timestamp + ")";
	
	// Deal with backorders
	// Is the item availability specified
	if (avail != "") {
		// We have the availability, so ...
		if (avail == "-1") {
			// The item is unique, so we're done
			document.paypal.quantity.value = "1";
		} else {
			// The item is not unique
			if (quantity > available && avail != "-99") {
				// Set the title to indicate a backorder
				document.paypal.item_name.value = "Backorder: " + document.paypal.item_name.value;
			}
			document.paypal.quantity.value = qty;
		}
	} else {
		// We don't have the availability, default to 1
		document.paypal.quantity.value = "1";
	}
	
	// Set the weight
	document.paypal.weight.value = weight;
	
	// Set the price
	document.paypal.amount.value = sprice;
	
	// Set the options
	document.paypal.on0.value = opn0;
	document.paypal.os0.value = ops0;
	document.paypal.on1.value = opn1;
	document.paypal.os1.value = ops1;
	
	// Submit the item
	document.paypal.business.value = "galatea@resonantenergies.com";
	document.paypal.submit();
	document.paypal.business.value = "";
}
//
// ____________________________________________________________ Basic cart submit
//
function Add2Cart(name,qty,price,opn0,ops0,opn1,ops1) {

	// Set the item name
	document.paypal.item_name.value = name;
	
	// Check the quantity
	if (qty != "") {
		document.paypal.quantity.value = qty;
	} else {
		document.paypal.quantity.value = "1";
	}
	// Set the price
	document.paypal.amount.value = price;
	
	// Set the options
	document.paypal.on0.value = opn0;
	document.paypal.os0.value = ops0;
	document.paypal.on1.value = opn1;
	document.paypal.os1.value = ops1;

	// Submit the item
	document.paypal.business.value = "galatea@resonantenergies.com";
	document.paypal.submit();
	document.paypal.business.value = "";
}
//
// ____________________________________________________________ Buy Now submit
//
function BuyNow(itemnum,name,avail,qty,sprice,shipping,opn0,ops0,opn1,ops1,backorder) {

	var submit = true;

	if (isNaN(qty)) { qty = "1"; }
	
	// These variables are for doing a numeric comparison instead of string comparison
	// Force the input to integer
	var available = parseInt(avail,10);
	var quantity = parseInt(qty,10);
	
	// Set the item name
	document.paypalbn.item_name.value = name;
	
	// Set the passthru number
	document.paypalbn.item_number.value = itemnum;
	
	// Set the options
	document.paypalbn.on0.value = opn0;
	document.paypalbn.os0.value = ops0;
	document.paypalbn.on1.value = opn1;
	document.paypalbn.os1.value = ops1;
	
	// Deal with backorders
	// Is the item availability specified
	if (avail != "") {
		// We have the availability, so ...
		if (avail == "-1") {
			// The item is unique, so we're done
			document.paypalbn.quantity.value = "1";
		} else {
			// The item is not unique
			if (quantity > available && avail != "-99") {
				if (!backorder && available >= 1) {
					alert("Backorders are not possible for this item.\n\nYour order quantity will be reset to the available stock.");
					qty = available;
				}
				if (!backorder && available < 1) {
					alert("This item is not in stock and cannot be backordered.\n\nPlease contact us about future availability.");
					submit = false;
				}
				if (backorder) {
					// Set the title to indicate a backorder
					document.paypalbn.item_name.value = "Backorder: " + name;
					document.paypalbn.on1.value = "Backordered Qty";
					document.paypalbn.os1.value = quantity - available;
				}
			}
			document.paypalbn.quantity.value = qty;
		}
	} else {
		// We don't have the availability, default to 1
		document.paypalbn.quantity.value = "1";
	}
	
	// Set the price
	document.paypalbn.amount.value = sprice;
	
	// Set the shipping
	document.paypalbn.shipping.value = shipping;
	document.paypalbn.shipping2.value = shipping;

	// Submit the item
	document.paypalbn.business.value = "galatea@resonantenergies.com";
	if (submit) { document.paypalbn.submit(); }
	document.paypalbn.business.value = "";
}
//
// ____________________________________________________________ Main cart submit
//
function msAdd2Cart(itemnum,name,avail,qty,rprice,sprice,opn0,ops0,opn1,ops1,shipping) {

	if (isNaN(qty)) { qty = "1"; }
	
	// These variables are for doing a numeric comparison instead of string comparison
	// Force the input to integer
	var available = parseInt(avail,10);
	var quantity = parseInt(qty,10);
	
	// Set the item name
	document.paypal.item_name.value = name;
	
	// Deal with backorders
	// Is the item availability specified
	if (avail != "") {
		// We have the availability, so ...
		if (avail == "-1") {
			// The item is unique, so we're done
			document.paypal.quantity.value = "1";
		} else {
			// The item is not unique
			if (quantity > available && avail != "-99") {
				// Set the title to indicate a backorder
				document.paypal.item_name.value = "Backorder: " + name;
			}
			document.paypal.quantity.value = qty;
		}
	} else {
		// We don't have the availability, default to 1
		document.paypal.quantity.value = "1";
	}
	
	// Set the price
	document.paypal.amount.value = sprice;
	
	// Set the options
	document.paypal.on0.value = opn0;
	document.paypal.os0.value = ops0;
	document.paypal.on1.value = opn1;
	document.paypal.os1.value = ops1;
	
	// Set the shipping
	if (shipping == "") {document.paypal.no_shipping.value = "0";}
	if (shipping != "" && shipping == "0") {document.paypal.no_shipping.value = "1";}

	// Submit the item
	document.paypal.business.value = "galatea@resonantenergies.com";
	document.paypal.submit();
	document.paypal.business.value = "";
}
//
// ____________________________________________________________ Main cart submit
//
function msAdd2Cart2(itemnum,name,avail,qty,rprice,sprice,opn0,ops0,opn1,ops1,shipping) {

	// Make this a cart transaction
	document.paypal.cmd.value = "_cart";
	
	if (isNaN(qty)) { qty = "1"; }
	
	// These variables are for doing a numeric comparison instead of string comparison
	// Force the input to integer
	var available = parseInt(avail,10);
	var quantity = parseInt(qty,10);
	
	// Set the item name
	document.paypal.item_name.value = name;
	
	// Deal with backorders
	// Is the item availability specified
	if (avail != "") {
		// We have the availability, so ...
		if (avail == "-1") {
			// The item is unique, so we're done
			document.paypal.quantity.value = "1";
		} else {
			// The item is not unique
			if (quantity > available && avail != "-99") {
				// Set the title to indicate a backorder
				document.paypal.item_name.value = "Backorder: " + name;
			}
			document.paypal.quantity.value = qty;
		}
	} else {
		// We don't have the availability, default to 1
		document.paypal.quantity.value = "1";
	}
	
	// Set the price
	document.paypal.amount.value = sprice;
	
	// Set the options
	document.paypal.on0.value = opn0;
	document.paypal.os0.value = ops0;
	document.paypal.on1.value = opn1;
	document.paypal.os1.value = ops1;
	
	// Set the shipping
	//if (shipping == "") {
	//	document.paypal.shipping.value = shipping;
	//	document.paypal.shipping2.value = shipping;
	//}
	if (shipping == "") {document.paypal.no_shipping.value = "0";}
	if (shipping != "" && shipping == "0") {document.paypal.no_shipping.value = "1";}

	// Submit the item
	document.paypal.business.value = "galatea@resonantenergies.com";
	document.paypal.submit();
	document.paypal.business.value = "";
}
//
// ____________________________________________________________ Send item data to cart page
//
function SendItemData(pre,num,ctitle,sprice,avail,qty,itemweight,boxsize,qtyperbox,backorder,opt1label,opt1value,opt2label,opt2value,returnpage,action) {

	// Set the data into the form
	document.send2cart.pre.value = pre;
	document.send2cart.num.value = num;
	document.send2cart.ctitle.value = ctitle;
	document.send2cart.sprice.value = sprice;
    document.send2cart.avail.value = avail;
	document.send2cart.qty.value = qty;
	document.send2cart.item_weight.value = itemweight;
	document.send2cart.box_size.value = boxsize;
	document.send2cart.qty_per_box.value = qtyperbox;
	document.send2cart.backorder.value = backorder;
	document.send2cart.opt1label.value = opt1label;
	document.send2cart.opt1value.value = opt1value;
	document.send2cart.opt2label.value = opt2label;
	document.send2cart.opt2value.value = opt2value;
	document.send2cart.return_page.value = returnpage;
	document.send2cart.action.value = action;
	
	// Submit the item
	document.send2cart.submit();

}
//
//  ____________________________________________________________ Do Nothing
//
function DoNothing() {}
//
//  ____________________________________________________________ Show the highlighted button
//
function ButtonHigh(button,index) {
	if (FancyMode) {
		document.images[index].src = HighImage[button].src;
	}
}
//
//  ____________________________________________________________ Show the normal button
//
function ButtonLow(button,index) {
	if (FancyMode) {
		document.images[index].src = LowImage[button].src;
	}
}
//
//  ____________________________________________________________ Show the clicked button
//
function ButtonClick(button,index) {
	if (FancyMode) {
		document.images[index].src = ClickImage[button].src;
	}
}
//
// ____________________________________________________________ Jump out of frames
//
function IfImInFrames()
{
	if (top.location != self.location) {
		top.location = self.location;
	}
}
//
// ____________________________________________________________ Reload the page
//
function ReCall(thispage)
{
	self.location = thispage;
}
//
// ____________________________________________________________ Open an output window
//
function PopupWinS(url,winname,winwidth,winheight) 
{
	Xspot = 10;
	Yspot = 10;
	if (winwidth == "Unused") 
	{
		winwidth = "500";
		winheight = "400";
		Xspot = 150;
		Yspot = 10;
	}
	if (winwidth <= 0) 
	{
		winwidth = "600";
		Xspot = 10;
	}
	if (winheight <= 0) 
	{
		winheight = "450";
		Yspot = 10;
	}
	
	var params = "";
	params = params + "scrollbars";
	params = params + ",resizable";
	params = params + ",location=no";
	params = params + ",copyhistory=no";
	params = params + ",width=" + winwidth;
	params = params + ",height=" + winheight;
	params = params + ",screenX=" + Xspot;
	params = params + ",screenY=" + Yspot;
	newWindow = window.open(url,winname,params);
	eval(newWindow).moveTo(Xspot,Yspot);
	eval(newWindow).focus();
}
//
// ____________________________________________________________ Open an output window
//
function PopupWinMNS(url,winname,winwidth,winheight) 
{
	Xspot = 10;
	Yspot = 10;
	if (winwidth == "MainSite") 
	{
		winwidth = "780";
		winheight = "440";
		Xspot = 10;
		Yspot = 10;
	}
	if (winwidth <= 0) 
	{
		winwidth = "780";
		Xspot = 10;
	}
	if (winheight <= 0) 
	{
		winheight = "440";
		Yspot = 10;
	}
	
	var params = "";
	params = params + ",status";
	params = params + ",menubar";
	params = params + ",resizable";
	params = params + ",copyhistory=no";
	params = params + ",width=" + winwidth;
	params = params + ",height=" + winheight;
	//params = params + ",screenX=" + Xspot;
	//params = params + ",screenY=" + Yspot;
	newWindow = window.open(url,winname,params);
	//eval(newWindow).moveTo(Xspot,Yspot);
	eval(newWindow).focus();
}
//
// _____________________________________________________________ String cleaners
//
function StripSpace(name)
{
	var regexp = / /;
	while(name.search(regexp) != -1)
	{
		name = name.replace(regexp, "");
	}
	return name;
}
function PlusSpace(name)
{
	var regexp = / /;
	while(name.search(regexp) != -1)
	{
		name = name.replace(regexp, "+");
	}
	return name;
}
function EscapeSpace(name)
{
	var regexp = / /;
	while(name.search(regexp) != -1)
	{
		name = name.replace(regexp, "%20");
	}
	return name;
}
//
// ____________________________________________________________ Foil
//
function Foil(act1,act2,sbj) {
	line = "mai" + "lto%" + "3A";
	line = line + act1 + act2 + "%" + "40";
	line = line + "resonant" + "energies" + "%" + "2E" + "com";
	line = line + "%" + "3F" + "Sub" + "ject" + "%" + "3D" + sbj;
	document.location = unescape(line);
}
//
// ____________________________________________________________ Expand or Contract menus
//
function ExpandCollapse(direction) {
	var NewURL = self.location.toString();
	var Offset = NewURL.indexOf("?");
	var TransChar = "?";
	var Param = "all";
	if (Offset != -1) { TransChar = "&"; }
	if (direction != "+") { Param = ""; }
	self.location = NewURL + TransChar + "exp=" + Param;
}
//
// ____________________________________________________________ Set the theme number
//
function SetTheme(number) {
	var NewURL = self.location.toString();
	var Offset = NewURL.indexOf("&thm=");
	if (Offset = -1) {
		Offset = NewURL.indexOf("?thm=");
		var TransChar = "?";
	} else {
		var TransChar = "&";
	}
	if (Offset != -1) {
		NewURL = NewURL.substr(0,Offset);
	}
	self.location = NewURL + TransChar + "thm=" + number;
}
//
// ____________________________________________________________ Set decimal places
//
function SetDecimal(expr,decplaces)
{
	var str = "" + Math.round(eval(expr) * Math.pow(10,decplaces));
	while (str.length <= decplaces) {
		str = "0" + str;
	}
	var decpoint = str.length - decplaces;
	return str.substring(0,decpoint) + "." + str.substring(decpoint,str.length);
}
//
// ____________________________________________________________ Set decimal places
//
function GoSearch(str)
{
	var regexp = /_/;
	while(str.search(regexp) != -1)
	{
		str = str.replace(regexp, " ");
	}
	self.document.SiteSearch.zoom_query.value = str;
	self.document.SiteSearch.submit()
}
//
// ____________________________________________________________ Div Popup Functions
//
// Detect if the browser is IE or not.
// If it is not IE, we assume that the browser is NS.
var IE = document.all?true:false

// If NS -- that is, !IE -- then set up for mouse capture
if (!IE) document.captureEvents(Event.MOUSEMOVE)

// Set-up to use getMouseXY function onMouseMove
document.onmousemove = getMouseXY;

// Temporary variables to hold mouse x-y pos.s
var mouseX = 0
var mouseY = 0

// Remember the popup state
var PopupOpen = false;

// Main function to retrieve mouse x-y pos.s

function showPopupV(width,height,left_pos,top_pos,file,obj){

	// Ajax load the content
	ajax_loadContent('PopupContent','library/help/' + file + '_inc.htm');
	ajax_loadContent('PopupHeader','library/help/' + file + '_header_inc.htm');
	
	// Adjust for weird IE sizing
	if (IE_4Plus) { 
		width += 10;
		height += 10;
	}
	var hdrHeight = 30; // Total height of the header bar
	var shdwOffset = 12; // Pixel offsset for the shadow div
	var padCompensation = 10; // This is set to twice the margin in the div css block
	
	var winHeight = winSize('height'); // Get the inner window height
	if (winHeight < height) {
		if (winHeight < 1) {
			winHeight = height + hdrHeight + 200; // Compensate for no window size return
		} else {
			height = winHeight - 60; // Compensate for really small windows
		}
	}
	var winWidth = winSize('width'); // Get the inner window width
	if (winWidth < width) {
		if (winWidth < 1) {
			winWidth = width + 200; // Compensate for no window size return
		} else {
			width = winWidth - 60; // Compensate for really small windows
		}
	}
	 
	var Header = document.getElementById("PopupHeader"); // Get the handle for the header bar div
	var popUp = document.getElementById("PopupContent"); // Get the handle for the content div
	var Shadow = document.getElementById("PopupShadow"); // Get the handle for the shadow div
	var left = "";
	var top = "";
	
	// Set the left position
	if (left_pos == "center" || left_pos == "") {
		left = (winWidth - width)/2;
		if (IE_4Plus) { left += 15; }
	} else if (left_pos == "left") {
		left = 187;
	} else if (left_pos == "right") {
		left = winWidth - width - shdwOffset - 173;
		if (IE_4Plus) { left += 30; }
	} else {
		left = left_pos;
	}
	//if (IE_4Plus) { left += 10; }
	
	// Set the top for the header and figure the rest from there
	if (top_pos == "mouse_center") {
		top = mouseY - ((height + hdrHeight)/2);
	} else if (top_pos == "mouse_top") {
		top = mouseY;
	} else if (top_pos == "mouse_top+50") {
		top = mouseY+50;
	} else if (top_pos == "mouse_bottom") {
		top = mouseY - (height + hdrHeight);
	} else {
		top = (((winHeight - height)/2) - hdrHeight);
		if (IE_4Plus) { top += 10; }
	}
	if (top < 10) { top = 10; }
	
	Header.style.top =  top + "px"; // Calculate the top offset
	Header.style.left = left + "px"; // Calculate the left offset
	if (IE_4Plus) {
		Header.style.width = (width) + "px"; // Set the header bar width for IE
	} else {
		Header.style.width = (width + padCompensation) + "px"; // Set the header bar width
	}
	Header.style.height = hdrHeight + "px"; // Set the header bar height
	
	if (IE_4Plus) {
		popUp.style.top = (top + hdrHeight - 1) + "px"; // Calculate the vertical offset
	} else {
		popUp.style.top = (top + hdrHeight) + "px"; // Calculate the vertical offset
	}
	popUp.style.left = left + "px"; // Set the left offset
	popUp.style.width = width + "px"; // Set the content width
	popUp.style.height = height + "px"; // Set the content height
	
	Shadow.style.top = (top + shdwOffset) + "px"; // Calculate the vertical offset
	Shadow.style.left = left + shdwOffset + "px"; // Calculate the left offset
	if (IE_4Plus) {
		Shadow.style.width = (width) + "px"; // Set the shadow width
		Shadow.style.height = height + hdrHeight + "px"; // Set the shadow height
	} else {
		Shadow.style.width = (width + padCompensation) + "px"; // Set the shadow width
		Shadow.style.height = height + hdrHeight + padCompensation + "px"; // Set the shadow height
	}
	
	// Turn on the divs
	Header.style.visibility = "visible";
	popUp.style.visibility = "visible";
	Shadow.style.visibility = "visible";
	
	PopupOpen = true;
}

function showMenuHint(left_pos,top_pos,image){

	if (PopupOpen) { hidePopup(); }
	
	var width = 135; // Fixed width for the div
	var height = 135; // Fixed heightr for the div
	var shdwOffset = 12; // Pixel offsset for the shadow div

	// Adjust for weird IE sizing
	if (IE_4Plus) { 
		width += 10;
		height += 10;
	}
	 
	var popUp = document.getElementById("PopupContent"); // Get the handle for the content div
	var Shadow = document.getElementById("PopupShadow"); // Get the handle for the shadow div
	var left = "";
	var top = "";
	
	// Set the left position
	if (left_pos == "center" || left_pos == "") {
		left = (winWidth - width)/2;
	} else if (left_pos == "left") {
		left = 187;
	} else if (left_pos == "menu_hint") {
		left = 165;
	} else if (left_pos == "right") {
		left = winWidth - width - shdwOffset - 173;
	} else {
		left = left_pos;
	}
	//if (IE_4Plus) { left += 10; }
	
	// Set the top for the header and figure the rest from there
	if (top_pos == "mouse_center") {
		top = mouseY - ((height + hdrHeight)/2);
	} else if (top_pos == "mouse_top") {
		top = mouseY;
	} else if (top_pos == "mouse_bottom") {
		top = mouseY - (height + hdrHeight);
	} else {
		top = (((winHeight - height)/2) - hdrHeight);
		if (IE_4Plus) { top += 10; }
	}
	if (top < 10) { top = 10; }
	
	popUp.style.top = top + "px"; // Calculate the vertical offset
	popUp.style.left = left + "px"; // Set the left offset
	popUp.style.width = width + "px"; // Set the content width
	popUp.style.height = height + "px"; // Set the content height
	
	if (!IE_4Plus) {
		width += 10;
		height += 10;
	}
	Shadow.style.top = (top + shdwOffset) + "px"; // Calculate the vertical offset
	Shadow.style.left = (left + shdwOffset) + "px"; // Calculate the left offset
	Shadow.style.width = width + "px"; // Set the shadow width
	Shadow.style.height = height + "px"; // Set the shadow height
	
	// Set the image
	document.menu_hint.src = image;
	
	// Turn on the divs
	popUp.style.visibility = "visible";
	Shadow.style.visibility = "visible";
	
}

function showPhotoZoom(left_pos,top_pos,image,zoom_size){

	if (PopupOpen) { hidePopup(); }
	
	if (zoom_size > 100) {
		var width = zoom_size + 10; // Fixed width for the div
		var height = zoom_size + 10; // Fixed height for the div
	} else {
		var width = 510; // Fixed width for the div
		var height = 510; // Fixed height for the div
	}
	var shdwOffset = 12; // Pixel offsset for the shadow div

	// Adjust for weird IE sizing
	if (IE_4Plus) { 
		width += 10;
		height += 10;
	}
	 
	var popUp = document.getElementById("PopupContent"); // Get the handle for the content div
	var Shadow = document.getElementById("PopupShadow"); // Get the handle for the shadow div
	var left = "";
	var top = "";
	
	// Set the left position
	if (left_pos == "center" || left_pos == "") {
		left = (winWidth - width)/2;
	} else if (left_pos == "left") {
		left = 187;
	} else if (left_pos == "mouse_right") {
		left = mouseX + 50;
	} else if (left_pos == "right") {
		left = winWidth - width - shdwOffset - 173;
	} else {
		left = left_pos;
	}
	//if (IE_4Plus) { left += 10; }
	
	// Set the top for the header and figure the rest from there
	if (top_pos == "mouse_center") {
		top = mouseY - ((height + hdrHeight)/2);
	} else if (top_pos == "mouse_top") {
		top = mouseY;
	} else if (top_pos == "mouse_up") {
		top = mouseY - 105;
	} else if (top_pos == "mouse_bottom") {
		top = mouseY - (height + hdrHeight);
	} else {
		top = (((winHeight - height)/2) - hdrHeight);
		if (IE_4Plus) { top += 10; }
	}
	if (top < 10) { top = 10; }
	
	popUp.style.top = top + "px"; // Calculate the vertical offset
	popUp.style.left = left + "px"; // Set the left offset
	popUp.style.width = width + "px"; // Set the content width
	popUp.style.height = height + "px"; // Set the content height
	
	if (!IE_4Plus) {
		width += 10;
		height += 10;
	}
	Shadow.style.top = (top + shdwOffset) + "px"; // Calculate the vertical offset
	Shadow.style.left = (left + shdwOffset) + "px"; // Calculate the left offset
	Shadow.style.width = width + "px"; // Set the shadow width
	Shadow.style.height = height + "px"; // Set the shadow height
	
	// Set the image
	document.menu_hint.src = image;
	if (zoom_size > 100) {
		document.menu_hint.width = zoom_size; 
		document.menu_hint.height = zoom_size;
	} else {
		document.menu_hint.width = 500; 
		document.menu_hint.height = 500;
	}
	
	// Turn on the divs
	popUp.style.visibility = "visible";
	Shadow.style.visibility = "visible";
	
}

function hidePopup(){

	var Header = document.getElementById("PopupHeader"); // Get the handle for the header bar div
	var popUp = document.getElementById("PopupContent"); // Get the handle for the content div
	var Shadow = document.getElementById("PopupShadow"); // Get the handle for the shadow div
	
	// Turn off the divs
	Header.style.visibility = "hidden";
	popUp.style.visibility = "hidden";
	Shadow.style.visibility = "hidden";
	
	// Clear the divs
	Header.innerHTML = "&#160;";
	//popUp.innerHTML = "&#160;";
	
	// Ajax reload the default content
	ajax_loadContent('PopupContent','library/help/menu_hint_inc.htm');
	PopupOpen = false;
}

function winSize(direction) {

	var myWidth = 0, myHeight = 0;
	if( typeof( window.innerWidth ) == 'number' ) {
	//Non-IE
		myWidth = window.innerWidth;
		myHeight = window.innerHeight;
	} else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
	//IE 6+ in 'standards compliant mode'
		myWidth = document.documentElement.clientWidth;
		myHeight = document.documentElement.clientHeight;
	} else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
	//IE 4 compatible
		myWidth = document.body.clientWidth;
		myHeight = document.body.clientHeight;
	}
	if (direction == "width") {
  		return myWidth;
	} else {
  		return myHeight;
	}
}

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

//-->

