//define lexicons for different glossing contexts

var glossWords_generic = new Array();

glossWords_generic[glossWords_generic.length] = 'ancestry|none|none|<b>Ancestry</b> can be represented by a family tree showing how biological family members are related to each other. It is sometimes used interchangeably with "lineage."';
glossWords_generic[glossWords_generic.length] = 'close relative|close relatives|none|A <b>close relative</b> is defined as a mother, father, sister, brother or child.';
glossWords_generic[glossWords_generic.length] = 'functional|none|none|<b>Functional</b> refers to genes or proteins that are not affected by genetic changes that disrupt their normal structure or behavior.';
glossWords_generic[glossWords_generic.length] = 'gene|genes|none|<b>Gene:</b> A piece of DNA that acts as an instruction to the body for how to make a specific protein (enzyme, hormone, etc.). Genes are inherited, passed from parent to child.';
glossWords_generic[glossWords_generic.length] = 'genetic counselor|none|none|<b>Genetic counselor:</b> a healthcare professional with specialized training in how the science of genetics relates to medical care.  A genetic counselor can evaluate your personal and family history, identify any risk factors for birth defects or genetic conditions, and help you understand and make decisions about testing or other options you may have.';
glossWords_generic[glossWords_generic.length] = 'genetic disorder|none|none|For these purposes, <b>genetic condition</b> refers to any condition caused by a change in the DNA of a single gene. Genetic disorders are inherited in predictable ways and specialized gene testing is often available. There are thousands of different genetic disorders. Common examples are: cystic fibrosis, sickle cell, Tay-Sachs, and muscular dystrophy.';
glossWords_generic[glossWords_generic.length] = 'hormone|hormones|none|<b>Hormones</b> may include oral contraceptive pills, patches or rings; hormonal treatments for infertility; hormone replacement therapy; or serum estrogen modifiers (sometimes taken to treat or prevent certain forms of cancer).';
glossWords_generic[glossWords_generic.length] = 'metabolism|none|none|<b>Metabolism:</b>The way drugs and other substances are broken down for use in the body and elimination.';
glossWords_generic[glossWords_generic.length] = 'mutation|mutations|none|<b>Mutation:</b>A change in the DNA code that may cause a gene not to function in the normal way.';
//glossWords_generic[glossWords_generic.length] = 'word|plural|exclude|<b>Word</b> defition text';


var glossWords_PGx = new Array();

glossWords_PGx[glossWords_PGx.length] = 'DNA|none|DNA Direct##DNA Perspectives|<b>DNA</b> is the acronym for deoxyribonucleic acid. DNA is the set of genetic instructions that direct all cellular activities including drug metabolism.';
glossWords_PGx[glossWords_PGx.length] = 'P450|none|none|<b>P450</b> is name for a family of drug metabolism enzymes that make drugs more soluble in the body.';
glossWords_PGx[glossWords_PGx.length] = 'functional|none|none|<b>Functional</b> refers to genes or proteins that are not affected by genetic changes that disrupt their normal structure or behavior.';
glossWords_PGx[glossWords_PGx.length] = 'gene|genes|none|<b>Gene:</b> A piece of DNA that acts as an instruction to the body for how to make a specific protein (enzyme, hormone, etc.). Genes are inherited, passed from parent to child.';
glossWords_PGx[glossWords_PGx.length] = 'genetic counselor|none|none|<b>Genetic counselor:</b> a healthcare professional with specialized training in how the science of genetics relates to medical care.  A genetic counselor can evaluate your personal and family history, identify any risk factors for birth defects or genetic conditions, and help you understand and make decisions about testing or other options you may have.';
glossWords_PGx[glossWords_PGx.length] = 'genetic disorder|none|none|For these purposes, <b>genetic condition</b> refers to any condition caused by a change in the DNA of a single gene. Genetic disorders are inherited in predictable ways and specialized gene testing is often available. There are thousands of different genetic disorders. Common examples are: cystic fibrosis, sickle cell, Tay-Sachs, and muscular dystrophy.';
glossWords_PGx[glossWords_PGx.length] = 'metabolism|none|none|<b>Metabolism:</b>The way drugs and other substances are broken down for use in the body and elimination.';
glossWords_PGx[glossWords_PGx.length] = 'metabolizer status|none|none|<b>Metabolizer status:</b>A measure of how well your body breaks down certain drugs, and a prediction of the amount of a drug that you may need and your risk for having side-effects.';
glossWords_PGx[glossWords_PGx.length] = 'mutations|mutations|none|<b>Mutation:</b>A change in the DNA code that may cause a gene not to function in the normal way.';
//glossWords_PGx[glossWords_PGx.length] = 'word|plural|exclude|<b>Word</b> defition text';


var glossWords_qFVL = new Array();

