_PFX = 'ctl00_C_';
var lastScroller = 0;
var noscroller = false;
var teaserDivs = new Array();
var teaserHeights = new Array();
var teaserKeys = new Array();
var galleryHeight = 350;

Window_OnLoad =
	function() 
	{

		if (YAHOO.util.Dom.inDocument('social'))
		{
			var socialImages = YAHOO.util.Dom.get('social').getElementsByTagName('img');
			for (var i=0; i<socialImages.length; i++)
			{
				var x = new DDI.Web.ImageButton(socialImages[i].id);
			}
		}
		
		Window_OnResize();
		
	}

Window_OnResize = 
	function() 
	{
		
		// set the height of the scroller if the window height changes
		
		var newHeight = YAHOO.util.Dom.getViewportHeight() - 6;  // 6 is extra cushion to avoid scroll bar
		newHeight -= YAHOO.util.Dom.get('header').offsetHeight;
		newHeight -= YAHOO.util.Dom.get('footer').offsetHeight;
		
		YAHOO.util.Dom.setStyle('main', 'height', newHeight + 'px');
		
		// set the height of the side panel, if present
		
		var scrollerHeight = newHeight - 12;  // not sure where 12 is coming from

		YAHOO.util.Dom.setStyle('Scroller', 'height', scrollerHeight + 'px');

		// position the social networking links along the bottom
	
		var elSocial = YAHOO.util.Dom.get('social');
		var marginHeight = newHeight - elSocial.offsetHeight - 25;  // 25 is me being lazy
		marginHeight -= YAHOO.util.Dom.get('RealContent').offsetHeight
		if (marginHeight < 0) marginHeight = 0;
		YAHOO.util.Dom.setStyle(elSocial, 'marginTop', marginHeight + 'px');

	}
	
YAHOO.util.Event.addListener(window, 'load', Window_OnLoad);
YAHOO.util.Event.addListener(window, 'resize', Window_OnResize);
