// JavaScript Document


//START FUNCTION
function setPage(scrolloffset) {

parent.focus();

//GET WINDOW SIZE
var windWidth;
var windHeight;

if ( typeof( window.innerWidth ) == 'number' ) {
	// non IE
	windWidth = window.innerWidth;
	windHeight = window.innerHeight;
}

else if (document.documentElement && (document.documentElement.clientWidth || document.documentElement.clientHeight )) {
	//IE 6+ in 'standards compliant mode'
	windWidth = document.documentElement.clientWidth;
    windHeight = document.documentElement.clientHeight;
}

else if (document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
	//IE 4 compatible
	windWidth = document.body.clientWidth;
    windHeight = document.body.clientHeight;
}

// WRITE VAR FOR DIFFERENT WINDOW SIZE
	var h;
	var hu;

	if (windWidth >= 1920) {
		h = 1440;
		hu = 360;
}

	else if (windWidth >= 1781) {
		h = 1336;
		hu=334;	
}

	else if (windWidth >= 1642) {
		h = 1232;
		hu = 308;
}

	else if (windWidth >= 1503) {
		h = 1128;
		hu = 282;
}

	else if (windWidth >= 1364) {
		h = 1024;
		hu = 256;
}

	else if (windWidth >= 1225) {
		h = 920;
		hu = 230;
}

	else if (windWidth >= 1088) {
		h = 816;
		hu = 204;
}

	else if (windWidth >= 949) {
		h = 712;
		hu = 178;
}

	else if (windWidth >= 810) {
		h = 608;
		hu = 152;
}

	else if (windWidth >= 671) {
		h = 504;
		hu = 126;
}

	else if (windWidth < 671) {
		h = 400;
		hu = 100;
}

//SET WIDTH & HEIGHT SIZE FOR 'NAVIGATION' & 'NAV_TABLE' <DIV>
		document.getElementById("navigation").style.height = hu + "px";
		document.getElementById("navigation").style.width = windWidth + "px";
		document.getElementById("nav_table").style.height = hu + "px";
		document.getElementById("nav_table").style.width = windWidth + "px";


//CALCULATE IMAGE HEIGHT & WIDTH "/IMG/SKY"
		var imgHeight;
		var imgWidth;

	if (windWidth  <=  (h*1.125)) {
		imgHeight= 0.75*h;
		imgWidth = Math.floor(1.5 * 0.75 * h);
}

	else if (windWidth  >  (h*1.125)) {
		imgWidth = windWidth;
		imgHeight = imgWidth * 0.67;
}

// SET POSITION FOR IMAGE AND NAVIGATION
	if (windHeight <= (imgHeight + hu)) {
		document.getElementById("spi_sky").style.top = windHeight - hu - imgHeight + "px";
		document.getElementById("navigation").style.top = windHeight - hu + "px";
}

	else if (windHeight > (imgHeight + hu)) {
		document.getElementById("spi_sky").style.top = 0 + "px";
		document.getElementById("navigation").style.top = imgHeight + "px";
}
// LOAD IMAGE BASED ON WINDOW WIDTH
	if (windWidth > 1500) {
		document.getElementById("sky").src = "img/sky_2000.jpg";
}

	else if (windWidth > 1000) {
		document.getElementById("sky").src = "img/sky_1500.jpg";
}

	else if (windWidth > 500) {
		document.getElementById("sky").src = "img/sky_1000.jpg";
}

	else if (windWidth <= 500) {
		document.getElementById("sky").src = "img/sky_500.jpg";
}
//SET HEIGHT & WIDTH SIZE FOR IMG
		document.getElementById("sky").style.height = imgHeight + "px";
		document.getElementById("sky").style.width = imgWidth + "px";

//END FUNCTION
}
