//////////////////////////////////////////////////////////////////
//																//
//	Weill Cornell Medical College								//
//	cornellsurgery.org site javascript							//
//	cornellsurgery.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://www.med.cornell.edu/wmhc/images/header/nav1_on.gif";
	one_off= new Image; one_off.src="http://www.med.cornell.edu/wmhc/images/header/nav1.gif";

	two_on= new Image; two_on.src="http://www.med.cornell.edu/wmhc/images/header/nav2_on.gif";
	two_off= new Image; two_off.src="http://www.med.cornell.edu/wmhc/images/header/nav2.gif";

	three_on= new Image; three_on.src="http://www.med.cornell.edu/wmhc/images/header/nav3_on.gif";
	three_off= new Image; three_off.src="http://www.med.cornell.edu/wmhc/images/header/nav3.gif";

	four_on= new Image; four_on.src="http://www.med.cornell.edu/wmhc/images/header/nav4_on.gif";
	four_off= new Image; four_off.src="http://www.med.cornell.edu/wmhc/images/header/nav4.gif";

	five_on= new Image; five_on.src="http://www.med.cornell.edu/wmhc/images/header/nav5_on.gif";
	five_off= new Image; five_off.src="http://www.med.cornell.edu/wmhc/images/header/nav5.gif";
	
		
	// include all additional section types to avoid errors. Set them to null.
	_on= new Image; _on.src=null;
	toolbar_1_on= new Image; toolbar_1_on.src=null;
	toolbar_2_on= new Image; toolbar_2_on.src=null;
	toolbar_3_on= new Image; toolbar_3_on.src=null;
	toolbar_4_on= new Image; toolbar_4_on.src=null;
	toolbar_5_on= new Image; toolbar_5_on.src=null;
	toolbar_6_on= new Image; toolbar_6_on.src=null;
	toolbar_7_on= new Image; toolbar_7_on.src=null;
	toolbar_8_on= new Image; toolbar_8_on.src=null;
	toolbar_9_on= new Image; toolbar_9_on.src=null;
	
}

// ::::::::::::::::::::::::::: 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 == "home") {
	panoLoc = "http://www.med.cornell.edu/wmhc/media/pano_home.swf";
} else if (active == "one") {
	panoLoc = "http://www.med.cornell.edu/wmhc/media/pano_" + active + ".swf";
} else if (active == "two") {
	panoLoc = "http://www.med.cornell.edu/wmhc/media/pano_" + active + ".swf";
} else if (active == "three") {
	panoLoc = "http://www.med.cornell.edu/wmhc/media/pano_" + active + ".swf";
} else if (active == "four") {
	panoLoc = "http://www.med.cornell.edu/wmhc/media/pano_" + active + ".swf";
} else if (active == "five") {
	panoLoc = "http://www.med.cornell.edu/wmhc/media/pano_" + active + ".swf";
} else { //default to this just in case
	panoLoc = "http://www.med.cornell.edu/wmhc/media/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 == "home") {
	altPanoLoc = "http://www.med.cornell.edu/wmhc/images/panoramas/pano_home.jpg";
} else if (active == "one") {
	altPanoLoc = "http://www.med.cornell.edu/wmhc/images/panoramas/pano_" + active + ".jpg";
} else if (active == "two") {
	altPanoLoc = "http://www.med.cornell.edu/wmhc/images/panoramas/pano_" + active + ".jpg";
} else if (active == "three") {
	altPanoLoc = "http://www.med.cornell.edu/wmhc/images/panoramas/pano_" + active + ".jpg";
} else  if (active == "four") {
	altPanoLoc = "http://www.med.cornell.edu/wmhc/images/panoramas/pano_" + active + ".jpg";
} else  if (active == "five") {
	altPanoLoc = "http://www.med.cornell.edu/wmhc/images/panoramas/pano_" + active + ".jpg";
} else { //default to this just in case
	altPanoLoc = "http://www.med.cornell.edu/wmhc/images/panoramas/pano.jpg";
}		
	

// set xml data for pano flash here
dataLoc				= "http://global.med.cornell.edu/panoramas/wmhc/pano.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				= "wmc";

// 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 ( 8, "http://www.med.cornell.edu/wmhc/provider/bios/");
buttonArray[1]		= new createButtonObject ( 4, "http://www.med.cornell.edu/search/search_advanced.html");

// setting the array, don't touch
additionalMapArray	= new Array ();

// lefthand nav homepage link
siteURL = "http://www.med.cornell.edu/wmhc/";

