//************************************************ 
//* Customizable region a file - this file can be 
//* modified to hold client page header.
//*
//* This region is the top of the html page.
//*
//* NOTE: DO NOT DELETE THIS FILE.
//*	  You may modify this file or you may
//*	  remove its functionality by deleting all
//*	  lines following the first line:
//*	  'document.write('<!--begin region_a-->');'
//*
//************************************************ 

// Normally a generic Quest header is used, but sometimes a special header is used depending on the URL.  
// getCustomScript checks the current URL and returns the custom script name, or "" if the generic script should be used.

function getCustomScript () {
        
        // THE NUMBER OF URLS/SCRIPTS
        var numScripts = 58;
        
        var scriptURL  = new Array(numScripts);
        var scriptName = new Array(numScripts);
        
        var thisPage = new String (location).toUpperCase();
        var result = "";
        
        //
        // START LIST OF URLS AND CORRESPONDING CUSTOM JAVASCRIPTS
        //
        
        scriptName[00] = "alpha_fetoprotein.js";     scriptURL[00] = "/kbase/topic/medtest/hw1663/descrip.htm";
        scriptName[01] = "bladder_cancer.js";        scriptURL[01] = "/kbase/topic/major/uh1360/descrip.htm";
        scriptName[02] = "blood_glucose.js";         scriptURL[02] = "/kbase/topic/medtest/hw8252/descrip.htm";
        scriptName[03] = "bloom.js";                 scriptURL[03] = "/kbase/nord/nord165.htm";
        scriptName[04] = "bone_mineral.js";          scriptURL[04] = "/kbase/topic/medtest/hw3738/descrip.htm";
        scriptName[05] = "breast_screening.js";      scriptURL[05] = "/kbase/nci/ncicdr0000257995.htm";
        scriptName[06] = "canavan.js";               scriptURL[06] = "/kbase/nord/nord157.htm";
        scriptName[07] = "chlamydia.js";             scriptURL[07] = "/kbase/topic/medtest/hw4046/descrip.htm";
        scriptName[08] = "crp.js";                   scriptURL[08] = "/kbase/topic/medtest/tu6309/descrip.htm";
        scriptName[09] = "colorectal_screening.js";  scriptURL[09] = "/kbase/nci/ncicdr0000258008.htm";
        scriptName[10] = "cystic_fibrosis.js";       scriptURL[10] = "/kbase/topic/major/hw188548/examtest.htm";
        scriptName[11] = "dysautonomia.js";          scriptURL[11] = "/kbase/nord/nord47.htm";
        scriptName[12] = "estrogens.js";             scriptURL[12] = "/kbase/topic/medtest/hw6200/descrip.htm";
        scriptName[13] = "fanconi.js";               scriptURL[13] = "/kbase/nord/nord84.htm";
        scriptName[14] = "folic_acid.js";            scriptURL[14] = "/kbase/topic/medtest/hw6522/descrip.htm";
        scriptName[15] = "gaucher.js";               scriptURL[15] = "/kbase/nord/nord12.htm";
        scriptName[16] = "gene_test.js";             scriptURL[16] = "/kbase/topic/medtest/hw4787/descrip.htm";
        scriptName[17] = "gonorrhea.js";             scriptURL[17] = "/kbase/topic/medtest/hw4905/descrip.htm";
        scriptName[18] = "hcg.js";                   scriptURL[18] = "/kbase/topic/medtest/hw42062/descrip.htm";
        scriptName[19] = "hepatitis_b_antigen.js";   scriptURL[19] = "/kbase/topic/major/hw40968/examtest.htm";
//      scriptName[20] = "hepatitis_c_antibody.js";  scriptURL[20] = "/kbase/topic/medtest/tw9921/descrip.htm";
        scriptName[20] = "hepatitis_c_rna.js";       scriptURL[20] = "/kbase/topic/detail/test/hw144321/detail.htm";
        scriptName[21] = "herpes_tests.js";          scriptURL[21] = "/kbase/topic/medtest/hw264763/descrip.htm";
        scriptName[22] = "hiv.js";                   scriptURL[22] = "/kbase/topic/medtest/hw4961/descrip.htm";
        scriptName[23] = "hpv.js";                   scriptURL[23] = "/kbase/topic/medtest/tu6451/descrip.htm";
        scriptName[24] = "immunoglobulins.js";       scriptURL[24] = "/kbase/topic/medtest/hw41342/descrip.htm";
        scriptName[25] = "karyotyping.js";           scriptURL[25] = "/kbase/topic/medtest/hw6392/descrip.htm";
        scriptName[26] = "niemann_pick.js";          scriptURL[26] = "/kbase/nord/nord93.htm";
        scriptName[27] = "ovarian_prevention.js";    scriptURL[27] = "/kbase/nci/ncicdr0000062822.htm";
        scriptName[28] = "pap.js";                   scriptURL[28] = "/kbase/topic/medtest/hw5266/descrip.htm";
//        scriptName[29] = "parathyroid_hormone.js";   scriptURL[29] = "/kbase/topic/medtest/hw8101/descrip.htm";
        scriptName[29] = "serum_triple.js";          scriptURL[29] = "/kbase/frame/ta703/ta7038/frame.htm";
        scriptName[30] = "sickle_cell.js";           scriptURL[30] = "/kbase/topic/medtest/hw43792/descrip.htm";
        scriptName[31] = "syphilis.js";              scriptURL[31] = "/kbase/topic/medtest/hw5839/descrip.htm";
        scriptName[32] = "tay_sachs.js";             scriptURL[32] = "/kbase/topic/mini/hw182975/overview.htm";
        scriptName[33] = "thyroid_tests.js";         scriptURL[33] = "/kbase/topic/medtest/hw27377/descrip.htm";
        scriptName[34] = "cbc.js";         scriptURL[34] = "/kbase/topic/medtest/hw4260/descrip.htm";
        scriptName[35] = "alt.js";         scriptURL[35] = "/kbase/topic/medtest/hw20645/descrip.htm";
        scriptName[36] = "tsp.js";         scriptURL[36] = "/kbase/topic/medtest/hw43614/descrip.htm";
        scriptName[37] = "alk_phos.js";         scriptURL[37] = "/kbase/topic/medtest/hw1717/descrip.htm";
        scriptName[38] = "ast.js";         scriptURL[38] = "/kbase/topic/medtest/hw20331/descrip.htm";
        scriptName[39] = "bun.js";         scriptURL[39] = "/kbase/topic/medtest/aa36271/descrip.htm";
        scriptName[40] = "creatinine.js";         scriptURL[40] = "/kbase/topic/medtest/hw4322/descrip.htm";
        scriptName[41] = "calcium.js";         scriptURL[41] = "/kbase/topic/medtest/hw3833/descrip.htm";
        scriptName[42] = "co2.js";         scriptURL[42] = "/kbase/topic/medtest/hw3895/descrip.htm";
        scriptName[43] = "chloride.js";         scriptURL[43] = "/kbase/topic/medtest/hw6323/descrip.htm";
        scriptName[44] = "cholesterol.js";         scriptURL[44] = "/kbase/topic/medtest/hw207814/descrip.htm";
        scriptName[45] = "ferritin.js";         scriptURL[45] = "/kbase/topic/medtest/hw6212/descrip.htm";
        scriptName[46] = "iron.js";         scriptURL[46] = "/kbase/topic/medtest/hw41550/descrip.htm";
        scriptName[47] = "ldh.js";         scriptURL[47] = "/kbase/topic/detail/test/tv6985/detail.htm";
        scriptName[48] = "magnesium.js";         scriptURL[48] = "/kbase/topic/medtest/aa11636/descrip.htm";
        scriptName[49] = "phosphate.js";         scriptURL[49] = "/kbase/topic/medtest/hw202265/descrip.htm";
        scriptName[50] = "potassium.js";         scriptURL[50] = "/kbase/topic/medtest/hw202677/descrip.htm";
        scriptName[51] = "sodium.js";         scriptURL[51] = "/kbase/topic/medtest/hw203476/descrip.htm";
        scriptName[52] = "tsh.js";         scriptURL[52] = "/kbase/topic/medtest/hw28656/descrip.htm";
        scriptName[53] = "uric_acid.js";         scriptURL[53] = "/kbase/topic/medtest/aa12023/descrip.htm";
        scriptName[54] = "calcium_urine.js";         scriptURL[54] = "/kbase/topic/medtest/hw27965/descrip.htm";
        scriptName[55] = "phosphate_urine.js";         scriptURL[55] = "/kbase/topic/medtest/hw202342/descrip.htm";
        scriptName[56] = "uric_acid_urine.js";         scriptURL[56] = "/kbase/topic/medtest/aa15402/descrip.htm";
        scriptName[57] = "lead_poisoning.js";         scriptURL[57] = "/kbase/topic/major/hw119898/descrip.htm";
        //
        // FINISH LIST
        //

        //search for each scriptURL[] entry in the current URL        
        var customURL = new String();
        for (i = 0; i < numScripts; i++) {
                customURL = scriptURL[i];
                if (thisPage.indexOf (customURL.toUpperCase()) >= 0) {
                        result = scriptName[i];
                        i = numScripts; //stop comparing
                }
        }
                
        return result;
}


