function FlipFish(emtObj){
	this.emt = (emtObj.length == 1) ? emtObj[0] : emtObj;
	
	// This function shamelessly snatched from http://www.howtocreate.co.uk/tutorials/javascript/browserwindow
	this.getWinSize = function(){
		var myWidth = 0, myHeight = 0;
		if( typeof( window.innerWidth ) == 'number' ) {
			//Non-IE
			myWidth = window.innerWidth;
			myHeight = window.innerHeight;
		} else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
			//IE 6+ in 'standards compliant mode'
			myWidth = document.documentElement.clientWidth;
			myHeight = document.documentElement.clientHeight;
		} else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
			//IE 4 compatible
			myWidth = document.body.clientWidth;
			myHeight = document.body.clientHeight;
		}
		
		return {width: myWidth, height: myHeight};
	}
	


	// Found somewhere, used everywhere :)
	this.findPos = function(){
		var curleft = curtop = 0;
		if (this.emt.offsetParent) {
			curleft = this.emt.offsetLeft
			curtop = this.emt.offsetTop
			var currentEmt = this.emt;
			while (currentEmt = currentEmt.offsetParent) {
				curleft += currentEmt.offsetLeft
				curtop += currentEmt.offsetTop
			}
		}
		return {left: curleft, top: curtop};
	}
	
	
	// This little thingy is all mine :)
	this.flip = function(){
		var winSize = this.getWinSize();
		var emtPos = this.findPos();
		var emtWidth = this.emt.offsetLeft;
		
		if(winSize.width <= emtPos.left + emtWidth){
			this.emt.style.left = "-" + emtWidth + "px";
		}
	}
	
	this.flip();
}
