function preloadnav(){

  nav = new Array(
  "images/portfolio.gif",
  "images/capabilities.gif",
  "images/aboutus.gif",
  "images/contact.gif",
  "images/photography.gif",
  "images/gicleeprinting.gif",
  "images/publications.gif",
  "images/copyrestoration.gif",
  "images/digitalart.gif",
  "images/product.gif",
  "images/food.gif",
  "images/people.gif",
  "images/industrial.gif",
  "images/stock.gif",
  "images/children.gif",
  "images/families.gif",
  "images/portraits.gif",
  "images/performingartist.gif",
  "images/weddings.gif",
  "images/capabilitieson.gif",
  "images/portfolioon.gif",
  "images/peopleon.gif",
  "images/publicationson.gif",
  "images/ourown.gif",
  "images/forothers.gif",
  "images/architectural.gif"
);
  var count;
  for (count = 0; count < nav.length; count++){
  newimage=new Image();
  newimage.src=nav[count];
  }
}

function navigate(linky, dropdown){
		
	kill(linky); //kills prev layers, turns imgs off
	var content = getContent(linky); //html to go to layer
	
	//turn on
	eval('document.' + linky + '.src="images/' + linky + 'on.gif"'); 
	document.getElementById(dropdown).style.visibility="visible";
	WriteLayer(dropdown, null, content);
//	setTimeout('kill("all")', 8000);

}

//defines layer
function WriteLayer(ID,parentID,sText) { 
		
 if (document.layers) { 
   	var oLayer; 
   	if(parentID){ 
     		oLayer = eval('document.' + parentID + '.document.' + ID + '.document'); 
		}	
		else{ 
     		oLayer = document.layers[ID].document; 
   } 
   oLayer.open();
   oLayer.write(sText); 
   oLayer.close(); 
 } 
 else if (parseInt(navigator.appVersion)>=5&&navigator.appName=="Netscape") { 
   document.getElementById(ID).innerHTML = sText; 
 } 
 else if (document.all) document.all[ID].innerHTML = sText 
} 


//returns a value to fill the dropdown navs
function getContent (linky){

	var text = "blah blah";

	if (linky == 'capabilities'){
		
	text = '<a href="photography.html"><img name="photography" border="0" alt="Photography" src="images/photography.gif" style="float: center;"></a> &nbsp; <a href="giclee.html"><img name="gicleeprinting" border="0" alt="Giclee Printing" src="images/gicleeprinting.gif"></a> &nbsp; <img name="publications" border="0" alt="Publications" src="images/publications.gif" onMouseOver="navigate(\'publications\',\'nav3\');"> &nbsp; <a href="copyrestoration.html"><img name="copyrestoration" border="0" alt="Copy & Restoration" src="images/copyrestoration.gif"></a> &nbsp; <a href="digitalartwork.html"><img name="digitalart" border="0" alt="Digital Artwork" src="images/digitalart.gif"></a>';
	}
	else if (linky == 'portfolio'){
		text = '<a href="product.html"><img name="product" border="0" alt="Product" src="images/product.gif"></a> &nbsp; &nbsp;<a href="food.html"><img name="food" border="0" alt="Food" src="images/food.gif"></a> &nbsp; &nbsp; <img name="people" border="0" alt="People" src="images/people.gif" onMouseOver="navigate(\'people\',\'nav3\');">  &nbsp; &nbsp;<a href="industrial.html"><img name="industrial" border="0" alt="Industrial" src="images/industrial.gif"></a> &nbsp; &nbsp; <a href="editorial.html"><img name="editorial" border="0" alt="Editorial" src="images/editorial.gif"></a> &nbsp; &nbsp; <a href="architectural.html"><img name="architectural" border="0" alt="Editorial" src="images/architectural.gif"></a> &nbsp; &nbsp;<a href="stock.html"><img name="stock" border="0" alt="Stock" src="images/stock.gif"></a>';
	}
	else if (linky == 'people'){
		text = '<a href="children.html"><img name="children" border="0" alt="children" src="images/children.gif"></a> &nbsp; &nbsp;<a href="families.html"><img name="families" border="0" alt="Families" src="images/families.gif"></a> &nbsp; &nbsp; <a href="portraits.html"><img name="portraits" border="0" alt="Portraits" src="images/portraits.gif"></a> &nbsp; &nbsp; <a href="performingartists.html"><img name="performingartists" border="0" alt="Performing Artists" src="images/performingartists.gif"></a> &nbsp; &nbsp;<a href="wedding.html"><img name="weddings" border="0" alt="Weddings" src="images/weddings.gif"></a>'
	}
	else if (linky == 'publications'){
		text= '<a href="ourown.html"><img name="ourown" border="0" alt="Our Own" src="images/ourown.gif"></a> &nbsp; &nbsp; <a href="forothers.html"><img name="forothers" border="0" alt="For Others" src="images/forothers.gif"></a>'
	}
	
	return (text);		
}

//hides layers
function kill(linky) {
	document.getElementById("nav3").style.visibility="hidden";
	if (linky != "publications"){
	eval('document.capabilities.src="images/capabilities.gif"'); 
	}
	if ((linky != "people") && (linky != "publications")){
		eval('document.portfolio.src="images/portfolio.gif"');
	}
	if (linky == "all"){
	document.getElementById('nav2').style.visibility="hidden";
	document.getElementById('nav3').style.visibility="hidden";
	}
}


