var aNumDesc = new Array();

aNumDesc[1] = "Oil  pick-up tube assembly with flange and bracket, and our patented pick-up screen design brazed to the tube.";
aNumDesc[2] = "Plated tube assembly with precision machined fittings.";
aNumDesc[3] = "Crossover tube assembly using seamless hydraulic tubing - including o-rings, precision machined nuts, and collars.";
aNumDesc[4] = "Fuel delivery tube using seamless hydraulic tubing, assembled with o-rings, precision machined nuts, and collars brazed to the tube.";
aNumDesc[5] = "Oil  pick-up tube assembly with flange and our patented pick-up screen design.";
aNumDesc[6] = "Coiled steel spring tube with multiple bends and quick connect stop beads at both ends.";
aNumDesc[7] = "Steel fabricated tube with tube-to-tube assembly using saddle beading, stop beading and hose beading.";
aNumDesc[8] = "High-pressure hydraulic clutch tube made from mechanical steel with aluminum-rich, hexavalant-free Galfan - includes bleeder supported precision-machined fitting and quick connect micro-bead.";
aNumDesc[9] = "Zinc-plated steel tube assembly with tube-to-tube fabrication, including beads.";
aNumDesc[10] = "Coated stainless steel tube with roll groove, offset angle welded to hole-pierced bracket.";
aNumDesc[11] = "Steel tube with multiple plane bending, including hose beading and swaging.";
aNumDesc[12] = "Fabricated tube assembly with multi-plane bending, stop beading, flaring and precision machined nut and fittings.";
aNumDesc[13] = "Hose connection utilizing steel tube with hose bead, stop bead, flatten and extrude processes.";
aNumDesc[14] = "Stainless steel tube with 90 degree bend and each end threaded.";
aNumDesc[15] = "Steel tubes with hose beading, stop beading, and saddle beading to accommodate tube-to-tube assembly.";
aNumDesc[16] = "Bent steel tube with stop beads, hose bead and swaged end form.";
aNumDesc[17] = "Steel tube including bending, swaging, expansion, hose beading and stop 	beading.";
aNumDesc[18] = "Steel drain tube utilizing stop beads, swage and roll groove for o-ring.";
aNumDesc[19] = "Bowl vent tube fabricated from steel tube, with quick connect bead and rectangle 	slot at radius.";
aNumDesc[20] = "Stainless steel tube fabricated with stop beads, cut beads and swaging.";
aNumDesc[21] = "Small diameter copper tubing with multiple bends including horseshoe loop.";
aNumDesc[22] = "Straight aluminum tube with machined spiral knurling."
aNumDesc[23] = "High-pressure, Bundy weld tube assembly with multiple bends, custom end beads and plated precision machined fittings."
aNumDesc[24] = "Steel hydraulic tube with multiple bends, double-wall flare and precision machined nuts and sleeves.";
aNumDesc[25] = "Steel angle cut tube assembly including swaging, hose beading and tube to tube 	brazing.";
aNumDesc[26] = "Steel tube with tube expansion, tube piercing and tube flattening processes.";
aNumDesc[27] = "Angle cut steel tube.";
aNumDesc[28] = "Straight steel tube with custom hexagonal tube expansion and tube swaging.";
aNumDesc[29] = "Straight steel tube with symmetrical end form expansions.";
aNumDesc[30] = "(do not use as tube interior reveals burnishing material)";
aNumDesc[31] = "Steel tube fabrication with weld-tacked and brazed deep drawn cup &ndash; including hose beading and stop beading.";
aNumDesc[32] = "Steel tube-to-tube fabrication with a 45 degree miter cuts, weld-tacked, brazed, beaded and double-flared.";
aNumDesc[33] = "Steel tubes with 45 degree miter cut ends, tack welded and brazed.";
aNumDesc[34] = "Steel tube fabrication with 45 degree miter cut, tack welded, brazed &ndash; including 	tube expansion and tube swaging.";
aNumDesc[35] = "Fabricated steel tubes with 45 miter cutting, tack welding, brazing, expansion, 	swaging, stop beading and flaring.";
aNumDesc[36] = "Fabricated metal tubes demonstrating a variety of custom end forms &ndash; 	manufactured using tooling made by our in-house toolmakers.";
aNumDesc[37] = "Fuel pressure regulator assembly, including steel fuel delivery tube with quick 	connect stop beads, threaded nut and steel collar.";
aNumDesc[38] = "Shock loop tube fabricated from copper-coated steel tube, with symmetrical 90 	degree bends and horseshoe loop bend.";
aNumDesc[39] = "Steel dipstick tube with XYZ coordinate bending, stop beading, roll grooving, 	swaging, expansion and serrations.";
aNumDesc[40] = "Custom serrated end form on steel tubing.";
aNumDesc[41] = "Refrigeration tube made from copper tubing with tube expansion and swaging.";
aNumDesc[42] = "Steel tube with XYZ coordinate bending, stop bead and hose bead end forms.";
aNumDesc[43] = "Coated steel dipstick tube assembly with expansion, flaring, roll grooving, stop 	beading and projection welded brackets.";
aNumDesc[44] = "Fabricated steel dipstick tube assembly including projection welded bracket, stop 	bead, roll groove, o-ring and swage.";
aNumDesc[45] = "Waterjet cutting aluminum.";
aNumDesc[46] = "Complex waterjet cut part.";
aNumDesc[47] = "Waterjet cut gear and tool blanks.";
aNumDesc[48] = "Stone accent pieces made using waterjet cutting.";
aNumDesc[49] = "Waterjet cutting makes intricate shapes.";

