// JavaScript Document

function resize() {  
var slideframe = document.getElementById("slideframe");  
var maskframe = document.getElementById("maskframe");  
var mainframe = document.getElementById("mainframe");  
var toptext = document.getElementById("toptext");  
var htmlheight = document.body.parentNode.scrollHeight;  
var windowheight = 0;
var windowwidth = 0;

if( typeof( window.innerWidth ) == 'number' ) {
    //Non-IE
    windowwidth = window.innerWidth;
    windowheight = window.innerHeight;
} else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    //IE 6+ in 'standards compliant mode'
    windowwidth = document.documentElement.clientWidth;
    windowheight = document.documentElement.clientHeight;
} else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    //IE 4 compatible
    windowwidth = document.body.clientWidth;
    windowheight = document.body.clientHeight;
}

var standardHeight = 896;
var standardWidth = 1196;
var ratio = (1196 * 1.0)/896;
if (windowheight < 600)
	windowheight = 600;
if (windowheight > standardHeight + 40)
	windowheight = standardHeight + 40;
windowheight -= 40;
var offset = windowheight * 0.082;

maskframe.style.height = windowheight + "px";
maskframe.style.width = ((windowheight * ratio) - 3 ) + "px";
mainframe.style.width = ((windowheight * ratio) + 40 - 3) + "px";  

slideframe.style.height = windowheight + "px";
slideframe.style.left = (-offset) + "px";
slideframe.style.width = ((windowheight * ratio) + offset) + "px";
mainframe.style.left = ((windowwidth - (windowheight * ratio)) / 2) + "px";
maskframe.style.left = "20px";

toptext.style.paddingRight = (20 + offset) + "px"; 

//window.alert(toptext.style.right);
//window.alert(maskframe.style.left + " " + maskframe.style.width + " " + slideframe.style.width + " " + slideframe.style.left);
}

