function byID(id)
{
	var obj;
	if (document.getElementById) obj = document.getElementById(id);
	else if (document.all) obj = document.all[id];
	else if (document.layers) {
		obj 	  = document.layers[id];
		obj.style = document.layers[id];	
	}
	return obj;	
}

function correct()
{
  var width = 0;
  if(typeof( window.innerWidth ) == 'number') {
    windowWidth = window.innerWidth - 17;
  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    windowWidth = document.documentElement.clientWidth;
  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    windowWidth = document.body.clientWidth;
  }

	var tmpA = 0;
	var tmpB = 0;
	var tmpRest = 0;
		
	if (990 > windowWidth) {
		byID("background-left").style.display = "none";
		byID("background-right").style.display = "none";
		byID("frame").style.width = "989px";
	} else if (1388 > windowWidth) {
		// left 272, right 126, center 989, max: 1387			
		tmpRest = windowWidth - 989;
		tmpA = tmpRest / 2;
		
		if (tmpA >= 126) {
			tmpB = tmpRest - 126;
			byID("background-left").style.width = tmpB + "px";
			byID("background-right").style.width = "126px";	
			tmpB = tmpB + 126 + 989;
			byID("frame").style.width = tmpB + "px";
		} else {
			byID("background-left").style.width = tmpA + "px";
			byID("background-right").style.width = tmpA + "px";
			tmpB = (tmpA*2) + 989;		
			byID("frame").style.width = tmpB + "px";	
		}
	}
}		