var aLetteredDesc = new Array();

//A	
aLetteredDesc[0] = "Assorted fabricated metal tube assemblies.";
//B	
aLetteredDesc[1] = "Cut-to-length steel tubes.";
//C	
aLetteredDesc[2] = "Assorted fabricated tube assemblies, brackets and flanges.";
//D	
aLetteredDesc[3] = "Precision machined parts manufactured on Swiss CNC turning center.";
//E	
aLetteredDesc[4] = "Plated steel tube fabrication with brazed flange.";
//F	
aLetteredDesc[5] = "Stainless steel tube assembly for marine fuel cooler application &ndash; includes coil 	bending, o-ring groove and brazed fitting.";
//G	
aLetteredDesc[6] = "Precision machined, coated gas piston for firearms application.";
//H	
aLetteredDesc[7] = "Stainless steel fabricated tube assembly for aftermarket automotive filtration 	application &ndash; includes tube bending, hose beading, stop beading, tube piercing 	and brazed collar with valve stem.";
//I	
aLetteredDesc[8] = "Steel tube fabrication with radiused flattened end form, tube piercing and tube 	knurling.";
//J	
aLetteredDesc[9] = "Assorted parts manufactured on Swiss CNC precision machining center.";
//K	
aLetteredDesc[10] = "Firearms parts manufactured on Swiss CNC precision machining equipment.";
//L	
aLetteredDesc[11] = "Precision machined flat bladed screwdriver tip manufactured Swiss CNC screw 	machine.";
//M	
aLetteredDesc[12] = "Machined metal tube with hose bead and hose barb.";
//N	
aLetteredDesc[13] = "Precision machined parts showing turning, milling, threading and tapping 	capabilities of Swiss CNC precision machining centers.";
//O	
aLetteredDesc[14] = "Precision machined parts showing cross-drilling, off-center drilling and long 	length to diameter ratio capabilities of Swiss CNC turning centers.";
//P	
aLetteredDesc[15] = "Assorted machined parts showing precision turning capabilities of Swiss CNC 	screw machines.";
//Q	
aLetteredDesc[16] = "Variety of parts for furniture, firearms and automotive industries &ndash; manufactured 	on Swiss CNC precision machining equipment.";
//R	
aLetteredDesc[17] = "The fabrication of a dipstick tube assembly begins with a cut-to-length metal tube 	&ndash; snap cut, and burr free for the next operation.";
//S	
aLetteredDesc[18] = "The tube is then beaded, expanded and flared using custom tooling made by our 	in-house toolmakers.";
//T	
aLetteredDesc[19] = "Next, the tube is roll-grooved to hold an o-ring, which will be added later in the 	process.";
//U	
aLetteredDesc[20] = "A multi-plane (XYZ coordinate) tube bending operation is completed, using 	custom tooling made by our in-house toolmakers.";
//V	
aLetteredDesc[21] = "A stamped metal bracket is manufactured.";
//W	
aLetteredDesc[22] = "The bracket is aligned and projection welded to the tube.";
//X	
aLetteredDesc[23] = "The nearly completed fabricated tube assembly is painted.";
//Y	
aLetteredDesc[24] = "The o-ring is assembled and the dipstick is inserted into the tube.";
//Z	
aLetteredDesc[25] = "A final audit inspection is performed and the completed dipstick tube assembly is 	packaged for shipment to the customer’s plant.";
//AA	
aLetteredDesc[26] = "Mill-length cut metal tubing to be used for in-house tube fabrication &ndash; or sold to 	customers who do their own tube fabricating.";

