/*
   LocusMainArticleSubtop
   --------------------------
*/
LocusMainArticleSubtop = Class.create({
	expanded: null,
	expandable: null,
	showLabel: null,
	hideLabel: null,
	rounded: null,
	initialize: function(expanded, expandable, showLabel, hideLabel) {
	
		this.expanded = expanded;
		this.expandable = expandable;
		this.showLabel = showLabel;
		this.hideLabel = hideLabel;
		this.rounded = false;
		
		$('mainArticleDisplayContainer').style.display = 'none';
		$('mainArticleDisplayContainer').removeClassName('hidden');

		if (this.expandable) {
			if (this.expanded) {
				$('locusMainArticleDisplay').down('a').update(this.hideLabel);
				$('mainArticleDisplayContainer').show();
				// need to create a timeout, as ie8 reports dom:loaded before roundedCorners is initialised
				setTimeout("roundedCorners.setUpInterval_special()", 1000);
				this.rounded = true;
			} else {
				$('locusMainArticleDisplay').down('a').update(this.showLabel);
			}
		}
      
	},
	toggle: function() {
		if (this.expandable) {
			this.expanded = !this.expanded;
			this.update();
		}
	},
	update: function() {
		if (this.expanded) {
			$('locusMainArticleDisplay').down('a').update(this.hideLabel);
		} else {
			$('locusMainArticleDisplay').down('a').update(this.showLabel);
		}
		Effect.toggle('mainArticleDisplayContainer', 'blind', {duration: 1.0});
		if (!this.rounded) {
			// create rounded corners on single element when user clicks "read more"
			window.roundedCorners.setUpInterval_special();
			this.rounded = true;
		}
	}
});
var locusMainArticleSubtop;