function getWindowHeight() {
  var height = 0;
  if( typeof( window.innerWidth ) == 'number' ) height = window.innerHeight; //Non-IE
  else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) height = document.documentElement.clientHeight; //IE 6+ in 'standards compliant mode'
  else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) )  height = document.body.clientHeight; //IE 4 compatible
  return height;
}
function getWindowWidth() {
  var width = 0;
  if( typeof( window.innerWidth ) == 'number' ) width = window.innerWidth; // non-IE
  else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) width = document.documentElement.clientWidth; //IE 6+ in 'standards compliant mode'
  else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) width = document.body.clientWidth; //IE 4 compatible
  return width;
}
function sizeall() {
  height = getWindowHeight();
  width  = getWindowWidth();

	setheight = document.getElementById('left').offsetHeight;

  if (height>setheight) {
	  document.getElementById('wrap').style.height = height+'px';
	  document.getElementById('left').style.height = height+'px';
	  document.getElementById('stage').style.height = height+'px';
	  document.getElementById('stage').style.width = (width-255)+'px';
  }
  else {
	  document.getElementById('wrap').style.height = setheight+'px';
	  document.getElementById('left').style.height = setheight+'px';
	  document.getElementById('stage').style.height = setheight+'px';
	  document.getElementById('stage').style.width = (width-255)+'px';
  }
}
function pageload() {
	sizeall();
}
function lookup(word) {
  flash = document.visuwords_swf;
  try { flash.lookup(word); }
  //catch(err) { return true; }
  catch(err) { 
		// couldnt find flash method so go to the url
		alert(err); 
		window.location = "http://visuwords.com/"+word;
		return false; 
  }
  return false;
}

