// JavaScript Document
//===================================================/
//  File name       :  resize.js                     /
//  Purpose         :  CENTERS WITHIN WINDOW         /
//  Last Revised    :  October 18, 2008              /
//  Time            :  11:00am                       /
//                                                   /
//  Author          :  Bill Paradis                  /
//  Version         :  1.00                          /
//                                                   /
// (c) Copyright 2008                                /                                
//   Bill Paradis                                    /
//   Center for Leadership Excellence                /
//   2411 Belle Glade Lane                               /
//   Manteca, CA 95336                             /
//   bill.paradis@centerforleadershipexcellence.com  /
//   www.clefasttrack.com                            /
//===================================================/
//
//  RESIZES TO POSITION PAGE IN CENTER OF AVAILABLE WINDOW
//
 function resize()
  {
    var wide = window.screen.availWidth
    var high = window.screen.availHeight
    var maxh = 580 // your max height here; enter 0 if not used
    var maxw = 900 // your max width here; enter 0 if not used
    var container = document.getElementById('container')
    container.style.position = 'absolute'
    
		alert("wide = " + wide + " and high = " + high);
		
		if(maxh > 0 && high <= maxh)
    {
    container.style.height = high
    }
    if(maxw > 0 && wide <= maxw)
    {
    container.style.height = high
    }

    if(maxh > 0 && high > maxh)
    {
    container.style.height = maxh
    high = (high - maxh) / 2
    //  
		//  If wanted vertically centered as well, change next line to
		//  containter.stytle.top = high + "px';
		//  As it is it puts at top of screen and centers horizontally
		//
		container.style.top = 0 + "px";
    }
    if(maxw > 0 && wide > maxw)
    {
    container.style.width = maxw
    wide = (wide - maxw) / 2
    container.style.left = wide +"px";
    
		alert("Resized wide = " + wide + " and high = " + high);
		
		}
  }
