

function closepopup(){
	document.getElementById('grayout').style.display="none";
	document.getElementById('popup').style.display="none";
}
function openpopup(){
	window.top.location.href="#top"
	if(atrisk()){
		document.getElementById('errormsg').style.display="none";
		document.getElementById('grayout').style.display="inline";
		document.getElementById('popup').style.display="inline";
		
	}else{				
		document.getElementById('errormsg').style.display="block";
	}
}
function selectAll(){
	var i;
	for (i=1;i<7;i++){
		document.getElementById("opt"+i).checked = true
	}
	document.getElementById("opt7").checked = false
}
function deSelectAll(){
	var i;
	for (i=1;i<7;i++){
		document.getElementById("opt"+i).checked = false
	}
}
function deSelectNone(){
	document.getElementById("opt7").checked = false
}

function atrisk(){
	var i;
	var counter = 0;
	var header = "<h1>You May Have Risk Factors That Contribute to Athero</h1>";
	var subheadtext = "";
	var htmlstring = "";
	var flavortext = "";
	for (i=1;i<8;i++){
		if (document.getElementById("opt"+i).checked){
			switch(i){
				case 1:
					document.getElementById("opt7").checked = false
					subheadtext = '<tr><td class="subhead" colspan="2">Based on your selections below, your risk factors may contribute to the development and progression  of atherosclerosis. Keep in mind that one risk factor that we all have is increasing age. Because athero is a progressive disease, the older we get the more likely it is that plaque is building up in our arteries. </td></tr>';
					htmlstring += '<tr><td class="popupliststyle"><img src="/images/popupliststyle.gif" height="11" width="14" alt=""></td><td class="popuprowheader"> <b>Smoking</b></td></tr>'
					htmlstring += '<tr><td class="popupcopy" colspan="2">Smoking raises your blood pressure and reduces the amount of oxygen that reaches your heart, which can contribute to the progression of athero and increase your risk for heart disease and stroke, two major consequences of athero. If you smoke, you should try to quit right away.</td></tr>';
					flavortext =  '<tr><td class="popupcopy" colspan="2">Athero is a leading cause of coronary heart disease, stroke, and other serious health conditions. But the good news is that there is something that you can do. Talk with your doctor about how you can manage your specific health factors. In the meantime, learn more about what can happen if athero progresses untreated.</td></tr>'
				break    
				case 2:
					document.getElementById("opt7").checked = false
					subheadtext = '<tr><td class="subhead" colspan="2">Based on your selections below, your risk factors may contribute to the development and progression  of atherosclerosis. Keep in mind that one risk factor that we all have is increasing age. Because athero is a progressive disease, the older we get the more likely it is that plaque is building up in our arteries.</td></tr>';
					htmlstring += '<tr><td class="popupliststyle"><img src="/images/popupliststyle.gif" height="11" width="14" alt=""></td><td class="popuprowheader"> <b>Blood pressure over 120/80</b></td></tr>'
					htmlstring += '<tr><td class="popupcopy" colspan="2">High blood pressure puts increased pressure on the arteries and can damage the artery walls, which can speed up the progression of atherosclerosis. Even high-normal blood pressure can speed up the progression of athero. </td></tr>';
					flavortext = '<tr><td class="popupcopy" colspan="2">Even high-normal blood pressure can speed up athero&rsquo;s progression.</td></tr>'
				break
				case 3:
					document.getElementById("opt7").checked = false
					subheadtext = '<tr><td class="subhead" colspan="2">Based on your selections below, your risk factors may contribute to the development and progression  of atherosclerosis. Keep in mind that one risk factor that we all have is increasing age. Because athero is a progressive disease, the older we get the more likely it is that plaque is building up in our arteries. </td></tr>';
					htmlstring += '<tr><td class="popupliststyle"><img src="/images/popupliststyle.gif" height="11" width="14" alt=""></td><td class="popuprowheader"> <b>High cholesterol</b></td></tr>'
					htmlstring += '<tr><td class="popupcopy" colspan="2">Too much bad cholesterol in your blood can cause a buildup of plaque in the artery walls and fuel the progression of athero.</td></tr>';
					flavortext = '<tr><td class="popupcopy" colspan="2">Athero is a leading cause of coronary heart disease, stroke, and other serious health conditions. But the good news is that there is something that you can do. Talk with your doctor about how you can manage your specific health factors. In the meantime, learn more about what can happen if athero progresses untreated.</td></tr>'
				break
				case 4:
					document.getElementById("opt7").checked = false
					subheadtext = '<tr><td class="subhead" colspan="2">Based on your selections below, your risk factors may contribute to the development and progression  of atherosclerosis. Keep in mind that one risk factor that we all have is increasing age. Because athero is a progressive disease, the older we get the more likely it is that plaque is building up in our arteries. </td></tr>';
					htmlstring += '<tr><td class="popupliststyle"><img src="/images/popupliststyle.gif" height="11" width="14" alt=""></td><td class="popuprowheader"> <b>Diabetes</b></td></tr>'
					htmlstring += '<tr><td class="popupcopy" colspan="2">Diabetes can cause damage to the lining of the arteries, which makes it easier for bad cholesterol to collect in artery walls and contribute to the development of athero. </td></tr>';
					flavortext = '<tr><td class="popupcopy" colspan="2">Athero is a leading cause of coronary heart disease, stroke, and other serious health conditions. But the good news is that there is something that you can do. Talk with your doctor about how you can manage your specific health factors. In the meantime, learn more about what can happen if athero progresses untreated.</td></tr>'
				break
				case 5:
					document.getElementById("opt7").checked = false
					subheadtext = '<tr><td class="subhead" colspan="2">Based on your selections below, your risk factors may contribute to the development and progression  of atherosclerosis. Keep in mind that one risk factor that we all have is increasing age. Because athero is a progressive disease, the older we get the more likely it is that plaque is building up in our arteries. </td></tr>';
					htmlstring += '<tr><td class="popupliststyle"><img src="/images/popupliststyle.gif" height="11" width="14" alt=""></td><td class="popuprowheader"> <b>Obesity</b></td></tr>'
					htmlstring += '<tr><td class="popupcopy" colspan="2">If you are obese, you are also more likely to have high blood pressure and high cholesterol, two other risk factors that contribute to the development of athero. </td></tr>';
					flavortext = '<tr><td class="popupcopy" colspan="2">Athero is a leading cause of coronary heart disease, stroke, and other serious health conditions. But the good news is that there is something that you can do. Talk with your doctor about how you can manage your specific health factors. In the meantime, learn more about what can happen if athero progresses untreated.</td></tr>'
				break
				case 6:
					document.getElementById("opt7").checked = false
					subheadtext = '<tr><td class="subhead" colspan="2">Based on your selections below, your risk factors may contribute to the development and progression  of atherosclerosis. Keep in mind that one risk factor that we all have is increasing age. Because athero is a progressive disease, the older we get the more likely it is that plaque is building up in our arteries. </td></tr>';
					htmlstring += '<tr><td class="popupliststyle"><img src="/images/popupliststyle.gif" height="11" width="14" alt=""></td><td class="popuprowheader"> <b>Family history of early heart disease</b></td></tr>'
					htmlstring += '<tr><td class="popupcopy" colspan="2">Family history is defined as a risk factor that contributes to the progression of athero for those who have a father or brother who has been diagnosed with heart disease before the age of 55 or a mother or sister before the age of 65. </td></tr>';
					flavortext = '<tr><td class="popupcopy" colspan="2">Athero is a leading cause of coronary heart disease, stroke, and other serious health conditions. But the good news is that there is something that you can do. Talk with your doctor about how you can manage your specific health factors. In the meantime, learn more about what can happen if athero progresses untreated.</td></tr>'
				break
				/*case 7:
					document.getElementById("opt7").checked = false
					subheadtext = '<tr><td class="subhead" colspan="2">Based on your selections below, your health factors may contribute to the development of atherosclerosis. Keep in mind that one health factor that we all have is age. Because athero is a progressive disease, the older we get the more likely it is that plaque is building up in our arteries. </td></tr>';
					htmlstring += '<tr><td class="popupliststyle"><img src="/images/popupliststyle.gif" height="11" width="14" alt=""></td><td class="popuprowheader"> <b>Age</b></td></tr>'
					htmlstring += '<tr><td class="popupcopy" colspan="2">Because athero is a progressive disease, age is an important consideration. As you get older, your risk for heart disease, stroke and other consequences of athero can increase. </td></tr>';
					flavortext = '<tr><td class="popupcopy" colspan="2">Athero is a leading cause of coronary heart disease, stroke, and other serious health conditions. But the good news is that there is something that you can do. Talk with your doctor about how you can manage your specific health factors. In the meantime, learn more about what can happen if athero progresses untreated.</td></tr>'
				break */
				/*case 8:
					htmlstring = ""
					subheadtext = '<tr><td class="subhead" colspan="2">Based on your selections below, your health factors may contribute to the development of atherosclerosis. Keep in mind that one health factor that we all have is age. Because athero is a progressive disease, the older we get the more likely it is that plaque is building up in our arteries. </td></tr>';
					htmlstring += '<tr><td class="popupliststyle"><img src="/images/popupliststyle.gif" height="11" width="14" alt=""></td><td class="popuprowheader"> <b>Age</b></td></tr>'
					htmlstring += '<tr><td class="popupcopy" colspan="2">Because athero is a progressive disease, age is an important consideration. As you get older, your risk for heart disease, stroke and other consequences of athero can increase. </td></tr>';
					htmlstring += '<tr><td class="popupliststyle"><img src="/images/popupliststyle.gif" height="11" width="14" alt=""></td><td class="popuprowheader"> <b>Smoking</b></td></tr>'
					htmlstring += '<tr><td class="popupcopy" colspan="2">Smoking raises your blood pressure and reduces the amount of oxygen that reaches your heart, which can contribute to the progression of athero and increase your risk for heart disease and stroke, two major consequences of athero. If you smoke, you should try to quit right away.</td></tr>';
					htmlstring += '<tr><td class="popupliststyle"><img src="/images/popupliststyle.gif" height="11" width="14" alt=""></td><td class="popuprowheader"> <b>Blood pressure over 120/80</b></td></tr>'
					htmlstring += '<tr><td class="popupcopy" colspan="2">High blood pressure puts increased pressure on the arteries and can damage the artery walls, which can speed up the progression of atherosclerosis.  </td></tr>';
					htmlstring += '<tr><td class="popupliststyle"><img src="/images/popupliststyle.gif" height="11" width="14" alt=""></td><td class="popuprowheader"> <b>High cholesterol</b></td></tr>'
					htmlstring += '<tr><td class="popupcopy" colspan="2">Too much bad cholesterol in your blood can cause a buildup of plaque in the walls and fuel the progression of athero.</td></tr>';
					htmlstring += '<tr><td class="popupliststyle"><img src="/images/popupliststyle.gif" height="11" width="14" alt=""></td><td class="popuprowheader"> <b>Diabetes</b></td></tr>'
					htmlstring += '<tr><td class="popupcopy" colspan="2">Diabetes can cause damage to the lining of the arteries, which makes it easier for bad cholesterol to collect in artery walls and contribute to the development of athero. </td></tr>';
					htmlstring += '<tr><td class="popupliststyle"><img src="/images/popupliststyle.gif" height="11" width="14" alt=""></td><td class="popuprowheader"> <b>Overweight/obesity</b></td></tr>'
					htmlstring += '<tr><td class="popupcopy" colspan="2">If you are obese, you are also more likely to have high blood pressure, high cholesterol, two health factors that contribute to the development of athero. </td></tr>';
					htmlstring += '<tr><td class="popupliststyle"><img src="/images/popupliststyle.gif" height="11" width="14" alt=""></td><td class="popuprowheader"> <b>Family history of premature heart disease</b></td></tr>'
					htmlstring += '<tr><td class="popupcopy" colspan="2">Family history is defined as a health factor that contributes to the progression of athero only for those who have a father or brother who has been diagnosed with heart disease before the age of 55 or a mother or sister before the age of 65. </td></tr>';
					flavortext = '<tr><td class="popupcopy" colspan="2">Athero is a leading cause of coronary heart disease, stroke, and other serious health conditions. But the good news is that there is something that you can do. Talk with your doctor about how you can manage your specific health factors. In the meantime, learn more about what can happen if athero progresses untreated.</td></tr>'
				break*/
				default:
					header = "<h1>You May Not Have Risk Factors That Contribute to Athero</h1>";
					subheadtext = '<tr><td class="subhead" colspan="2">Based on your selection, you may not have any health factors that contribute to athero. However, athero is a progressive disease, and plaque buildup in your arteries is something that can change over time. One health factor that all of us have is age. The older we get the more likely it is that plaque is building up in our arteries.</td></tr>';
					flavortext = '<tr><td class="popupcopy" colspan="2">Talk with your doctor to find out what else you can do to slow the progression of athero and reduce the risks for its consequences.  In the meantime, learn more about what can happen if athero progresses untreated.</td></tr>'
			}
		}else{
			counter+=1;
		}
	}
	if(counter == 8){
		return(false);
	}
	flavortext += "</table>"
	document.getElementById('popupheader').innerHTML = header
	document.getElementById('popuptext').innerHTML="<table>" + subheadtext + htmlstring + flavortext;
	return(true);
}