function xDef()
{
  for(var i=0; i<arguments.length; ++i){if(typeof(arguments[i])=='undefined') return false;}
  return true;
}

function xClientHeight()
{
  var v=0,d=document,w=window;
  if((!d.compatMode || d.compatMode == 'CSS1Compat') && !w.opera && d.documentElement && d.documentElement.clientHeight)
    {v=d.documentElement.clientHeight;}
  else if(d.body && d.body.clientHeight)
    {v=d.body.clientHeight;}
  else if(xDef(w.innerWidth,w.innerHeight,d.width)) {
    v=w.innerHeight;
    if(d.width>w.innerWidth) v-=16;
  }
  return v;
}

$(document).ready(function() {
	// if ($('#wrapper').height() < xClientHeight()) {
	// 	$('#wrapper').height(xClientHeight()-52);
	// 	$('#footer').css('position', 'absolute').css('bottom', '16');
	// }
	
	// NK 7-1-09
	// make it so that the entire "i've read and agree to eula" box is selectable,
	// rather than just the pitiful little checkbox
	$('p#agrees span').click(function(){
		//var isChecked = $('p#agrees input:checkbox').attr('checked');
		//$('p#agrees input:checkbox').attr('checked', !isChecked);
        $('p#agrees input').attr('checked', !($('p#agrees input').attr('checked')));
	}).css("cursor", "pointer");
});

window.onresize = function() {
	// if ($('#wrapper').height() < xClientHeight()) {
	// 	$('#wrapper').height(xClientHeight()-52);
	// 	$('#footer').css('position', 'absolute').css('bottom', '16');
	// } else {
	// 	$('#wrapper').height('auto');
	// 	$('#footer').css('position', 'static').css('bottom', '');
	// }
}

