window.onresize = findWindowDim

var orig_height = false;

function findWindowDim(){
	
	var client_height = getWindowHeight();
	var wrap = document.getElementById('wrap').offsetHeight;
	var head_wrap = document.getElementById('nav2')?110:71;
	var center = document.getElementById('center_content').offsetHeight;
	if(!orig_height){		
		orig_height= document.getElementById('center_content').offsetHeight;
	}
	var footer = document.getElementById('footer').offsetHeight;
	var prop_height =  ((client_height - 6) - (head_wrap + footer + 20));	
		
	if((prop_height > 250) && (prop_height > orig_height)){
		document.getElementById('center_content').style.height =  prop_height+"px";	
	}	
}

function getWindowHeight() {
  var myHeight = 0;
  if( typeof( window.innerHeight ) == 'number' ) {
    //Non-IE
   	myHeight = window.innerHeight;
  } else if( document.documentElement &&
      ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    //IE 6+ in 'standards compliant mode'
   myHeight = document.documentElement.clientHeight;
  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    //IE 4 compatible
     myHeight = document.body.clientHeight;
  }
 return myHeight;
}

function getWindowWidth(){
	 var myWidth = 0;
  if( typeof( window.innerWidth ) == 'number' ) {
    //Non-IE
    myWidth = window.innerWidth;
   
  } else if( document.documentElement &&
      ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    //IE 6+ in 'standards compliant mode'
    myWidth = document.documentElement.clientWidth;   
  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    //IE 4 compatible
    myWidth = document.body.clientWidth;    
  }
  return myWidth;
}

function isNetscape(v) {
  /*
  ** Check if the browser is Netscape compatible
  **    v  version number
  ** returns  true if Netscape and version equals or greater
  */
  return isBrowser("Netscape", v);
  }

function isMicrosoft(v) {
  /*
  ** Check if the browser is Microsoft Internet Explorer compatible
  **    v  version number
  ** returns  true if MSIE and version equals or greater
  */
  return isBrowser("Microsoft", v);
  }

function isBrowser(b,v) {
  /*
  ** Check if the current browser is compatible
  **  b  browser name
  **  v  version number (if 0 don't check version)
  ** returns true if browser equals and version equals or greater
  */
  browserOk = false;
  versionOk = false;	
  browserOk = (navigator.appName.indexOf(b) != -1);
  if (v == 0) versionOk = true;
  else  versionOk = (v <= parseInt(navigator.appVersion));
  return browserOk && versionOk;
  }
  // Example:

// simplePreload( '01.gif', '02.gif' ); 

function simplePreload()
{ 
  var args = simplePreload.arguments;
  document.imageArray = new Array(args.length);
  for(var i=0; i<args.length; i++)
  {
    document.imageArray[i] = new Image;
    document.imageArray[i].src = args[i];
  }
}


