var FSImage = Class.create({

	initialize: function(obj,imgPath)
	{
		this.img = Element.extend(obj);
		this.imgPath = imgPath;
		this.handleLoad();
	},
	
	handleLoad: function()
	{
		this.imgWidth = this.img.width;
		this.imgHeight = this.img.height;
		this.scale();
	},
	
	scale: function()
	{	
		// grab window dimensions
		var windowWidth = document.viewport.getWidth();
		var windowHeight = document.viewport.getHeight();
		
		// base size on height
		var ratio =  windowHeight / this.imgHeight;
		var newWidth = ratio*this.imgWidth;
		var newHeight = windowHeight;
		
		// if width is less than window width
		if(newWidth < windowWidth){
			// base size on width
			ratio =  windowWidth / this.imgWidth;
			newWidth = windowWidth;
			newHeight = ratio*this.imgHeight;
		}
		
		// set dimensions and center
		this.img.width = newWidth;
		this.img.height = newHeight;
		this.img.style.left = windowWidth/2 - this.img.width/2;
		//this.img.style.display = "block";
		this.img.style.visibility = "visible";
	}

});