function innerSize(wh) {
  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 );
  
  if (wh == 'height') {
    return myHeight;
  } else if (wh == 'width') {
    return myWidth;
  } else {
    return 0;
  }
}

function fitPic() {
    w = ( document.images[0].width > screen.width - 10 ) ? screen.width - 10 : document.images[0].width;
    h = ( document.images[0].height > screen.height - 60 ) ? screen.height - 60 : document.images[0].height;
    iWidth = w - innerSize('width');
    iHeight = h - innerSize('height');
    window.resizeBy(iWidth, iHeight);
    
    // moveTo
    //iX = ( w == screen.width - 10 ) ? 0 : ( screen.width - w ) / 2;
    //iY = ( h == screen.height - 60 ) ? 0 : ( screen.height - h ) / 2;
    //moveTo(iX, iY);
    
}

