var slide_info = {
	hash_delay: 250,
	hash_timer: 0,
	hash: "",
	container: '#interior-header',
		
	setup: function() {
		hash_timer = window.setInterval('slide_info.hash_tick()', this.hash_delay);
		this.hash_tick();	
	},
	
	hash_tick: function() {
		var hash = location.hash;
		if (hash != this.hash) {
			this.hash = hash;
			this.update();
		}
	},
	
	update: function() {
		if (this.hash.length > 1) {
			var id = this.hash.substr(1);
			var info = jQuery('#' + id + '-slide-info');
			if (info.length > 0) {
				var html = info.html();
				
				var div = jQuery('<div class="slide-info-display"/>');
				div.html(html);

				//stop slideshow script
				clearTimeout(slideshow.timer);
				
				jQuery(this.container).html(div);
				
				//calculate height
				var jq = jQuery(this.container).find('div.slide-info-right');
				jq.css({'height':''});
				var h = jq.height();
				if (h > 300)
					jq.css({'overflow-y':'scroll', 'height':300});
				else
					jq.css({'overflow-y':'', 'height':''});
			}
		}
	}
};

jQuery(document).ready(function() { 
	slide_info.setup();
});