var aNumFile = new Array();
aNumFile[1] = "_0575.jpg";
aNumFile[2] = "0576.jpg";
aNumFile[3] = "0578.jpg";
aNumFile[4] = "0580.jpg";
aNumFile[5] = "0581.jpg";
aNumFile[6] = "0514.jpg";
aNumFile[7] = "0515.jpg";
aNumFile[8] = "0516.jpg";
aNumFile[9] = "0517.jpg";
aNumFile[10] = "0520.jpg";
aNumFile[11] = "0521.jpg";
aNumFile[12] = "0522.jpg";
aNumFile[13] = "0523.jpg";
aNumFile[14] = "0526.jpg";
aNumFile[15] = "0527.jpg";
aNumFile[16] = "0528.jpg";
aNumFile[17] = "0529.jpg";
aNumFile[18] = "0530.jpg";
aNumFile[19] = "0531.jpg";
aNumFile[20] = "0532.jpg";
aNumFile[21] = "0533.jpg";
aNumFile[22] = "0534.jpg";
aNumFile[23] = "0538.jpg";
aNumFile[24] = "0543.jpg";
aNumFile[25] = "0544.jpg";
aNumFile[26] = "0545.jpg";
aNumFile[27] = "0546.jpg";
aNumFile[28] = "0548.jpg";
aNumFile[29] = "0550.jpg";
aNumFile[30] = "0552.jpg";
aNumFile[31] = "0553.jpg";
aNumFile[32] = "0554.jpg";
aNumFile[33] = "0555.jpg";
aNumFile[34] = "0556.jpg";
aNumFile[35] = "0560.jpg";
aNumFile[36] = "0562.jpg";
aNumFile[37] = "0563.jpg";
aNumFile[38] = "0564.jpg";
aNumFile[39] = "0565.jpg";
aNumFile[40] = "0566.jpg";
aNumFile[41] = "0567.jpg";
aNumFile[42] = "0569.jpg";
aNumFile[43] = "0572.jpg";
aNumFile[44] = "0573.jpg";
aNumFile[45] = "0585.jpg";
aNumFile[46] = "0588.jpg";
aNumFile[47] = "0590.jpg";
aNumFile[48] = "0597.jpg";
aNumFile[49] = "0598.jpg";

var aLetteredFile = new Array();
aLetteredFile[0] = "hl_tubes.jpg"; // A
aLetteredFile[1] = "hl_cut.jpg"; // B
aLetteredFile[2] = "obrack2.jpg"; // C
aLetteredFile[3] = "dsc01.jpg"; // D
aLetteredFile[4] = "shinyassembly_001.jpg"; // E
aLetteredFile[5] = "sm_home_coiled.jpg"; // F
aLetteredFile[6] = "brass_machined_part_large.jpg"; // G
aLetteredFile[7] = "assembly_black_cap_007.jpg"; // H
aLetteredFile[8] = "fabpic2.jpg"; // I
aLetteredFile[9] = "Two-Silver-Parts-Large.jpg"; // J
aLetteredFile[10] = "Blk-Parts-Retouchd-small.jpg"; // K
aLetteredFile[11] = "screw_driver_bit_large.jpg"; // L
aLetteredFile[12] = "small_brass_turned_part_large.jpg"; // M
aLetteredFile[13] = "Gold-Parts-600-pix.jpg"; // N
aLetteredFile[14] = "Multiple-Parts-Silver-Gold.jpg"; // O
aLetteredFile[15] = "tpart1l.jpg"; // P
aLetteredFile[16] = "tpart2l.jpg"; // Q
aLetteredFile[17] = "chron1.jpg"; // R
aLetteredFile[18] = "chron2.jpg"; // S
aLetteredFile[19] = "chron3.jpg"; // T
aLetteredFile[20] = "chron4.jpg"; // U
aLetteredFile[21] = "chron5.jpg"; // V
aLetteredFile[22] = "chron6.jpg"; // W
aLetteredFile[23] = "chron7.jpg"; // X
aLetteredFile[24] = "chron8.jpg"; // Y
aLetteredFile[25] = "chron9.jpg"; // Z
aLetteredFile[26] = "mill.jpg"; // AA

