var w = 800;
var h = 600;
var top;
var r = 0.7;
var a_top, alb_height;

// default value if h = 600px
D_album = 340;
D_footer = 180;

function writeTag(name) {
  // IE
  if(document.all){
    w = document.body.clientWidth;
    h = document.body.clientHeight;
  }
  // NN
  else if (document.layers || document.getElementById) {
    w = innerWidth;
    h = innerHeight;
  }

  if (h>600) {
    alb_height = D_album + (h-600) * r;
    a_top = (h - (alb_height + D_footer)) / 2;
  }
  else {
    alb_height = D_album;
    a_top = h * 0.06;
  }

  switch(name) {
  case 'all':
    pad = alb_height + 50;
    document.write('<div id="all" style="margin-top:' + a_top + 
		   'px;height:' + pad + '">');
    break;
  case 'footer':
    document.write('<div id="footer" style="top:' + alb_height + 'px;">');
    break;
  case 'ac':
    ac = alb_height - 30;
    document.write('<div id="album-c" style="height:' + ac + 'px;">');
    break;
  }
}


function printArea() {
  // IE
  if (document.all) {
    w = document.body.clientWidth;
    h = document.body.clientHeight;
  }
  // NN
  else if (document.layers || document.getElementById) {
    w = innerWidth;
    h = innerHeight;
  }
  document.write(w + 'x' + h);
}
