function setCookie(name, value, expire)
{
  document.cookie = name + "=" + escape(value) + ((expire == null) ? "" : ("; expires=" + expire.toGMTString()))
}

function getCookie(Name)
{
  var search = Name + "=";
  if (document.cookie.length > 0) // if there are any cookies
 {
    offset = document.cookie.indexOf(search)
    if (offset != -1)  // if cookie exists 
   {
     offset += search.length;   // set index of beginning of value
     end = document.cookie.indexOf(";", offset);     // set index of end of cookie value
     if (end == -1)   end = document.cookie.length;
     return unescape(document.cookie.substring(offset, end));
   }
  }
 return null;
}

function register( nom, valeur )
{
  var today = new Date();
  var expires = new Date();
  expires.setTime(today.getTime() + 1000*60*60*24);
  setCookie(nom, valeur, expires);
}

function testCookie()
{
  register( "test", 0 );
  return( getCookie("test") );
}




function position_img( top_p, left_p, rep, img_name, img_width, img_height, o_titre, o_date )
{
// l'image fixe doit avoir l'extension 's.jpg'

  chaine = rep + "/" + img_name + ".jpg;" + o_titre + ";" + o_date;

  document.write( "<span style=\"position:relative; top:" + top_p + "px; left:" + left_p + "px\">" );
  document.write( "<a href=\"agrandissement.htm\" onClick=\"register('oeuvre','" + chaine + "');\">" );
  document.write( "<img src=\"" + rep + "/" + img_name + "s.jpg\" width=\"" + img_width + "\" height=\"" + img_height + "\" border=\"0\" name=\"e" + img_name + "\">" );
  document.write( "</a>" );
  document.write( "</span>" );
}



