// scale.js


function TurnToolScaled()
{
	var winW = 876, winH = 500; // If some browser for some reason cannot get the window size
	if (typeof( window.innerWidth ) == 'number' ) {
    //Non-IE
    winW = window.innerWidth-80;
    winH = window.innerHeight-140;
	}
	else if ( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    //IE 6+ in 'standards compliant mode'
    winW = document.documentElement.clientWidth-84;
    winH = document.documentElement.clientHeight-144;
	}
	else if ( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    //IE 4 compatible
    winW = document.body.clientWidth-84;
    winH = document.body.clientHeight-144;
	}
	// Sets min sizes to make sure its works on IE6
	if (winW < 876) {
		winW = 876; 
	}
	if (winH < 500) {
		winH = 500;
	}
	// Adds 'px' so that the style setting understands them
	var winWs = winW+"px";
	var winHs = winH+"px";
	var winWbg = winW+56+"px"; // Wider for frames
	// Sets the element sizes
	document.getElementById('wrap').style.width = winWbg;
	document.getElementById('scene').style.width = winWbg;
	document.getElementById('scene').style.height = winHs;
	document.getElementById('TurnTool').style.width = winWs;
	document.getElementById('TurnTool').style.height = winHs;
}

