	menuimage = '';
	
	function swapLocImgObject(aObject,aNewImgState,aOldImgState)
	{
		
		newSrc = aObject.src;
		
		newSrc = newSrc.replace(aOldImgState, aNewImgState);
		
		aObject.src = newSrc;
	}
	
	function swapImgObject(aObject,aImgSrc,aImgState,aImgPath)
	{
		if (aObject.src.indexOf('.gif') > 0) {
			theType = '.gif';
		}
		else {
			theType = '.jpg';
		}
		if (aImgPath == 'any') {
			aImgPath = imgPathAny;
		}
		else
		{
			aImgPath = imgPathAny  + aImgPath + '/';
		}
		
		//alert(aImgPath + aImgSrc + '_' + aImgState + theType);
		aObject.src = aImgPath + aImgSrc + '_' + aImgState + theType;
	}
	
	function swapImgObjectPath(aObject,aImgSrc,aImgState,aImgPath)
	{
		if (aObject.src.indexOf('.gif') > 0) {
			theType = '.gif';
		}
		else {
			theType = '.jpg';
		}
		
		aObject.src = aImgPath + aImgSrc + '_' + aImgState + theType;
	}

	function swapImages(aFrame ,aImgName, aImgState, aImgSrc, aImgPath)
	{
		if ( (aFrame == '') || (!aFrame))
		{
			theDoc = eval('self.document');
		}
		else
		{
			theDoc = eval('self.top.' + aFrame + '.document');
		}
		
		// alert(aImgName + ':' + theDoc.images[aImgName]);
		if ( (aImgSrc == '') || (!aImgSrc))
		{
			aImgSrc = aImgName;
		}
		
		if ((aImgPath == '') || (!aImgPath)) {
			aImgPath = imgPath;
		}
		if (theDoc.images[aImgName])
		{	
			if (theDoc.images[aImgName].src.indexOf('.gif') > 0) {
				theType = '.gif';
			}
			else {
				theType = '.jpg';
			}
		
			theDoc.images[aImgName].src = aImgPath + aImgSrc + '_' + aImgState + theType;
		}
	}
	
	function swapMenuImages(aImgName, aImgState, aImgSrc)
	{
		if (aImgName != menuimage)
		{
			//alert('menuimage: ' + menuimage );
			
			theDoc = eval('self.top.MAINMENU.document');
			
			aImgPath = imgPath;
			
			if (theDoc.images[aImgName])
			{	
				if (theDoc.images[aImgName].src.indexOf('.gif') > 0) {
					theType = '.gif';
				}
				else {
					theType = '.jpg';
				}
			
				theDoc.images[aImgName].src = aImgPath + aImgSrc + '_' + aImgState + theType;
			}
			
		}
		else
		{
			//alert('NO');
		}
	}
	

	function swapImagesAny(aFrame ,aImgName, aImgState, aImgSrc)
	{
	
		if ( (aImgSrc == '') || (!aImgSrc))
		{
			aImgSrc = aImgName;
		}
		
		swapImages(aFrame,aImgName,aImgState,aImgSrc,imgPathAny);
		
	}