$(document).ready(function() 
{ 
	if (1) {
	// How many image files of each type do we have?
	// (each image file should be in the appropriate folder.)
	var left_horizontal_images = [
	  {
	    filename    : "Martin-Schreiber.jpg",
	    title       : "Martin Schreiber",
	    artist      : "martin_schreiber"
	  }, {
	    filename    : "Alexander_Harding_13.jpg",
	    title       : "Alexander Harding",
	    artist      : "alexander_harding"
	  }, {
	    filename    : "Harold-Feinstein.jpg",
	    title       : "Harold Feinstein",
	    artist      : "harold_feinstein"
	  }, {
	    filename    : "Brian-Kaplan.jpg",
	    title       : "Brian Kaplan",
	    artist      : "brian_kaplan"
	  }, {
	    filename    : "Glen-Scheffer.jpg",
	    title       : "Glen Scheffer",
	    artist      : "glen_scheffer"
	  }, {
  	  	filename    : "Heidi_Kirkpatrick.jpg",
      	title       : "Heidi Kirkpaptrick",
     	 artist     : "heidi_kirkpatrick"
      }, {
  	  	filename    : "William-Wegman.jpg",
      	title       : "William Wegman",
     	 artist     : "wegman"
      }
  ];
	var center_vertical_images = [
	  {
  	  filename    : "Schubert_west.jpg",
      title       : "Erik Schubert",
      artist      : "erik_schubert"
  	 }, {
  	  filename    : "Stephen-Sheffield.jpg",
      title       : "Stephen Sheffield",
      artist      : "stephen_sheffield"
     }, {
  	  filename    : "Rowland_Scherman.jpg",
      title       : "Rowland Scherman",
      artist      : "rowland_scherman"
     }, {
  	  filename    : "Roger-Farrington.jpg",
      title       : "Roger Farrington",
      artist      : "roger_farrington"
     }, {
  	  filename    : "Kevin-Van-Aelst.jpg",
      title       : "Kevin Van Aelst",
      artist      : "kevin_van_aelst"
     }
  ];
	var right_top_horizontal_images = [
  	{
  	  filename      : "Suzanne_Revy.jpg",
      title         : "Suzanne Revy",
      artist        : "suzanne_revy"
  	}, {
  	  filename      : "Bill_Franson.jpg",
      title         : "Bill Franson",
      artist        : "bill_franson"
  	}, {
  	  filename      : "Eva-Timothy.jpg",
      title         : "Eva Timothy",
      artist        : "eva_timothy"
  	}
	];
	var right_bottom_square_images = [
  	{
  	  filename      : "Ken-Rosenthal.jpg",
      title         : "Ken Rosenthal",
      artist        : ""
  	}, {
  	  filename      : "Fran-Forman.jpg",
      title         : "Fran Forman",
      artist        : "fran_forman"
    }, {
  	  filename      : "Hiroshi_Watanabe.jpg",
      title         : "Hiroshi Watanabe",
      artist        : "hiroshi_watanabe"
    }, {
  	  filename      : "Jennifer_Hudson.jpg",
      title         : "Jennifer Hudson",
      artist        : "jennifer_hudson"
    }
	];
	
	
	
	
	
	// placeholders for the image we pick.
	var left_horizontal_image = {};
	var center_vertical_image = {};
	var right_top_horizontal_image = {};
	var right_bottom_square_image = {};
	
	// ugh. don't look, ugly iteration. 
	// adding paths to the filename to get the images.
	// randomly select from the array.
	
	// left hoz
	var l = left_horizontal_images.length; var i = 0; var rnd_no = 0;
	for (i = 0; i < l; i++) {
		left_horizontal_images[i]['filename'] = "images/home/left_horizontal/" + left_horizontal_images[i]['filename'];
	}
	rnd_no = Math.round((l - 1)*Math.random());
	left_horizontal_image = left_horizontal_images[rnd_no];
	
	// center vert
	l = center_vertical_images.length; i = 0;
	for (i = 0; i < l; i++) {
		center_vertical_images[i]['filename'] = "images/home/center_vertical/" + center_vertical_images[i]['filename'];
	}
	rnd_no = Math.round((l - 1)*Math.random());
	center_vertical_image = center_vertical_images[rnd_no];
	
	// right top hoz
	l = right_top_horizontal_images.length; i = 0;
	for (i = 0; i < l; i++) {
		right_top_horizontal_images[i]['filename'] = "images/home/right_top_horizontal/" + right_top_horizontal_images[i]['filename'];
	}
	rnd_no = Math.round((l - 1)*Math.random());
	right_top_horizontal_image = right_top_horizontal_images[rnd_no];
	
	// right bottom sq
	l = right_bottom_square_images.length; i = 0;
	for (i = 0; i < l; i++) {
		right_bottom_square_images[i]['filename'] = "images/home/right_bottom_square/" + right_bottom_square_images[i]['filename'];
	}
	rnd_no = Math.round((l - 1)*Math.random());
	right_bottom_square_image = right_bottom_square_images[rnd_no];
	
	$('td#collage_left_horizontal').html("<a href=\"artist/" + left_horizontal_image['artist'] + "\"><img src=\"" + left_horizontal_image['filename'] + "\"  width=\"370\" height=\"252\"  alt=\"" + left_horizontal_image['title'] + "\" title=\"" + left_horizontal_image['title'] +"\"/></a>");
	$('td#collage_center_vertical').html("<a href=\"artist/" + center_vertical_image['artist'] + "\"><img src=\"" + center_vertical_image['filename'] + "\" width=\"272\"  alt=\"" + center_vertical_image['title'] + "\" title=\"" + center_vertical_image['title'] +"\" /></a>");
	$('td#collage_right_top_horizontal').html("<a href=\"artist/" + right_top_horizontal_image['artist'] + "\"><img src=\"" + right_top_horizontal_image['filename'] + "\" width=\"194\"  alt=\"" + right_top_horizontal_image['title'] + "\" title=\"" + right_top_horizontal_image['title'] +"\" /></a>");
	$('td#collage_right_bottom_square').html("<a href=\"artist/" + right_bottom_square_image['artist'] + "\"><img src=\"" + right_bottom_square_image['filename'] + "\" width=\"194\"  alt=\"" + right_bottom_square_image['title'] + "\" title=\"" + right_bottom_square_image['title'] +"\" /></a>");

	}
});
