//
// javascript file for the insertion of a (configurable) banner at the top of each page 
//

var  hibar_code = '';
var banner_code = '';
var  lobar_code = '';

var link_string1  = '" onmouseover="self.status=\' ';
var link_string2  = ' \';return true" onmouseout="self.status=\' \';return true"';

// Central Banner

// There are three images to assemble:
// mp_banner_<banner_type>_head.jpg: the left side (e.g. the trees)
// mp_banner_<banner_type>_body.jpg: the elastic cental image (e.g. the sky)
// mp_banner_<banner_type>_tail.jpg: the right side (e.g. the moon)
//
// These images can be changed using the style directive,
// after calculating the new image path. For instance:
// <div class="example" style="background : url('+photo_path+') no-repeat center center">');
//

// default values (to be customized with the page type)

var banner_type = 'forest_';
var banner_title=
  '    <span id="tp_logo_1">/tiberio fanti </span>'
+ '    <span id="tp_logo_2">:</span>'
+ '    <span id="tp_logo_3"> photographs </span>'
+ '    <span id="tp_logo_5">: </span>'
+ '    <span id="tp_logo_4">'+page_name+'</span>';

if (page_name=="freeware")
 {
  banner_type = 'logo_';
  banner_title= '<span id="tp_logo_4">'+page_name+'</span>';
    };

var banner_string_1 = 'style="background : url(../Images/decorations/mp_banner_'+banner_type;

banner_code =
  '<div class="tp_banner" '+banner_string_1+'body.jpg) 0px 0px repeat-x">'
+ '  <p class="tp_moon" '+banner_string_1+'tail.jpg) 6px 0px no-repeat">' // 6px hack
+ '  </p>'
+ '  <p class="tp_logo" '+banner_string_1+'head.jpg) 0px 0px no-repeat">'
+ banner_title
+ '  </p>'
+ '</div>';

// Higher and Lower Bars

  hibar_code =
  '<div class="hibar_list">';

  lobar_code =
  '<div class="tp_bar_list">'
+ '  <a class="tp_bar_list" id="tp_bar_contact" href="./contact.html'+link_string1+'How to contact me'+link_string2+'" title="How to write me">'
+ '    <img src="../Images/decorations/envelop.gif">'
+ '  </a>';

if (page_name=="home")
 {
  for (i=0; i<hibar.length; i++)
   {
    hibar_code = hibar_code
    + '<a class="hibar_list" href="'+hibar[i][2]+link_string1+hibar[i][3]+link_string2+'" title="'+hibar[i][3]+'">'+'<span class="capital">'+hibar[i][0]+'</span>'+hibar[i][1]
    + '</a>';
    };

  for (i=0; i<lobar.length; i++)
   {
    lobar_code =
      lobar_code
    + '<a class="tp_bar_list" href="'+lobar[i][2]+link_string1+lobar[i][3]+link_string2+'" title="'+lobar[i][3]+'">'+'<span class="capital">'+lobar[i][0]+'</span>'+lobar[i][1]
    + '</a>';
    };
  }
else
 {
  lobar_code =
    lobar_code
  + '    <a class="tp_bar_list" href="./main.html"'
  + link_string1
  + 'Back to the main page'
  + link_string2
  + ' target="_top"><span class="capital">h</span>ome</a> ';
  };

// all variables are gathered and printed out

var inc_banner_js =
  hibar_code
+ '</div>'
+ banner_code
+ lobar_code
+ '</div>';

document.write(inc_banner_js);
