 namespace('Page.Display')['Initialize'] = function() {
	AttachEvent(window,'load',Page.Display.AutoWidthProductCell);
	AttachEvent(window,'resize',Page.Display.AutoWidthProductCell);
}



Page.Display.AutoWidthProductCell = function() {
//	if (!document.getElementById("centerArea")){return;}
	if (!document.getElementById("FeaturedProducts")){return;}
	if (!document.getElementById("HomepagePrd")){return;}
//	var w = parseInt(document.getElementById("centerArea").offsetWidth);
	var w = parseInt(document.getElementById("FeaturedProducts").offsetWidth) - 1;
	var oldw = w;
	var ic = document.getElementById("HomepagePrd").className.replace(/[^\d]/ig,'') - 0;
	var wmin = 645;
	w = (w < wmin) ? wmin:w;
//	w = w; // hack to make it stop writing 4 boxes and wrapping 3
//	 alert ('oldw = ' + oldw + '\nw = ' + w);

	var cc = Math.floor(w / 197); // 197 is the width of the home_product box plus a little padding
	var mx = (ic < 4) ? ic:4;
	cc = (cc > mx) ? mx:cc;
	var pd = parseInt((w - (197 * cc)) / (cc*2 - 1)) + 'px'; // figured out padding between each, -1 chunk of padding for rightmost
	var homesection;
	for (var i = 1; i <= ic; ++i) {
		if (homesection = document.getElementById('Section' + i)) {
			homesection.style.posTop = '0px';
			homesection.style.paddingLeft = pd;
			if ((i % cc) == 0) {
				homesection.className = "SectionRt";
				homesection.style.paddingRight = '0px';
			} else {
				homesection.className = "Section";
				homesection.style.paddingRight = pd;
			}
		}
	}
}

