//////////////////////////////////////////////////////////////////
//																//
//	Weill Cornell Medical College								//
//	nypspine.com site javascript							//
//	nypspine.js											//
//	Version 1.5 												//											
//																//
//////////////////////////////////////////////////////////////////

// ::::::::::::::::::::::::::: SECTION I: preload top nav images: three state rollovers

// fill in the absolute paths for all the images
if (browser) {
	one_on = new Image; one_on.src="http://images.med.cornell.edu/headers/navbar/nypspine/nav1_on.gif";
	one_off = new Image; one_off.src="http://images.med.cornell.edu/headers/navbar/nypspine/nav1.gif";
	one_active = new Image; one_active.src="http://images.med.cornell.edu/headers/navbar/nypspine/nav1_on.gif";
	
	two_on = new Image; two_on.src="http://images.med.cornell.edu/headers/navbar/nypspine/nav2_on.gif";
	two_off = new Image; two_off.src="http://images.med.cornell.edu/headers/navbar/nypspine/nav2.gif";
	two_active = new Image; two_active.src="http://images.med.cornell.edu/headers/navbar/nypspine/nav2_on.gif";

	three_on = new Image; three_on.src="http://images.med.cornell.edu/headers/navbar/nypspine/nav3_on.gif";
	three_off = new Image; three_off.src="http://images.med.cornell.edu/headers/navbar/nypspine/nav3.gif";
	three_active = new Image; three_active.src="http://images.med.cornell.edu/headers/navbar/nypspine/nav3_on.gif";

	four_on = new Image; four_on.src="http://images.med.cornell.edu/headers/navbar/nypspine/nav4_on.gif";
	four_off = new Image; four_off.src="http://images.med.cornell.edu/headers/navbar/nypspine/nav4.gif";
	four_active = new Image; four_active.src="http://images.med.cornell.edu/headers/navbar/nypspine/nav4_on.gif";	
	
	five_on = new Image; five_on.src="http://images.med.cornell.edu/headers/navbar/nypspine/nav5_on.gif";
	five_off = new Image; five_off.src="http://images.med.cornell.edu/headers/navbar/nypspine/nav5.gif";
	five_active = new Image; five_active.src="http://images.med.cornell.edu/headers/navbar/nypspine/nav5_on.gif";	
	
	six_on = new Image; six_on.src="http://images.med.cornell.edu/headers/navbar/nypspine/nav6_on.gif";
	six_off = new Image; six_off.src="http://images.med.cornell.edu/headers/navbar/nypspine/nav6.gif";
	six_active = new Image; six_active.src="http://images.med.cornell.edu/headers/navbar/nypspine/nav6_on.gif";
	
}

// ::::::::::::::::::::::::::: SECTION II: set values for panos, use absolute paths for all file locations

// flash pano: use this if using only one pano for the whole site
//panoLoc				= "http://media.med.cornell.edu/panoramas/nyp/pano_home.swf";

// flash pano: use this if using different pano for each section
if (active == "" && activeHome == "home") {
	panoLoc = "http://media.med.cornell.edu/panoramas/nypspine/pano_home.swf";
} else { //default to this just in case
	panoLoc = "http://media.med.cornell.edu/panoramas/nypspine/pano.swf";
}
		
// set animation to true or false		
inAnimation			= "false";

// static pano: use this if using one pano for the whole site
//altPanoLoc = "http://images.med.cornell.edu/panoramas/test/pano_" + active + ".jpg";
// static pano: use this if using different pano for each section
if (active == "" && activeHome == "home") {
	altPanoLoc = "http://images.med.cornell.edu/panoramas/nypspine/pano_home.jpg";
} else { //default to this just in case
	altPanoLoc = "http://images.med.cornell.edu/panoramas/nypspine/pano.jpg";
}		
	

// set site url
siteURL 			= "http://www.nyp.org/spine/";


// set xml data for pano flash here
dataLoc				= "http://global.med.cornell.edu/panoramas/nypspine/data.xml";

