var timeoutID = 0;
// Déclaration des variables 'domaine' et 'date d'expiration'
var pathname=location.pathname;
var myDomain=pathname.substring(0,pathname.lastIndexOf('/')) +'/';
var date_exp = new Date();
date_exp.setTime(date_exp.getTime()+(3600*1000));// 1 heure
function Timer(x)
{
if ( x== "*")
{
x = "imgdir.htm";
}
//this.status = 'document.location='+x;
timeoutID = window.setTimeout('document.location="'+x+'"', 6000);
}
function affiche(no,fich) {
jtext = fich + '.htm';
document.location = jtext;
}
// Voici les 3 fonctions de gestions des cookies
////////////////////////////////////////////////
function getCookieVal(offset) {
	var endstr=document.cookie.indexOf (";", offset);
	if (endstr==-1)
      		endstr=document.cookie.length;
	return unescape(document.cookie.substring(offset, endstr));
}
function GetCookie (name) {
	var arg=name+"=";
	var alen=arg.length;
	var clen=document.cookie.length;
	var i=0;
	while (i<clen) {
		var j=i+alen;
		if (document.cookie.substring(i, j)==arg)
                        return getCookieVal (j);
                i=document.cookie.indexOf(" ",i)+1;
                        if (i==0) break;}
	return null;
}
function SetCookie (name, value) {
// un cookie a besoin d'un nom, d'une valeur, d'un nom de domaine, d'une date d'expiration
// 
	var argv=SetCookie.arguments;
	var argc=SetCookie.arguments.length;
	var expires=(argc > 2) ? argv[2] : null;
	var path=(argc > 3) ? argv[3] : null;
	var domain=(argc > 4) ? argv[4] : null;
	var secure=(argc > 5) ? argv[5] : false;
	document.cookie=name+"="+escape(value)+
		((expires==null) ? "" : ("; expires="+expires.toGMTString()))+
		((path==null) ? "" : ("; path="+path))+
		((domain==null) ? "" : ("; domain="+domain))+
		((secure==true) ? "; secure" : "");
}
//
// format date as dd-mmm-yy
// example: 12-Jan-99
//
function date_ddmmmyy(date)
{
  var d = date.getDate();
  var m = date.getMonth() + 1;
  var y = date.getYear();

  // handle different year values 
  // returned by IE and NS in 
  // the year 2000.
  if(y >= 2000)
  {
    y -= 2000;
  }
  if(y >= 100)
  {
    y -= 100;
  }

  // could use splitString() here 
  // but the following method is 
  // more compatible
  var mmm = 
    ( 1==m)?'Janvier':( 2==m)?'Février':(3==m)?'Mars':
    ( 4==m)?'Avril':( 5==m)?'Mai':(6==m)?'Juin':
    ( 7==m)?'Juillet':( 8==m)?'Août':(9==m)?'Septembre':
    (10==m)?'Octobre':(11==m)?'Novembre':'Décembre';

  return "" +
    (d<10?"0"+d:d) + " " +
    mmm + " 20" +
    (y<10?"0"+y:y);
}


//
// get last modified date of the 
// current document.
//
function date_lastmodified()
{
  var lmd = document.lastModified;
  var s   = "Unknown";
  var d1;

  // check if we have a valid date
  // before proceeding
  if(0 != (d1=Date.parse(lmd)))
  {
    s = "" + date_ddmmmyy(new Date(d1));
  }

  return s;
}

function lm()
{
//
// finally display the last modified date
// as DD-MMM-YY
//
document.write( 
  date_lastmodified() );
}
function winvendre(fich)
{
 vendid = window.open(fich, 'avendre', 'scrollbars=yes,status=no,width=400,height=400,resizable=yes');
vendid.title = 'Info Increvables'
}
function wininsc(fich)
{
var larg = 200;
 inscid = window.open(fich, 'insc', 'scrollbars=yes,status=no,width=500,height=400,resizable=yes,menubar=yes');
inscid.title = 'Info Increvables'
}
//
//<script>courriel(" par courriel","membres","velo.qc.ca","sujet")</script>
function courriel(texte,user, domain,sujet)
{
//<a href="mailto:xxx@hail.com?subject=réservation">courriel.</a>
  var s   = '<a href="mailto:' ;
  s = s + user + "@" +domain ;
  if (sujet != "" )
  {
  	s = s +'?subject='+sujet;
  }
  s = s+'">'+texte+'</a>';
  document.write(s);
}
//
//<script>inc_courriel(" par courriel","sujet")</script>
function inc_courriel(texte, sujet)
{
//<a href="mailto:xxx@hail.com?subject=réservation">courriel.</a>
  var s   = '<a href="mailto:increvables' ;
  s = s + "@" + 'gmail.com' ;
  if (sujet != "" )
  {
  	s = s +'?subject='+sujet;
  }
  s = s+'">' + texte + '</a>';
  document.write(s);
}
///////////////////////////////////