// calculation
head[W] = layout[W];
head[H] = Math.round(layout[W] * headfootratio);
head[X] = layout[X];
head[Y] = layout[Y];

//preload images
var headimgs = new Array();
headimgs[0] = new Image(); headimgs[0].src = 'images/headlogoattivo.gif';
headimgs[1] = new Image(); headimgs[1].src = 'images/headlogobene.gif';
headimgs[2] = new Image(); headimgs[2].src = 'images//headcreativeresource.gif';
headimgs[3] = new Image(); headimgs[3].src = 'images/headrocket.gif';

// set head
setstyle('head', [
  ['backgroundColor', colorattivo],
  ['left', head[X]],
  ['top', head[Y]],
  ['width', head[W]],
  ['height', head[H]]
]);
setstyle('headline', [
  ['backgroundColor', colorheadfootline],
  ['left', head[X]],
  ['top', head[Y] + head[H] - 1],
  ['width', head[W]],
  ['height', 1]
]);
setstyle('headspacer1', [
  ['width', Math.round(18 * scale)],
  ['height' , head[H] - 1]
]);
setstyle('headlogo', [
  ['width', Math.round(134 * scale)],
  ['height' , Math.round(14 * scale)]
]);
setstyle('headcreativetesources', [
  ['width', Math.round(134 * scale)],
  ['height' , Math.round(13 * scale)]
]);
setstyle('headrocket', [
  ['width', Math.round(71 * scale)],
  ['height' , Math.round(35 * scale)]
]);
setstyle('headspacer2', [
  ['width', Math.round(21 * scale)],
  ['height' , head[H] - 1]
]);