
// Variable declarations for thumbnail box

var rightHover = false;
var leftHover = false;
var timer;


// Variable declarations for Image Arrays

var res1_images, res2_images, res3_images;
var com1_images, com2_images, com3_images;
var shop1_images;

// Master Arrays

var res_arrays = [res1_images, res2_images, res3_images];
var com_arrays = [com1_images, com2_images, com3_images];
var shop_arrays = [shop1_images];

// Constant values

var RES = 0;
var COM = 1;
var SHOP = 2;


// -----------------------------------------------------------------------------------------------

// Functions for div scrolling

function moveRight()
{
	var thumbBox = document.getElementById("thumb_box");
	thumbBox.scrollLeft += 1;
	timer = setTimeout("moveRight()",10);
}

function moveLeft()
{
	var thumbBox = document.getElementById("thumb_box");
	thumbBox.scrollLeft -= 1;
	timer = setTimeout("moveLeft()", 10);
}

function stopMovement()
{
	clearTimeout(timer);
}

// ------------------------------------------------------------------------------------------------

// The base object for a captioned image


function CaptionedImage(name, source, thumbnail, caption)
{
	this.source = source;
	this.thumbnail = thumbnail;
	this.caption = caption;
	this.name = name;
	this.image = new Image();
	this.image.src = source;
}

// --------------------------------------------------------------------------------------------------

	// called to display image from web page

function displayImage(type, page, image)
{
	var temp_array = null;

	if (type == RES)
	{
		temp_array = res_arrays[page - 1];
	}
	else if (type == COM)
	{
		temp_array = com_arrays[page - 1];
	}
	else if (type == SHOP)
	{
		temp_array = shop_arrays[page - 1];
	}

	

	for (var i=0; i < temp_array.length; i++)
	{
		
		if (image.name == temp_array[i].name)
		{
			
			var imageBox = document.getElementById("image_box");
			imageBox.innerHTML = "<center><img src='" + temp_array[i].source +
				"'></center>";
			var captionBox = document.getElementById("caption_box");
			captionBox.innerHTML ="<center><p class='caption'>" + temp_array[i].caption + 
				"</p></center>";
			return;
		}
	}
}

// -------------------------------------------------------------------------------------------------

	// preloadPhotos() must be called before call to displayImage()
	// This function must be updated if new pages are added

function preloadPhotos(type, page)
{
	if (type == RES)
	{
		if (page == 1)
		{
			if (!res1_images)
				init_residential_1();			
		}
		else if (page == 2)
		{
			if (!res2_images)
				init_residential_2();
		}
		else if (page == 3)
		{
			if (!res3_images)
				init_residential_3();
		}
	}
	else if (type == COM)
	{
		if (page == 1)
		{
			if (!com1_images)
				init_commercial_1();
		}
		else if (page == 2)
		{
			if (!com2_images)
				init_commercial_2();
		}
		else if (page == 3)
		{
			if (!com3_images)
				init_commercial_3();
		}
	}
	else if (type == SHOP)
	{
		if (page == 1)
		{
			if (!shop1_images)
				init_shop_1();
		}
	}
}

// ---------------------------------------------------------------------------------------

// From here down, the "down and dirty" initialization functions for each page

function init_commercial_1()
{

  // Commercial Page 1
	box_1a = new CaptionedImage("box_1a", "pictures/box_1a.jpg", "thumbs/t_box_1a.jpg",	
		"Brass drop box with patina.  Antique Bronze.  24x25x12" );
	box_1b = new CaptionedImage("box_1b", "pictures/box_1b.jpg", "thumbs/t_box_1b.jpg",
		"Brass drop box with patina.  Antique Bronze.  24x25x12");
	lighting_1a = new CaptionedImage("lighting_1a", "pictures/lighting_1a.jpg", "thumbs/t_lighting_1a.jpg",
		"Steel lighting fixtures with black powder coat.");
	lighting_1b = new CaptionedImage("lighting_1b", "pictures/lighting_1b.jpg", "thumbs/t_lighting_1b.jpg",
		"Steel lighting fixtures with black powder coat.");
	rack_1a = new CaptionedImage("rack_1a", "pictures/rack_1a.jpg", "thumbs/t_rack_1a.jpg",
		"Steel racks with integral lighting.");
	rack_1b = new CaptionedImage("rack_1b", "pictures/rack_1b.jpg", "thumbs/t_rack_1b.jpg",
		"Steel racks with integral lighting.");
	rack_1c = new CaptionedImage("rack_1c", "pictures/rack_1c.jpg", "thumbs/t_rack_1c.jpg",
		"Hidden fitting room door fabricated in aluminum with laminated, black mirror (closed).");
	rack_1d = new CaptionedImage("rack_1d", "pictures/rack_1d.jpg", "thumbs/t_rack_1d.jpg",
		"Hidden fitting room door fabricated in aluminum with laminated, black mirror (open).");

	com1_images = [box_1a, box_1b, lighting_1a, lighting_1b, rack_1a, rack_1b, rack_1c,
		rack_1d];
	com_arrays = [com1_images, com2_images, com3_images];
}

	// ---------------------------------------------------------------------------------------------