glossWords_qFVL[glossWords_qFVL.length] = 'close relative|close relatives|none|A <b>close relative</b> is defined as a mother, father, sister, brother or child.';
glossWords_qFVL[glossWords_qFVL.length] = 'a blood clot in the veins|none|none|<b>A blood clot in the veins</b> is defined as a deep vein thrombosis (DVT), which usually occurs in the legs or arms, but may also occur in the brain, eye and liver, or a pulmonary embolism (PE) which occurs when a blood clot travels to the lungs.';
glossWords_qFVL[glossWords_qFVL.length] = 'hormone|hormones|none|<b>Hormones</b> may include oral contraceptive pills, patches or rings; hormonal treatments for infertility; hormone replacement therapy; or serum estrogen modifiers (sometimes taken to treat or prevent certain forms of cancer).';
glossWords_qFVL[glossWords_qFVL.length] = 'preeclampsia|none|none|<b>Preeclampsia</b> is characterized by high blood pressure and the presence of protein in the urine and typically occurs after 20 weeks of pregnancy.';
glossWords_qFVL[glossWords_qFVL.length] = 'placental abruption|placental abruptions|none|<b>Placental abruption</b> is defined as the separation of the placental lining from the uterus.';
glossWords_qFVL[glossWords_qFVL.length] = 'intrauterine growth retardation|none|none|<b>Intrauterine growth retardation</b> is usually defined as any fetus whose size in below the 10th percentile compared to other babies of the same gestational age.';
//glossWords_qFVL[glossWords_qFVL.length] = 'word|plural|exclude|<b>Word</b> defition text';


var glossWords_GEN = new Array();

glossWords_GEN[glossWords_GEN.length] = 'mitochondrial DNA|none|none|Also called mtDNA, <b>mitochondrial DNA</b> is found in the energy-producing structures of cells called mitochondria. Only mothers pass mtDNA to their children, not fathers.';
glossWords_GEN[glossWords_GEN.length] = 'Y-DNA|none|none|<b>Y-DNA</b> refers to the Y chromosome is found only in men and is passed only from father to son. It is one of two sex chromosomes; the other is the X chromosome. Men have an XY combination of sex chromosomes while women have XX.';
glossWords_GEN[glossWords_GEN.length] = 'sequence|sequences|none|A DNA <b>sequence</b> is the order of four bases represented by the letters A, T, C, and G that hold the information our cells need to keep our bodies running.';
glossWords_GEN[glossWords_GEN.length] = 'chromosomal DNA|none|none|<b>Chromosomal DNA</b> is found in the cell nucleus. It is made up of 23 pairs of chromosomes.';
glossWords_GEN[glossWords_GEN.length] = 'autosomal DNA|none|none|<b>Autosomal DNA</b> is found in non-sex chromosomes located in the cell nucleus. Humans have 44 non-sex chromosomes.';
glossWords_GEN[glossWords_GEN.length] = 'admixture|none|none|<b>Admixture</b> is a person\'s ancestry that can originate from more than one ethnic and/or racial group.';
glossWords_GEN[glossWords_GEN.length] = 'marker|markers|none|<b>Markers</b> are short segments of DNA that can be compared between people.';
glossWords_GEN[glossWords_GEN.length] = 'genetic profile|genetic profiles|none|<b>Genetic profiles</b> are a set of DNA markers (short segments of DNA) that can be used to identify a unique person.';
glossWords_GEN[glossWords_GEN.length] = 'genetic genealogy|none|none|<b>Genetic genealogy</b> is the use of DNA testing to study a person\'s ancestry and ethnic background.';
glossWords_GEN[glossWords_GEN.length] = 'lineage|lineages|none|A <b>lineage</b> refers to line of descendants of one person, also known as a common ancestor. Descendants include children, grandchildren, great-grandchildren, and so on.';
glossWords_GEN[glossWords_GEN.length] = 'maternal lineage|maternal lineages|none|<b>Maternal lineage</b> indicates all the male and female descendents of a female ancestor who is related to you as your mother, or grandmother, or great-grandmother, and so on.';
glossWords_GEN[glossWords_GEN.length] = 'paternal lineage|paternal lineages|none|<b>Paternal lineage</b> indicates all the male and female descendents of a male ancestor who is related to you as your father, or grandfather, or great-grandfather, and so on.';
glossWords_GEN[glossWords_GEN.length] = 'common ancestor|common ancestors|none|A <b>common ancestor</b> is a person to whom two or more descendants can be linked.';
glossWords_GEN[glossWords_GEN.length] = 'ancestry|none|none|<b>Ancestry</b> can be represented by a family tree showing how biological family members are related to each other. It is sometimes used interchangeably with "lineage."';


var glossWords_lenetix = new Array();