// global footer
function bottom(htmlbase, showLogo){
	if (htmlbase == null) htmlbase = "";
	if (showLogo == null) showLogo = true;
	var today = new Date(); 	
	var year = today.getFullYear(); 

	str = "";
	str+= '<!--stopindex-->';
	str+= '<table cellspacing="0" cellpadding="0" border="0" width="760">';
	str+= '<tr>';
	str+= '<td width="10" rowspan="99"><img src="'+htmlbase+'/images/clear.gif" width=10 height=1></td>';
	str+= '<td width="160" bgcolor="#cccccc"><img src="'+htmlbase+'/images/clear.gif" width=160 height=1></td>';
	str+= '<td width="590" bgcolor="#cccccc"><img src="'+htmlbase+'/images/clear.gif" width=590 height=1></td>';
	str+= '</tr>';	
	str+= '<tr>';
	str+= '<td colspan="2" height="10"></td>';
	str+= '</tr>';
	str+= '<tr>';
	str+= '<td></td>';
	str+= '<td><span class="utility">Go to: <a href="'+htmlbase+'/index.html" class="utility">HOME</a> | <a href="'+htmlbase+'/hcp/index.html" class="utility">Healthcare Professionals</a> | <a href="'+htmlbase+'/patient/index.html" class="utility">Patients and Consumers</a> | <a href="'+htmlbase+'/brand/index.html" class="utility">About Our Company</a> </span></td>';
	str+= '</tr>';
	str+= '<tr>';
	str+= '<td colspan="2" height="10"></td>';
	str+= '</tr>';
	str+= '<tr>';
	str+= '<td></td>';
		
	str+= '<td colspan="2"><span class="utility">Quest, Quest Diagnostics, the associated logo, Nichols Institute and all associated Quest Diagnostics marks are the registered trademarks of Quest Diagnostics. All third party marks &#8212; &#174;\' and &#8482;\' &#8212; are the property of their respective owners. &#169; 2000-';
	
	str+= year;
	
	str+= ' Quest Diagnostics Incorporated.  All rights reserved.</span></td>';
	str+= '</tr>';
	
	
	str+= '<tr>';
	str+= '<td colspan="2" height="20"></td>';
	str+= '</tr>';
	str+= '</table>';	
	str+= '<!--startindex-->';
	document.write(str);

	if(showLogo)
		logo(htmlbase);
}


