function display_menu() {
	if ( MM_FlashCanPlay ) {
		show_flash("flash_menu", "/flash/nav-top.swf", 755, 22, "loc=<%= path_translated %>")
	} else{
		document.write('<img src="/images/menu.gif" width="755" height="29" border="0" usemap="#menu_map">');
		document.write('<map name="menu_map" id="menu_map">');
	    document.write('<area shape="rect" coords="0,0,109,29" href="http://www.pureprescriptions.com/products/">');
	    document.write('<area shape="rect" coords="110,0,261,29" href="http://www.pureprescriptions.com/expert_opinion/">');
	    document.write('<area shape="rect" coords="262,0,406,29" href="http://www.pureprescriptions.com/healthy_living/">');
	    document.write('<area shape="rect" coords="407,0,550,29" href="http://www.pureprescriptions.com/health_library/">');
	    document.write('<area shape="rect" coords="551,0,616,29" href="http://www.pureprescriptions.com/products/on_sale.asp">');
	    document.write('<area shape="rect" coords="617,0,755,29" href="http://www.pureprescriptions.com/products/express_shop.asp">');
		document.write('</map>');
	}
}


$(document).ready(function(){
	var popDelay = "";
	$(".shareThis").hover(
		  function () {
			  if($(".shareThisDD").is(":hidden"))$(".shareThisDD").show();
			   if(popDelay != "") clearTimeout(popDelay);
		  }, 
		  function () {
			popDelay = setTimeout(function(){$('.shareThisDD').hide();}, 800);
		  }
	);
	$('.shareThisDD').hover(
		function() {			
			clearTimeout(popDelay);			
		},
		function(){
			popDelay = setTimeout(function(){$('.shareThisDD').hide();}, 800);
		}
	);	


});

