// ----------------------------------
// to make sure that the main page is never trapped within frames of another page
		if (top != self) {
			top.location = location;
		}

	function loadDisabled(dname, target, ptype)
	{
		return false;
	}
// ----------------------------------
// central loading function to load pages into the main div
function ahah(url, target) {
  document.getElementById(target).innerHTML = ' Fetching data...';
  if (window.XMLHttpRequest) {
    req = new XMLHttpRequest();
  } else if (window.ActiveXObject) {
    req = new ActiveXObject("Microsoft.XMLHTTP");
  }
  if (req != undefined) {
    req.onreadystatechange = function() {ahahDone(url, target);};
    req.open("GET", url, true);
    req.send("");
  }
}  

function ahahDone(url, target) {
// alert("Target: " + target + " URL: " + url);
  if (req.readyState == 4) { // only if req is "loaded"
    if (req.status == 200) { // only if "OK"
      document.getElementById(target).innerHTML = req.responseText;
    } else {
      document.getElementById(target).innerHTML=" AHAH Error:\n"+ req.status + "\n" +req.statusText;
    }
  }
}

function load(name, div) {
	ahah(name,div);
	return false;
}

// ----------------------------------
// for main page
		function DoMonthlyBanner() {

			var dtNow = new Date();
			var iMonth = dtNow.getMonth() + 1;
			var strlead =  "";
			if (iMonth < 10) strlead = "0"; 
			var MonthImageName = 'images/' + strlead + iMonth + 'Banner.jpg';

			document.getElementById("MonthlyBannerPic").src = MonthImageName;

			return;
		}

		function CheckForParms() {
			var scr_width = screen.availWidth - 2;
			var scr_height = screen.availHeight - 2;
			window.moveTo(1, 1);
			window.resizeTo(scr_width, scr_height);
		}

		function DoFeatures() {
				var MonthlyFeaturePics = 
				[
				'feature/patcheshowto01.jpg', 
				'feature/reenacting.jpg', 
				'feature/acrylichowto01.jpg', 
				'feature/apollopatches.jpg', 
				'feature/namhelogunner.jpg', 
				'feature/arlington.jpg', 
				'feature/ww1aces.jpg', 
				'feature/ww2aces.jpg'
				];
				var MonthlyFeatureLinks = 
				[
				'howto/patcheshowto01.htm', 
				'articles/civilwar.htm', 
				'howto/acrylichowto01.htm', 
				'articles/space/patches/apollopatches.html', 
				'collection.htm', 
				'museums/arlington/pictures.html', 
				'ww1/ameraces.htm', 
				'ww2/wwiiaces.htm'
				];
				var MonthlyFeatureSubTypes = 
				[
				'web', 
				'web', 
				'web', 
				'web', 
				'web', 
				'web', 
				'web', 
				'web'
				];
				var MonthlyFeatureTypes = 
				[
				'HTML', 
				'HTML', 
				'HTML', 
				'HTML', 
				'HTML', 
				'HTML', 
				'HTML', 
				'HTML'
				];
				var MonthlyFeatureCaptions = 
				[
				'Make Patches', 
				'Civil War Reenacting', 
				'Paint Figure Heads', 
				'Apollo Patches', 
				'Action Figures', 
				'Arlington', 
				'Aces of World War I', 
				'Aces of World War II' 
				];
				var MonthlyFeatureTitles = 
				[
				'How To', 
				'Feature Article', 
				'How To', 
				'Feature Article', 
				'Must See', 
				'Tour', 
				'History', 
				'History'
				];

			for (var i=0; i < 8; i++)
			{
				var picname = "FeaturePic" + ((i+1)+'');
				var linkname = "FeatureLink" + ((i+1)+'');
				var captionname = "FeatureCaption" + ((i+1)+'');
				var titlename = "FeatureTitle" + ((i+1)+'');
				document.getElementById(picname).src = MonthlyFeaturePics[i];
				document.getElementById(picname).alt = MonthlyFeatureCaptions[i];
				document.getElementById(linkname).href = MonthlyFeatureLinks[i];
				if (MonthlyFeatureTypes[i] == "HTML") document.getElementById(linkname).onclick = function (){load(this.href, 'LAAMainDiv'); return false;};
				if (MonthlyFeatureTypes[i] == "XML") {
					if (MonthlyFeatureSubTypes[i] == "patch") document.getElementById(linkname).onclick = function (){loadXMLDoc(this.href, 'LAAMainDiv', 'patch'); return false;};
					if (MonthlyFeatureSubTypes[i] == "figure") document.getElementById(linkname).onclick = function (){loadXMLDoc(this.href, 'LAAMainDiv', 'figure'); return false;};
					if (MonthlyFeatureSubTypes[i] == "museum") document.getElementById(linkname).onclick = function (){loadXMLDoc(this.href, 'LAAMainDiv', 'museum'); return false;};
				}
				document.getElementById(captionname).innerHTML = MonthlyFeatureCaptions[i];
				document.getElementById(titlename).innerHTML = MonthlyFeatureTitles[i];
			}
		}