function logo(htmlbase){
	if (htmlbase == null) htmlbase = "";

if (document.layers) {
	document.write('<layer id="quest_logo" height="59" width="153" left="5" top="12"><a href="'+htmlbase+'/index.html" target="_top"><img src="'+htmlbase+'/images/b_logo_quest_compliant.gif" width="153" height="59" alt="Quest Diagnostics" border="0"></a></layer>');
	} else {
	document.write('<div id="quest_logo" style="position: absolute; left: 5px; top: 12px; z-index: 10; width: 153px; height: 59px;"><a href="'+htmlbase+'/index.html" target="_top"><img src="'+htmlbase+'/images/b_logo_quest_compliant.gif" width="153" height="59" alt="Quest Diagnostics" border="0"></a></div>');
}

}


























// This is a popup for "buy your own lab tests" link
function openQuestest(url, w, h){
        var randomstring = "";
        var alphabet = new Array("a","b","c");
        for (var i=0; i < 4; i++) {
                var rndlet = Math.round(Math.random()+.3 * alphabet.length);
                randomstring += alphabet[rndlet];
        }
        windowFeatures = 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizeable=yes,height=470,width=410,left=230,top=0';
        window.open(url, randomstring, windowFeatures);
}


// This displays the standard or customized header, broken into three sections: top, middle/custom, and bottom.
function regionA (customScript) {
        var sCustomScript = new String (customScript);
        
        document.write ('<script src="/healthwise/js/custom_headers/region_a_top.js"></script> ');
        if (sCustomScript.length > 0) {
                //use the custom middle content
                document.write ('<script src="/healthwise/js/custom_headers/' + sCustomScript + '"></script> ');
        }
        else {  //use the generic middle content
                document.write ('<script src="/healthwise/js/custom_headers/region_a_middle.js"></script> ');
        }
        document.write ('<script src="/healthwise/js/custom_headers/region_a_bottom.js"></script> ');
}


//main section of script
regionA (getCustomScript());
