// JavaScript Document
var dict_definition = new Array();
dict_definition['BMI'] = "Underweight -> Less than 18.5.<br> Normal Weight -> From 18.5 to 24.9.<br> Overweight -> From 25 to 29.9.<br> Obesity -> Greater than 30. ";
dict_definition['BMR']  = "Simply put, BMR is the number of calories you'd burn if you stayed in bed all day. It does not include exercise, typing on the computer, yard work, walking, talking, sitting, driving your car, shopping or even thinking for that matter. Yet, your BMR is important because it accounts for 60% to 70% of calories you burn each day. Wow, can you believe that!!! Nearly two thirds of the calories you burn every day are the result of your BMR which includes calories burned for basic bodily functions such as breathing, blood circulation and maintenance of body temperature. So many people don't realize this but it is truly a key factor in weight loss.<br>To have your BMR show in the graph and table below you must first fill out all of the required information in the settings tab. You must also enter your current weight before your BMR can be calculated. Each time you \"weigh in\" your BMR will be recalculated.";
dict_definition['TDEE'] = "Your Total Daily Energy Expenditure is also called and known as your \"maintenance level\". TDEE is the total sum of all the calories you burn in a day and includes calories burned by your BMR, daily activities and exercise. Accurately determining and knowing your TDEE is the most important factor in designing a successful weight loss program.<br>To have your TDEE show in the graph and table below you must first fill out all of the required information in the settings tab. Make sure to select the activity level that \"best\" describes your current lifestyle. You must also enter your current weight before your TDEE can be calculated. Each time you \"weigh in\" your TDEE will be recalculated. Your TDEE value that is calculated does not consider your actual calories you burn from your workouts, but instead uses an estimate of the calories you burn from exercising based on the \"Activity Factor\" you selected for your preferences in the Settings tab.";
dict_definition['WLGF'] = "The Weight Loss/Gain Forecaster purpose is to estimate the amount of weight you could lose over a period of time based on your current TDEE and the calories you consumed today. Your TDEE will change over time as you lose or gain weight and this means the accuracy of this calculator decreases with time.  This calculator is only accurate for healthy weight loss or weight gain. The American College of sports medicine (ACSM) says that the daily calorie level consumed for women should never drop below 1200 calories per day and 1800 calories per day for men. In, some cases this may still even be too much of a reduction and could cause severe health problems and cause your BMR to drop significantly. ";
dict_definition['TODAYSWORKOUTS'] = "Workouts you have scheduled for today in your calendar will automatically be shown here.";
dict_definition['WEIGHT'] = "This is where you can see, record and track all of your weight and body measurements.  Make sure you have first set all of your preferences in the Settings tab as this information is used to correctly display your weight, BMI and body measurements. You can easily enter your daily weight or body measurements by clicking on the green \"Enter My Daily Values\" button located in the upper right corner of the Workout Manager home page. You may also enter daily values by clicking on the link next to the bold value to the right of each graph you wish to change.";
dict_definition['MYWORKOUTS'] = "This where you can see and find information about all of your workouts, including number of completed workouts, distance traveled and your workout duration times.";
dict_definition['COMPLETEDWORKOUTS'] = "This graph shows how many workouts you have   completed. The information for this graph comes from workouts you have added to your calendar and marked as complete.";
dict_definition['DISTANCE'] = "This graph shows how you the sum of how far you have ran, swam or traveled for all or any of your cardio workouts. The information for this graph comes from workouts you have added to your calendar and marked as complete.";
dict_definition['TIME'] = "This graph shows your time details for all of your workouts. By default the sum times of all your workouts are shown in the graph. Alternatively you may select a sub category from the dropdown to see more specific workout time details.  The information for this graph comes from workouts you have added to your calendar and marked as complete.";
dict_definition['CALORIESDEFICIT'] = "This graph is calculated by subtracting calories you consumed today from your TDEE (calories you burned today). If you want to lose weight you will want calories consumed to be less than your TDEE. The opposite is true for those wanting to gain weight. The American College of sports medicine (ACSM) says that the daily calorie level consumed for women should never drop below 1200 calories per day and 1800 calories per day for men. In, some cases this may still even be too much of a reduction and could cause severe health problems.";
dict_definition['CALORIESCONSUMED'] = " This graph shows calories you have consumed. You can use our \"Food Search\" to quickly find the caloric values of almost any food.  Then just enter total calories consumed for the day by clicking on the green \"Enter My Daily Values\" button.";
dict_definition['EXERCISECALORIES'] = "This shows the calories you have burned through exercising.  The information for this graph comes from workouts you have added to your calendar and marked as complete.";
dict_definition['PRINTCALENDAR'] = "To print your calendar you have to enable \"Print Background Images\". Here is what you need to do:<br>Firefox Browsers:<br>Go To File -> Page Set Up -> Format & Options -> Check the option 'Print Background (colors & images)' -> Click OK<br>IE Browsers:<br>Go to Tools -> Internet Options -> Advanced -> Printing -> Check \"Print Background Colors and Images\" -> Click Apply";

