function bindSEvent(obj, eventName, func) {
	
		if (document.attachEvent)
			obj.attachEvent("on"+eventName, func);
		else if (document.addEventListener) {
			obj.addEventListener(eventName, func, 0);
		}
	
}

function getWidth(id) {
	
		return (document.getElementById(id).scrollWidth > document.getElementById(id).offsetWidth)?document.getElementById(id).scrollWidth:document.getElementById(id).offsetWidth;
		
}

var setWidth = function() {

		document.getElementById('content_inner').style.overflow = 'auto';
		 
		var constWidth = 490;
		var contentWidth = getWidth('content_inner');
		
		var blocks = ['wrapper','footer'];

		if (document.body.clientWidth < constWidth+contentWidth) {

			document.body.style.minWidth = constWidth+contentWidth+'px';
			
			for (var key in blocks) {
				try{
					document.getElementById(blocks[key]).style.minWidth = constWidth+contentWidth+'px';
				} catch(e) {}
			}
	
		}
		
		document.getElementById('content_inner').style.overflow = 'hidden';
		
	}
	
function fixWidth() {
	bindSEvent(window, 'load', setWidth)
}