function init_commercial_2()
{
	// Commercial Page 2
	hall_1a = new CaptionedImage("hall_1a", "pictures/hall_1a.jpg", "thumbs/t_hall_1a.jpg",
		"Long Island University - Refinishing of interior stainless steel ceiling to #4 linear brush.  5x15.");
	hall_1c = new CaptionedImage("hall_1c", "pictures/hall_1c.jpg", "thumbs/t_hall_1c.jpg",
		"Long Island University - Refinishing of interior stainless steel ceiling to #4 linear brush.  5x15.");
	hall_1d = new CaptionedImage("hall_1d", "pictures/hall_1d.jpg", "thumbs/t_hall_1d.jpg",
		"Long Island University - Refinishing of interior stainless steel ceiling to #4 linear brush.  5x15.");
	hall_1e = new CaptionedImage("hall_1e", "pictures/hall_1e.jpg", "thumbs/t_hall_1e.jpg",
		"Long Island University - Refinishing of interior stainless steel ceiling to #4 linear brush.  5x15.");
	hall_1f = new CaptionedImage("hall_1f", "pictures/hall_1f.jpg", "thumbs/t_hall_1f.jpg",
		"Long Island University - Refinishing of interior stainless steel ceiling to #4 linear brush.  5x15.");
	hall_1g = new CaptionedImage("hall_1g", "pictures/hall_1g.jpg", "thumbs/t_hall_1g.jpg",
		"Long Island University - Refinishing of interior stainless steel ceiling to #4 linear brush.  5x15.");
	wall_1a = new CaptionedImage("wall_1a", "pictures/wall_1a.jpg", "thumbs/t_wall_1a.jpg",
		"Long Island University - Right of exterior stainless steel canopy with random swirl design.  10x39");
	wall_1b = new CaptionedImage("wall_1b", "pictures/wall_1b.jpg", "thumbs/t_wall_1b.jpg",
		"Long Island University - Right of exterior stainless steel canopy with random swirl design.  10x39");

	com2_images = [hall_1a, hall_1c, hall_1d, hall_1e, hall_1f, hall_1g, wall_1a, wall_1b];
	com_arrays = [com1_images, com2_images, com3_images];
}

	// ----------------------------------------------------------------------------------------------


function init_commercial_3()
{
	// Commercial Page 3
	stage_1a = new CaptionedImage("stage_1a", "pictures/stage_1a.jpg", "thumbs/t_stage_1a.jpg",
		"Steel frame with fiberglass panels on the theatre set for &quot;Flight&quot;.");
	stairs_1a = new CaptionedImage("stairs_1a", "pictures/stairs_1a.jpg", "thumbs/t_stairs_1a.jpg",
		"Aluminum railing with clear lacquer at P.C.Richards 86th St, NYC.");
	stairs_1b = new CaptionedImage("stairs_1b", "pictures/stairs_1b.jpg", "thumbs/t_stairs_1b.jpg",
		"Aluminum railing with clear lacquer at P.C.Richards 86th St, NYC.");
	stairs_6a = new CaptionedImage("stairs_6a", "pictures/stairs_6a.jpg", "thumbs/t_stairs_6a.jpg",
		"Patina bronze handrail on historic steel railing.");
	stairs_6b = new CaptionedImage("stairs_6b", "pictures/stairs_6b.jpg", "thumbs/t_stairs_6b.jpg",
		"Patina bronze handrail on historic steel railing.");

	com3_images = [stage_1a, stairs_1a, stairs_1b, stairs_6a, stairs_6b];
	com_arrays = [com1_images, com2_images, com3_images];
}

	// -----------------------------------------------------------------------------------------------

