//--------------------------------------------------------------------------------

//	JAVASCRIPT LIBRARY

//--------------------------------------------------------------------------------

//	DATE			AUTHOR			DESCRIPTION

//	----			------			-----------

//	Sep 02 2003		Jeff Tsang		Created file and added PopupImage().

//	Sep 22 2003		Susan Lessard	Added top and left values.

//	Sep 25 2003		Susan Lessard	Added PopupRichMedia().

//	Oct 09 2003		Jeff Tsang		Added PopupGlossary().

//	Oct 21 2003		Jeff Tsang		Resized window in PopupRichMedia().

//  Nov 26 2003		Susan Lessard	Added PopupCopyright().

//	Dec 05 2003		Jeff Tsang		Make all popup pages open in the same window instance.

//--------------------------------------------------------------------------------

//javascript:window.open("http://www.virtualmuseum.ca/Exhibitions/Cosmos/english/emailtofriend.php?game=game2",%20null,%20"top=10,left=10,height=551,width=783,scrollbars=yes,status=yes,toolbar=no,menubar=no,location=no")

//onunload="if ((popupWindow) && (!popupWindow.closed)) popupWindow.close()"

var popupWindow;

function PopupImage(strUrl) {

	if ((popupWindow) && (!popupWindow.closed)) popupWindow.close();

	popupWindow = window.open(strUrl, "myWindow", "top=10,left=10,height=480,width=580,resize=yes,scrollbars=yes,status=yes,toolbar=no,menubar=no,location=no");

}



function PopupRichMedia(strUrl) {

	if ((popupWindow) && (!popupWindow.closed)) popupWindow.close();

	popupWindow = window.open(strUrl, "myWindow", "top=10,left=10,height=480,width=580,resize=yes,scrollbars=yes,status=yes,toolbar=no,menubar=no,location=no");

}



function PopupGlossary(strUrl) {

	if ((popupWindow) && (!popupWindow.closed)) popupWindow.close();

	popupWindow = window.open(strUrl, "myWindow", "target=_self, top=10,left=10,height=200,width=637,resize=yes,scrollbars=yes,status=yes,toolbar=no,menubar=no,location=no");

}



function PopupAutoGlossary(strTerm) {

	 var strGlossaryPath;

	 var strGlossaryPath = document.URL;

	 var pos;

	 

	 pos=strGlossaryPath.indexOf("english");

	 if (pos > 0) 

	 { 

		strGlossaryPath = strGlossaryPath.substr(0,pos+8) + 'glossary.html#'+strTerm;

	 }

	 else

	 { 

	    pos=strGlossaryPath.indexOf("francais");

		strGlossaryPath = strGlossaryPath.substr(0,pos+9) + 'glossary.html#'+strTerm;

	 }

	if ((popupWindow) && (!popupWindow.closed)) popupWindow.close();

	popupWindow = window.open(strGlossaryPath, "myWindow", "target=_self, top=10,left=10,height=200,width=637,resize=yes,scrollbars=yes,status=yes,toolbar=no,menubar=no,location=no");

}







function PopupCopyright(strUrl) {

	if ((popupWindow) && (!popupWindow.closed)) popupWindow.close();

	popupWindow = window.open(strUrl, "myWindow", "top=10,left=10,height=400,width=450,scrollbars=yes,status=yes,toolbar=no,menubar=no,location=no");

}



function PopupCredits(strUrl) {

	if ((popupWindow) && (!popupWindow.closed)) popupWindow.close();

	popupWindow = window.open(strUrl, "myWindow", "top=10,left=10,height=400,width=600,scrollbars=yes,status=yes,toolbar=no,menubar=no,location=no");

}



function PopupResources(strUrl) {

	if ((popupWindow) && (!popupWindow.closed)) popupWindow.close();

	popupWindow = window.open(strUrl, "myWindow", "top=10,left=10,height=400,width=600,scrollbars=yes,status=yes,toolbar=no,menubar=no,location=no");

}



