jamm_header = {
	timer: null,
	timeout: 1500,
	
	init: function() {
		this.tween = new Fx.Tween('jamm-header', {property: 'height', link: 'cancel', duration: 'short', 'onComplete': this.complete.bind(this)});
		
		$('jamm-header').addEvent('mouseenter', this.over.bind(this));
		$('jamm-header').addEvent('mouseleave', this.out.bind(this, false));
	},
	
	complete: function() {
		if($('jamm-header').getStyle('height').toInt() === 28) {
			$('jamm-header').addClass('collapsed');
		}
	},
	
	expand: function() {
		if(!$(document.body).hasClass('preview-mode')) {
			$('jamm-header').removeClass('collapsed');
			
			this.tween.start(86);
		}
	},
	
	collapse: function() {
		this.tween.start(28);
	},
	
	over: function() {
		$clear(this.timer);
		this.expand();
	},
	
	out: function() {
		this.timer = this.collapse.delay(this.timeout, this);
	},
	
	browser_supported: function() {
		if(Browser.Engine.trident) {
			var is_IE6 = false /*@cc_on || @_jscript_version < 5.7 @*/;
			
			if(is_IE6) {
				if(user.lang_code == 'fr-ca') {
					error_console.add('Internet Explorer 6 et versions ant\u00F9rieures non support\u00F9es.', "<p>L'édition de Jamm n'est pas supportée par Internet Explorer 6, ou ses versions antérieures.</p><p>S'il vous plaît essayez MyJamm avec un fureteur Web différent; nous recommandons <a href=\"http://www.getfirefox.com/\" target=\"_blank\">Firefox</a>.</p>", true);
				} else {
					error_console.add('Internet Explorer 6 & Below Not Supported', '<p>We are not able to support editing a Jamm in Internet Explorer version 6 and below.</p><p>Please try MyJamm with a differnt browser, we recommend <a href="http://www.getfirefox.com/" target="_blank">Firefox</a>.</p>', true);
				}
				return false;
			}
		}
		
		return true;
	}
}

tip_bubble_manager = {
	list: [],
	
	add: function(tip_bubble) {
		if(tip_bubble !== null) {
			this.list.push(tip_bubble);
		}
	},
	
	signal: function(name, show) {
		this.list.each(function(tip_bubble) {
			if(tip_bubble.custom_event !== null && tip_bubble.custom_event === name) {
				if(show === true) {
					tip_bubble.show();
				} else {
					tip_bubble.close();
					this.list.erase(tip_bubble);
				}
			}
		}, this);
	}
}

window.addEvent('domready', jamm_header.init.bind(jamm_header));