//onerror = report;    
function report(message,url,line) {
return false;
//alert('Erreur : ' + message + ' à la ligne ' + line + ' --> ' + url);

}



function afficheVignette(cheminVignette,cheminMaxi,legendeImg)
	{
	document.write('<A HREF="javascript:afficheMaxi(\''+cheminMaxi+'\',\''+legendeImg+'\')"><IMG SRC="'+cheminVignette+'" HSPACE=0 VSPACE=0 BORDER=0 ALT="'+legendeImg+'\nCliquez ici pour agrandir l\'image"></A>');
	}
function afficheMaxi(chemin,legendeImg)
	{
	i1 = new Image;
	i1.src = chemin;
	html = '<HTML><HEAD><TITLE>'+legendeImg+'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TITLE></HEAD><BODY LEFTMARGIN=0 MARGINWIDTH=0 TOPMARGIN=0 MARGINHEIGHT=0 onBlur=self.focus(); ><CENTER><IMG SRC="'+chemin+'" BORDER=0 NAME=imageTest id=imageTest ALT="'+legendeImg+'"></CENTER></BODY></HTML>';
	popupImage = window.open('vide.html','photo','width=10,height=10,toolbar=0,location=0,directories=0,menuBar=0,scrollbars=0,resizable=yes');
	popupImage.document.open();
	popupImage.document.write(html);
	popupImage.document.close();
setTimeout('resizeWindow()',0);
setTimeout('resizeWindow()',1000);
	};
function resizeWindow() {
    if (popupImage.document.images) {
        if (popupImage.document.images.length == 1) {
            if (document.layers) popupImage.resizeTo(popupImage.document.images[0].width,popupImage.document.images[0].height)
            else if (document.all) popupImage.resizeTo(popupImage.document.images[0].width+10,popupImage.document.images[0].height+30)
            else if (document.getElementById) popupImage.resizeTo(popupImage.document.getElementById('imageTest').width+20,popupImage.document.getElementById('imageTest').height+40)
        }
        else 
            setTimeout('resizeWindow()',200);
    }
}


function add2pan(no){
var date1=new Date;
var existedja=0;
date1.setFullYear(date1.getFullYear()+1);
var TablFavoris=GetCook("FAVORIS");
if (TablFavoris==null){
SetCook("FAVORIS","FAVORIS,"+parseInt(no),date1,"/");return false;}
else{
var bb=TablFavoris.indexOf(","+parseInt(no))
if(bb!=-1){existedja=1}
if (existedja==1){TablFavoris=replace(TablFavoris,","+parseInt(no),"");}}
if (existedja==0){TablFavoris=TablFavoris+","+parseInt(no);}
SetCook("FAVORIS",TablFavoris,date1,"/");
//alert(no+"--"+GetCook("FAVORIS")+"--"+existedja);
}

function checkfav(no){

var TablFavoris=GetCook("FAVORIS");
if (TablFavoris!=null){
var bb=TablFavoris.indexOf(","+parseInt(no))
if(bb!=-1){
	
	var tablX=TablFavoris.split(",");
		var obj=eval("document.ajouter.pan"+no)
		if (obj!="undefined"){obj.checked="True";}else{obj.checked="False";}

}}
}
function GetCook (name)
{
	var NonameG = name + "=";
	var ToLen = NonameG.length;
	var CookieLen = document.cookie.length;
	var i = 0;
	while (i < CookieLen)
	{
		var j = i + ToLen;
		if (document.cookie.substring(i, j) == NonameG)
		return GetCookVal (j);
		i = document.cookie.indexOf(" ", i) + 1;
		if (i == 0) break;
	}
	return null;
}

function SetCook(name,value,expires,path,domain,secure) 
{
	document.cookie = name + "=" + escape (value) +
	((expires) ? "; expires=" + expires.toGMTString() : "") +
	((path) ? "; path=" + path : "") +
	((domain) ? "; domain=" + domain : "") +
	((secure) ? "; secure" : "");
}
function GetCookVal (offset)
{
	var endstr = document.cookie.indexOf (";", offset);
	if (endstr == -1)
	endstr = document.cookie.length;
	return unescape(document.cookie.substring(offset, endstr));
}

function replace(inputString, fromString, toString) {
   var temp = inputString;
   if (fromString == "") {
      return inputString;
   }
   if (toString.indexOf(fromString) == -1) { 
      while (temp.indexOf(fromString) != -1) {
         var toTheLeft = temp.substring(0, temp.indexOf(fromString));
         var toTheRight = temp.substring(temp.indexOf(fromString)+fromString.length, temp.length);
         temp = toTheLeft + toString + toTheRight;
      }
   } else { 
      var midStrings = new Array("~", "`", "_", "^", "#");
      var midStringLen = 1;
      var midString = "";
      while (midString == "") {
         for (var i=0; i < midStrings.length; i++) {
            var tempMidString = "";
            for (var j=0; j < midStringLen; j++) { tempMidString += midStrings[i]; }
            if (fromString.indexOf(tempMidString) == -1) {
               midString = tempMidString;
               i = midStrings.length + 1;
            }
         }
      } 
      while (temp.indexOf(fromString) != -1) {
         var toTheLeft = temp.substring(0, temp.indexOf(fromString));
         var toTheRight = temp.substring(temp.indexOf(fromString)+fromString.length, temp.length);
         temp = toTheLeft + midString + toTheRight;
      }
      while (temp.indexOf(midString) != -1) {
         var toTheLeft = temp.substring(0, temp.indexOf(midString));
         var toTheRight = temp.substring(temp.indexOf(midString)+midString.length, temp.length);
         temp = toTheLeft + toString + toTheRight;
      }
   } 
   return temp; 
}


