
function printOptions() 
{
 for (var i=90; i<=320; i++) {
  document.write('<option value="' + i + '">' + i + ' pounds</option>' + "\n");
	} 
}

function calculate() {
var f = document.forms['frmCalc'];
for (var i=0; i<(f.length-1); i++) 
		{
        if (f.elements[i].selectedIndex == 0) 
		{
            alert('Sorry, all options must be selected.');
            return false;
        }
    }
	var h, w;
    h = f.h.options[f.h.selectedIndex].value;
    w = f.w.options[f.w.selectedIndex].value;
	r = Math.round((w * 704.5) / (h * h));
	alert('BMI = ' + r);
 	return false;
}

function changea()
{
	
var ele= document.getElementById("a1");
var ele1= document.getElementById("a5");
ele.innerHTML="What are alternative diet programs? Most alternative diet programs center on the belief that you can improve your health by managing proper eating plan. Better food habits can help you be healthier. The American Heart Association recommends that Americans eat a variety of foods daily from all of the basic food groups.";
ele1.href="news_article/essential_health_tips.htm";
}

function changeb()
{
var ele= document.getElementById("a1");
var ele1= document.getElementById("a5");
ele.innerHTML="A demanding fitness programs that stretches and strengthens the spine, tones the body and develops a sense of well being within; a way of learning to relax. Yoga is probably the oldest defined practice of self development. Founded on principle those promote development of self awareness, through the practice of physical asana.";
ele1.href="men_fitness/motivation.htm";
}

function changec()
{
var ele= document.getElementById("a1");
var ele1= document.getElementById("a5");
ele.innerHTML="Older adults are growing in number and defying stereotypes, a government report shows. But those gaps are narrowing, the report states. Here are some of the report's health highlights: Heart disease, It is very important that you stay in touch with your own feelings while you are acting as an agent, A study gives mixed grades for the health of U.S.";
ele1.href="news_article/fitness_steps_for_men.htm";
}

function checkForm() {
		var Msg = "";
		var newline = "\r";
		if (document.intakes.age.value == "") {
				Msg = appendMsg(Msg, 'You must enter your age. ');
				document.intakes.age.focus();
			}
		var charpos = document.intakes.age.value.search("[^0-9]"); 
		if(document.intakes.age.value.length > 0 &&  charpos >= 0) { 
			Msg = appendMsg(Msg, 'Age must be a number.');
		}
		if(document.intakes.age.value > 110) {
			Msg = appendMsg(Msg, 'Age must be 110 or younger');
		}
		if(document.intakes.age.value < 2) {
			Msg = appendMsg(Msg, 'Age must be 2 or older');
		}
		if (document.intakes.sx.options[document.intakes.sx.selectedIndex].value == "0") {
				Msg = appendMsg(Msg, 'You must select your sex.');
				document.intakes.sx.focus();
			}
		if (document.intakes.act.options[document.intakes.act.selectedIndex].value == "0") {
				Msg = appendMsg(Msg, 'You must select your physical activity.');
				document.intakes.act.focus();
				}
		if (Msg.length > 0) {
			alert(Msg);
			return false;
		} else {
			goSubmit();
		}
	}
function appendMsg(Msg, TheMessage) {
		var newline = "\r";
		var aMsg = "";
		aMsg = Msg
		if (aMsg.length != 0) {
			aMsg += newline + TheMessage;
		} else {
			aMsg = TheMessage;
		}
		return aMsg;
	}
	function goSubmit() {
//	alert("Submitted");
		document.intakes.submit();
	}
	function checkEmail(myForm)
{
	if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(myForm))
	{	
		return (true);
	}
	alert("Please enter valid email address.");
	return 0;
}
function validate()
{
if (document.frm.newsletter.value == "")
	{
		alert("Please enter email address.");
		document.frm.newsletter.focus();
		return (false );
	}
	else	
		{
			if(checkEmail(document.frm.newsletter.value)==0)		
				{
					document.frm.newsletter.select();
					document.frm.newsletter.focus();
					return false;
				}
		}
}



document.write('');