﻿// JScript File

function changeCell(el) {

//variable declarations
cellone = document.getElementById(el.id);
celltitle = document.getElementById("title");
celldata = document.getElementById("desc");

var img = document.getElementById("imgArrow");
// initialization
var tdDesc = document.getElementById("tdDesc");
tdDesc.style.textAlign = "left";
tdDesc.style.verticalAlign="top";

var tblInfo = document.getElementById("tblInfo");
tblInfo.style.display = "block";

var tblArrow = document.getElementById("tblArrow");
tblArrow.style.display = "none";


var img = document.createElement("img");
img.src = "images/left-arrow.gif";
img.width="66";
img.height="45";
celltitle.innerHTML = "";
celltitle.appendChild(img);
celltitle.innerHTML = "";
el.bgColor="#dce3e6";

// change the title and text
if(el.id=='onea')
{
    celltitle.innerHTML = "MAGNESIUM";
	celldata.innerHTML = "Important for cell metabolism, activation of enzymes and as an agent in utilization of other minerals and vitamins. Necessary for nerve and muscle function. Deficiency results: Muscular weakness, heart & circulatory diseases, nervousness and depression, dizziness, diarrhea, convulsions. Alcoholics and diabetics often short of magnesium. Daily need: 300mg ";
	 
}
else if(el.id=='oneb')
{
	celltitle.innerHTML = "CHROMIUM";
	celldata.innerHTML = "Improves the body's utilization of glucose and helps to regulate blood sugar levels. Believed to keep cholesterol low. Deficiency results: Hardening of the arteries. Daily need: Trace";
	 
}
else if(el.id=='onec')
{
	celltitle.innerHTML = "MANGANESE";
	celldata.innerHTML = "Activates enzymes and helps maintain reproductive processes. Deficiency results: Unlikely, but causes poor equilibrium & bad co-ordination, sterility, reduction of sexual drive, abnormal body growth, stillbirths. Daily need: Trace.";
	 
}
else if(el.id=='oned')
{
	celltitle.innerHTML = "PHOSPHORUS";
	celldata.innerHTML = "Present in all cells, important for grow maintenance & repair of cells, energy and nerve transmissions, genetic and hereditary patterns. Deficiency results: Poor teeth and bones, disturbance in cell regulation, stunted growth. Daily need: 1mg ";
	 
}
else if(el.id=='onee')
{
	celltitle.innerHTML = "SULPHUR";
	celldata.innerHTML = "Helps in formation of body tissue, necessary for proper function of the vitamins thiamine & biotin, acts as a detoxant. Deficiency results: Rare, but same effect as lack of protein. Daily need: No fixed amount, widely available through protein.";
	 
}
else if(el.id=='onef')
{
	celltitle.innerHTML = "SELENIUM";
	celldata.innerHTML = "Anti oxidant and prevents certain forms of cancer. May be important in vision. Deficiency results: Difficulty in absorbing and utilizing Vitamin E. Daily need: 200mg";
	 
}
else if(el.id=='oneg')
{
	celltitle.innerHTML = "COPPER";
	celldata.innerHTML = "Associated with iron in production of red blood cells, stimulating the production of hair pigment, catalyzes enzymes connected with muscle and nerve fibers. Deficiency results: Rare, but can lead to anemia, graying and loss of hair, heart trouble and nervousness. Daily need: 2,5mg. ";
	 
}
else if(el.id=='oneh')
{
	celltitle.innerHTML = "ZINC";
	celldata.innerHTML = "Assists in elimination of carbon dioxide, helps formation of enzymes and proteins. Deficiency results: Delayed sexual maturity & retarded grow. Daily need: Trace.";
	 
}
else if(el.id=='onei')
{
	celltitle.innerHTML = "POTASSIUM";
	celldata.innerHTML = "Stimulates and maintains nerve signals and muscle contractions. Helps regulate osmosis and water balance. Essential for cell metabolism. Deficiency results: Muscular weakness, irritability, and heart problems. Daily need: 4mg. ";
	 
}
else if(el.id=='onej')
{
	celltitle.innerHTML = "CHLORINE";
	celldata.innerHTML = "Important in cell metabolism, helps regulate the balance of acid and alkali in the blood. Deficiency results: Arteriosclerosis, poor water retention. Daily need: 4-10mg.";
	 
}
else if(el.id=='onek')
{
	celltitle.innerHTML = "SODIUM";
	celldata.innerHTML = "Important in cell-metabolism. Protects body against excess fluid loss. Balances acid and alkali levels. Influences muscle activity. Deficiency results: Rare, but excessive perspiration may deplete the body's salt content, causing headaches, nausea, diarrhea and cramp. Daily need: 2-5mg. Maximum 1 gm with high blood pressure. ";
	 
}
else if(el.id=='onel')
{
	celltitle.innerHTML = "BROMINE";
	celldata.innerHTML = "Necessary for cell metabolism and stimulation of the body's natural repair process. Deficiency results: Nervous tension, drying of skin, possible proliferation of skin cells. Daily need: Trace";
	 
}
else if(el.id=='onem')
{
	celltitle.innerHTML = "CALCIUM";
	celldata.innerHTML = "Regulates heart muscles and nerve transmission. Builds and maintains bones and teeth. Deficiency results: Deterioration of bores and teeth, muscle cramps, numbness and tingling in arms and legs, blood clotting. Daily need: 600mg.";
	 
}
else if(el.id=='onen')
{
	celltitle.innerHTML = "IODINE";
	celldata.innerHTML = "Vital to cell metabolism & necessary for production of thyroxin which chiefly regulates metabolic energy. Deficiency results: Thyroid problems leading to weight gain, nervous tension, lethargy, hair loss and drying of skin. Daily need: Trace";
	 
}
else if(el.id=='oneo')
{
	celltitle.innerHTML = "IRON";
	celldata.innerHTML = "Assists in transportation of oxygen to the cells and in formation of hemoglobin. Deficiency results: Anemia, loss of energy, brittle nails, premature gray hair, palliations and breathlessness. Daily need: 15mg";
	 
}
else if(el.id=='onep')
{
	celltitle.innerHTML = "FLUORINE";
	celldata.innerHTML = "Helps deposit calcium thus strengthens teeth and bones. Hinders tooth decay by fighting acid forming bacteria. Deficiency results: Poor bones & teeth, tooth decay. Daily need: 1mg.";
	 
}
else if(el.id=='oneq')
{
	celltitle.innerHTML = "COBALT";
	celldata.innerHTML = "Proper functioning of red blood cells and Vit. B-12. Deficiency results: Dry, scaly skin; pernicious anemia Daily need: Trace.";
	 
}

//onmouseout functionality - reset
el.onmouseout=function() {
var tblInfo = document.getElementById("tblInfo");
tblInfo.style.display = "none";

var tblArrow = document.getElementById("tblArrow");
tblArrow.style.display = "block";

tdDesc = document.getElementById("tdDesc");

tdDesc.style.textAlign = "center";
tdDesc.style.verticalAlign="middle";

var img = document.createElement("img");
img.src = "images/left-arrow.gif";
img.width="66";
img.height="45";
celltitle.innerHTML = "";
celltitle.appendChild(img);//"<img id=""imgArrow"" src=""Images/left-arrow.gif"" />";
celldata.innerHTML = "<br>Scroll over a mineral to learn more...";
el.bgColor="transparent";
} 

}
