//////////////////////////////////////////////////////////////////
//																//
//	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://images.med.cornell.edu/headers/navbar/cornellvascular/about_on.gif";
	one_off = new Image; one_off.src="http://images.med.cornell.edu/headers/navbar/cornellvascular/about_off.gif";
	one_active = new Image; one_active.src="http://images.med.cornell.edu/headers/navbar/cornellvascular/about_on.gif";
	
	two_on = new Image; two_on.src="http://images.med.cornell.edu/headers/navbar/cornellvascular/varicose_on.gif";
	two_off = new Image; two_off.src="http://images.med.cornell.edu/headers/navbar/cornellvascular/varicose_off.gif";
	two_active = new Image; two_active.src="http://images.med.cornell.edu/headers/navbar/cornellvascular/varicose_on.gif";

	three_on = new Image; three_on.src="http://images.med.cornell.edu/headers/navbar/cornellvascular/uterine_on.gif";
	three_off = new Image; three_off.src="http://images.med.cornell.edu/headers/navbar/cornellvascular/uterine_off.gif";
	three_active = new Image; three_active.src="http://images.med.cornell.edu/headers/navbar/cornellvascular/uterine_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

if (active == "" && activeHome == "home") {
	panoLoc = "http://media.med.cornell.edu/panoramas/cornellvascular/pano_home.swf";
} else { //default to this just in case
	panoLoc = "http://media.med.cornell.edu/panoramas/cornellvascular/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/cornellvascular/pano_home.jpg";
} else { //default to this just in case
	altPanoLoc = "http://images.med.cornell.edu/panoramas/cornellvascular/pano.jpg";
}		
	
siteURL 			= "http://www.cornellvascular.com";

// set xml data for pano flash here
dataLoc = "http://global.med.cornell.edu/panoramas/cornellvascular/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				= "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 (10, "http://www.cornellvascular.com/appt.html");
buttonArray[1]		= new createButtonObject (4, "http://www.med.cornell.edu/search/search_advanced.html");
buttonArray[2]		= new createButtonObject (6, "http://www.cornellvascular.com/maps.html");

// setting the array, don't touch
additionalMapArray	= new Array ();


// ::::::::::::::::::::::::::: 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('Learn About Our Physicians', 'http://www.cornellvascular.com/about/our_phy.html', '2', '', '');

	}  else if (active == "two") {
		
		navLinks[0] = new LeftLink('What are Varicose and Spider Veins?', 'http://www.cornellvascular.com/varicose/wha_var.html', '2', '', '');	
		navLinks[1] = new LeftLink('Treatments for Varicose and Spider Veins', 'http://www.cornellvascular.com/varicose/tre.html', '2', '', '');
		navLinks[2] = new LeftLink('Endovenous Laser Treatment (EVLT)', 'http://www.cornellvascular.com/varicose/evlt.html', '3', 'Treatments for Varicose and Spider Veins', '');	
		navLinks[3] = new LeftLink('Microphlebectomy', 'http://www.cornellvascular.com/varicose/micro.html', '3', 'Treatments for Varicose and Spider Veins', '');	
		navLinks[4] = new LeftLink('Sclerotherapy', 'http://www.cornellvascular.com/varicose/scl.html', '3', 'Treatments for Varicose and Spider Veins', '');	
		navLinks[5] = new LeftLink('Conservative/Medical Therapy', 'http://www.cornellvascular.com/varicose/con_med.html', '3', 'Treatments for Varicose and Spider Veins', '');	
		navLinks[6] = new LeftLink('Laser Treatment', 'http://www.cornellvascular.com/varicose/laser.html', '3', 'Treatments for Varicose and Spider Veins', '');
		navLinks[7] = new LeftLink('Sclerotherapy FAQs', 'http://www.cornellvascular.com/varicose/faq.html', '2', '', '');	
		navLinks[8] = new LeftLink('Pre- and Post-Treatment Gallery', 'http://www.cornellvascular.com/varicose/pre_pos.html', '2', '', '');	
		//navLinks[9] = new LeftLink('Before and After Your Visit', 'http://www.cornellvascular.com/varicose/bef_you.html', '2', '', '');	
		navLinks[9] = new LeftLink('News, Press, and Articles', 'http://www.cornellvascular.com/varicose/new_pre.html', '2', '', '');	
		
	} else if (active == "three") {
		
		navLinks[0] = new LeftLink('What are Uterine Fibroids?', 'http://www.cornellvascular.com/uterine/wha_ute.html', '2', '', '');
		navLinks[1] = new LeftLink('Treatments for Uterine Fibroids', 'http://www.cornellvascular.com/uterine/tre_fib.html', '2', '', '');
		navLinks[2] = new LeftLink('Uterine Fibroid Embolization (UFE)', 'http://www.cornellvascular.com/uterine/ute_art.html', '3', 'Treatments for Uterine Fibroids', '');	
		//navLinks[3] = new LeftLink('Pre- and Post-Treatment Gallery', 'http://www.cornellvascular.com/uterine/pre_pos.html', '3', 'Uterine Fibroid Embolization (UFE)', '');
		navLinks[3] = new LeftLink('Clinical Trials for Fibroid Treatment at Weill Cornell Vascular', 'http://www.cornellvascular.com/uterine/cli_tri.html', '3', 'Uterine Fibroid Embolization (UFE)', '');
		navLinks[4] = new LeftLink('Before and After Your Visit', 'http://www.cornellvascular.com/uterine/bef_aft.html', '2', '', '');	
		//navLinks[6] = new LeftLink('After Your Visit', 'http://www.cornellvascular.com/uterine/aft_you.html', '2', '', '');	
		navLinks[5] = new LeftLink('News, Press, and Articles', 'http://www.cornellvascular.com/uterine/new_pre.html', '2', '', '');	
		//navLinks[6] = new LeftLink('Additional Resources', 'http://www.cornellvascular.com/uterine/add_res.html', '2', '', '');	
	
	}  
	// returning the value here, don't touch
	return (navLinks);
}


// Expanding Questions/Answers Javascript

var ids=new Array();

function QAinit(){
	if(document.getElementById) {
		var tids=document.getElementsByTagName('div');
		for(i=0;i<tids.length;i++)if(tids[i].className=="expand")ids[ids.length]=tids[i];
		for(i=0;i<ids.length;i++)ids[i].onmouseup=setstate;
	}
}

function setstate(){
	

	for(i=0;i<ids.length;i++) {
		//ids[i].style.display="block";
		ids[i].style.visibility="";
		ids[i].style.height="";

	}
	
	if(this.className=="expand")this.style.visibility="hidden";
	if(this.className=="expand")this.style.height="0";

	
	for(i=0;i<ids.length;i++) {
	ids[i].parentNode.getElementsByTagName('div')[1].style.display="none";
	}
	
	for(i=0;i<ids.length;i++) {
		if(ids[i]==this){
			var d=this.parentNode.getElementsByTagName('div')[1];
		if(d.style.display=="block")d.style.display="none";
		else d.style.display="block";
		}
	}

}

function expandall(){
if(document.getElementById){
for(i=0;i<ids.length;i++)ids[i].parentNode.getElementsByTagName('div')[1].style.display="block";
}}

function collapseall(){
	if(document.getElementById){
		for(i=0;i<ids.length;i++)ids[i].parentNode.getElementsByTagName('div')[1].style.display="none";
	}
}

