   //document.onload = size_tuning();


   function get_window_width ( )
   {
      if( document.body.clientWidth ) {
         return document.body.clientWidth;
      } else if ( document.body.offsetWidth ) {
         return document.body.offsetWidth;
      } else if ( window.innerWidth ) {
         return window.innerWidth;
      }
   }
   
   
   
   function get_elem_width ( id )
   {
      if( document.getElementById( id ).clientWidth ) {
         return document.getElementById( id ).clientWidth;
      } else if ( document.getElementById( id ).offsetWidth ) {
         return document.getElementById( id ).offsetWidth;
      }
   }
   
   
   function getStyle(el,styleProp)
   {
      var x = document.getElementById(el);
      if (x.currentStyle) {
         var y = x.currentStyle[styleUpper(styleProp)];
      }
      else if (window.getComputedStyle) {
         var y = document.defaultView.getComputedStyle(x,null).getPropertyValue(styleProp);
      }
      return y;
      //return y.replace( /(px)$/ , '' );
   }
   
   
   
   // 'margin-bottom'  ->  'marginBottom'
   // 'width'          ->  'width'
   function styleUpper ( style_string )
   {
      var txts   = style_string.split( '-');
      var answer = txts[0];
      for ( i=1; i < txts.length; i++ ) {
         answer += 
            txts[i].substring(0,1).toUpperCase() +
            txts[i].substring(1);
      }
      return answer;
   }

   
   
   
   function size_tuning ( )
   {
      var window_width   = 0;
      window_width       = get_window_width();
      // tuning of: div #content
      var content_width  = 0;
      content_width      = get_elem_width('content');
      if( content_width < 0.7*window_width ) {
         document.getElementById('content').style.width =
            Math.floor( 0.7 * window_width ) + 'px';
      }
      //alert( getStyle( 'related' , 'margin-bottom' ) )
      
      // tuning of: div #related
      var content_height = 0;
      var related_offset = 0;
      var margins        = 0;
      content_height     = document.getElementById('content').offsetHeight;
      if( document.getElementById('related') ) {
         related_offset  = document.getElementById('related').offsetTop;
         margins         = parseFloat( getStyle( 'related' , 'margin-bottom' ) );
         document.getElementById('related').style.height = 
            content_height -related_offset +margins + 'px';
      }
   }