//////////////////////////////////////////////////////////////////
//																//
//	NewYork-Presbyterian Hospital   							//
//	nyp.org site javascript										//
//	nyp.js														//
//	Version 2.0													//
//																//
//////////////////////////////////////////////////////////////////

if ( browser ){
	hea_on = new Image; hea_on.src="http://images.med.cornell.edu/headers/navbar/nyptransplant/top_nav_hea_on.gif";
	hea_off = new Image; hea_off.src="http://images.med.cornell.edu/headers/navbar/nyptransplant/top_nav_hea.gif";
	hea_activeTop = new Image; hea_activeTop.src="http://images.med.cornell.edu/headers/navbar/nyptransplant/top_nav_hea_on.gif";

	kid_on = new Image; kid_on.src="http://images.med.cornell.edu/headers/navbar/nyptransplant/top_nav_kid_on.gif";
	kid_off = new Image; kid_off.src="http://images.med.cornell.edu/headers/navbar/nyptransplant/top_nav_kid.gif";
	kid_activeTop = new Image; kid_activeTop.src="http://images.med.cornell.edu/headers/navbar/nyptransplant/top_nav_kid_on.gif";

	liv_on = new Image; liv_on.src="http://images.med.cornell.edu/headers/navbar/nyptransplant/top_nav_liv_on.gif";
	liv_off = new Image; liv_off.src="http://images.med.cornell.edu/headers/navbar/nyptransplant/top_nav_liv.gif";
	liv_activeTop = new Image; liv_activeTop.src="http://images.med.cornell.edu/headers/navbar/nyptransplant/top_nav_liv_on.gif";

	lun_on = new Image; lun_on.src="http://images.med.cornell.edu/headers/navbar/nyptransplant/top_nav_lun_on.gif";
	lun_off = new Image; lun_off.src="http://images.med.cornell.edu/headers/navbar/nyptransplant/top_nav_lun.gif";
	lun_activeTop = new Image; lun_activeTop.src="http://images.med.cornell.edu/headers/navbar/nyptransplant/top_nav_lun_on.gif";

	pan_on = new Image; pan_on.src="http://images.med.cornell.edu/headers/navbar/nyptransplant/top_nav_pan_on.gif";
	pan_off = new Image; pan_off.src="http://images.med.cornell.edu/headers/navbar/nyptransplant/top_nav_pan.gif";
	pan_activeTop = new Image; pan_activeTop.src="http://images.med.cornell.edu/headers/navbar/nyptransplant/top_nav_pan_on.gif";

		
	one_on = new Image; one_on.src="http://images.med.cornell.edu/headers/navbar/nyptransplant/about_on.gif";
	one_off = new Image; one_off.src="http://images.med.cornell.edu/headers/navbar/nyptransplant/about.gif";
	one_active = new Image; one_active.src="http://images.med.cornell.edu/headers/navbar/nyptransplant/about_on.gif";
	
	two_on = new Image; two_on.src="http://images.med.cornell.edu/headers/navbar/nyptransplant/cli_ser_on.gif";
	two_off = new Image; two_off.src="http://images.med.cornell.edu/headers/navbar/nyptransplant/cli_ser.gif";
	two_active = new Image; two_active.src="http://images.med.cornell.edu/headers/navbar/nyptransplant/cli_ser_on.gif";
	
	if (activeTop == "hea") {
		three_on = new Image; three_on.src="http://images.med.cornell.edu/headers/navbar/nyptransplant/hea_az_on.gif";
		three_off = new Image; three_off.src="http://images.med.cornell.edu/headers/navbar/nyptransplant/hea_az.gif";
		three_active = new Image; three_active.src="http://images.med.cornell.edu/headers/navbar/nyptransplant/hea_az_on.gif";
	} else if (activeTop == "kid") {
		three_on = new Image; three_on.src="http://images.med.cornell.edu/headers/navbar/nyptransplant/kid_az_on.gif";
		three_off = new Image; three_off.src="http://images.med.cornell.edu/headers/navbar/nyptransplant/kid_az.gif";
		three_active = new Image; three_active.src="http://images.med.cornell.edu/headers/navbar/nyptransplant/kid_az_on.gif";
	} else if (activeTop == "liv") {
		three_on = new Image; three_on.src="http://images.med.cornell.edu/headers/navbar/nyptransplant/liv_az_on.gif";
		three_off = new Image; three_off.src="http://images.med.cornell.edu/headers/navbar/nyptransplant/liv_az.gif";
		three_active = new Image; three_active.src="http://images.med.cornell.edu/headers/navbar/nyptransplant/liv_az_on.gif";
	} else if (activeTop == "lun") {
		three_on = new Image; three_on.src="http://images.med.cornell.edu/headers/navbar/nyptransplant/lun_az_on.gif";
		three_off = new Image; three_off.src="http://images.med.cornell.edu/headers/navbar/nyptransplant/lun_az.gif";
		three_active = new Image; three_active.src="http://images.med.cornell.edu/headers/navbar/nyptransplant/lun_az_on.gif";
	} else if (activeTop == "pan") {
		three_on = new Image; three_on.src="http://images.med.cornell.edu/headers/navbar/nyptransplant/pan_az_on.gif";
		three_off = new Image; three_off.src="http://images.med.cornell.edu/headers/navbar/nyptransplant/pan_az.gif";
		three_active = new Image; three_active.src="http://images.med.cornell.edu/headers/navbar/nyptransplant/pan_az_on.gif";
	}

	four_on = new Image; four_on.src="http://images.med.cornell.edu/headers/navbar/nyptransplant/wha_exp_on.gif";
	four_off = new Image; four_off.src="http://images.med.cornell.edu/headers/navbar/nyptransplant/wha_exp.gif";
	four_active = new Image; four_active.src="http://images.med.cornell.edu/headers/navbar/nyptransplant/wha_exp_on.gif";

	five_on = new Image; five_on.src="http://images.med.cornell.edu/headers/navbar/nyptransplant/org_don_on.gif";
	five_off = new Image; five_off.src="http://images.med.cornell.edu/headers/navbar/nyptransplant/org_don.gif";
	five_active = new Image; five_active.src="http://images.med.cornell.edu/headers/navbar/nyptransplant/org_don_on.gif";

	fivea_on = new Image; fivea_on.src="http://images.med.cornell.edu/headers/navbar/nyptransplant/res_on.gif";
	fivea_off = new Image; fivea_off.src="http://images.med.cornell.edu/headers/navbar/nyptransplant/res.gif";
	fivea_active = new Image; fivea_active.src="http://images.med.cornell.edu/headers/navbar/nyptransplant/res_on.gif";

}