// set this line to the location of the temp toolbar when working on the test server. comment it out to move to production
toolBarLoc			= "http://media.med.cornell.edu/panoramas/framework_toolbar" + homeWrapper + ".swf";

// set loading value here: wmc or nyp
brand				= "nyp";

// setting the array, don't touch
buttonArray			= new Array ();

// set absolute paths for all the pano toolbar links [image map for static pano]
buttonArray[0]		= new createButtonObject ( 16, "http://www.beryl.net/custom/physref/nyp/PhysSearchCriteria.asp");
buttonArray[1]		= new createButtonObject ( 4, "http://www.nyp.org/search/search_advanced.html");
buttonArray[2]		= new createButtonObject ( 5, "http://www.nyp.org/spine/contact.html?name1=Contact+Us&type1=2Active");
buttonArray[3]		= new createButtonObject ( 6, "http://www.nyp.org/give/index.html");
buttonArray[4]		= new createButtonObject ( 7, "http://www.nyp.org/spine/maps.html?name1=Maps+and+Directions&type1=2Active");

// setting the array, don't touch
additionalMapArray	= new Array ();

// VARIABLES FOR WEB TRENDS
//var gFpcDom=".nyppsychiatry.org";
var gDomain="cds.nypspine.org";
var gDcsId="dcscxiciki711rsfjz0x8gsg8_5u9i";

function sectionName() {
	var activeSectionName = "";
	if (active == "one") {
		activeSectionName = "About Us";
	} else if (active == "two") {
		activeSectionName = "Health Services";
	} else if (active == "three") {
		activeSectionName = "Spine A to Z";
	} else if (active == "four") {
		activeSectionName = "Research";
	} else if (active == "five") {
		activeSectionName = "Patients and Visitors";
	} else if (active == "six") {
		activeSectionName = "Healthcare Professionals";
	} else if (active == "") {
		if (activeHome == "home") {
			activeSectionName = "Home";
		} else {
			activeSectionName = "Toolbar:Quick Info";
		}
	} 
	return activeSectionName;
}

// ::::::::::::::::::::::::::: SECTION III: set 2nd and 3rd level navigation links here, customize according to section

// 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 (active == "one") {
	    
		navLinks[0] = new LeftLink('The Spine Center Team', 'http://www.nyp.org/spine/about/spi_cen_tea.html', '2', '', '');
	
	} else if (active == "four") {
		
		navLinks[0] = new LeftLink('Clinical Research', 'http://www.nyp.org/spine/research/cli_res.html', '2', '', '');
		navLinks[1] = new LeftLink('Clinical Trials', 'http://www.nyp.org/spine/research/cli_tri.html', '2', '', '');
		
	} else if (active == "five") {
	
		navLinks[0] = new LeftLink('Preparing for Surgery', 'http://www.nyp.org/spine/pat_vis/pre_sur.html', '2', '', '');
		navLinks[1] = new LeftLink('Before you arrive: Instructions for day and night before surgery, and day of surgery', 'http://www.nyp.org/spine/pat_vis/bef_arr.html', '3', 'Preparing for Surgery', '');
		navLinks[2] = new LeftLink('Anesthesia', 'http://www.nyp.org/spine/pat_vis/ane_gen_blu.html', '3', 'Preparing for Surgery', '');
		navLinks[3] = new LeftLink('After Your Surgery (recovery room info, reuniting with your family, getting discharge instructions)', 'http://www.nyp.org/spine/pat_vis/aft_you.html', '3', 'Preparing for Surgery', '');
		
		navLinks[4] = new LeftLink("FAQ's", 'http://www.nyp.org/spine/pat_vis/faq.html', '2', '', '');
		navLinks[5] = new LeftLink('Helpful Links', 'http://www.nyp.org/spine/pat_vis/links.html', '2', '', '');

		
	}  else if (active == "six") {
	
		navLinks[0] = new LeftLink('Newsletters', 'http://www.nyp.org/spine/resources/newsletters.html', '2', '', '');
		navLinks[1] = new LeftLink('Helpful Links', 'http://www.nyp.org/spine/resources/hel_lin.html', '2', '', '');
			
	} else if (active == "") {
		
		if (activeTool == "contact") {

			navLinks[0] = new LeftLink('Contact Us', 'http://www.nyp.org/spine/contact.html', '2', '', '');
			navLinks[1] = new LeftLink('Maps and Directions', 'http://www.nyp.org/spine/maps.html', '2', '', '');

		}
	}
	// returning the value here, don't touch
	return (navLinks);
}