glossWords_lenetix[glossWords_lenetix.length] = 'abdominal wall defect|none|none|<b>Abdominal wall defect:</b> A birth defect characterized by a herniation of abdominal organs through the abdomen. The most common examples are omphalocele (herniation through the navel) and gastroschisis (herniation to one side of the navel).';
glossWords_lenetix[glossWords_lenetix.length] = 'AchE|none|none|<b>AchE:</b> An enzyme found in nerve tissue that is involved with regulating nerve impulses.  During pregnancy, AchE measured in the amniotic fluid can be used to confirm a neural tube defect in a developing baby.';
glossWords_lenetix[glossWords_lenetix.length] = 'AFP|none|none|<b>AFP</b> is short for Alpha-FetoProtein, a protein made mostly by the developing baby\'s liver in pregnancy. AFP levels measured in the mother\'s blood during the second trimester tend to be higher-than-expected in pregnancies with neural tube defects and lower-than-expected in pregnancies with Down syndrome or Trisomy 18.';
glossWords_lenetix[glossWords_lenetix.length] = 'amniocentesis|none|none|<b>Amniocentesis:</b> A procedure typically done in the second trimester of pregnancy to get a small amount of the amniotic fluid that surrounds the developing baby. Cells from the fluid can be used to diagnose chromosome abnormalities or specific genetic conditions. Done by inserting a thin needle under ultrasound guidance through the mother\'s abdomen into the "bag of water."';
glossWords_lenetix[glossWords_lenetix.length] = 'amniotic fluid|none|none|<b>Amniotic fluid:</b> The liquid (sometimes called the "water") that surrounds and cushions the developing baby in the womb. The amniotic fluid is circulated through the baby swallowing and inhaling it, and then urinating or exhaling it out.';
glossWords_lenetix[glossWords_lenetix.length] = 'anencephaly|none|none|<b>Anencephaly:</b> A birth defect where a significant part of the skull and brain do not form. Babies with anencephaly usually do not survive pregnancy or more than a few days after delivery. Up to 1 in 2,500 babies born has anencephaly.';
glossWords_lenetix[glossWords_lenetix.length] = 'B-hCG|none|none|<b>B-hCG</b> is short for Beta-human Chorionic Gonadotropin, a hormone made during pregnancy by the placenta and often used as the basis of a pregnancy test. B-hCG levels measured in the mother\'s blood during pregnancy tend to be higher-than-expected in pregnancies with Down syndrome and lower-than-expected in pregnancies with trisomy 18.';
glossWords_lenetix[glossWords_lenetix.length] = 'birth defect|birth defects|none|<b>birth defect:</b> any problem with how a part of the body is formed or functions that is present from birth.  A birth defect is likely to cause some degree of physical or mental disability, unless there is an effective treatment available. There are many different recognized causes, but in many cases, the cause is unknown.  About 1 in 33 babies born has some type of birth defect.';
glossWords_lenetix[glossWords_lenetix.length] = 'chorionic villus sampling|none|none|<b>CVS:</b> A medical procedure done in the first trimester of pregnancy to take a cell sample of the placenta. Cells from the placenta can be used to diagnose chromosome abnormalities or specific genetic conditions. Depending on the placenta location, this may be done by inserting a thin needle through the abdomen or with a catheter inserted through the cervix.';
glossWords_lenetix[glossWords_lenetix.length] = 'CVS|none|none|<b>CVS:</b> A medical procedure done in the first trimester of pregnancy to take a cell sample of the placenta. Cells from the placenta can be used to diagnose chromosome abnormalities or specific genetic conditions. Depending on the placenta location, this may be done by inserting a thin needle through the abdomen or with a catheter inserted through the cervix.';
glossWords_lenetix[glossWords_lenetix.length] = 'chromosome abnormality|chromosome abnormalities|none|<b>Chromosome abnormality:</b> Chromosomes typically come in 23 pairs. A chromosome abnormality can be an extra or missing chromosome, an extra or missing piece of a chromosome, or a rearrangement in the structure of a chromosome. Some chromosome abnormalities can cause mental retardation and/or physical birth defects.';
glossWords_lenetix[glossWords_lenetix.length] = 'chromosome|chromosomes|chromosome abnormality|<b>Chromosome:</b> a package of genes found in the nucleus of the cell. Humans usually have 23 pairs of chromosomes, for a total of 46. One from each pair comes from our mother and the other from our father.';
glossWords_lenetix[glossWords_lenetix.length] = 'combined test|none|none|<b>Combined Test,</b> also called first trimester screening: Combines nuchal translucency measurement and blood test results to predict the chance for Down syndrome, trisomy, 18, and trisomy 13. Done in the first trimester of pregnancy.';
glossWords_lenetix[glossWords_lenetix.length] = 'combined test plus|none|none|<b>Combined Test Plus,</b> also called first trimester screening, combines nuchal translucency measurement and blood test results to predict the chance for Down syndrome, trisomy, 18, and trisomy 13. Done in the first trimester of pregnancy. Requires a separate AFP blood test in the second trimester for neural tube defect screening. The same as the Combined Test with an additional blood chemical ( Inhibin A).';
glossWords_lenetix[glossWords_lenetix.length] = 'contingent|none|none|<b>Contingent Test:</b> Combining nuchal translucency measurement and blood test results in the first trimester to predict the chance for Down syndrome, trisomy, 18, and trisomy 13. If the estimated risk is "high," prenatal diagnosis is offered. If the risk is "low," nothing else is done. If the risk is "intermediate," additional substances are measured in maternal blood in the second trimester to further evaluate high or low risk. A good compromise for those who want early testing if the risk is high, but also want the better detection rate that second trimester screening adds.';
glossWords_lenetix[glossWords_lenetix.length] = 'detection rate|none|none|<b>Detection rate:</b> The likelihood that a pregnancy with a specific condition will actually be identified as being at increased risk by the screening test. For instance, an 80% detection rate for Down syndrome means that 8 out of 10 pregnancies with Down syndrome would be classified as "increased risk" by the test; and 2 out of 10 pregnancies with Down syndrome would be classified as lower risk.';
glossWords_lenetix[glossWords_lenetix.length] = 'Down syndrome|none|none|<b>Down Syndrome,</b> also called trisomy 21: A chromosome abnormality caused by an extra chromosome #21 in each cell (total of 47 chromosomes instead of the usual 46). Usually associated with mild to moderate mental retardation, characteristic facial appearance, and sometimes other physical birth defects (heart, digestive system). About 1 in 800 to 1000 babies born has Down syndrome. Risk for Down syndrome increases with the mother\'s age.';
glossWords_lenetix[glossWords_lenetix.length] = 'gene|genes|none|<b>Gene:</b> A piece of DNA that acts as an instruction to the body for how to make a specific protein (enzyme, hormone, etc.). Genes are inherited, passed from parent to child.';
glossWords_lenetix[glossWords_lenetix.length] = 'genetic counselor|none|none|<b>Genetic counselor:</b> a healthcare professional with specialized training in how the science of genetics relates to medical care.  A genetic counselor can evaluate your personal and family history, identify any risk factors for birth defects or genetic conditions, and help you understand and make decisions about testing or other options you may have.';
glossWords_lenetix[glossWords_lenetix.length] = 'genetic disorder|none|none|For these purposes, <b>genetic condition</b> refers to any condition caused by a change in the DNA of a single gene. Genetic disorders are inherited in predictable ways and specialized gene testing is often available. There are thousands of different genetic disorders. Common examples are: cystic fibrosis, sickle cell, Tay-Sachs, and muscular dystrophy.';
glossWords_lenetix[glossWords_lenetix.length] = 'gestational age|none|none|<b>Gestational Age:</b> the number of weeks and days you are in pregnancy as calculated from the first day of your last period. Gestational age includes the two weeks from your last period to the time when you actually conceived. So, a person who is 15 weeks gestation has actually only been pregnant for about 13 weeks. A full-term pregnancy is 40 weeks gestation.';
glossWords_lenetix[glossWords_lenetix.length] = 'Inhibin A|none|none|<b>Inhibin A:</b> a hormone involved in the production of eggs and sperm, and in maintaining pregnancy.  Inhibin A levels measured in the mother\'s blood tend to be higher-than-expected in pregnancies with Down syndrome.';
glossWords_lenetix[glossWords_lenetix.length] = 'integrated|none|none|<b>Integrated Test:</b> Combines nuchal translucency measurement with blood test results from the first and second trimesters to predict the chance for Down syndrome, trisomy 18, trisomy 13, and open neural tube defects. Results available in the second trimester. Best balance of low positive rate and high detection rate for Down syndrome.';
glossWords_lenetix[glossWords_lenetix.length] = 'mental retardation|none|none|<b>Mental retardation</b> is a general term for below-average intellectual function and ability to learn necessary life skills. Mild cases may not be diagnosed until school age while severe or profound cases are usually diagnosed in early childhood. Although many conditions are known to cause mental retardation, an explanation is only found in about 25% of cases. About 1 in 33 to 1 in 100 people has some degree of mental retardation.';
glossWords_lenetix[glossWords_lenetix.length] = 'modified sequential|none|none|<b>Modified Sequential Test:</b> In the first trimester, combines nuchal translucency measurement and blood test results to predict the chance for Down syndrome, trisomy, 18, and trisomy 13. If the estimated risk is "high," prenatal diagnosis is offered. If the risk is "low," additional substances are measured in maternal blood in the second trimester to further evaluate as high or low risk. A good compromise for those who want early testing if the risk is high, but also want the better detection rate that second trimester screening adds.';
glossWords_lenetix[glossWords_lenetix.length] = 'mutations|mutations|none|<b>Mutation:</b>A change in the DNA code that may cause a gene not to function in the normal way.';
glossWords_lenetix[glossWords_lenetix.length] = 'neural tube defect|none|none|<b>Neural tube defect:</b> A group of birth defects caused by a failure of the embryonic neural tube to close properly during the first month of pregnancy. This tissue becomes the brain and spinal cord. The most common example is spina bifida, which causes an opening in the spine and often, damage to the underlying nerves and spinal cord. Some degree of paralysis of the lower limbs is common and other complications are possible.';
glossWords_lenetix[glossWords_lenetix.length] = 'nuchal translucency|none|none|The <b>nuchal translucency</b> is a normally occurring, fluid-filled area at the back of the developing baby\'s neck. The depth of the nuchal translucency can be measured by ultrasound at 11 weeks 1 day to 13 weeks 6 days. A larger-than-average nuchal translucency may be associated with a chromosome abnormality or certain other birth defects.';
glossWords_lenetix[glossWords_lenetix.length] = 'PAPP-A|none|none|<b>PAPP-A</b> is short for Pregnancy-Associated Plasma Protein A, a protein made during pregnancy by the placenta. PAPP-A levels measured in the mother\'s blood during the first trimester tend to be lower-than-expected in pregnancies with Down syndrome and certain other chromosome abnormalities.';
glossWords_lenetix[glossWords_lenetix.length] = 'perinatologist|none|none|<b>Perinatologist,</b> also called a maternal-fetal medicine specialist: a physician trained in obstetrics and gynecology that specializes in caring for women with high-risk pregnancies.';
glossWords_lenetix[glossWords_lenetix.length] = 'placenta|none|none|<b>Placenta:</b> the organ that forms with pregnancy to allow the transfer of oxygen, nutrients, and wastes between the mother and the developing baby. The cells of the placenta and the baby are formed from the same original fertilized egg.';
glossWords_lenetix[glossWords_lenetix.length] = 'positive rate|none|none|<b>Positive rate:</b> The percentage of all people who take the screening test who have an "increased risk" result for a specific condition. For instance, if the Down syndrome positive rate for a test is 5%, this means that 5 out of 100 (or 1 in 20) people who have the screening test will be classified as having an increased risk.  Most of these 5% of people will not actually have a baby with Down syndrome.';
glossWords_lenetix[glossWords_lenetix.length] = 'prenatal diagnostic procedure|prenatal diagnostic procedures|none|<b>Prenatal diagnostic procedures:</b> medical procedures done in pregnancy to obtain a sample of cells from the developing baby (fetus). Cells may be used to diagnose or rule out chromosome abnormalities or specific genetic conditions.  Amniocentesis and chorionic villus sampling (CVS) are the most common examples.';
glossWords_lenetix[glossWords_lenetix.length] = 'prenatal screening test|prenatal screening tests|none|<b>Prenatal screening tests:</b> tests done during pregnancy to identify an increased risk for Down syndrome, trisomy 18 or 13, spina bifida, and certain other birth defects. May combine maternal age, maternal blood test results, and/or ultrasound information. Prenatal diagnosis is then required to confirm or rule-out a condition.';
glossWords_lenetix[glossWords_lenetix.length] = 'quad test|none|none|<b>Quad Test:</b> Measures four substances in maternal blood to predict the chance for Down syndrome, trisomy 18, and neural tube defects. Done in the second trimester of pregnancy. The only screening option (other than ultrasound) available to women who want testing after 13 weeks 6 days gestation.';
glossWords_lenetix[glossWords_lenetix.length] = 'screen negative|none|none|<b>Screen negative:</b> When a risk estimate or other screening result is lower than the threshold established by the laboratory, the result is called "screen negative." This can be considered the "normal" result, although a screen negative result does not rule out a condition – it simply makes it less likely.';
glossWords_lenetix[glossWords_lenetix.length] = 'screen positive|none|none|<b>Screen positive:</b> When a risk estimate or other screening result exceeds the threshold established by the laboratory, the result is called "screen positive." Although this is not really an "abnormal" result (because it doesn\'t necessarily mean that anything is wrong with the pregnancy), some people find it easier to think about the result this way.';
glossWords_lenetix[glossWords_lenetix.length] = 'serum integrated|none|none|<b>Serum Integrated Test:</b> Combines blood test results from the first and second trimesters to predict the chance for Down syndrome, trisomy 18, and open neural tube defect. Results available in the second trimester. Designed to give the best detection rate possible for Down syndrome and trisomy 18 when nuchal translucency measurement is not available.';
glossWords_lenetix[glossWords_lenetix.length] = 'spina bifida|none|none|<b>Spina bifida:</b> A birth defect that involves incomplete development of part of the backbone and spinal cord. This often leaves an open lesion on the back (also called myelomeningocele) and may cause complete or partial paralysis of the legs, bowel and bladder control problems, and hydrocephalus ("water on the brain").  Severity of this condition depends in part on the size and location of the opening. Up to 1 in 800 babies born has spina bifida.';
glossWords_lenetix[glossWords_lenetix.length] = 'trimester|trimesters|none|A complete pregnancy is divided into three stages or <b>trimesters.</b> The first trimester extends until the end of 13 weeks.  The second trimester is 14 to 26 weeks.  The third trimester goes from 27 weeks through the end of pregnancy (usually 37 to 42 weeks).';
glossWords_lenetix[glossWords_lenetix.length] = 'trisomy 13|none|none|<b>Trisomy 13,</b> also called Patau syndrome: A chromosome abnormality caused by an extra chromosome #13 in each cell (total of 47 chromosomes instead of the usual 46). Usually associated with serious physical birth defects and mental retardation that limits survival beyond infancy. About 1 in 10,000 babies born has trisomy 13.';
glossWords_lenetix[glossWords_lenetix.length] = 'trisomy 18|none|none|<b>Trisomy 18,</b> also called Edward syndrome: A chromosome abnormality caused by an extra chromosome #18 in each cell (total of 47 chromosomes instead of the usual 46). Usually associated with serious physical birth defects and mental retardation that limits survival beyond infancy. About 1 in 3000 to 6000 babies has trisomy 18.';
glossWords_lenetix[glossWords_lenetix.length] = 'UE3|none|none|<b>UE3</b> is short for unconjugated estriol, a form of the hormone estrogen that is made during pregnancy in part by the developing baby and the placenta. uE3 levels measured in the mother\'s blood during the second trimester tend to be lower-than-expected in pregnancies with Down syndrome and trisomy 18.';
glossWords_lenetix[glossWords_lenetix.length] = 'ultrasound|ultrasounds|none|<b>Ultrasounds,</b> or sonograms use high-frequency sound waves that reflect off the developing baby\'s body structures and are received by a computer to create a picture. There are no documented risks with ultrasound and no radiation is used. Ultrasound in pregnancy is useful to measure the baby\'s growth, evaluate the major structures and organs for birth defects or unusual appearance, and assess other features such as the amount of amniotic fluid and the position and appearance of the placenta.';
//glossWords_lenetix[glossWords_lenetix.length] = 'word|plural|exclude|<b>Word</b> defition text';