// ::::::::::::::::::::::::::: SECTION II: set values for panos, use absolute paths for all file locations

// flash pano: use this if using different pano for each section
if (activeTop == "hea") {
	panoLoc = "http://media.med.cornell.edu/panoramas/nyptransplant/pano_heart.swf";
} else if (activeTop == "kid") {
	panoLoc = "http://media.med.cornell.edu/panoramas/nyptransplant/pano_kidney.swf";
} else if (activeTop == "liv") {
	panoLoc = "http://media.med.cornell.edu/panoramas/nyptransplant/pano_liver.swf";
} else if (activeTop == "lun") {
	panoLoc = "http://media.med.cornell.edu/panoramas/nyptransplant/pano_lung.swf";
} else if (activeTop == "pan") {
	panoLoc = "http://media.med.cornell.edu/panoramas/nyptransplant/pano_pancreas.swf";
} else if (activeTop == "") {
	if (activeHome == "home") {
		panoLoc = "http://media.med.cornell.edu/panoramas/nyptransplant/pano_home.swf";	
	} else {
		panoLoc = "http://media.med.cornell.edu/panoramas/nyptransplant/pano_heart.swf";
	}
}

// set animation to true or false		
if (activeHome == "home") {
	inAnimation			= "true";
} else {
	inAnimation			= "false";
}
// static pano: use this if using different pano for each section
if (activeTop == "hea") {
	altPanoLoc = "http://images.med.cornell.edu/panoramas/nyptransplant/pano_heart.jpg";
} else if (activeTop == "kid") {
	altPanoLoc = "http://images.med.cornell.edu/panoramas/nyptransplant/pano_kidney.jpg";
} else if (activeTop == "liv") {
	altPanoLoc = "http://images.med.cornell.edu/panoramas/nyptransplant/pano_liver.jpg";
} else if (activeTop == "lun") {
	altPanoLoc = "http://images.med.cornell.edu/panoramas/nyptransplant/pano_lung.jpg";
} else if (activeTop == "pan") {
	altPanoLoc = "http://images.med.cornell.edu/panoramas/nyptransplant/pano_pancreas.jpg";
} else if (activeTop == "") {
	if (activeHome == "home") {
		altPanoLoc = "http://images.med.cornell.edu/panoramas/nyptransplant/home.jpg";	
	} else {
		altPanoLoc = "http://images.med.cornell.edu/panoramas/nyptransplant/pano_heart.jpg";
	}
}