function init_residential_1()
{
	// Residential Page 1
	closet_1a = new CaptionedImage("closet_1a",	"pictures/closet_1a.jpg", "thumbs/t_closet_1a.jpg",	
		"Steel closet doors with polished nickel finish and mirror insert.  24x86 ea.");
	closet_1b = new CaptionedImage("closet_1b", "pictures/closet_1b.jpg", "thumbs/t_closet_1b.jpg",
		"Steel closet doors with polished nickel finish and mirror insert.  24x86 ea.");
	fireplace_1a = new CaptionedImage("fireplace_1a", "pictures/fireplace_1a.jpg", "thumbs/t_fireplace_1a.jpg",
		"Steel fireplace surround with black patina and wax finish.  39x58.");
	fireplace_1b = new CaptionedImage("fireplace_1b", "pictures/fireplace_1b.jpg", "thumbs/t_fireplace_1b.jpg",
		"Steel fireplace surround with black patina and wax finish.  39x58.");
	gate_1a = new CaptionedImage("gate_1a", "pictures/gate_1a.jpg", "thumbs/t_gate_1a.jpg",
		"Hand-forged, steel gate with black paint.  60x50.");
	gate_1b = new CaptionedImage("gate_1b", "pictures/gate_1b.jpg", "thumbs/t_gate_1b.jpg",
		"Hand-forged, steel gate with black paint.  60x50.");
	lighting_2a = new CaptionedImage("lighting_2a", "pictures/lighting_2a.jpg", "thumbs/t_lighting_2a.jpg",
		"Polished aluminum turn signal bracket.");
	vent_1a = new CaptionedImage("vent_1a", "pictures/vent_1a.jpg", "thumbs/t_vent_1a.jpg",
		"Custom stainless steel stove-top vent.");
	vent_1b = new CaptionedImage("vent_1b", "pictures/vent_1b.jpg", "thumbs/t_vent_1b.jpg",
		"Custom stainless steel stove-top vent.");

	res1_images = [closet_1a, closet_1b, fireplace_1a, fireplace_1b, gate_1a, gate_1b, lighting_2a,
		vent_1a, vent_1b];
	res_arrays = [res1_images, res2_images, res3_images];
}

	// ----------------------------------------------------------------------------------------------

function init_residential_2()
{
	 // Residential Page 2
	kitchen_1a = new CaptionedImage("kitchen_1a", "pictures/kitchen_1a.jpg", "thumbs/t_kitchen_1a.jpg",
		"Private Residence - Stainless steel countertop with integral Fanke sink.  145x25.");
	kitchen_1b = new CaptionedImage("kitchen_1b", "pictures/kitchen_1b.jpg", "thumbs/t_kitchen_1b.jpg",
		"Private Residence - Stainless steel countertop with integral Fanke sink.  145x25.");
	kitchen_1c = new CaptionedImage("kitchen_1c", "pictures/kitchen_1c.jpg", "thumbs/t_kitchen_1c.jpg",
		"Private Residence - Hand-brushed steel counter with finish and wax.");
	kitchen_1d = new CaptionedImage("kitchen_1d", "pictures/kitchen_1d.jpg", "thumbs/t_kitchen_1d.jpg",
		"Private Residence - Hand-brushed steel counter with finish and wax.");
	kitchen_1e = new CaptionedImage("kitchen_1e", "pictures/kitchen_1e.jpg", "thumbs/t_kitchen_1e.jpg",
		"Private Residence - Hand-brushed steel counter with finish and wax.");
	kitchen_1h = new CaptionedImage("kitchen_1h", "pictures/kitchen_1h.jpg", "thumbs/t_kitchen_1h.jpg",
		"Private Residence - Hand-brushed steel counter with finish and wax.");
	kitchen_1i = new CaptionedImage("kitchen_1i", "pictures/kitchen_1i.jpg", "thumbs/t_kitchen_1i.jpg",
		"Private Residence - Hand-brushed steel counter with finish and wax.");

	res2_images = [kitchen_1a, kitchen_1b, kitchen_1c, kitchen_1d, kitchen_1e, kitchen_1h,
		kitchen_1i];
	res_arrays = [res1_images, res2_images, res3_images];
}

	// ----------------------------------------------------------------------------------------------