// ----------------------------------
// for movies page
		function showMovieDiv(PObj) {
			document.getElementById("divWWI").style.display = "none";
			document.getElementById("divWWII").style.display = "none";
			document.getElementById("divSpace").style.display = "none";
			document.getElementById("divVN").style.display = "none";
			document.getElementById("divModern").style.display = "none";
			document.getElementById("divACW").style.display = "none";
			document.getElementById("divSciFi").style.display = "none";
			document.getElementById("divOthers").style.display = "none";
			document.getElementById(PObj).style.display = "block";
			return;
			}
// for music CDs page
		function showMe(PObj) {
			document.getElementById("divBadfinger").style.display = "none";
			document.getElementById("divBrianWilson").style.display = "none";
			document.getElementById("divDaDa").style.display = "none";
			document.getElementById("divElvisCostello").style.display = "none";
			document.getElementById("divPinkFloyd").style.display = "none";
			document.getElementById("divRadiohead").style.display = "none";
			document.getElementById("divSqueeze").style.display = "none";
			document.getElementById("divTearsForFears").style.display = "none";
			document.getElementById("divBeatles").style.display = "none";
			document.getElementById("divTheWho").style.display = "none";
			document.getElementById("divXTC").style.display = "none";
			document.getElementById("divJimiHendrix").style.display = "none";
			document.getElementById("divSRV").style.display = "none";
			document.getElementById("divJimmyPage").style.display = "none";
			document.getElementById("divClapton").style.display = "none";
			document.getElementById("divNickDrake").style.display = "none";
			document.getElementById("divJeffBuckley").style.display = "none";
			document.getElementById("divJellyfish").style.display = "none";
			document.getElementById("divCottonMather").style.display = "none";
			document.getElementById(PObj).style.display = "block";
			return;
			}
		function showLinkDiv(PObj) {
			document.getElementById("div_reference").style.display = "none";
			document.getElementById("div_modern_gear").style.display = "none";
			document.getElementById("div_models_n_plans").style.display = "none";
			document.getElementById("div_Hobby_Supplies").style.display = "none";
			document.getElementById("div_One_Sixth_Manufacturers").style.display = "none";
			document.getElementById("div_One_Sixth_Dealers").style.display = "none";
			document.getElementById("div_plastic_models").style.display = "none";
			document.getElementById(PObj).style.display = "block";
			return;
			}

		var MercurySlideShowPics = 
		[
		"articles/space/mercury/57640157.jpg",
		"articles/space/mercury/57641157.jpg",
		"articles/space/mercury/62MA756.jpg",
		"articles/space/mercury/GPN2000001023.jpg",
		"articles/space/mercury/GPN2000001026.jpg",
		"articles/space/mercury/GPN2000001027.jpg",
		"articles/space/mercury/GPN2000001028.jpg",
		"articles/space/mercury/GPN2000001361.jpg",
		"articles/space/mercury/mercury01.jpg",
		"articles/space/mercury/mercury02.jpg",
		"articles/space/mercury/mercury03.jpg"
		];
		var MercurySlideIndex = 0;
		var MercurySlideShowLength = MercurySlideShowPics.length - 1;
		function AdvanceMercurySlide(PicObj) {
			MercurySlideIndex += 1;
			if (MercurySlideIndex > MercurySlideShowLength) MercurySlideIndex = 0;
			PicObj.src = MercurySlideShowPics[MercurySlideIndex];
		}

		var GeminiSlideShowPics = 
		[
		"articles/space/suits/10074069.jpg",
		"articles/space/suits/10074073.jpg",
		"articles/space/suits/10074074.jpg",
		"articles/space/suits/10074213.jpg",
		"articles/space/suits/suit03.jpg",
		"articles/space/suits/suit04.jpg",
		"articles/space/suits/suit05.jpg",
		"articles/space/suits/suit08.jpg",
		"articles/space/suits/suit09.jpg",
		"articles/space/suits/suit10.jpg",
		"articles/space/suits/suit11.jpg",
		"articles/space/suits/suit12.jpg",
		"articles/space/suits/suit14.jpg",
		"articles/space/suits/suit15.jpg"
		];
		var GeminiSlideIndex = 0;
		var GeminiSlideShowLength = GeminiSlideShowPics.length - 1;
		function AdvanceGeminiSlide(PicObj) {
			GeminiSlideIndex += 1;
			if (GeminiSlideIndex > GeminiSlideShowLength) GeminiSlideIndex = 0;
			PicObj.src = GeminiSlideShowPics[GeminiSlideIndex];
		}

		var ApolloSlideShowPics = 
		[
		"articles/space/suits/5903.jpg",
		"articles/space/suits/Armtraje.jpg",
		"articles/space/suits/ArmstrongAldrinSuits.jpg",
		"articles/space/suits/ArmstrongEMU.jpg",
		"articles/space/suits/AS11-40-5867.jpg",
		"articles/space/suits/AS11-40-5874.jpg",
		"articles/space/suits/AS11-40-5942.jpg",
		"articles/space/suits/cmdscott.jpg",
		"articles/space/suits/suit01.jpg",
		"articles/space/suits/10075391.jpg"
		];
		var ApolloSlideIndex = 0;
		var ApolloSlideShowLength = ApolloSlideShowPics.length - 1;
		function AdvanceApolloSlide(PicObj) {
			ApolloSlideIndex += 1;
			if (ApolloSlideIndex > ApolloSlideShowLength) ApolloSlideIndex = 0;
			PicObj.src = ApolloSlideShowPics[ApolloSlideIndex];
		}

		var Apollo2SlideShowPics = 
		[
		"articles/space/apollo2/apollo01.jpg",
		"articles/space/apollo2/apollo02.jpg",
		"articles/space/apollo2/apollo03.jpg",
		"articles/space/apollo2/apollo04.jpg",
		"articles/space/apollo2/apollo05.jpg",
		"articles/space/apollo2/apollo06.jpg",
		"articles/space/apollo2/ap1772H251.jpg",
		"articles/space/apollo2/ap1772H253.jpg",
		"articles/space/apollo2/ap1772H297.jpg",
		"articles/space/apollo2/ap1772H298.jpg",
		"articles/space/apollo2/ap1772H314.jpg",
		"articles/space/apollo2/AS1713420387.jpg"
		];
		var Apollo2SlideIndex = 0;
		var Apollo2SlideShowLength = Apollo2SlideShowPics.length - 1;
		function AdvanceApollo2Slide(PicObj) {
			Apollo2SlideIndex += 1;
			if (Apollo2SlideIndex > Apollo2SlideShowLength) Apollo2SlideIndex = 0;
			PicObj.src = Apollo2SlideShowPics[Apollo2SlideIndex];
		}

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