homeon= new Image(77,20); 
homeon.src="images/homeon.jpg";

homeoff= new Image(77,20); 
homeoff.src="images/homeoff.jpg";

salvagesoff= new Image(137,20); 
salvagesoff.src="images/salvagesoff.jpg";

salvagesoff= new Image(137,20); 
salvagesoff.src="images/salvagesoff.jpg";

photosoff= new Image(124,20); 
photosoff.src="images/photosoff.jpg";

photosoff= new Image(124,20); 
photosoff.src="images/photosoff.jpg";

newsoff= new Image(97,20); 
newsoff.src="images/newsoff.jpg";

newsoff= new Image(97,20); 
newsoff.src="images/newsoff.jpg";

mediaoff= new Image(107,20); 
mediaoff.src="images/mediaoff.jpg";

mediaoff= new Image(107,20); 
mediaoff.src="images/mediaoff.jpg";

contactoff= new Image(138,20); 
contactoff.src="images/contactoff.jpg";

contactoff= new Image(138,20); 
contactoff.src="images/contactoff.jpg";

function writeCopyright(){
	document.write("<div class='toptext'style='margin-left: 22px; margin-top: 22px;'>Copyright&copy; 2007 - 2011, AeroArchaeology.com<br>Alfred Hagen. All rights reserved<\/div>");
}

function writeWebDesign(){
	document.write("<div class='toptext' style='text-align: right; margin-right: 22px; margin-top: 22px;'>Website by <a href='http://www.simpaticodesign.com' target='_blank' class='toptextlink'>www.simpaticodesign.com<\/a><\/div>");
}

function loadingOff(){
	var loadobj = document.getElementById("loadgif");
	loadobj.className = "loadoff";
	}


/*=====================================================================
				START GALLERY SCRIPTS
=====================================================================*/

function writeGal2(whichgal,galname){
	//alert(galname);
	var rownum = 0;
	document.write("<table><tr><td colspan='5' align='right' style='width: 620px; height: 20px; font-size: 11px; font-family: verdana,arial,helvetica,sans-serif; padding-right: 15px;'>Click Image to Enlarge<\/td><\/tr><\/table>");
	document.write("<table width='635' cellpadding='0' cellspacing='12' border='0'>");
		for (galloop = 0; galloop < whichgal[0].length; galloop++){
			if (rownum == 5){
			rownum = 0;
			document.write("<\/tr><tr>");
			}
		document.write("<td><div onClick='showPic(\"" + galname + "\",\"" + whichgal[0][galloop][0] + "pic\",\"" + whichgal[0][galloop][1] + "\");' class='thumbs'><img src='" + whichcat + "/" + whichgal[0][galloop][0] + "sm.jpg'><\/div><\/td>");
		rownum++;
		}
	document.write("<\/tr><\/table>");
	}
	
	
	function writePicDivs(thisgal,galname){
		for (divloop = 0; divloop < thisgal[0].length; divloop++){
		document.write("<div id='" + thisgal[0][divloop][0] + "pic' class='hidimg'><div class='toprow'><table><tr><td align='center'><table><tr><td class='prenext'>(" + (divloop +1) + " of " + gallery1[0].length + ") |<\/td><td><div class='prenext'><font style='cursor: pointer' onClick='preDiv(" + divloop + ")'>Previous<\/font> | <font style='cursor: pointer' onClick='nextDiv(" + divloop + ")'>Next<\/font><\/div><\/td><td><div onClick='closePic(\"" + thisgal[0][divloop][0] + "pic\");' class='closex'>| Close [X]<\/div><\/td><\/tr><\/table><\/td><\/tr><\/table><\/div><center><img src='" + whichcat + "/" + thisgal[0][divloop][0] + "lg.jpg'><br><div class='captions'>" + thisgal[0][divloop][1] + "<\/div><\/center><\/div><\/div>");
		}
	}
	
	function preDiv(currentdiv){
	var visiblediv = gallery1[0][currentdiv][0] + "pic";
		if (currentdiv == 0){
			currentdiv = gallery1[0].length;
		}
	var previousdiv = gallery1[0][currentdiv -1][0] + "pic";
	var currentobj = document.getElementById(visiblediv);
	var previousobj = document.getElementById(previousdiv);
	currentobj.className =  "hidimg";
	previousobj.className =  "hidimgb";
	}
	
	function nextDiv(currentdiv){
	var visiblediv = gallery1[0][currentdiv][0] + "pic";
		if (currentdiv == gallery1[0].length -1){
			currentdiv = -1;
		}
	var nextdiv = gallery1[0][currentdiv +1][0] + "pic";
	var currentobj = document.getElementById(visiblediv);
	var nextobj = document.getElementById(nextdiv);
	currentobj.className =  "hidimg";
	nextobj.className =  "hidimgb";
	}
	
	function showPic(mygal,picid){
		if (mygal == 'gallery1'){
			for (idloop = 0; idloop < gallery1[0].length; idloop++){
			var idtemp = gallery1[0][idloop][0] + "pic";
			var objtemp = document.getElementById(idtemp);
			objtemp.className = "hidimg";
			}
		}
		
		if (mygal == 'gallery2'){
			for (idloop = 0; idloop < gallery2[0].length; idloop++){
			var idtemp = gallery2[0][idloop][0] + "pic";
			var objtemp = document.getElementById(idtemp);
			objtemp.className = "hidimg";
			}
		}
		
	//alert(picid);
	var imgobj = document.getElementById(picid);
	var allobj = document.getElementById("allcontent");
			imgobj.className = "hidimgb";
			allobj.className = "mainb";
	}
	
	
	function closePic(picid,galname){
	//alert(galname[0].length);
	//if (galname == 'gallery1'){
		//for (idloop = 0; idloop < gallery1[0].length; idloop++){
		//var idtemp = gallery1[0][idloop][0] + "pic";
		//var objtemp = document.getElementById(idtemp);
		//objtemp.className = "hidimg";
		//}
	//}
		
		var imgobj = document.getElementById(picid);
		var allobj = document.getElementById("allcontent");
		imgobj.className = "hidimg";
		allobj.className = "main";
		activepic = "";
	}
	
	function picOff(){
	//alert(activepic);
		if (activediv = "on"){
		closePic(activepic);
		activediv = "off";
		}
	}
	/*=====================================================================
				END GALLERY SCRIPTS
	=====================================================================*/