var glossWords_sfpa = new Array();

glossWords_sfpa = glossWords_lenetix;

var okayPreChars = '"> (';
var okayPostChars = '" <.,\'!)';

function findPlace(whatText, inWhatString) {

	var thePlaceObj = new Object();

	thePlaceObj.wordStart = -1;	

	if (whatText != 'none') {		

		var wordPos = '';
		thePlaceObj.preChar = '';
		thePlaceObj.postChar = '';		

		//we only search for words with space in front of them 
		//and a space, period, or comma after them
		//because we don't want to catch pieces of other words
		//this will miss some occurneces of words, but will prevent
		//weird partial word linking		

		if (capName(whatText) == whatText || whatText.toUpperCase() == whatText || whatText.toLowerCase() != whatText) {
			wordPos = inWhatString.indexOf(whatText);
				
			if (wordPos >= 0) {
				thePlaceObj.preChar = inWhatString.substring(wordPos - 1, wordPos);
				thePlaceObj.postChar = inWhatString.substring(wordPos + whatText.length, wordPos + whatText.length + 1);
			}
			
		} else {
			wordPos = inWhatString.toLowerCase().indexOf(whatText);
			if (wordPos >= 0) {
				thePlaceObj.preChar = inWhatString.toLowerCase().substring(wordPos - 1, wordPos);
				thePlaceObj.postChar = inWhatString.toLowerCase().substring(wordPos + whatText.length, wordPos + whatText.length + 1);
			}
		}
		
		//alert(whatText + '|' + wordPos);

		if (okayPreChars.indexOf(thePlaceObj.preChar) != -1 && okayPostChars.indexOf(thePlaceObj.postChar) != -1) {
			thePlaceObj.wordStart = wordPos;
		}
	}

	return(thePlaceObj);

}

