	var swapImgData = new Array();
	var fixedImgData = new Array();
	
	/**
	 * restore the swapped image, if its not fixed              
	 *
	 * @param string id
	 * @return void
	 *
	 **/
	 function swapImgRestore(id)
	 {
	 	// if there is a valid id
	 	if ( id != '' && id != null )
	 	{
	 		if ( swapImgData[id] != null )
	 		{
		 		picID = swapImgData[id]['picID'];	 
		 			
		 		pic = document.getElementById(picID);
				//alert('swapImgRestore: picID=' + picID + ', swapImgData[id][url]=' + swapImgData[id]['url']);	
				
				if ( pic != null )
				{
					// there is a fixed image
					if ( fixedImgData[id] != null )
		 			{
		 				//alert('swapImgRestore: there is a fixed image for id=' + id);
		 				
		 				// if image to restore is not fixed
			 			if ( fixedImgData[id]['picID'] != swapImgData[id]['picID'] )
						{
							pic.src = swapImgData[id]['url'];	 	
						}
					}
					// there is no fixed image => restore it
					else
					{
						pic.src = swapImgData[id]['url'];
					}
				}
				else
				{
					alert('swapImgRestore: pic was null!');
				}
				
				swapImgData[id] = null;
			}
	 	}
	 	else
	 	{
	 		len = swapImgData.length - 1;
	 		
	 		if ( swapImgData[len] != null )
	 		{
		 		picID = swapImgData[len]['picID'];
		 		pic = document.getElementById(picID);
			
				if ( pic != null )
				{
					pic.src = swapImgData[len]['url'];	 	
				}
				swapImgData[len] = null;
			}
		}
	 } 


	function preloadImages() 
	{
		if ( document.images ) 
		{
			var imgFiles = preloadImages.arguments;
	    
			if ( document.preloadArray == null )
			{
				document.preloadArray = new Array();
			}
	
			var i = document.preloadArray.length;
			
			with ( document ) 
			{
				for ( var j = 0; j < imgFiles.length; j++ )
				{
					if ( imgFiles[j].charAt(0) != "#" )
					{
						preloadArray[i] = new Image;
						preloadArray[i++].src = imgFiles[j];
					}
				}
			}
		}
	}


	
	/**
	 * 
	 * modified by Manuel Lutz (post@manuel-lutz.de) on 18.04.2001
	 * now swapImage() will also work with layers in Netscape 4.7 or higher
	 * 
	 * @param string id, some id, used to store the image info, optional
	 * @param string, name of the picture
	 * @param string, url of the picture to swap to
	 * @return void
	 *
	 **/
	function swapImage(id, picID, url) 
	{
		pic = document.getElementById(picID);
		
		/*if ( fixedImgData[id] != null )
			alert('swapImage: fixedImgData[' + id + '][picID] = ' + fixedImgData[id]['picID']);
		*/
			
		if ( pic != null )
		{
			if ( id != '' && id != null )
			{
				swapImgData[id] = new Array();
				swapImgData[id]['picID'] = picID;
				swapImgData[id]['url'] = pic.src;
			}
			else
			{
				len = swapImgData.length;
				//alert('len=' + len);
				swapImgData[len] = new Array();
				swapImgData[len]['picID'] = picID;
				swapImgData[len]['url'] = pic.src;
			}
			
			swap(picID, url);
		}		
	}
	
	function swap(id, url)
	{
		//alert('swap: id=' + id + ', url=' + url);
		pic = document.getElementById(id);
		
		if ( pic != null )
		{
			
			pic.src = url;
		}
	}
	
	/**
	 * 
	 * fix an image, so that it can not be swapped back
	 *
	 * @param id, the navigation (sub or main)
	 * @param the name of the picture
	 * @param the url of the 'off' picture
	 * @return void;
	 *
	 **/
	function fixImage(id, picID, offURL) 
	{
		//alert('fixImage: id=' + id + ', picID=' + picID + ', offURL=' + offURL);
		pic = document.getElementById(picID);
		
		if ( pic != null )
		{
			if ( id != '' && id != null )
			{
				fixedImgData[id] = new Array();
				fixedImgData[id]['picID'] = picID;
				fixedImgData[id]['url'] = offURL;
				//alert('fixImage: fixedImgData[' + id + '][picID] = ' + fixedImgData[id]['picID']);
			}		
		}
	}


	function freeFixedImage(id)
	{		
		//alert('freefixedimage(' + id + ')');
		if ( fixedImgData[id] != null )
		{
			//alert('freeFixedImage: fixedImgData[' + id + '][picID]=' 
			//		+ fixedImgData[id]['picID'] + ', fixedImgData[id][url]=' + fixedImgData[id]['url']);
		
			swap(fixedImgData[id]['picID'], fixedImgData[id]['url']);
			fixedImgData[id] = null;
		}
	}
	
	
	function isImageFixed(id)
	{
		if ( fixedImgData[id] != null )
			return true;
		
		return false;
	}