storySize = function(){ 

	// Highlight Active Story
	$S('#story').each(	
		function(element){
			element.className = 'storyOff';
			element.onmouseover = function(){ this.className = 'storyOn'; }
			element.onmouseout = function(){ this.className = 'storyOff'; }					
	});	

	// Capture the end height
	$S('#storyBy a').each(	
		function(element){
		
			o=element.parentNode;
			while(o.previousSibling.nodeType!=1){ o = o.previousSibling; }
			o = o.previousSibling;				 
		
			element.remHeight = o.offsetHeight;
			element.initHeight = new fx.Height(o);
			// Resize all (target only one of the links while looping since same parent)
			if( element.className == 'more' ) element.initHeight.custom( 0, 55 );
	});	
	
	// Grow
	$S('#storyBy a.more').action({
		
		onclick: function()
		{
			o=this.parentNode;
			while(o.previousSibling.nodeType!=1){ o = o.previousSibling; }
			o = o.previousSibling;	
			
			if( o.offsetHeight < parseInt( this.remHeight ) )
				this.initHeight.custom( 55, parseInt( this.remHeight ) ); 
				
			this.nextSibling.className = 'show';
						
			this.blur();
			this.className = 'hide';
		}
	});
	
	// Shrink
	$S('#storyBy a.less').action({
		initialize: function(){ this.className='hide'; },
		
		onclick: function()
		{ 				
			o=this.parentNode;
			while(o.previousSibling.nodeType!=1){ o = o.previousSibling; }
			o = o.previousSibling;	

			this.previousSibling.className = 'show';
			
			if( o.offsetHeight >= parseInt( this.remHeight ) )
				this.initHeight.custom( parseInt( this.remHeight ), 55 ); 
				
			this.blur();
			this.className='hide';
		}
	});	
}

AddOnload('storySize');