var stopSearch = false;
var foundNode = null;

function searchAllChildTextNodes(thisObj, whichLex, whichExcludeLex) {	

	for (var j=0;j<thisObj.childNodes.length;j++) {
		var thisNode = thisObj.childNodes[j];
		if (thisNode.nodeType != 3) {
			//we don't want to worry about text inside any <a> nodes
			//so we can abandon nodes branches with hrefs			

            var nodeName = thisNode.nodeName.toLowerCase();

            if (thisNode.href == null && nodeName != 'h1' && nodeName != 'h2' && nodeName != 'h3') {
				searchAllChildTextNodes(thisNode, whichLex, whichExcludeLex);
			}
						
		} else {

			//if (whichLex == 'trisomy 18') {
			//	alert('[' + thisNode.nodeValue + '] [' + thisNode.nodeValue.indexOf(whichLex) + ']');
			//}

			var lexInd = thisNode.nodeValue.indexOf(whichLex);			
			var excludeLexInd = null;

			if (lexInd != -1) {

				if (whichExcludeLex.indexOf('##') != -1) {
					var excludes = whichExcludeLex.split('##');
					var excludeMatch = false;
					for (var k=0; k<excludes.length ;k++) {
						excludeLexInd = thisNode.nodeValue.indexOf(excludes[k]);				
						
						if (lexInd == excludeLexInd) {
							foundNode = null;
							stopSearch = false;
							break;
						} else if (okayPostChars.indexOf(thisNode.nodeValue.charAt(lexInd + whichLex.length)) != -1 && ((okayPreChars.indexOf(thisNode.nodeValue.charAt(lexInd - 1)) != -1) || (lexInd == 0))) {
							foundNode = thisNode;
							stopSearch = true;
						}

					}
				} else {
					excludeLexInd = thisNode.nodeValue.indexOf(whichExcludeLex);
					if (lexInd != excludeLexInd && okayPostChars.indexOf(thisNode.nodeValue.charAt(lexInd + whichLex.length)) != -1 && ((okayPreChars.indexOf(thisNode.nodeValue.charAt(lexInd - 1)) != -1) || (lexInd == 0))) {
						foundNode = thisNode;
						stopSearch = true;
					}

				}

			}
		}

		if (stopSearch) {			
			break;
		}
	}

	return(foundNode);

}

