document.onresize = fixPos;
window.onresize = fixPos;
document.onload = fixPos;
window.onload = fixPos;

function getWinHeight() {
var myHeight = 0;
if( typeof( window.innerWidth ) == "number" ) {
myHeight = window.innerHeight;
} else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
myHeight = document.documentElement.clientHeight;
} else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
myHeight = document.body.clientHeight;
}
return (myHeight);
}

function getWinWidth() {
var myWidth = 0;
if( typeof( window.innerHeight ) == "number" ) {
myWidth = window.innerWidth;
} else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
myWidth = document.documentElement.clientWidth;
} else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
myWidth = document.body.clientWidth;
}
return (myWidth);
}


function fixPos() {
var thisTime = getWinHeight();
var thisTime2 = getWinWidth();
myDiv=document.getElementById("page");
if (thisTime < 628) {
myDiv.style.top = "314px";
} else {
myDiv.style.top = "50%";
}
if (thisTime2 < 870) {
myDiv.style.left = "435px";
} else {
myDiv.style.left = "50%";
}
}
