var image_curr='';
var img_alt='';

function hasloaded(image,wintop,largeur,hauteur){
  if(hauteur-image.height>0){
    var posh=wintop+(hauteur-image.height)/2;
  }else{
    var posh=wintop+10;
  }
  if(largeur-image.width>0){
    var posl=(largeur-image.width)/2;
  }
  else{
    var posl=10;
  }
  var img1 = '<img src="js/shadow.png" border="0" width="10" height="'+image.height+'" class="png" alt="" />';
  var img2 = '<img src="js/shadow_bottom.png" border="0" width="'+image.width+'" height="10" class="png" alt="" />';
  var img3 = '<img src="js/shadow_corner.png" border="0" width="10" height="10" class="png" alt="" />';
	if((image_curr!='') && (image_curr!=image.src) && (document.getElementById("fullimage").style.display=="block"))
  {
    document.getElementById("fullimage").innerHTML = "";
    document.getElementById("fullimage").style.display = "none";
    document.getElementById("fullimage").style.top = posh+"px";
    document.getElementById("fullimage").style.left = posl+"px";
    document.getElementById("fullimage").innerHTML = "<div class=\"dropshadow2\"><div class=\"dropshadow2\"><a href=\"javascript:FullImage('"+image.src+"')\"><img title=\""+img_alt+"\" alt=\""+img_alt+"\" src=\""+image.src+"\" width="+image.width+" height="+image.height+" border=\"0\" /></a>"+img1+"</div>"+img2+""+img3+"</div>";
    document.getElementById("fullimage").style.display = "block";
    document.getElementById("fullimage").style.zIndex = 101000;

  }else if(document.getElementById("fullimage").style.display=="none"){
    document.getElementById("fullimage").style.top = posh+"px";
    document.getElementById("fullimage").style.left = posl+"px";
    document.getElementById("fullimage").innerHTML = "<div class=\"dropshadow2\"><div class=\"dropshadow2\"><a href=\"javascript:FullImage('"+image.src+"')\"><img title=\""+img_alt+"\" alt=\""+img_alt+"\" src=\""+image.src+"\" width="+image.width+" height="+image.height+" border=\"0\" /></a>"+img1+"</div>"+img2+""+img3+"</div>";
    document.getElementById("fullimage").style.display = "block";
    document.getElementById("fullimage").style.zIndex = 500000;
  }else{
    document.getElementById("fullimage").innerHTML = "";
    document.getElementById("fullimage").style.display = "none";
  }
  image_curr=image.src;
}

function FullImage(arg){
	var wintop=10;
	if (document.getElementById) { //IE5
		var wintop=parseInt(document.body.scrollTop);
		var hauteur=document.body.clientHeight;
		var largeur=document.body.clientWidth;
	}
	if ((document.getElementById) && (document.all)) { //IE6
		var wintop=parseInt(document.documentElement.scrollTop);
		var hauteur=document.documentElement.clientHeight;
		var largeur=document.documentElement.clientWidth;
	}
	if ((document.getElementById) && (!document.all)) { //NS6
		var wintop=parseInt(window.pageYOffset);
		var hauteur=window.innerHeight;
		var largeur=window.innerWidth;
	}
	var image=new Image;
	image.src=arg;
	if(!image.complete)		image.onload = function(){hasloaded(this,wintop,largeur,hauteur)};
	else hasloaded(image,wintop,largeur,hauteur);
}
function writeObjImg(){
	document.write ('<div id="fullimage" style="z-index:100;display:none;position:absolute;"></div>');
}