function init_residential_3()
{
	 // Residential Page 3
	kitchen_1j = new CaptionedImage("kitchen_1j", "pictures/kitchen_1j.jpg", "thumbs/t_kitchen_1j.jpg",
		"Private Residence - Stainless steel cladding in kitchen nook.");
	kitchen_1k = new CaptionedImage("kitchen_1k", "pictures/kitchen_1k.jpg", "thumbs/t_kitchen_1k.jpg",
		"Private Residence - Stainless steel cladding in kitchen nook.");
	kitchen_1l = new CaptionedImage("kitchen_1l", "pictures/kitchen_1l.jpg", "thumbs/t_kitchen_1l.jpg",
		"Private Residence - Stainless steel cladding in kitchen nook.");
	kitchen_1m = new CaptionedImage("kitchen_1m", "pictures/kitchen_1m.jpg", "thumbs/t_kitchen_1m.jpg",
		"Private Residence - Stainless steel cladding in kitchen nook.");
	kitchen_1n = new CaptionedImage("kitchen_1n", "pictures/kitchen_1n.jpg", "thumbs/t_kitchen_1n.jpg",
		"Private Residence - Stainless steel cladding in kitchen nook.");
	stairs_2a = new CaptionedImage("stairs_2a", "pictures/stairs_2a.jpg", "thumbs/t_stairs_2a.jpg",
		"Steel railing with silver powder coat in NYC.");
	stairs_4b = new CaptionedImage("stairs_4b", "pictures/stairs_4b.jpg", "thumbs/t_stairs_4b.jpg",
		"Steel staircase with oak treads.");
	stairs_5a = new CaptionedImage("stairs_5a", "pictures/stairs_5a.jpg", "thumbs/t_stairs_5a.jpg",
		"Stainless steel handrail.");
	stairs_5b = new CaptionedImage("stairs_5b", "pictures/stairs_5b.jpg", "thumbs/t_stairs_5b.jpg",
		"Stainless steel handrail.");
	stairs_7a = new CaptionedImage("stairs_7a", "pictures/stairs_7a.jpg", "thumbs/t_stairs_7a.jpg",
		"Steel handrail with ponderosa pine inserts at private residence.");
	stairs_8a = new CaptionedImage("stairs_8a", "pictures/stairs_8a.jpg", "thumbs/t_stairs_8a.jpg",
		"Steel with glass balcony.");

	res3_images = [kitchen_1j, kitchen_1k, kitchen_1l, kitchen_1m, kitchen_1n, stairs_2a, stairs_4b,
	stairs_5a, stairs_5b, stairs_7a, stairs_8a];
	res_arrays = [res1_images, res2_images, res3_images];
}

	// ----------------------------------------------------------------------------------------------

function init_shop_1()
{
  // Shop Page 1

	shop_2a = new CaptionedImage("shop_2a", "pictures/shop_2a.jpg", "thumbs/t_shop_2a.jpg",
		"Stress relieving sawtooth stringer at the shop.");
	shop_2b = new CaptionedImage("shop_2b", "pictures/shop_2b.jpg", "thumbs/t_shop_2b.jpg",
		"Stress relieving sawtooth stringer at the shop.");
	shop_2c = new CaptionedImage("shop_2c", "pictures/shop_2c.jpg", "thumbs/t_shop_2c.jpg",
		"Stress relieving sawtooth stringer at the shop.");
	shop_2h = new CaptionedImage("shop_2h", "pictures/shop_2h.jpg", "thumbs/t_shop_2h.jpg",
		"Full-penetration weld.");
	shop_3a = new CaptionedImage("shop_3a", "pictures/shop_3a.jpg", "thumbs/t_shop_3a.jpg",
		"Preparation for welding.");
	shop_4a = new CaptionedImage("shop_4a", "pictures/shop_4a.jpg", "thumbs/t_shop_4a.jpg",
		"Shop supervisor.");
	shop_5a = new CaptionedImage("shop_5a", "pictures/shop_5a.jpg", "thumbs/t_shop_5a.jpg",
		"Custom bookshelves. 3&#39; x 2&quot; x 10&quot;.");
	shop_6a = new CaptionedImage("shop_6a", "pictures/shop_6a.jpg", "thumbs/t_shop_6a.jpg",
		"Custom bookshelves.  10&quot; x 2&quot; x 8&#39;.");

	shop1_images = [shop_2a, shop_2b, shop_2c, shop_2h, shop_3a, shop_4a, shop_5a, shop_6a];
	shop_arrays = [shop1_images];
}

//---------------------------------------------------------------------------------------------------










