/*	Name:		Scott Ash JS Menu Image Swap	Type:		Object	Created:	03/03/2005	Modified:	03/03/2005	Version:	2.0	Updates:	12/20/2004 (v1.0)					first release into build of a website.				05/10/2005					updated function to be object oriented. Still has very specific calls that may be updated					in the future.	Author:		Scott A. Ash	Copyright:	Scott Ash	Functions:	bpi_prod_photos()								init():				This function swaps the image of a target window for previewing photos. It also loads an 				arrow image based on the thumbnail image name.								The function takes two parameters being the target image name and the number of photos that will				be set for preview.								Example thumnail file name:				[target name]_[xx]_t.jpg				Example matching photo file name:		[target name]_[xx].jpg				Example thumnail image call				<img onmousedown="[object].setview([xx])" src"[...]">								Where "target name" is the first part of the filename and also the name & id of the preview window in				the html. "xx" represents an integer value from 0-99.						Uses:		solo	Required:	This is a very specific function. It requires that the preview box be build as it is in this 				website.					Settings:	None*/function bpi_prod_photos(){	// members	this.target;	this.len;		this.init = init;	this.setview = setview;	// constructor	function init(t,l)	{		this.target = t;		this.len = l;	}		function setview(n)	{		// initialize number		imgnum = n;		if(n<10)		{			arrowname = "a0" + n;			imgnum = "0" + n;		}else		{			arrowname = "a" + n;			imgnum = n;		}						arrowsrc = document[arrowname].src;		arrowsrcparts = arrowsrc.split('arrow');	// requires file name to start with "arrow"					// test for image swap ability		var isAllowed = (document.images);				if(isAllowed)		{			// reset all arrows to blanks			for(i=0;i<this.len;i++)			{					document['a0' + i].src = arrowsrcparts[0] + 'arrows/arrow_blank.gif';			}						// swap target image			document[this.target].src = "prod_photos/" + this.target + '_' + imgnum + '.jpg';						// load red arrow to current image			document[arrowname].src = arrowsrcparts[0] + 'arrows/arrow_down.gif';					}else		{			alert("ERROR!\nbpi_prod_photos():\nYour browser does not support image swapping.");		}	}}