// JavaScript Document
function setimage(in_container, in_imgsource, in_imagealt, in_description)
{
	//see page 446 JsDHTML Cookbook
	/* Create a div tag to hold everything. */
	var newContainer = document.createElement("div");
	/* Create an image tag to display the image. */
	var newImage = document.createElement("img");
	newImage.setAttribute("src", in_imgsource);
	newImage.setAttribute("alt", in_imagealt);
	/* Put the image inside the div tag. */
	newContainer.appendChild(newImage);
	/* Create a paragraph tag to hold the description. */
	var newParagraph = document.createElement("p");
	newParagraph.setAttribute("class", "image-description");
	newParagraph.appendChild(document.createTextNode(in_description || ("Please describe " + in_imagealt)));
	/* Put the paragraph inside the div tag. */
	newContainer.appendChild(newParagraph);
	
	/* Find the container on the page. */
	var elem = document.getElementById(in_container);
	/* Replace the old contents (previous containers or whitespace) with the new container. */
	elem.replaceChild(newContainer, elem.firstChild);
}



