//This script created the random images for the knittersHomepage

function rotateImg() {

  var num0 = Math.round(Math.random() * 44); 
  var num1 = Math.round(Math.random() * 44); 
  var num2 = Math.round(Math.random() * 44); 

//change the number start at zero (0) for the number of images to rotate. Currently there are 5 images, so the number value should be 4.

//this is to set up the individual links that correspond to the masthead image - capable of having multiple links - (name image starting with 0), the script will find the neccessary images.

  var captionArray = new Array();
	captionArray[0] = "http://www.knithq.net/" ;		

//image map coordinate for the text caption link.	
  var imageMapArray = new Array();
    imageMapArray[0] = "0,0,702,160";
	
  var w = "";
	w += "<map name=\"masthead\"><area href='" + captionArray[num0] + "' coords='" + imageMapArray[num0] + "' /></map>";
	w += "<img src=\"./images/masthead/Family_" + num0 + ".jpg\"  width=\"250\"  height=\"200\" alt=\"knitters\"  border=\"0\" usemap=\"#masthead\" />";	
	w += "<img src=\"./images/sapacer.gif\"  width=\"5\"  height=\"5\" alt=\"\"  border=\"0\" u/>";	
	w += "<img src=\"./images/masthead/Family_" + num1 + ".jpg\"  width=\"250\" height=\"200\" alt=\"knitters\"  border=\"0\" usemap=\"#masthead\" />";	
	w += "<img src=\"./images/sapacer.gif\"  width=\"5\"  height=\"5\" alt=\"\"  border=\"0\" u/>";	
	w += "<img src=\"./images/masthead/Family_" + num2 + ".jpg\"  width=\"250\" height=\"200\" alt=\"knitters\"  border=\"0\" usemap=\"#masthead\" />";	

	
  var mastImage = new csspObj('mainImg');
  if(document.layers) {
    mastImage.setProperty('innerHTML',w);
  	  document.open();
      document.write(w);
      document.close();
  } else {
//     mastImage.innerHTML+w = mastImage.innerHTML+w;
 mastImage.innerHTML = w;
  }
  //-->
}


