var Images = 
{
	PreLoad : function() 
	{
		arr=arguments; 
		var img;
		var imagesArray = new Array();
		var urlPrefix = "http://" + location.hostname;
		for(var i=0; i<arr.length; i++) 
		{ 
			img = new Image;
			img.src =  urlPrefix + arr[i];
			imagesArray[i] = img;
		}
	},
	IsImage : function(elemValue)
	{
		return (elemValue.toLowerCase().indexOf('.gif') > 0 ||
				elemValue.toLowerCase().indexOf('.bmp') > 0 ||
				elemValue.toLowerCase().indexOf('.jpeg') > 0 ||
				elemValue.toLowerCase().indexOf('.jpg') > 0  );
	},
	LimitHeight : function(containerId,maxHeight)
	{		
		Images.LimitObjHeight(document.getElementById(containerId),maxHeight);
	},
	LimitObjHeight : function(obj,maxHeight)
	{
	    if (obj == null) return;
		var images = obj.getElementsByTagName('img');
		
		for (var i = 0; i < images.length ; i++) {
	 	    Images.LimitImageObjHeight(images[i],maxHeight);	 	    
		}
	},
	LimitImageHeight : function(imgId,maxHeight)
	{
	    Images.LimitImageObjHeight(document.getElementById(imgId),maxHeight);
	},
	LimitImageObjHeight : function(img,maxHeight)
	{		
		if (Site.IsIE()){
 		    if ( img.fileSize < 0 || img.height > maxHeight)
		    {   
			    img.style.height = maxHeight;	
		    }
		}
		else
		{  			
		    if (img.height > maxHeight)
		    {   			  
			    img.style.height = maxHeight;	
		    }
		}
	},
	LimitObjWidth : function(obj,maxWidth)
	{
		var images = obj.getElementsByTagName('img');
		for (var i = 0; i < images.length ; i++) {
			if (images[i].fileSize < 0 || images[i].width > maxWidth)
			{
				images[i].style.width = maxWidth;				
			}
		}
	},
	LimitWidth : function(containerId,maxWidth)
	{
		Images.LimitObjWidth(document.getElementById(containerId),maxWidth);
	}	
}

