/* -- Adobe GoLive JavaScript Library */


function newImage(arg) {
    if (document.images) {
	    rslt = new Image();
	    rslt.src = arg;
	    return rslt;
    }
}

function changeImagesArray(array) {
    if (preloadFlag == true) {
	    var d = document; var img;
	    for (var i=0; i<array.length; i+=2) {
		    img = null; var n = array[i];
		    if (d.images) {img = d.images[n];}
		    if (!img && d.getElementById) {img = d.getElementById(n);}
		    if (img) {img.src = array[i+1];}
	    }
    }
}

function changeImages() {
    changeImagesArray(changeImages.arguments);
}


function e(id) {
    return document.getElementById(id);
}

/* keep vertically centered */
function reCenter() {
    var offsetTop = 0;
    var page = e("container");
    var extraHeight = getWindowHeight() - 590;
    var offset = extraHeight/2;
    
        page.style.top = "0px";
        e("container").style.top = "0px";
        
    if (extraHeight > 0) {
        page.style.top = offset + "px";
        e("container").style.top = offset + "px";
    }
}

function getWindowHeight() {
    if (window.self && self.innerHeight) {
        return self.innerHeight;
    }
    if (document.documentElement && document.documentElement.clientHeight) {
        return document.documentElement.clientHeight;
    }
    return 0;
}

function getWindowWidth() {
    if (window.self && self.innerWidth) {
        return self.innerWidth;
    }
    if (document.documentElement && document.documentElement.clientWidth) {
        return document.documentElement.clientWidth;
    }
    return 0;
}

function fixTop() {
    var top = "";
    var left = "";
    
    if(getWindowHeight() < 580) {
        top = "0px";
        e("container").style.top = "0px";
    }
    else {
        top = "-295px";
        e("container").style.top = "50%";
    }
    
    if(getWindowWidth() < 840){
        left = "0px";
        e("container").style.left = "0px";
    }
    else {
        left = "-425px";
        e("container").style.left = "50%";
    }
    
    e("container").style.margin = top + " 0px 0px " + left;
}