// fourth-level navigation code begins here


function loadNav4Pages() {
 
 // setting the array, don't touch
 
var oneNav4Links = new Array();
var allNav4Pages = new Array();

 if (active == "one") {
 
 // customize 4th level navigation links here
 
  oneNav4Links[0] = new LeftLink('Michael A. Weiner, MD', 'http://www.nyp.org/spine/abo_us/sta_phy_wei.html', '4', 'Staff', "Physicians");
  oneNav4Links[1] = new LeftLink('Mitchell S. Cairo, MD', 'http://www.nyp.org/spine/abo_us/sta_phy_mit.html', '4', 'Staff', "Physicians");
  oneNav4Links[2] = new LeftLink('Linda S. Granowetter, MD', 'http://www.nyp.org/spine/abo_us/sta_phy_lin.html', '4', 'Staff', "Physicians");
  oneNav4Links[3] = new LeftLink('Gustavo del Toro, MD', 'http://www.nyp.org/spine/abo_us/sta_phy_gus.html', '4', 'Staff', "Physicians");  
  oneNav4Links[4] = new LeftLink('James H. Garvin, Jr., MD, PhD', 'http://www.nyp.org/spine/abo_us/sta_phy_jam.html', '4', 'Staff', "Physicians");  
  oneNav4Links[5] = new LeftLink('Julia Glade Bender, MD', 'http://www.nyp.org/spine/abo_us/sta_phy_jul.html', '4', 'Staff', "Physicians");  
  oneNav4Links[6] = new LeftLink('Olga Bessmertny, PharmD', 'http://www.nyp.org/spine/abo_us/sta_phy_olg.html', '4', 'Staff', "Physicians");  
  oneNav4Links[7] = new LeftLink('Mary Ann Bonilla, MD', 'http://www.nyp.org/spine/abo_us/sta_phy_mar.html', '4', 'Staff', "Physicians");  
  oneNav4Links[8] = new LeftLink('Mary Brigid Bradley, MD', 'http://www.nyp.org/spine/abo_us/sta_phy_mar_bri.html', '4', 'Staff', "Physicians");  
  oneNav4Links[9] = new LeftLink('Diane George, MD', 'http://www.nyp.org/spine/abo_us/sta_phy_dia.html', '4', 'Staff', "Physicians");  
  oneNav4Links[10] = new LeftLink('Heather Grossman, MD', 'http://www.nyp.org/spine/abo_us/sta_phy_hea.html', '4', 'Staff', "Physicians");  
  oneNav4Links[11] = new LeftLink('Kara Kelly, MD', 'http://www.nyp.org/spine/abo_us/sta_phy_kar.html', '4', 'Staff', "Physicians");  
  oneNav4Links[12] = new LeftLink('Judith R. Marcus, MD', 'http://www.nyp.org/spine/abo_us/sta_phy_jud.html', '4', 'Staff', "Physicians");  
  oneNav4Links[13] = new LeftLink('Jill S. Menell, MD', 'http://www.nyp.org/spine/abo_us/sta_phy_jil.html', '4', 'Staff', "Physicians");  
  oneNav4Links[14] = new LeftLink('Tamara New, MD', 'http://www.nyp.org/spine/abo_us/sta_phy_tam.html', '4', 'Staff', "Physicians");  
  oneNav4Links[15] = new LeftLink('Manuela Orjuela, MD, ScM', 'http://www.nyp.org/spine/abo_us/sta_phy_man.html', '4', 'Staff', "Physicians");  
  oneNav4Links[16] = new LeftLink('Kenneth Rivlin, MD, PhD', 'http://www.nyp.org/spine/abo_us/sta_phy_ken.html', '4', 'Staff', "Physicians");  
  oneNav4Links[17] = new LeftLink('Stephen Sands, PhD', 'http://www.nyp.org/spine/abo_us/sta_phy_ste.html', '4', 'Staff', "Physicians");  
  oneNav4Links[18] = new LeftLink('Darrell Yamashiro, MD, PhD', 'http://www.nyp.org/spine/abo_us/sta_phy_dar.html', '4', 'Staff', "Physicians");  
 
  allNav4Pages[0] = new Nav4Page('http://www.nyp.org/spine/abo_us/sta_phy.html', oneNav4Links);
  allNav4Pages[1] = new Nav4Page('http://www.nyp.org/spine/abo_us/sta_phy_wei.html', oneNav4Links);
  allNav4Pages[2] = new Nav4Page('http://www.nyp.org/spine/abo_us/sta_phy_mit.html', oneNav4Links);
  allNav4Pages[3] = new Nav4Page('http://www.nyp.org/spine/abo_us/sta_phy_lin.html', oneNav4Links);
  allNav4Pages[4] = new Nav4Page('http://www.nyp.org/spine/abo_us/sta_phy_gus.html', oneNav4Links);
  allNav4Pages[5] = new Nav4Page('http://www.nyp.org/spine/abo_us/sta_phy_jam.html', oneNav4Links);
  allNav4Pages[6] = new Nav4Page('http://www.nyp.org/spine/abo_us/sta_phy_jul.html', oneNav4Links);
  allNav4Pages[7] = new Nav4Page('http://www.nyp.org/spine/abo_us/sta_phy_olg.html', oneNav4Links);
  allNav4Pages[8] = new Nav4Page('http://www.nyp.org/spine/abo_us/sta_phy_mar.html', oneNav4Links);
  allNav4Pages[9] = new Nav4Page('http://www.nyp.org/spine/abo_us/sta_phy_mar_bri.html', oneNav4Links);
  allNav4Pages[10] = new Nav4Page('http://www.nyp.org/spine/abo_us/sta_phy_dia.html', oneNav4Links);
  allNav4Pages[11] = new Nav4Page('http://www.nyp.org/spine/abo_us/sta_phy_hea.html', oneNav4Links);
  allNav4Pages[12] = new Nav4Page('http://www.nyp.org/spine/abo_us/sta_phy_kar.html', oneNav4Links);
  allNav4Pages[13] = new Nav4Page('http://www.nyp.org/spine/abo_us/sta_phy_jud.html', oneNav4Links);
  allNav4Pages[14] = new Nav4Page('http://www.nyp.org/spine/abo_us/sta_phy_jil.html', oneNav4Links);
  allNav4Pages[15] = new Nav4Page('http://www.nyp.org/spine/abo_us/sta_phy_tam.html', oneNav4Links);
  allNav4Pages[16] = new Nav4Page('http://www.nyp.org/spine/abo_us/sta_phy_man.html', oneNav4Links);
  allNav4Pages[17] = new Nav4Page('http://www.nyp.org/spine/abo_us/sta_phy_ken.html', oneNav4Links);
  allNav4Pages[18] = new Nav4Page('http://www.nyp.org/spine/abo_us/sta_phy_ste.html', oneNav4Links);
  allNav4Pages[19] = new Nav4Page('http://www.nyp.org/spine/abo_us/sta_phy_dar.html', oneNav4Links);
  
 } 
 
// returning the value here, don't touch
return (allNav4Pages);
 
}

function popup_tour(pg) {
       tourpopup=window.open(pg,"popupwindow","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizeable=no,width=600,height=350");
       tourpopup.focus();
}