
var currentWidth = 0;
var t;

function resize() {
	
	var tmpWidth;	
	
	if ( currentWidth == window.innerWidth ) {
	
		return timedCount();
	
	}
	
      tmpWidth = window.innerWidth - 40;
	
	if ( tmpWidth > 960 ) {
		
		tmpWidth = 960;
	
	} else if ( tmpWidth < 540 ) {
	
		tmpWidth = 540;
	
	} else {
	
		tmpWidth = tmpWidth;
	}

	document.getElementById("containerMainCenter").style.width = tmpWidth + 'px';			
	currentWidth = window.innerWidth;	
	timedCount();
			
}
	
function timedCount( ) {

	t=setTimeout( "resize()", 1000);

}

resize();	

