// ##LOG: 
// -----------------------------------------------------------------------------------------------
//	17/12/03	bkel			Created.
// -----------------------------------------------------------------------------------------------
// ##TEMPLATE: 
// -----------------------------------------------------------------------------------------------
//	This file contains a function that provided graphic rollover code.
// -----------------------------------------------------------------------------------------------


// [rollImg]
function rollImg ( theImg )
{	
	// Work out the file extention we are working with.
	imageExtArray = theImg.src.split( '.' );
	getVal = imageExtArray.length - 1;
	imageExt = imageExtArray[getVal];		
	
	
	// Split the image source on '/' so we can figure out the image name.
	nameArray = theImg.src.split( '/' );				
	
	// If nameArray has some elements.
	if ( nameArray.length > 0 )
	{	
		// Figure out the current name of the image.
		getVal = nameArray.length - 1;
		imageName = nameArray[getVal];		
		
		// Figure out the image location.
		getVal = ( theImg.src.length - imageName.length);		
		imageLoc = theImg.src.substring( 0, getVal )
			
				
		// Roll Image On
		if ( imageName.indexOf('_over') != -1 )
		{
			//'sellYourProperty_over.gif'
			theImageName = imageName.substring(0 , ( imageName.length - ( 6 + imageExt.length ) ) ) + '.' + imageExt;
						
			// mainGraphic Image On	
			try 
			{
				theImg.src = imageLoc + theImageName;
			} catch (e) { }				
					
		}
		// Roll Image Off
		else
		{
			theImageName = imageName.substring(0 , ( imageName.length - 4 ) ) + '_over.' + imageExt;
						
			// mainGraphic Image Off
			try 
			{

				theImg.src = imageLoc + theImageName;		
			} catch (e) { }
			
		}
		
	}
	
}





