var id = null;
var settings = null;

$.fn.catfish = function(options) {
	this.settings = {
		closeLink: 'none',
		animation: 'slide',
		height: '50'
	}
	if(options)
		$.extend(this.settings, options);
	
	if ( this.settings.animation != 'slide' && this.settings.animation != 'none' && this.settings.animation != 'fade' ) {
		alert('animation can only be set to \'slide\', \'none\' or \'fade\'');
	}
	
	id = this.id();
	settings = this.settings;
	
	$(this).css('position', 'fixed').css('bottom', '0').css('left', '0').css('padding', '0').css('height', this.settings.height + 'px').css('cursor', 'pointer').css('margin', '0').css('width', '100%');
	$('html').css('padding', '0 0 ' + this.settings.height + 'px 0');
	if ( jQuery.browser.msie ) {
		$('html').add('body').css('height', '100%').css('overflow', 'hidden').css('width', 'auto');
		$(this).css('position', 'absolute').css('z-index', '100').css('overflow', 'hidden');
		var wrapper = document.createElement('div');
		wrapper.id = 'catfish-wrapper';
		$('body').append(wrapper);
		$('body').children().appendTo('#catfish-wrapper');
		$('body').append(this);
		$('#catfish-wrapper').css('width', '100%').css('padding', '0').css('margin', '0').css('height', '100%').css('overflow', 'auto').css('position', 'relative');
	}
	if ( this.settings.animation == 'slide' ) {
		$(this).slideDown('slow');
	}
	else if ( this.settings.animation == 'fade' ) {
		$(this).fadeIn('slow');
	}
	
	if ( this.settings.closeLink != 'none' ) {
		$(this.settings.closeLink).click(function(){
			$.closeCatfish();
			return false;
		});
	}
	
	return this;
};
$.closeCatfish = function() {
	this.catfish = $('#' + id);
	$(this.catfish).hide();
	$('html').css('padding', '0');
}