var theURL = document.location.href;

function getLexFromFocusedTest() {

	var thisLexID = 'generic';

	if (theURL.indexOf('/drug-response/') != -1) {
		thisLexID = 'PGx';
	} else if (theURL.indexOf('/blood-clotting-disorders/') != -1) {
		thisLexID = 'FVL';
	} else if (theURL.indexOf('/ancestry-and-genealogy/') != -1) {
		thisLexID = 'GEN';
	}

	if (thisLexID == 'NONE') {
		thisLexID = 'generic'
	}

	return(thisLexID);
}

var fullGlossaryML = '';

var defsList = new Array();

function addArticleGloss(eleID, whichLex, thisTabW) {	

	if (!document.getElementById(eleID)) {
		return(void(0));
	}

	fullGlossaryML = '';

	var thisObj =  document.getElementById(eleID);

	var thisArtContent = thisObj.innerHTML;
	var origArtContent = thisObj.innerHTML;

	var thisLex = glossWords_generic;

	if (!exists(whichLex)) {
		whichLex = getLexFromFocusedTest();
	}

	if (exists(thisTabW)) {
		tabW = thisTabW + 0;
	}

	try {
		thisLex = eval('glossWords_' + whichLex);
	} 
	catch(err) {
		thisLex = null;
	}

	//alert('glossWords_' + whichLex +']]]]' + thisLex.length);

	if (thisLex != null) {

		defsList = new Array();

		for (var i=0;i<thisLex.length;i++) {		

			var thisWordSingular = thisLex[i].split('|')[0];
			var thisWordPlural = thisLex[i].split('|')[1];
			var thisWordExclude = thisLex[i].split('|')[2];
			
			defsList[i] = replace(replace(thisLex[i].split('|')[3], '\'', '\\\''), '"', '&quot;');	

			fullGlossaryML += '<a href="javascript:showGloss(\'' + thisWordSingular + '\', ' + i + ');">' + thisWordSingular + '</a><br>';

			var nodeForPlural = null;
			
			var nodeForSingular = null;
			
			if (thisWordPlural != 'none') {
				nodeForPlural = searchAllChildTextNodes(thisObj, thisWordPlural, thisWordExclude);
				stopSearch = false;
			}

			nodeForSingular = searchAllChildTextNodes(thisObj, thisWordSingular, thisWordExclude);
			stopSearch = false;
			
			//alert(thisWordSingular + '| ' +  nodeForSingular  + ' | ' + nodeForPlural);

			foundNode = null;

			var thisNode = null;
			var thisWord = '';

			if (nodeForPlural) {
				thisNode = nodeForPlural;
				thisWord = thisWordPlural + '';
			} else  {
				thisNode = nodeForSingular;
				thisWord = thisWordSingular + '';
			}

			var thisPlaceObj = new Object();
			var thisWordPlaceObj = new Object();

			if (thisNode) {

				var nodeML = thisNode.parentNode.innerHTML + '';
				var nodeText = thisNode.nodeValue;

				thisWordPlaceObj = findPlace(thisWord, nodeText);

				if (thisWordPlaceObj.wordStart > -1) {

					var thisWordFromText = nodeText.substring(thisWordPlaceObj.wordStart,thisWordPlaceObj.wordStart + thisWord.length);

					//alert(thisWordFromText + '\n\r' + nodeText + '\n\r\n\r' + thisPlaceObj.wordStart);

					var unglossedNodeText = nodeText + '';
					thisPlaceObj = findPlace(unglossedNodeText, nodeML);

					//alert(thisWordFromText + '\n\r' + nodeML + '\n\r' + nodeText + '\n\r' + thisPlaceObj.wordStart);

					nodeText = nodeText.substring(0,thisWordPlaceObj.wordStart-1) + thisWordPlaceObj.preChar + getLinkedWordML(thisWord, thisWordFromText, i, eleID) + thisWordPlaceObj.postChar + nodeText.substring(thisWordPlaceObj.wordStart + thisWordFromText.length + 1,nodeText.length);

					//alert(nodeText);

					if (thisPlaceObj.wordStart > -1) {
						thisNode.parentNode.innerHTML =  nodeML.substring(0,thisPlaceObj.wordStart-1) + thisPlaceObj.preChar + nodeText + thisPlaceObj.postChar + nodeML.substring(thisPlaceObj.wordStart + unglossedNodeText.length + 1,nodeML.length);
					}

					//alert(nodeML.substring(0,thisPlaceObj.wordStart-1) + thisPlaceObj.preChar + nodeText + thisPlaceObj.postChar + nodeML.substring(thisPlaceObj.wordStart + unglossedNodeText.length + 1,nodeML.length));
				}
				
			}			

		}

	}

}

