// JavaScript Document

// NOTE: Requires object-tools.js

function Window() {
	
	var w = new Object;
	
	w.getSize = function() {
		var size = new Array;
		if ( parseInt( navigator.appVersion ) > 3 ) {
			if ( navigator.appName == "Netscape" )
				size = [ window.innerWidth, window.innerHeight ];
			else if ( navigator.appName.indexOf( "Microsoft" ) != -1 )
				size = [ document.body.offsetWidth, document.body.offsetHeight ];
		  else 
		    size = [ window.innerWidth, window.innerHeight ];
		}
		return size;
	}
	
	w.setSize = function( width, height ) {
		if ( parseInt( navigator.appVersion ) > 3 ) {
			if ( navigator.appName == "Netscape" ) {
				window.innerWidth = width;
				window.innerHeight = height;
			} else if ( navigator.appName.indexOf( "Microsoft" ) != -1 ) {
				document.body.offsetWidth = width;
				document.body.offsetHeight = height;
			}	else {
			  window.innerWidth = width;
				window.innerHeight = height;
			}
		}
	}
	return w;
}


function makeAdjust() {
  
  var minWidth = 1051;
  var narrowSS = "layout-narrow";
  var wideSS   = "layout-wide";
  var w = new Window();
  var windowSize = w.getSize();
  var wide = getObj( wideSS );
  var narrow = getObj( narrowSS );
  if ( windowSize[0] > minWidth ) {
    wide.disabled = false;
    narrow.disabled = true;
  } else {
    wide.disabled = true;
    narrow.disabled = false;   
  }
  return true;
}



function initObj() {
  
  // Add additional methods to the window object
  var w = getObj( window );
  
  // Make the n
  if ( makeAdjust() )
    w.addEventHandler( "resize", makeAdjust );

}