var ajax = function()
	{
		this.req = null;			// This holds the request object
		this.oTimer = null;			// This is used for the timeout that hides the layer
		this.curID = "";			// This holds a reference to the current ID
		//this.prevID = "";			// This holds a reference to the previous ID
		this.oLayer = "";			// This holds a reference to the layer
		this.bv = "";				// This holds the users browser version
		this.mousex = 0;			// To be used when displaying the layer
		this.mousey = 0;			// To be used when displaying the layer
		this.browserCheck();		// This checks the users browser version
		this.bAjaxVerify = (!window.XMLHttpRequest && !window.ActiveXObject ? false : true);
		this.iRequests = 0;			// Total number of request
		this.oCache = [];			// This will contain a list of all info received from the server to reduce the amount of server calls
	}
	ajax.prototype.browserCheck = function()
	{
		// Set the users browser version
		this.bv = document.layers ? "ns" : document.getElementById && !document.all ? "ns6" : "ie";
	}
	ajax.prototype.requestPost = function(url, parameters)
	{
		// If Mozilla and Safari
		if (window.XMLHttpRequest) {
			this.req = new XMLHttpRequest();
			if (this.req.overrideMimeType)
				this.req.overrideMimeType("text/xml");
		
		// Else if IE
		} else if (window.ActiveXObject) {
			try {
				this.req = new ActiveXObject("Msxml2.XMLHTTP");
			} catch(e) {
				try {
					this.req = new ActiveXObject("Microsoft.XMLHTTP");
				} catch(e) {}
			}
		}

		// If successfull move on otherwise stop!
		if (this.req != null) {
			// Set the method to process the request
			this.req.onreadystatechange = this.requestProcess;
			
			// Open the request
			this.req.open("POST", url, true);
//			If sending XML
//				this.req.setRequestHeader("Content-Type", "text/xml");
//				this.req.send("<xmldoc><tag val="test"/><value>test</value></xmldoc>");
//			ELSE
			// Set the request headers
			this.req.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
			//this.req.setContentType("application/x-www-form-urlencoded");
			this.req.setRequestHeader("Content-length", parameters.length);
			this.req.setRequestHeader("Connection", "close");
			
			// Send the request
			this.req.send(parameters);
		}
	}
	ajax.prototype.requestProcess = function()
	{
		// Hold a reference to the ajax class
		var obj = oAjax;
		
		// Only if req shows "complete"
		if (obj.req.readyState == 4) {
			// Only if "OK"
			if (obj.req.status == 200) {
				var response = obj.req.responseText;
				obj.iRequests ++;

				if (response != "") {
					// Add the response to the cache array so we can pull it from there next time
					obj.cacheAdd(obj.curID, response);

					// Show the response
					obj.layerWrite(response);
				} else {
					//response = "ERROR-DELIMITER-InvalidID
					//obj.layerWrite("ERROR", "Invalid ID");
				}
			} else {
				// If the abort method was NOT envoked
				if (obj.req.status != 0){
				//	alert("There was a problem retrieving the XML data:\n" + req.statusText);
				}
			}
		}
	}
	ajax.prototype.messageGet = function(ID)
	{
		// Exit if ajax is NOT suppoted
		if (!this.bAjaxVerify)
			return;
			
		// Clear the timeout so the layer is not hidden accidentally
		clearTimeout(this.oTimer);
		
		// If this is the same request as the current one, return and ignore
		if (this.curID == ID)
			return;
		
		// Abort all current processes!
		if (this.req != null)
			this.req.abort();
		
		// If oLayer is not set, set it here and only here
		if (this.oLayer == "") {
			this.oLayer = document.getElementById("ajax-dragLayer");
		}

		// Hide the layer so it doesn't display until text is written to the layer
		this.oLayer.style.visibility = "hidden";
		
////////////////////////////////
		//return;
////////////////////////////////

		// Set the current ID to AnswerID so we no which one is currently being displayed
		this.curID = ID;
		
		// Set the previous ID to the current ID so we know if we should do another AJAX call
		//this.prevID = this.curID;
		
		// Update the PNG image for IE - IE doesn't automatically render PNGs as transparent
		//if (this.iRequests == 0) this.pngUpdate();

		// Check to see if we have the cached version before contacting the server
		var cachedIndex = this.cacheLookUp(this.curID);

		// Get the cached version
		if (cachedIndex > -1) {
			this.cacheGet(cachedIndex);
		// Get the server's version
		} else {
			// Encode the querystring and post the request
			var postStr = "id=" + this.encode(this.curID);
			this.requestPost("/includes/ajax_get_summary.asp", postStr);
		}
	}
	ajax.prototype.cacheLookUp = function(ID)
	{
		var index = -1;
		for (var i=0; i<this.oCache.length; i++)
		{
			if (this.oCache[i][0] == ID) {
				index = i;
				break;
			}
		}
		return index;
	}
	ajax.prototype.cacheAdd = function(ID, sText)
	{
		var index = this.cacheLookUp(ID);
		if (index == -1) {
			this.oCache[this.oCache.length] = [ID, sText];
		}
	}
	ajax.prototype.cacheGet = function(index)
	{
		this.layerWrite(this.oCache[index][1]);
	}	
	ajax.prototype.layerShow = function()
	{
		// Show the layer
		this.oLayer.style.visibility = "visible";
	}
	ajax.prototype.layerHide = function()
	{
		// Hide the layer and reset the current ID
		clearTimeout(this.oTimer);
		this.oTimer = setTimeout('oAjax.oLayer.style.visibility="hidden"; oAjax.curID = "";', 10);
	}
	ajax.prototype.layerWrite = function(sText)
	{
		var oResponseArray = sText.split("-DELIMITER-");
		if (oResponseArray.length == 0) return;
		var sTitle = oResponseArray[0];
		var sSummary = oResponseArray[1];

		// Write to and display the layer
		sTitle = this.decode(sTitle);
		sSummary = this.decode(sSummary);

		// If we are to show the layer to the left append "-left" to the end of the id
		$("#ajax-summary").html(sTitle);
		$("#ajax-summary").html(sSummary);
		
		//bHeight =  parseInt($(".dragbody").innerHeight()) - 100;
		
		// If we are NOT to hide the layer, show it
		if (this.curID != "")
			this.layerShow();
			
	}
	ajax.prototype.encode = function(uri)
	{
		if (escape) {
			return escape(uri);
		}
		if (encodeURIComponent) {
			return encodeURIComponent(uri);
		}
		return uri;
	}
	ajax.prototype.decode = function(uri)
	{
		uri = uri.replace(/\+/g, ' ');
		if (unescape) {
			return unescape(uri);
		}
		if (decodeURIComponent) {
			return decodeURIComponent(uri);
		}
		return uri;
	}

	// Instantiate the ajax class
	oAjax = new ajax();
	
	var bHeight = 0;
	
	// Capture the mouse events for all browers
	if (ajax.bv == "ns") {
		window.captureEvents(Event.MOUSEMOVE);
		window.onmousemove = followMouse;
	} else {
		document.onmousemove = followMouse;
	}


var pixTop = 0;
		


	function followMouse(e){
		// Set the x and y coordinates of the mouse so we know where to show the layer
		bHeight =  parseInt($(".dragbody").innerHeight()) - 100;
		
		if (oAjax.bv == "ie") {
			if (document.documentElement){
				var el = document.body ? document.body : document.documentElement;
				oAjax.mousey = (event.clientY + el.scrollTop) - (bHeight + 38);
				oAjax.mousex = (event.clientX + el.scrollLeft) + 47;
			} else {
				oAjax.mousey = (event.clientY + document.body.scrollTop) - (bHeight + 38);
				oAjax.mousex = (event.clientX + document.body.scrollLeft)  + 47;
			}

		} else {
			oAjax.mousey = e.pageY - bHeight;
			oAjax.mousex = e.pageX  + 50;
		}
		
		// If the layer is visible, set its location
		if (oAjax.curID != "") {
			oAjax.oLayer.style.left = oAjax.mousex + "px";
			oAjax.oLayer.style.top = oAjax.mousey + "px";
		}
	}

function showBigSubNav() {
	document.getElementById("big-subnav").style.display = "inline";
}

function hideBigSubNav() {
	document.getElementById("big-subnav").style.display = "none";
}