﻿function getWindowHeight()
{ 
	var windowHeight = 0; 
	if (typeof(window.innerHeight) == 'number')
	{ 
		windowHeight = window.innerHeight; 
	} 
	else
	{ 
		if (document.documentElement && document.documentElement.clientHeight)
		{ 
			windowHeight = document.documentElement.clientHeight; 
		} 
		else
		{ 
			if (document.body && document.body.clientHeight)
			{ 
				windowHeight = document.body.clientHeight; 
			} 
		} 
	}
	return (windowHeight);
}

function getWindowWidth()
{ 
	var windowWidth = 0; 
	if (typeof(window.innerWidth) == 'number')
	{ 
		windowWidth = window.innerWidth; 
	} 
	else
	{ 
		if (document.documentElement && document.documentElement.clientWidth)
		{ 
			windowWidth = document.documentElement.clientWidth; 
		} 
		else
		{ 
			if (document.body && document.body.clientWidth)
			{ 
				windowWidth = document.body.clientWidth; 
			} 
		} 
	}
	return (windowWidth);
}

function getObject(id)
{
	if (document.getElementById) 
		var returnVar = document.getElementById(id); 
	else if (document.all) 
		var returnVar = document.all[id]; 
	else if (document.layers) 
		var returnVar = document.layers[id]; 
	return returnVar;
}

function animationRescale()
{
	var winHeight = getWindowHeight();
	var winWidth = getWindowWidth();
	var divWidth = 750; //default width
	var divHeight = 500; //default height
	var ratio = winHeight / divHeight - 0.20;
	
	if (ratio > 1.35)
		ratio = 1.35;
	if ((ratio < 1.0) || isNaN(ratio))
		ratio = 1.0;
	getObject("sitecontent").style.width = (ratio * divWidth) + "px";
	getObject("sitecontent").style.height = (ratio * divHeight) + "px";
	//getObject("sitecontent").style.left = (winWidth - 32 - (ratio * divWidth)) / 2 + "px";
}