var playing = true;
$(document).ready(function() {
	if ($(window).width() < '1200px') {
		$('body').css('width','1200px');
	}
	
	$('#'+page+'_underscore').addClass('nav_selected');
	
	$('.nav').hover (function() {
		if ($(this).attr('page') != page) $('#'+$(this).attr('page')+'_underscore').addClass('nav_hover');
	}, function() {
		if ($(this).attr('page') != page) $('#'+$(this).attr('page')+'_underscore').removeClass('nav_hover');
	});
	
	$('.nav').click(function() {
		window.location = 'index.php?page='+$(this).attr('page');
	});
});

var nf = window.nf || {}; // Initialize namespace.

function windowSize() {
  var myWidth = 0, myHeight = 0;
  if( typeof( window.innerWidth ) == 'number' ) {
    //Non-IE
    myWidth = window.innerWidth;
    myHeight = window.innerHeight;
  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    //IE 6+ in 'standards compliant mode'
    myWidth = document.documentElement.clientWidth;
    myHeight = document.documentElement.clientHeight;
  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    //IE 4 compatible
    myWidth = document.body.clientWidth;
    myHeight = document.body.clientHeight;
  }
/*  window.alert( 'Width = ' + myWidth );
  window.alert( 'Height = ' + myHeight );*/ 
  return new Array (myWidth, myHeight);
} // windowSize

function resizeForIE() {
	var window_size = windowSize();
	var table_height = document.getElementById('TheTable').offsetHeight+40;
	if (window_size[1] < table_height) {
		document.getElementById('outer').style.height=table_height+'px';
		document.getElementById('middle').style.height=table_height+'px';
	} else {
		document.getElementById('outer').style.height='100%';
		document.getElementById('middle').style.height='';			
	}
}

function navHover (page) {
	e = document.getElementById(page + '_nav_underscore');
	if (e.className == 'nav_selected') return false;
	if (e.className == 'nav_hover') {
		e.className='';
	} else {
		e.className='nav_hover';
	} // if
} // navHover