function locateObject(elementID, container) {
	var p,i,foundObj;  
  
	if(!container)
	{
  		container=document; 
  	}
  	
  	if((p=elementID.indexOf("?"))>0&&parent.frames.length)
  	{
    	container=parent.frames[elementID.substring(p+1)].document; 
    	elementID=elementID.substring(0,p);
    }
    
 	if(!(foundObj=container[elementID])&&container.all)
 	{
 	 	foundObj=container.all[elementID];
 	}
 	 
 	for (i=0;!foundObj&&i<d.forms.length;i++)
 	{
 	 	foundObj=container.forms[i][elementID];
 	}
 	 
 	for(i=0;!foundObj&&container.layers&&i<container.layers.length;i++)
 	{
 		foundObj=locateObject(elementID,container.layers[i].document);
 	}

	if(!foundObj && container.getElementById)
	{
		foundObj=container.getElementById(elementID); 
	}
	
	if(foundObj)
	{
		return foundObj;
	}
}

function imageRollover(image) 
{
	var pos;
	
  	if((pos = image.src.lastIndexOf("."))>0)
  	{
    	image.src = image.src.substring(0,pos) + '_over' + image.src.substring(pos); 
    }
}

function imageRestore(image)
{
	var pos;
	
  	if((pos = image.src.lastIndexOf("_over"))>0)
  	{
    	image.src = image.src.substring(0,pos) + image.src.substring(pos+5); 
    }
}

function imagePreload() { 
	var images, i, preloadedImage;
	
	images=document.getElementsByTagName("img");
	
	for( i=0; i<images.length; i++ )
	{
		if( images[i].className.indexOf("preload") != -1 )
		{
		  	if((pos = images[i].src.indexOf("."))>0)
		  	{
				if(!document.preloadedImages)
				{
					document.preloadedImages = new Array();
				}

				preloadedImage = document.preloadedImages[document.preloadedImages.length] = new Image;
				preloadedImage.src = images[i].src.substring(0,pos) + '_over' + images[i].src.substring(pos); 
		    }
		}
	}
}

window.onload = imagePreload;