function prepImages(idDiv, aImageIDs)
{
	var shtml;	
	var div = document.getElementById(idDiv);
	shtml = '';
	for (k=0; k < aImageIDs.length; k++)
	{
		shtml += getImageHTML(aImageIDs[k]);
	}
	
	div.innerHTML = shtml;
	initLightbox();
}

function getImageHTML(id)
{
	var sURL = 'images/photos2/' + getImageFile(id);
	var sDesc = getImageDescription(id);
	var shtml = '';
	
	
	shtml = '<a href="' + sURL + '" rel="lightbox" title="' + sDesc + '"><img class="tfrightphoto" src="' + sURL + '"';
	shtml += 'alt="' + sDesc + '" /></a> ';
	
	// onclick="showPopupImage(' + "'" + sURL + "', '', '" + sDesc + "', this);\" 
	return shtml;
}

function getNumForLetteredIndex(id)
{
			var index;
			index = asc(id.charAt(0)) - asc('A');
			// ASSUME at most 26^2 images
			if (id.length > 1)
				index = (index+1)*26 + asc(id.charAt(1)) - asc('A');
				
			return index;
}

function getImageFile(id)
{
		if (typeof(id) == "number")
		{
			return aNumFile[id];
		}
		else if (typeof(id) == "string")
		{
			return aLetteredFile[getNumForLetteredIndex(id)];
		}
		else
			alert('getImageDescription: Error on page');
}

function asc(sChar)
{
	var esc = sChar.charCodeAt(0);
	
	return parseInt(esc);
}

function getImageDescription(id)
{
		if (typeof(id) == "number")
		{
			return aNumDesc[id];
		}
		else if (typeof(id) == "string")
		{
			return aLetteredDesc[getNumForLetteredIndex(id)];
		}
		else
			alert('getImageDescription: Error on page');
}

function getGalleryImageHTML(id)
{
	var sURL = 'images/photos2/' + getImageFile(id);
	var sThumbURL = sURL.replace('\.', '_thumb\.').replace('/photos2/', '/thumb/'); 
	
	var sDesc = getImageDescription(id);
	var shtml = '';
	
	
	shtml = '<a href="' + sURL + '" rel="lightbox" title="' + sDesc + '"><img class="tfgallerythumb" src="' + sThumbURL + '"';
	shtml += 'alt="' + sDesc + '" /></a> ';
	
	return shtml;
}

var aGalleryPages = new Array();

aGalleryPages[0] = new Array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, /*17, */ 18, 19, 20, 21, 22, 23, 24, 25);
aGalleryPages[1] = new Array(26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45,46,47,48, 49);
aGalleryPages[2] = new Array('A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', /*'I',*/  'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q' /*, 'R' , 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', 'AA'*/ );

function showPhotoGalleryPage(id, page_index)
{
	var div = document.getElementById(id);
	var shtml = '';

	page = aGalleryPages[page_index-1];
	for (k = 0; k < page.length ; k++)
	{
		shtml += getGalleryImageHTML(page[k]);
	}

	div.innerHTML = shtml;
	initLightbox();
}
function insertPhotoGallery(id)
{
	
	var div = document.getElementById(id);
	var shtml = '';

	for (set = 0; set < aGalleryPages.length; set++)
	{
		page = aGalleryPages[set];
		for (k = 0; k < page.length ; k++)
		{
			shtml += getGalleryImageHTML(page[k]);
		}
	}
	
	/*for (k = asc('A'); k <= asc('Z'); k++)
	{
		shtml += getGalleryImageHTML(String.fromCharCode(k));
	}
	shtml += getGalleryImageHTML('AA');*/
	
	div.innerHTML = shtml;
	initLightbox();
	
	
}