/*

var strPath = String(location.href);

if (strPath.indexOf("english") != -1)

	strPath = strPath.substr(strPath.indexOf("english") + 8);

else

	strPath = strPath.substr(strPath.indexOf("francais") + 9);

var strCat = strPath.substr(0, strPath.indexOf("/"));

strPath = strPath.substr(strPath.indexOf("/") + 1);

if (strPath.indexOf("/") == -1)

	var strItem = "";

else

	var strItem = strPath.substr(0, strPath.indexOf("/"));

strPath = strPath.substr(strItem.length + 1);



var strParentCat = ""

var strCategory = "";

var strSubCategory = "";



if (strCat == "introduction")

{

	strCategory = "Introduction";

	if (strItem == "") strSubCategory = "Introduction Home";

	if (strItem == "indigenouspeoples") strSubCategory = "Indigenous Peoples Featured in this Project";

}

else

{

	strCat = strItem;

	strParentCat = strCat;

	if (strPath.indexOf("/") == -1)

		strItem = strPath.substr(0, strPath.indexOf(".html"));

	else

		strItem = strPath.substr(0, strPath.indexOf("/"));

	

	if (strParentCat == "astronomybasics")

	{

		if (strCat == "introduction")

		{

			strCategory = "Introduction";

			strSubCategory = "Introduction Home";

		}

		if (strCat == "ourplaceinspace")

		{

			strCategory = "Our Place in Space";

			if (strItem == "index") strSubCategory = "Our Place in Space Home";

			if (strItem == "thebigpicture") strSubCategory = "The Big Picture";

		}

		if (strCat == "thesolarsystem")

		{

			strCategory = "The Solar System";

			if (strItem == "index") strSubCategory = "The Solar System Home";

			if (strItem == "thesun") strSubCategory = "The Sun";

			if (strItem == "mercury") strSubCategory = "Mercury";

			if (strItem == "venus") strSubCategory = "Venus";

			if (strItem == "earth") strSubCategory = "Earth";

			if (strItem == "mars") strSubCategory = "Mars";

			if (strItem == "jupiter") strSubCategory = "Jupiter";

			if (strItem == "saturn") strSubCategory = "Saturn";

			if (strItem == "uranus") strSubCategory = "Uranus";

			if (strItem == "neptune") strSubCategory = "Neptune";

			if (strItem == "pluto") strSubCategory = "Pluto";

		}

		if (strCat == "stars")

		{

			strCategory = "Stars";

			if (strItem == "index") strSubCategory = "Stars Home";

			if (strItem == "astarisborn") strSubCategory = "A Star is Born";

			if (strItem == "itsastarslife") strSubCategory = "It's a Star's Life";

		}

		if (strCat == "galaxies")

		{

			strCategory = "Galaxies";

			if (strItem == "index") strSubCategory = "Galaxies Home";

			if (strItem == "galacticorigins") strSubCategory = "Galactic Origins";

			if (strItem == "galaxyshapes") strSubCategory = "Galaxy Shapes";

			if (strItem == "themilkyway") strSubCategory = "The Milky Way";

		}

		if (strCat == "theuniverse")

		{

			strCategory = "The Universe";

			if (strItem == "index") strSubCategory = "The Universe Home";

			if (strItem == "understandinggravity") strSubCategory = "Understanding Gravity";

			if (strItem == "theexpandinguniverse") strSubCategory = "The Expanding Universe";

			if (strItem == "darkmatter") strSubCategory = "Dark Matter";

		}

	}



	if (strParentCat == "theskythestarsandyou")

	{

		if (strCat == "introduction")

		{

			strCategory = "Introduction";

			strSubCategory = "Introduction Home";

		}

		if (strCat == "ourcosmicorigins")

		{

			strCategory = "Our Cosmic Origins";

			if (strItem == "index") strSubCategory = "Our Cosmic Origins Home";

			if (strItem == "indigenouspeoplesviews") strSubCategory = "Indigenous People's Views";

			if (strItem == "thebigbang") strSubCategory = "The Big Bang";

		}

		if (strCat == "navigation")

		{

			strCategory = "Navigation";

			if (strItem == "index") strSubCategory = "Navigation Home";

			if (strItem == "thetimeballatsydneyobservatory") strSubCategory = "The Time Ball at Sydney Observatory";

			if (strItem == "matthewflindersandthechartingofaustralia") strSubCategory = "Matthew Flinders and the Charting of Australia";

		}

		if (strCat == "timekeeping")

		{

			strCategory = "Timekeeping";

			if (strItem == "index") strSubCategory = "Timekeeping Home";

			if (strItem == "thetransitcircletelescope") strSubCategory = "The Transit Circle Telescope";

		}

		if (strCat == "skycalendar")

		{

			strCategory = "Sky Calendar";

			if (strItem == "index") strSubCategory = "Sky Calendar Home";

			if (strItem == "markingtimeandseasonalchange") strSubCategory = "Marking Time and Seasonal Change";

			if (strItem == "storiesusefultosurvival") strSubCategory = "Stories Useful to Survival";

		}

		if (strCat == "inspiredbythesky")

		{

			strCategory = "Inspired By The Sky";

			if (strItem == "index") strSubCategory = "Inspired By The Sky Home";

			if (strItem == "visualartsandphotography") strSubCategory = "Visual Arts and Photography";

			if (strItem == "musicperformanceandpoetry") strSubCategory = "Music, Performance and Poetry";

		}

	}



	if (strParentCat == "waysoflooking")

	{

		if (strCat == "introduction")

		{

			strCategory = "Introduction";

			strSubCategory = "Introduction Home";

		}

		if (strCat == "thenakedeye")

		{

			strCategory = "The Naked Eye";

			if (strItem == "index") strSubCategory = "The Naked Eye Home";

			if (strItem == "watchingtheskies") strSubCategory = "Watching the Skies";

			if (strItem == "skyobjects") strSubCategory = "Sky Objects";

			if (strItem == "constellations") strSubCategory = "Constellations";

			if (strItem == "thedeathofnight") strSubCategory = "The Death of Night";

		}

		if (strCat == "modelsandmaps")

		{

			strCategory = "Models and Maps";

			if (strItem == "index") strSubCategory = "Models and Maps Home";

			if (strItem == "transitofvenus") strSubCategory = "Transit of Venus";

			if (strItem == "mappingthemilkyway") strSubCategory = "Mapping the Milky Way";

			if (strItem == "a3dmapofthecosmos") strSubCategory = "A 3-D Map of the Cosmos";

		}

		if (strCat == "extendingthesenses")

		{

			strCategory = "Extending the Senses";

			if (strItem == "index") strSubCategory = "Extending the Senses Home";

			if (strItem == "telescopes") strSubCategory = "Telescopes";

			if (strItem == "photography") strSubCategory = "Photography";

			if (strItem == "astarryspectrum") strSubCategory = "A Starry Spectrum";

			if (strItem == "takingthetwinkleoutofstarlight") strSubCategory = "Taking the Twinkle out of Starlight";

		}

	}



	if (strParentCat == "insideastronomy")

	{

		if (strCat == "introduction")

		{

			strCategory = "Introduction";

			strSubCategory = "Introduction Home";

		}

		if (strCat == "people")

		{

			strCategory = "People";

			if (strItem == "index") strSubCategory = "People Home";

			if (strItem == "meetanastronomer") strSubCategory = "Meet an Astronomer";

			if (strItem == "skystoriestoday") strSubCategory = "Sky Stories Today";

			if (strItem == "astronomersoftomorrow") strSubCategory = "Astronomers of Tomorrow";

		}

		if (strCat == "places")

		{

			strCategory = "Places";

			if (strItem == "index") strSubCategory = "Places Home";

			if (strItem == "aluminizingtheplasketttelescopemirror") strSubCategory = "Aluminizing the Plaskett Telescope Mirror";

		}

		if (strCat == "exploringtheuniverse")

		{

			strCategory = "Exploring the Universe";

			if (strItem == "index") strSubCategory = "Exploring the Universe Home";

			if (strItem == "megatelescopeofthefuture") strSubCategory = "Mega Telescope of the Future";

			if (strItem == "seeingthroughstarsanddust") strSubCategory = "Seeing Through Stars and Dust";

			if (strItem == "planethunting") strSubCategory = "Planet Hunting";

			if (strItem == "thesearchforlife") strSubCategory = "The Search for Life";

			if (strItem == "inpursuitofpulsars") strSubCategory = "In Pursuit of Pulsars";

			if (strItem == "canadasfirstsatellite") strSubCategory = "Canada's First Satellite";

			if (strItem == "canadarmandcanadarm2") strSubCategory = "Canadarm and Canadarm2";

			if (strItem == "parkesandspaceexploration") strSubCategory = "Parkes and Space Exploration";

		}

	}



	if (strParentCat == "skystories")

	{

		if (strCat == "introduction")

		{

			strCategory = "Introduction";

			strSubCategory = "Introduction Home";

		}

		if (strCat == "indigenousaustralians")

		{

			strCategory = "The Indigenous Australians";

			if (strItem == "index") strSubCategory = "The Indigenous Australians Home";

			if (strItem == "thesevensisters") strSubCategory = "The Seven Sisters - The Orion and Pleiades Constellations";

			if (strItem == "theeveningstarandthemorningstar") strSubCategory = "The Evening Star and the Morning Star - The Planet Venus";

			if (strItem == "themilkyway") strSubCategory = "The Milky Way";

			if (strItem == "thesun") strSubCategory = "The Sun";

			if (strItem == "themoon") strSubCategory = "The Moon";

			if (strItem == "thesoutherncross") strSubCategory = "The Southern Cross";

			if (strItem == "themagellanicclouds") strSubCategory = "The Magellanic Clouds";

		}

		if (strCat == "anishinabe")

		{

			strCategory = "The Anishinabe of Central North America";

			if (strItem == "index") strSubCategory = "The Anishinabe of Central North America Home";

			if (strItem == "thesevendaughtersofthemoonandsun") strSubCategory = "The Seven Daughters of the Moon and Sun - the Pleiades Constellation";

			if (strItem == "thefisherconstellation") strSubCategory = "The Fisher Constellation - part of the Big Dipper Constellation";

			if (strItem == "thebearconstellation") strSubCategory = "The Bear Constellation - part of the Big Dipper";

			if (strItem == "snaringthesun") strSubCategory = "Snaring The Sun";

		}

		if (strCat == "blackfoot")

		{

			strCategory = "The Blackfoot of the North American Plains";

			if (strItem == "index") strSubCategory = "The Blackfoot of the North American Plains Home";

			if (strItem == "miohpokoiksi") strSubCategory = "Miohpokoiksi - The Six Lost Boys - The Pleiades Constellation";

			if (strItem == "ihkitsikammiksi") strSubCategory = "Ihkitsikammiksi - The Big Dipper";

			if (strItem == "theskybeings") strSubCategory = "The Sky Beings (The Moon, Sun and Morning Star - the Planet Venus)";

			if (strItem == "thenorthstar") strSubCategory = "The North Star - the planet Venus";

			if (strItem == "makoiyohsokoyi") strSubCategory = "Makoi-Yohsokoyi - The Wolf Trail - The Milky Way";

		}

	}

}



window.document.myMenu.SetVariable("initial_category", strCategory);

window.document.myMenu.SetVariable("initial_subcategory", strSubCategory);

*/
