
//-------------------------------------------------------
	function cSwapImages(sPathToImages, bWithLayer, bGif)
	{
		this.pArrayOfImages = new Array();
		this.pLastImageNumber = null;
		this.pPathToImages = sPathToImages;
		this.pWithLayer = bWithLayer;
		this.pGif = bGif;
		this.pType = null;
		this.pException1 = null;
		this.pException2 = null;
		this.pType = null;
	
		this.mLoadImagesByNumber = fLoadImagesByNumber;
		this.mSwapByNumber = fSwapByNumber;
		this.mSwapByNumberWithLayer = fSwapByNumberWithLayer;
		this.mSwapManagerByNumber = fSwapManagerByNumber;
		this.mSwapManagerByName =  fSwapManagerByName;
		this.mDetermineImageType = fDetermineImageType;
		this.mLoadImagesByName = fLoadImagesByName;
		this.mSwapByName = fSwapByName;
		this.mSwapByNameWithLayer = fSwapByNameWithLayer;
		
		this.mDetermineImageType();
	}
//-----------
	function fDetermineImageType()
	{
		if (this.pGif)
		{
			this.pType = ".gif";
		}
		else
		{
			this.pType = ".jpg";
		}
	}
//-----------	
	function fSwapByNumberWithLayer(sHtmlImageName, iImageNumber, sLayerName)
	{
		if (document.layers)
		{
			eval("document." + sLayerName + ".document." + sHtmlImageName + ".src = this.pArrayOfImages[" + iImageNumber + "].src");
		}
		else
		{
			eval("document." + sHtmlImageName + ".src = this.pArrayOfImages[" + iImageNumber + "].src");
		}
	}
//-----------	
	function fSwapByNameWithLayer(sHtmlImageName, iImageName, sLayerName)
	{
		if (document.layers)
		{
			eval("document." + sLayerName + ".document." + sHtmlImageName + ".src = eval(iImageName).src");
		}
		else
		{
			eval("document." + sHtmlImageName + ".src = eval(iImageName).src");
		}
	}
//-----------	
	function fLoadImagesByNumber(iLastImageNumber)
	{
		this.pLastImageNumber = iLastImageNumber;
		for (x = 0; x <= this.pLastImageNumber; x++)
		{
			this.pArrayOfImages[x] = new Image();
			this.pArrayOfImages[x].src = this.pPathToImages + "/" + x + this.pType;
		}
	}
//-----------
	function fLoadImagesByName(asImagesName)
	{
		for (x = 0; x < asImagesName.length; x++)
		{
			eval(asImagesName[x] + " = new Image()");
			eval(asImagesName[x]).src = this.pPathToImages + "/" + asImagesName[x] + this.pType;
		}
	}
//-----------
	function fSwapByNumber(sHtmlImageName, iImageNumber, sLayerName)
	{
		if (this.pException1 == iImageNumber || this.pException2 == iImageNumber){ return; }
		
		if (this.pWithLayer == false)
		{
			eval("document." + sHtmlImageName + ".src = this.pArrayOfImages[" + iImageNumber + "].src");
		}
		else
		{
			this.mSwapByNumberWithLayer(sHtmlImageName, iImageNumber, sLayerName);
		}	
	}
//-------------------------------------------------------
	function fSwapByName(sHtmlImageName, sImageName, sLayerName)
	{
		if (this.pException1 == sImageName || this.pException2 == sImageName){ return; }
		
		if (this.pWithLayer == false)
		{
			eval("document." + sHtmlImageName + ".src = eval(sImageName).src");
		}
		else
		{
			this.mSwapByNameWithLayer(sHtmlImageName, sImageName, sLayerName);
		}	
	}
//-------------------------------------------------------
	function fSwapManagerByNumber(aiImageOverAndOut, asHtmlImageName, aiImagesClicked, aiImagesRestore, asLayerNames, iTargetInArray)
	{
		for (x = 0; x < asHtmlImageName.length; x++)
		{
			this.mSwapByNumberWithLayer(asHtmlImageName[x], aiImagesRestore[x], asLayerNames[x]);
		}
		
		this.pException1 = aiImageOverAndOut[0];
		this.pException2 = aiImageOverAndOut[1];
		this.mSwapByNumberWithLayer(asHtmlImageName[iTargetInArray], aiImagesClicked[iTargetInArray], asLayerNames[iTargetInArray]);
	}
//-------------------------------------------------------
	function fSwapManagerByName(asImageOverAndOut, asHtmlImageName, asImagesClicked, asImagesRestore, asLayerNames, iTargetInArray)
	{
		for (x = 0; x < asHtmlImageName.length; x++)
		{
			this.mSwapByNameWithLayer(asHtmlImageName[x], asImagesRestore[x], asLayerNames[x]);
		}
		
		this.pException1 = asImageOverAndOut[0];
		this.pException2 = asImageOverAndOut[1];
		this.mSwapByNameWithLayer(asHtmlImageName[iTargetInArray], asImagesClicked[iTargetInArray], asLayerNames[iTargetInArray]);
	}
//-------------------------------------------------------