var horizontal_offset="9px" //horizontal offset of hint box from anchor link
/////No further editting needed
var vertical_offset="0" //horizontal offset of hint box from anchor link. No need to change.
var ie=document.all
var ns6=document.getElementById&&!document.all

function getposOffset(what, offsettype){
	var totaloffset=(offsettype=="left")? what.offsetLeft : what.offsetTop;
	var parentEl=what.offsetParent;
	while (parentEl!=null){
		totaloffset=(offsettype=="left")? totaloffset+parentEl.offsetLeft : totaloffset+parentEl.offsetTop;
		parentEl=parentEl.offsetParent;
	}
	return totaloffset;
}

function iecompattest(){
	return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}

function clearbrowseredge(obj, whichedge){
	var edgeoffset=(whichedge=="rightedge")? parseInt(horizontal_offset)*-1 : parseInt(vertical_offset)*-1
	if (whichedge=="rightedge"){
		var windowedge=ie && !window.opera? iecompattest().scrollLeft+iecompattest().clientWidth-65 : window.pageXOffset+window.innerWidth-90
		dropmenuobj.contentmeasure=dropmenuobj.offsetWidth
		if (windowedge-dropmenuobj.x < dropmenuobj.contentmeasure)
		edgeoffset=dropmenuobj.contentmeasure+obj.offsetWidth+parseInt(horizontal_offset)
	}
	else{
		var windowedge=ie && !window.opera? iecompattest().scrollTop+iecompattest().clientHeight-15 : window.pageYOffset+window.innerHeight-18
		dropmenuobj.contentmeasure=dropmenuobj.offsetHeight
		if (windowedge-dropmenuobj.y < dropmenuobj.contentmeasure)
		edgeoffset=dropmenuobj.contentmeasure-obj.offsetHeight
	}
	return edgeoffset
}

function showhint(menucontents, obj, e, tipwidth){
	if ((ie||ns6) && document.getElementById("hintbox")){
		dropmenuobj=document.getElementById("hintbox");
		//var x = dict_definition.join("::");
		dropmenuobj.innerHTML= dict_definition[menucontents];
		//dropmenuobj.innerHTML='Substance means a chemical element and its compounds in the natural state or obtained by any manufacturing process, including any additive necessary to preserve its stability and any impurity deriving from the process used, but excluding any solvent which may be separated without affecting the stability of the substance or changing its composition;'
		dropmenuobj.style.left=dropmenuobj.style.top=-300
		if (tipwidth!=""){
			dropmenuobj.widthobj=dropmenuobj.style
			dropmenuobj.widthobj.width=tipwidth
		}
		dropmenuobj.x=getposOffset(obj, "left")
		dropmenuobj.y=getposOffset(obj, "top")
		dropmenuobj.style.left=dropmenuobj.x-clearbrowseredge(obj, "rightedge")+obj.offsetWidth+"px";
		dropmenuobj.style.top=dropmenuobj.y-clearbrowseredge(obj, "bottomedge")+"px";
		dropmenuobj.style.visibility="visible"
		obj.onmouseout=hidetip
	}
}

function hidetip(e){
	dropmenuobj.style.visibility="hidden"
	dropmenuobj.style.left="-500px"
}

function createhintbox(){
	var divblock=document.createElement("div")
	divblock.setAttribute("id", "hintbox")
	document.body.appendChild(divblock)
}

if (window.addEventListener) {
	window.addEventListener("load", createhintbox, false)
} else if (window.attachEvent) {
	window.attachEvent("onload", createhintbox)
} else if (document.getElementById) {
	window.onload=createhintbox
}

