// Javascript document for Baschnagel index page


// crown graphic mouseover
window.onload=findLinkIDs;

function findLinkIDs(){
	for(var i=0; i<document.links.length; i++) // loop through links on the page
	{
		var testLink=document.links[i]; //assign each link to testLink variable
		if (testLink.id){				// if link has an ID...
			var foundLinkID=document.getElementById(testLink.id+"Img");
					// see if another Id with same name plus "Img" exists
			if (foundLinkID){		// if there's a matching pair...
				crownSetup(testLink, foundLinkID); // execute function, pass parameters
			}
		}
	}
}

function crownSetup(abc, xyz){ //thisLink=abc, thisImage=xyz
	abc.imgToChange=xyz;
	abc.onmouseover=crownIconOn;
	abc.onmouseout=crownIconOff;
	
	abc.outImage=new Image();
	abc.outImage.src=xyz.src; // outImage is same source as default image
	
	abc.overImage=new Image();
	abc.overImage.src="images/stellarcrownsmall.png";
}

function crownIconOn(){
	this.imgToChange.src=this.overImage.src;
}

function crownIconOff(){
	this.imgToChange.src=this.outImage.src;
}	
// end crown graphic mouseover	