// lefthand nav homepage link
siteURL = "http://www.nyptransplant.org/";

// set xml data for pano flash here
dataLoc				= "http://global.med.cornell.edu/panoramas/nyptransplant/content.xml";

// set loading value here: wmc or nyp
brand				= "nyp";

// setting the array, don't touch
buttonArray			= new Array ();

buttonArray[0]		= new createButtonObject ( 15, "http://www.beryl.net/custom/physref/nyp/PhysSearchCriteria.asp");
buttonArray[1]		= new createButtonObject ( 3, "http://www.nyp.org/search/search_advanced.html");
buttonArray[2]		= new createButtonObject ( 6, "http://www.nyptransplant.org/contact.html");
buttonArray[3]		= new createButtonObject ( 6, "http://www.nyp.org/give/index.html");
buttonArray[4]		= new createButtonObject ( 6, "http://www.nyp.org/maps/index.html");

// set color for the pano bar
var newColor = "";

if (active == "one") {
	newColor = "#999966";
} else if (active == "two") {
	newColor = "#669999";
} else if (active == "four") {
	newColor = "#7796a6";
} else if (active == "five") {
	newColor = "#7d8f74";
} else if (active == "fivea") {
	newColor = "#7dad91";
}					

// setting the array, don't touch
additionalMapArray	= new Array ();

// VARIABLES FOR WEB TRENDS
//var gFpcDom=".nyppsychiatry.org";
var gDomain="cds.nyptransplant.org";
var gDcsId="dcsae1fiki711rsfjz0x8gsg8_5u2h";

function sectionName() {
	var activeSectionName = "";
	
	if (activeTop == "hea") {
		activeSectionName = " - Heart";
	} else if (activeTop == "kid") {
		activeSectionName = "Kidney";
	} else if (activeTop == "liv") {
		activeSectionName = "Liver";
	} else if (activeTop == "lun") {
		activeSectionName = "Lung";
	} else if (activeTop == "pan") {
		activeSectionName = "Pancreas";
	} else {
		
		if (activeHome == "home") {
			activeSectionName = "Home";
		} else {
			activeSectionName = "Toolbar:Quick Info";
		}
	}
	
	if (active == "one") {
		activeSectionName += ": About Us";
	} else if (active == "two") {
		activeSectionName += ": Clinical Services";
	} else if (active == "three") {
		activeSectionName += ": Health A to Z";
	} else if (active == "four") {
		activeSectionName += ": What to Expect";
	} else if (active == "five") {
		activeSectionName += ": Organ Donation";
	} else if (active == "fivea") {
		activeSectionName += ": Research";
	} 
	
	return activeSectionName;
}

