var answer = 22;
var isNS, isIE, referant;
var agenttest = navigator.appVersion;
var iswin = agenttest.indexOf("Win");
var isMac = navigator.userAgent.indexOf("Mac") != -1;
var states = 'hidden';



if (navigator.appVersion.charAt(0) == "4") {
	if (navigator.appName == "Netscape") {
		isNS = true
	} else {
		isIE = true
	}
}

//************   ONERROR  *********************
function handleError(){
location.replace("http://jeanpierredaviau.com/feedback.html#erreur&" + document.location)
}
// assign default error handler
//window.onerror = handleError
//*************************************************

function MM_reloadPage(init) {  
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true); 

function handleResize() { if(isNS) {location.reload();	return false;}}

var dlh=" ";var doc=" ";var lnk = "";
var copy = "<br/><br/>Tous droits réservés pour tous usages et tous pays. Les oeuvres représentées sur ce site sont la propriété de l'artiste. Toute reproduction, copie, adaptation, ou utilisation de l'ensemble ou d'une partie des illustrations de ce site, sans le consentement écrit du propriétaire des droits, est interdite et constitue une contrefaçon passible des peines prévues par la loi sur le droit d'auteur."

function makeWichOne(){
		var session = new Date();
		session.setTime(session.getTime() + (1000 * 60 * 60 * 24 ));
		setCookie("referant", document.location.href, session);
	}

function fnote() {
	lnk =  document.location.href
	if(parseInt(agenttest)>=4) {
		dlh=document.location.href

		pos=dlh.lastIndexOf("/")
		dlh=dlh.substring(pos+0)
		referant = dlh.substring(1)
		doc=dlh
	
		dlh= "<p>" + dlh + "<img align='absmiddle' src='pages_src/demipouce.gif'>Montréal (Pointe-aux-Trembles): last modified " + document.lastModified.substring(0,10) ;
	}
	document.write("<br/><br/><br/><center style='font-size:10px; color:#C1B4AD;'><a href='copyright.htm' target='_top' style='font-size:10px; color:#C1B4AD;'><EM>COPYRIGHT</EM>&nbsp;&nbsp;&nbsp;</A>" + copy) 
	if(parseInt(agenttest)>=4) {
		document.write( dlh )
	}

	if(iswin) {
		document.write("<img align='absmiddle' src='pages_src/demipouce.gif'><A HREF='feedback.htm' onClick='makeWichOne()' style='font-size:10px; color:#C1B4AD;'><img border=0 align='top' src='pages_src/lettre.gif'><I>Post(ez)</I></A></center></p>")}}

function mtime(){
var stopTime = new Date()
stopTime = stopTime.getTime()
dfvalue = ((stopTime - startTime) / 1000)
}
function namopener() {
	var end = document.location.href
	var slant= eval(document.location.href.lastIndexOf("/") +1)
	var nomme = end.substring(slant, end.length)
}   

var repeatCustomer = false;
var lastVisit = 0;
var dateAdjustment = 0;
function adjustDate() {
	var base = new Date()
	var testDate = base
	testDate = testDate.toLocaleString()
	testDate = new Date(testDate)
	dateAdjustment = testDate.getTime() - base.getTime()
}
function saveCurrentVisit() {
	var visitDate = new Date()
	var nowGMT = visitDate.getTime() - dateAdjustment
	if(getChip('siteObject', 'lastVisit')){delChip('siteObject','lastVisit')};
	setChip("siteObject", "lastVisit", nowGMT)
}

function initialize() {
	var lastVisitVar = getChip('siteObject', 'lastVisit');
	var softVar = getCookie('soft');
	adjustDate()
	
	if (!lastVisitVar){
		
		saveCurrentVisit()
		repeatCustomer = false
		} 
	else {
	if (!softVar) {
			setCookie("soft", lastVisitVar, null)
			lastVisit = parseFloat(lastVisitVar)
			saveCurrentVisit()
			repeatCustomer = true
			} else {
			lastVisit = parseFloat(softVar)
			repeatCustomer = true}}}
function newAsOf(authorDate) {
	authorDate = new Date(authorDate)
	var itemUpdated = authorDate.getTime()
	return ((itemUpdated > lastVisit) && repeatCustomer) ? "<IMG SRC='_image/new.gif' HEIGHT=31 WIDTH=31>" : ""
}


////////////////////////

var exp = 0;
//////////////////////////



function getCookie(name){
var cname = name + "=";               
var dc = document.cookie;             
    if (dc.length > 0) {              
    begin = dc.indexOf(cname);       
        if (begin != -1) {           
        begin += cname.length;       
        end = dc.indexOf(";", begin);
            if (end == -1) end = dc.length;
            return unescape(dc.substring(begin, end));}}return null;}

function setCookie(name, value, exp) {
document.cookie = name + "=" + escape(value)  + "|" + ";expires=" + new Date(exp).toGMTString() + "; path=/";
}
function delCookie(name) {
document.cookie = name + "=; expires=Thu, 01-Jan-70 00:00:01 GMT" +  "; path=/";
}


function getChip(cookie, name){
var cn = name + '=';
var dc = getCookie(cookie);
    if (dc != null) {
    var start = dc.indexOf(cn);
       if (start != -1) {                       
       start += cn.length;
       var end = dc.indexOf('|', start);
           if (end != -1) return unescape(dc.substring(start, end));
       }}return null;}

function setChip(cookie, name, value) {
var dc = getCookie(cookie);
var cv = getChip(cookie, name);
var cn = name + '=';
    if (cv != null) {                        
    var start = dc.indexOf(cn);              
        if (start != -1) {
        var end = dc.indexOf('|', start);      
        setCookie(cookie, dc.substring(0, start) + cn + value  + dc.substring(end + 1, dc.length), exp);
        }        
    }else {
       if (dc != null) dc += cn + value;
       else dc = cn + value ;

    setCookie(cookie, dc, exp);
    }
 }

function delChip(cookie, name) {
var dc = getCookie(cookie);
var cv = getChip(cookie, name);
var cn = name + '=';                        
    if (cv != null) {                      
    var start = dc.indexOf(cn); 
    var end = dc.indexOf('|', start);
    setCookie(cookie, dc.substring(0, start) + dc.substring(end + 1, dc.length), exp);}
}

///////////////////////////////////////////
var sujet='?subject=' + document.title;
function some(){
var randming = '';
var ligue = new Array ("o", "t", "l", "i", "a", "m")
for(j=ligue.length-1;j>-1;j--)
	randming = randming + ligue[j]
return randming
}
function none(){
var randoming = '';
var ligne = new Array(100, 97, 118, 105, 97, 117, 106, 112);
for(j=0;j<ligne.length;j++)
randoming = randoming + String.fromCharCode(ligne[j])
return randoming
}
function handsome(){
var li = new Array("a", "c",".", "n", "o", "r", "t", "o", "e", "d", "i", "v");
var skip = li.reverse();
var ran = '';
for(k=0; k<skip.length; k++)
	ran= ran + skip[k]
return ran + sujet;
}
