<!--
//
// head.js - Litteral.com header scripts
//
// Unpublished proprietary source code.
// Copyright (C) 2006-2007 LITTERAL SAS, SURESNES, FRANCE
// All rights reserved.
//

function zaplang()
{
  window.parent.location = document.zap.lang.options[document.zap.lang.selectedIndex].value;
}

function showimg(id, onoff)
{
  // If the browser can do this, on-the-fly change of the specified image
  // with the specified preloaded object
  if (document.images)
    document.images[id].src = eval( id + "_" + onoff + ".src");
}

function nextbanner()
{
  // If the browser can do this, set the next-in-list banner image
  if (document.images)
  {
    banner = (banner+1) % banners.length;
    document.images['img_banner'].src = banners[banner].src;
  }

  // Remember this call
  direct = 1;
}


function rotbanner()
{
  // Change banner if no recent click
  if (direct == 0)
    nextbanner();

  // Start next banner rotation
  if (delay > 0)
    setTimeout('rotbanner()', delay);

  // Forget last call...
  direct = 0;
}

function initimg(id)
{
  if (document.images)
  { 
    // Preload images
    img_head_on = new Image();
    img_head_on.src = "images/head"+id+"_on.jpg";

    img_head_off = new Image();
    img_head_off.src = "images/head"+id+"_off.jpg";

    direct  = 0;
    delay   = 0; //30000;
    banner  = 0;
    banners = new Array(9);

    for (var i=0; i<banners.length; i++)
    {
      banners[i] = new Image();
      banners[i].src = 'images/banner'+i+'.png';
    }
  
    // start banner rotation
    if (delay > 0)
      setTimeout('rotbanner()', delay);
  }
}

// -->