// needed for 4th level links grey line, don't touch
var num4thLevelLinks = 0;

// load 2nd and 3rd level navigation here
function loadLinks() {
	
	// setting the array, don't touch this line
	var navLinks = new Array();
	
	if (activeTop == "hea") {	
		if (active == "one") {
		    // customize section one, 2nd and 3rd level navigation links here
			navLinks[0] = new LeftLink('Introduction', 'http://www.nyptransplant.org/heart/about/index.html', '2', '', '');
		    navLinks[1] = new LeftLink('Our Contributions to Heart Transplantation', 'http://www.nyptransplant.org/heart/about/our_con.html', '3', 'Introduction', '');
			navLinks[2] = new LeftLink('Our Physicians', 'http://www.nyptransplant.org/heart/about/our_phy.html', '2', '', '');
		}  else if (active == "two") {
			// customize section three, 2nd and 3rd level navigation links here
		    navLinks[0] = new LeftLink('Coordinated and Comprehensive Care', 'http://www.nyptransplant.org/heart/cli_ser/index.html', '2', '', '');	
			navLinks[1] = new LeftLink('High-Risk Patients', 'http://www.nyptransplant.org/heart/cli_ser/hig_ris.html', '3', 'Coordinated and Comprehensive Care', '');	
			navLinks[2] = new LeftLink('Anti-Rejection Advances', 'http://www.nyptransplant.org/heart/cli_ser/ant_rej.html', '3', 'Coordinated and Comprehensive Care', '');	
			navLinks[3] = new LeftLink('Outpatient Care', 'http://www.nyptransplant.org/heart/cli_ser/out_car.html', '3', 'Coordinated and Comprehensive Care', '');	
			navLinks[4] = new LeftLink('Inpatient Care', 'http://www.nyptransplant.org/heart/cli_ser/in_car.html', '3', 'Coordinated and Comprehensive Care', '');	
			navLinks[5] = new LeftLink('Pediatric Heart Transplantation', 'http://www.nyptransplant.org/heart/cli_ser/ped_hea.html', '2', '', '');	
			navLinks[6] = new LeftLink('Support Services', 'http://www.nyptransplant.org/heart/cli_ser/sup_ser.html', '2', '', '');	
		}  else if (active == "four") {
			// customize section three, 2nd and 3rd level navigation links here
		    navLinks[0] = new LeftLink('Pretransplant Evaluation', 'http://www.nyptransplant.org/heart/wha_exp/index.html', '2', '', '');	
			navLinks[1] = new LeftLink("Tests", 'http://www.nyptransplant.org/heart/wha_exp/test.html', '3', 'Pretransplant Evaluation', '');	
			navLinks[2] = new LeftLink('Evaluation Results', 'http://www.nyptransplant.org/heart/wha_exp/eva_res.html', '3', 'Pretransplant Evaluation', '');	
			navLinks[3] = new LeftLink('Waiting for Transplantation', 'http://www.nyptransplant.org/heart/wha_exp/wai_tra.html', '2', '', '');	
			navLinks[4] = new LeftLink('Heart Transplant Surgery', 'http://www.nyptransplant.org/heart/wha_exp/hea_tra.html', '2', '', '');	
		    navLinks[5] = new LeftLink('Post-Transplantation', 'http://www.nyptransplant.org/heart/wha_exp/pos_tra.html', '2', '', '');	
			navLinks[6] = new LeftLink('Life After Transplant', 'http://www.nyptransplant.org/heart/wha_exp/lif_aft.html', '2', '', '');	
		} 
	} else if (activeTop == "kid") {	
		if (active == "one") {
		    // customize section one, 2nd and 3rd level navigation links here
			navLinks[0] = new LeftLink('Introduction', 'http://www.nyptransplant.org/kidney/about/index.html', '2', '', '');
		    navLinks[1] = new LeftLink('Our Physicians', 'http://www.nyptransplant.org/kidney/about/our_phy.html', '2', '', '');
		}  else if (active == "two") {
			// customize section three, 2nd and 3rd level navigation links here
		    navLinks[0] = new LeftLink('Coordinated and Comprehensive Care', 'http://www.nyptransplant.org/kidney/cli_ser/index.html', '2', '', '');	
			navLinks[1] = new LeftLink('Pediatric Transplantation', 'http://www.nyptransplant.org/kidney/cli_ser/ped_tra.html', '2', '', '');	
			navLinks[2] = new LeftLink('Support Services', 'http://www.nyptransplant.org/kidney/cli_ser/sup_ser.html', '2', '', '');	
			navLinks[3] = new LeftLink('Living Donors', 'http://www.nyptransplant.org/kidney/cli_ser/liv_don.html', '2', '', '');	
		}  else if (active == "four") {
			// customize section three, 2nd and 3rd level navigation links here
		    navLinks[0] = new LeftLink('Pretransplantation Evaluation', 'http://www.nyptransplant.org/kidney/wha_exp/index.html', '2', '', '');	
			navLinks[1] = new LeftLink("Waiting for a Transplant", 'http://www.nyptransplant.org/kidney/wha_exp/wai_tra.html', '2', '', '');	
			navLinks[2] = new LeftLink('Kidney Transplantation Surgery', 'http://www.nyptransplant.org/kidney/wha_exp/kid_tra.html', '2', '', '');	
			navLinks[3] = new LeftLink('Post-Transplantation', 'http://www.nyptransplant.org/kidney/wha_exp/pos_tra.html', '2', '', '');		
		} 
		
	} else if (activeTop == "liv") {	
		if (active == "one") {
		    // customize section one, 2nd and 3rd level navigation links here
			navLinks[0] = new LeftLink('Introduction', 'http://www.nyptransplant.org/liver/about/index.html', '2', '', '');
		    navLinks[1] = new LeftLink('Our Physicians', 'http://www.nyptransplant.org/liver/about/our_phy.html', '2', '', '');
		}  else if (active == "two") {
			// customize section three, 2nd and 3rd level navigation links here
		    navLinks[0] = new LeftLink('Coordinated and Comprehensive Care', 'http://www.nyptransplant.org/liver/cli_ser/index.html', '2', '', '');	
			navLinks[1] = new LeftLink('Support Services', 'http://www.nyptransplant.org/liver/cli_ser/sup_ser.html', '2', '', '');	
			navLinks[2] = new LeftLink('Living Donor', 'http://www.nyptransplant.org/liver/cli_ser/liv_don.html', '3', 'Support Services', '');	
		}  else if (active == "four") {
			// customize section three, 2nd and 3rd level navigation links here
		    navLinks[0] = new LeftLink('Initial Consultation', 'http://www.nyptransplant.org/liver/wha_exp/index.html', '2', '', '');	
			navLinks[1] = new LeftLink('Pre-Surgical Evaluation', 'http://www.nyptransplant.org/liver/wha_exp/pre_sur_eva.html', '2', '', '');	
			navLinks[2] = new LeftLink('Waiting for Transplantation', 'http://www.nyptransplant.org/liver/wha_exp/wai_tra.html', '2', '', '');	
			navLinks[3] = new LeftLink('Keeping Healthy', 'http://www.nyptransplant.org/liver/wha_exp/kee_hea.html', '3', 'Waiting for Transplantation', '');		
			navLinks[4] = new LeftLink('Waiting for an Organ', 'http://www.nyptransplant.org/liver/wha_exp/wai_org.html', '2', '', '');	
			navLinks[5] = new LeftLink('Post-Transplantation', 'http://www.nyptransplant.org/liver/wha_exp/pos_tran.html', '2', '', '');	
			navLinks[6] = new LeftLink('Complications', 'http://www.nyptransplant.org/liver/wha_exp/pos_tran_com.html', '3', 'Post-Transplantation', '');	
			navLinks[7] = new LeftLink('Medications', 'http://www.nyptransplant.org/liver/wha_exp/pos_tran_med.html', '3', 'Post-Transplantation', '');	
			navLinks[8] = new LeftLink('Follow-up Care', 'http://www.nyptransplant.org/liver/wha_exp/foll_car.html', '2', '', '');	
			navLinks[9] = new LeftLink('Life After Transplant', 'http://www.nyptransplant.org/liver/wha_exp/lif_aft_tran.html', '2', '', '');	
		} 
	} else if (activeTop == "lun") {	
		if (active == "one") {
		    // customize section one, 2nd and 3rd level navigation links here
			navLinks[0] = new LeftLink('Introduction', 'http://www.nyptransplant.org/lung/about/index.html', '2', '', '');
		    navLinks[1] = new LeftLink('Our Physicians', 'http://www.nyptransplant.org/lung/about/our_phy.html', '2', '', '');
		}  else if (active == "two") {
			// customize section three, 2nd and 3rd level navigation links here
		    navLinks[0] = new LeftLink('Coordinated and Comprehensive Care', 'http://www.nyptransplant.org/lung/cli_ser/index.html', '2', '', '');	
			navLinks[1] = new LeftLink('Support Services', 'http://www.nyptransplant.org/lung/cli_ser/sup_ser.html', '2', '', '');	
			navLinks[2] = new LeftLink('Support Group', 'http://www.nyptransplant.org/lung/cli_ser/sup_gro.html', '3', 'Support Services', '');	
		}  else if (active == "four") {
			// customize section three, 2nd and 3rd level navigation links here
		    navLinks[0] = new LeftLink('Pretransplant Evaluation', 'http://www.nyptransplant.org/lung/wha_exp/index.html', '2', '', '');	
			navLinks[1] = new LeftLink('Waiting for a Transplantation', 'http://www.nyptransplant.org/lung/wha_exp/wai_tra.html', '2', '', '');	
			navLinks[2] = new LeftLink('Post-Transplantation', 'http://www.nyptransplant.org/lung/wha_exp/pos_tra.html', '2', '', '');	
		} 
	} else if (activeTop == "pan") {	
		if (active == "one") {
		    // customize section one, 2nd and 3rd level navigation links here
			navLinks[0] = new LeftLink('Introduction', 'http://www.nyptransplant.org/pancreas/about/index.html', '2', '', '');
		    navLinks[1] = new LeftLink('Our Physicians', 'http://www.nyptransplant.org/pancreas/about/our_phy.html', '2', '', '');
		}  else if (active == "two") {
			// customize section three, 2nd and 3rd level navigation links here
		    navLinks[0] = new LeftLink('Coordinated and Comprehensive Care', 'http://www.nyptransplant.org/pancreas/cli_ser/index.html', '2', '', '');	
			navLinks[1] = new LeftLink('Support Services', 'http://www.nyptransplant.org/pancreas/cli_ser/sup_ser.html', '2', '', '');	
		}  else if (active == "four") {
			// customize section three, 2nd and 3rd level navigation links here
		    navLinks[0] = new LeftLink('Presurgical Evaluation', 'http://www.nyptransplant.org/pancreas/wha_exp/index.html', '2', '', '');	
			navLinks[1] = new LeftLink('Waiting for a Transplantation', 'http://www.nyptransplant.org/pancreas/wha_exp/wai_tra.html', '2', '', '');	
			navLinks[2] = new LeftLink('Post-Transplantation', 'http://www.nyptransplant.org/pancreas/wha_exp/pos_tra.html', '2', '', '');	
		} 
	}
	
	if (active=="fivea") {
			// Transplant Newsletter is in each organ research section
		    navLinks[0] = new LeftLink('NewYork-Presbyterian Transplant Newsletters', 'http://www.nyptransplant.org/newsletter.html', '2', '', '');	
	} 
		
	// returning the value here, don't touch
	return (navLinks);
		
}