function getLinkedWordML(thisWord, thisWordFromText, wordInd, eleID) {

	if (thisWordFromText.indexOf(' ') == -1) {
		return(getGlossLink(thisWord, thisWordFromText, wordInd, eleID + '_' + wordInd));
	} else {
		var intraLinkedWordML = '';
		var wordBits = thisWordFromText.split(' ');
		for (var j=0;j< wordBits.length;j++ ) {
			intraLinkedWordML += getGlossLink(thisWord, wordBits[j] + (j<(wordBits.length-1)?' ':''), wordInd, eleID + '_' + wordInd + '_' + j);
		}
		return(intraLinkedWordML);
	}

}

function getGlossLink(thisWord, thisWordFromText, wordInd, linkID) {

	return('<a class="glossA" href="javascript:;" onClick="showGloss(\'' + thisWord + '\', ' + wordInd + ', event, this);this.blur();" id="glossA_' + linkID + '">' + thisWordFromText + '</a>');

}


var tabW = 175;
var tabH = 110;

var lastLinkObj = null;

function showGloss(thisWord, thisDefIndex, clickEvent, linkObj) {

	if (exists(clickEvent)) {

		lastLinkObj = linkObj;

		//close the current tab if there is one
		//closeTab();

		var ePos = findPos(linkObj);

		//alert(ePos[0] + '\\\\' + ePos[1]);

		var eX = ePos[0] + linkObj.offsetWidth/5;
		var eY = ePos[1] + 18;

		//get the window size to offset clicks near the edges
		var oX = document.body.clientWidth + document.body.scrollLeft;
		var oY = document.body.clientHeight + document.body.scrollTop;

		//and offset the left and top of the tip box
		//if we're close to an edge

		if ((eX + tabW) > oX) {
			eX = eX - (tabW - (oX - eX)) - 1;	
		}

		if ((eY + tabH) > oY) {
			eY = eY - (tabH - (oY - eY));	
		}

		//and finally the scroll offset for smaller windows

		//eX += document.body.scrollLeft;
		//eY += document.body.scrollTop;

		//alert(document.body.scrollTop);
	}

	document.getElementById('glossDef').innerHTML =  defsList[thisDefIndex] + '<div style="position:relative;display:block;text-align:right;font-size:11px;"><a href="javascript:viewFullGlossary();">view full glossary</a></div>';

	if (exists(clickEvent)) {
		document.getElementById('glossDiv').style.top = eY + 'px';
		document.getElementById('glossDiv').style.left = eX + 'px';
		document.getElementById('glossDiv').style.display = 'block';
	}

}


function viewFullGlossary() {

	document.getElementById('glossDef').innerHTML = '<div style="height:250px;overflow:auto;"><strong style="font-size:13px;">Glossary of Terms</strong><br><p style="margin-top:5px;margin-bottom:0px;">' + fullGlossaryML + '</p></div>';

}

var glossHide = true;
function callHideGloss() {
	setTimeout('hideGloss();', 200);

}

function hideGloss() {
	if (glossHide) {
		document.getElementById('glossDiv').style.display = 'none';
	}
}

function findPos(obj) {

	obj = document.getElementById(obj.id);

	var curleft = curtop = 0;
	if (obj.offsetParent) {
		curleft = obj.offsetLeft
		curtop = obj.offsetTop

		while (obj = obj.offsetParent) {			

			curleft += obj.offsetLeft
			curtop += obj.offsetTop

		}
	}

	return [curleft,curtop];
}