// ::::::::::::::::::::::::::: 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('About the Consortium', 'http://www.med.cornell.edu/wmhc/about/index.html', '2', '', '');
		//navLinks[1] = new LeftLink('About the Founder', 'http://www.med.cornell.edu/wmhc/about/founder.html', '2', '', '');
		navLinks[1] = new LeftLink('About Our Health Care Providers', 'http://www.med.cornell.edu/wmhc/provider/bios', '2', '', '');
		
	}  else if (active == "two") {		
		
		navc = 0;
		
		//navLinks[navc++] = new LeftLink('Diagnostic Consultation', 'http://www.med.cornell.edu/wmhc/hea_ser/diagnostic.html', '2', '', '');	
		navLinks[navc++] = new LeftLink('Psychotherapy', 'http://www.med.cornell.edu/wmhc/hea_ser/psychotherapy.html', '2', '', '');	
		navLinks[navc++] = new LeftLink('Psychodynamic', 'http://www.med.cornell.edu/wmhc/hea_ser/psych_dynamic.html', '3', 'Psychotherapy', '');	
		navLinks[navc++] = new LeftLink('Cognitive Behavioral Therapy', 'http://www.med.cornell.edu/wmhc/hea_ser/psych_cognitive.html', '3', 'Psychotherapy', '');	
		navLinks[navc++] = new LeftLink('Interpersonal Therapy', 'http://www.med.cornell.edu/wmhc/hea_ser/psych_inter.html', '3', 'Psychotherapy', '');	
		navLinks[navc++] = new LeftLink('Supportive Psychotherapy', 'http://www.med.cornell.edu/wmhc/hea_ser/psych_support.html', '3', 'Psychotherapy', '');	
		navLinks[navc++] = new LeftLink('Psychoanalysis', 'http://www.med.cornell.edu/wmhc/hea_ser/psych_psycho.html', '3', 'Psychotherapy', '');	
		navLinks[navc++] = new LeftLink('Spiritual/Existential', 'http://www.med.cornell.edu/wmhc/hea_ser/psych_spiritual.html', '3', 'Psychotherapy', '');	
		navLinks[navc++] = new LeftLink('Integrative Therapy', 'http://www.med.cornell.edu/wmhc/hea_ser/psych_integrated.html', '3', 'Psychotherapy', '');	
		
		navLinks[navc++] = new LeftLink('Psychopharmacology', 'http://www.med.cornell.edu/wmhc/hea_ser/psychopharm.html', '2', '', '');	
		
		navLinks[navc++] = new LeftLink('Specialties ', 'http://www.med.cornell.edu/wmhc/hea_ser/specialties.html', '2', '', '');	
		navLinks[navc++] = new LeftLink('Reproductive Psychiatry', 'http://www.med.cornell.edu/wmhc/hea_ser/spe_reproductive.html', '3', 'Specialties', '');	
		navLinks[navc++] = new LeftLink('Eating Disorders/Body Image', 'http://www.med.cornell.edu/wmhc/hea_ser/spe_eating.html', '3', 'Specialties', '');	
		navLinks[navc++] = new LeftLink('Trauma, Interpersonal Violence, Abuse', 'http://www.med.cornell.edu/wmhc/hea_ser/spe_trauma.html', '3', 'Specialties', '');	
		navLinks[navc++] = new LeftLink('Child and Adolescent', 'http://www.med.cornell.edu/wmhc/hea_ser/spe_child.html', '3', 'Specialties', '');	
		navLinks[navc++] = new LeftLink('HIV/AIDS', 'http://www.med.cornell.edu/wmhc/hea_ser/spe_hiv.html', '3', 'Specialties', '');	
		navLinks[navc++] = new LeftLink('Coping with Medical Issues', 'http://www.med.cornell.edu/wmhc/hea_ser/spe_issues.html', '3', 'Specialties', '');	
		navLinks[navc++] = new LeftLink('Fertility and Assisted Reproduction', 'http://www.med.cornell.edu/wmhc/hea_ser/spe_fertility.html', '3', 'Specialties', '');	
		navLinks[navc++] = new LeftLink('Sexuality and sexual dysfunction', 'http://www.med.cornell.edu/wmhc/hea_ser/spe_sex.html', '3', 'Specialties', '');	
		navLinks[navc++] = new LeftLink('Bereavement', 'http://www.med.cornell.edu/wmhc/hea_ser/spe_bereave.html', '3', 'Specialties', '');	
		navLinks[navc++] = new LeftLink('Personality Disorders', 'http://www.med.cornell.edu/wmhc/hea_ser/spe_disorders.html', '3', 'Specialties', '');	
		navLinks[navc++] = new LeftLink('Parenting', 'http://www.med.cornell.edu/wmhc/hea_ser/spe_parenting.html', '3', 'Specialties', '');	
		navLinks[navc++] = new LeftLink('Anxiety Disorders', 'http://www.med.cornell.edu/wmhc/hea_ser/spe_anxiety.html', '3', 'Specialties', '');	
		navLinks[navc++] = new LeftLink('Mood Disorders', 'http://www.med.cornell.edu/wmhc/hea_ser/spe_mood.html', '3', 'Specialties', '');	
		navLinks[navc++] = new LeftLink('Gender Issues/Sexual Orientation', 'http://www.med.cornell.edu/wmhc/hea_ser/spe_gender.html', '3', 'Specialties', '');	
		navLinks[navc++] = new LeftLink('Mid-Life Transitions', 'http://www.med.cornell.edu/wmhc/hea_ser/spe_midlife.html', '3', 'Specialties', '');	
		navLinks[navc++] = new LeftLink('Work and Family Conflict', 'http://www.med.cornell.edu/wmhc/hea_ser/spe_work.html', '3', 'Specialties', '');	
		navLinks[navc++] = new LeftLink('Pregnancy Loss', 'http://www.med.cornell.edu/wmhc/hea_ser/spe_menopause.html', '3', 'Specialties', '');	
		navLinks[navc++] = new LeftLink('Menopause', 'http://www.med.cornell.edu/wmhc/hea_ser/spe_menopause.html', '3', 'Specialties', '');	
		navLinks[navc++] = new LeftLink('Relationship Issues', 'http://www.med.cornell.edu/wmhc/hea_ser/spe_relationship.html', '3', 'Specialties', '');	
		navLinks[navc++] = new LeftLink('Aging', 'http://www.med.cornell.edu/wmhc/hea_ser/spe_aging.html', '3', 'Specialties', '');	
		
		
	} else if (active == "three") {
		
		//navLinks[0] = new LeftLink("Calendar of Women's Mental Health Events", 'http://www.med.cornell.edu/wmhc/patients/index.html', '2', '', '');	
		//navLinks[1] = new LeftLink('Seminars ', 'http://www.med.cornell.edu/wmhc/patients/seminars.html', '2', '', '');
		//navLinks[2] = new LeftLink('Newsletters/Posting', 'http://www.med.cornell.edu/wmhc/patients/newsletters.html', '2', '', '');
		//navLinks[3] = new LeftLink('Hot Topics', 'http://www.med.cornell.edu/wmhc/patients/topics.html', '2', '', '');
		navLinks[0] = new LeftLink('Links', 'http://www.med.cornell.edu/wmhc/patients/links.html', '2', '', '');
		
	} else if (active == "four") {		
		
		//navLinks[0] = new LeftLink('PMS Research Study', 'http://www.med.cornell.edu/wmhc/research/pms.html', '2', '', '');	
		//navLinks[1] = new LeftLink('Post-Traumatic Stress Disorder (PTSD) Research Study', 'http://www.med.cornell.edu/wmhc/research/ptsd.html', '2', '', '');	
		navLinks[0] = new LeftLink('Pregnancy Anxiety Study', 'http://www.med.cornell.edu/wmhc/research/pas.html', '2', '', '');	
		//navLinks[1] = new LeftLink('Perimenopause/ Menopause Insomnia Study', 'http://www.med.cornell.edu/wmhc/research/insomnia.html', '2', '', '');	
		//navLinks[2] = new LeftLink('Effect of Menstrual Cycle on Lithium and Zoloft Blood Levels', 'http://www.med.cornell.edu/wmhc/research/menstral.html', '2', '', '');	
		
	} /*else if (active == "five") {		
		
		navLinks[0] = new LeftLink('Listserv/Message Board', 'http://www.med.cornell.edu/wmhc/members/listserv.html', '2', '', '');	
		navLinks[1] = new LeftLink('Referral Bank', 'http://www.med.cornell.edu/wmhc/members/bank.html', '2', '', '');	
		
	} */
		
	// returning the value here, don't touch
	return (navLinks);
}

function highLightNav(nav2id, nav3id, nav4id) {
        var li = document.getElementsByTagName('li');
        for (var i = 0; i < li.length; i++) {
           if ( (li[i].id == nav2id) && (nav2id != '' && nav3id == null && nav4id == null) ) {
                   li[i].className = "nav2Selected";
           } else if ( (li[i].id == nav2id) && (nav2id != '' && (nav3id != '' || nav4id != '' )) ) {
                   li[i].className = "nav2Active";
           } else if ( (li[i].id == nav3id) && (nav3id != '' && nav4id == null) ) {
                   li[i].className = "nav3Selected";
           } else if ( (li[i].id == nav3id) && (nav2id != '' && nav3id != '' && nav4id != '') ) {
                 li[i].className = "nav3Active";
           } else if ( (li[i].id == nav4id) && (nav2id != '' & nav4id != '') ) {
                   li[i].className = "nav4Selected";
           }
        }
} 