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 windowWidth = 0;
    if(typeof( window.innerWidth ) == 'number') {
    	windowWidth = window.innerWidth - 18;
    } 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;
  	var a = 0;
		
	if (1001 > windowWidth) {
		byID("background-left").style.display = "none";
		byID("background-right").style.display = "none";
	} else if (1298 < windowWidth) {
		byID("background-left").style.width = "201px";
		byID("background-right").style.width = "98px";
		byID("frame").style.width = "1299px";
	} else {			
		tmpRest = windowWidth - 1000;
		if ((tmpRest % 2) == 1) { a = 1; }			
		tmpA = tmpRest / 2;	
		byID("background-left").style.width = tmpA + "px";
		byID("background-right").style.width = tmpA + "px";
		byID("frame").style.width = windowWidth + "px";	
	}
}

function correct2()
{
    var windowWidth = 0;
    if(typeof( window.innerWidth ) == 'number') {
    	windowWidth = window.innerWidth - 18;
    } 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;
    }

	if (1001 > windowWidth) {
		byID("background-right").style.display = "none";
	} else if (1148 < windowWidth) {
		byID("background-right").style.width = "148px";
		byID("frame").style.width = "1148px";
	} else {			
		byID("background-right").style.width = (windowWidth - 1000) + "px";
		byID("frame").style.width = windowWidth + "px";	
	}
}
