/* thanks to experts-exchange, from alertSize()*/
function bWidth() {
  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;
  }

  
  if (myWidth<=780)
  {
  	return('small'); 
  }
  else if (myWidth>780 && myWidth <= 1100)
  {
	  return('medium');
  }
  else if (myWidth>1100 && myWidth <= 1600)
  {
	  return('large');
  }
  else
  {
	  return('verylarge');  
  }
  
 /* window.alert( 'Width = ' + myWidth );
  window.alert( 'Height = ' + myHeight );
  */ 
}

function iHeight(sz) {
  if (sz=='small')
  {
  	return(251); 
  }
  else if (sz=='medium')
  {
    return(312);
  }
  else if (sz=='large')
  {
	  return(330);
  }
  else
  {
	 return (548);
  }
}


/* http://www.webdeveloper.com/forum/showthread.php?t=108392 */
function getWidthAndHeight() {
    alert("'" + this.name + "' is " + this.width + " by " + this.height + " pixels in size.");
    return true;
}
function loadFailure() {
    alert("'" + this.name + "' failed to load.");
    return true;
}

/* var myImage = new Image();
myImage.name = "../images/header/homepage/panorama-orig.jpg";
myImage.onload = getWidthAndHeight;
myImage.onerror = loadFailure;
myImage.src = "../images/header/homepage/panorama-orig.jpg"; */
