<!--
function setwidth() {
	var cssRules;
	var entryWidth = 0;


//      Adjusts the margin size on the catalogentry class so that
//      it centres within the catalogwrapper class.
//	if it's currently being displayed
	if ( document.getElementById('catalogwrapper') ) {

	    for (var Sheet = 0; Sheet < document.styleSheets.length; Sheet++){

		if (document.styleSheets[Sheet]['rules']) {
			cssRules = 'rules';
		} else if (document.styleSheets[Sheet]['cssRules']) {
			cssRules = 'cssRules';
		} else {
			//no rules found... browser unknown
		}

		var catalogWrapper =  document.getElementById('catalogwrapper');
		if ( catalogWrapper.clientWidth ) {
			var containerWidth = parseInt ( catalogWrapper.clientWidth);
		} else {
			var containerWidth = parseInt ( catalogWrapper.innerWidth);
		}

//	      Get the catalogwrapper/entry width
		for (var Rule = 0; Rule < document.styleSheets[Sheet][cssRules].length; Rule++) {
			if (document.styleSheets[Sheet][cssRules][Rule].selectorText == '.catalogentry') {
				entryWidth  = parseInt (document.styleSheets[Sheet][cssRules][Rule].style.width);
				entryWidth += parseInt (document.styleSheets[Sheet][cssRules][Rule].style.borderRightWidth);
				entryWidth += parseInt (document.styleSheets[Sheet][cssRules][Rule].style.borderLeftWidth);

				var numMargins =  Math.floor ( containerWidth / entryWidth ) + 1;
				var spareSpace = Math.floor ( containerWidth % entryWidth );
				if ( numMargins > 1 )
				{
					var newWidth = Math.floor ( spareSpace /  numMargins );
					var newHeight = Math.floor ( newWidth / 2 );
				}
				else
				{
					var newWidth = 0;
					var newHeight = 10;
				}

				document.styleSheets[Sheet][cssRules][Rule].style.marginRight = "0px";
				document.styleSheets[Sheet][cssRules][Rule].style.marginLeft = newWidth + "px";
				document.styleSheets[Sheet][cssRules][Rule].style.marginTop = newHeight + "px";
				document.styleSheets[Sheet][cssRules][Rule].style.marginBottom = newHeight + "px";
//alert ( document.getElementById('container').clientWidth + ":" + contentWidth + ":" + containerWidth + ':' + catalogWrapper.innerWidth + ':' + entryWidth + ':' + spareSpace + ':' + numMargins + '=' + newWidth );
				
							return false;
			}
		}
	    }
	}

	return false;
}
//->

