// afficher l'image dans un endroit sur la page
function affiche_image()
{
        image = new Image;
        if (window.document.forms[0].url.value == "")
            image.src = "images/trans.gif";
        else {
            image.src = window.document.forms[0].url.value;
            }
        window.document.zone_image.src=image.src;
}

// fonction pour afficher l'image dans une nouvelle fen�tre.
function lien_image(source,commentaire)
{
    image_affichee = new Image;
    image_affichee.src = source;

    H = image_affichee.height + 120;
    W = image_affichee.width + 30;

    var chaine = commentaire;
    var reg = new RegExp("\n","gi");
    commentaire = chaine.replace(reg,"<br>");

  nouveau = window.open("", "photo", "height=" + (screen.height-50) + ",width=" + 480 + ",screenX=10,screenY=10");
	nouveau.document.write("<html><head><META HTTP-EQUIV=\"imagetoolbar\" CONTENT=\"no\"><style type=\"text/css\">@import url(style.css);</style><title>.:: MILADY ::.</title><body onContextMenu='return false;' onblur='javascript:self.close();' bgcolor='black'>");
	nouveau.document.write("<center><img src=" + image_affichee.src + " width=\"460\"></center>");
	nouveau.document.write("<div class=\"article\" align='center'>"+commentaire+"</center></div>");
	nouveau.document.write("<div class=\"close\" align='right'><a href='javascript:self.close();'>Close</a></div></body></html>");
	nouveau.document.close();
}

function lien_article(source,commentaire)
{
    image_affichee = new Image;
    image_affichee.src = source;

    H = image_affichee.height + 100;
    W = image_affichee.width + 20;

    //var chaine = commentaire;
    var reg = new RegExp("\n","gi");
    commentaire = commentaire.replace(reg,"<br>");

  nouveau = window.open("", "photo", "height=" + (screen.height-50) + ",width=" + 460 + ",screenX=10,screenY=10");
	nouveau.document.write("<html><head><META HTTP-EQUIV=\"imagetoolbar\" CONTENT=\"no\"><style type=\"text/css\">@import url(style.css);</style><title>.:: MILADY ::.</title><body onContextMenu='return false;' onblur='javascript:self.close();' bgcolor='black'>");
	nouveau.document.write("<center><img src=" + image_affichee.src + " width=\"440\"></center>");
	nouveau.document.write("<div class=\"article\" align='center'>"+commentaire+"</center></div>");
	nouveau.document.write("<div class=\"close\" align='right'><a href='javascript:self.close();'>Close</a></div></body></html>");
	nouveau.document.close();
}

//Redimensionnage d'une image img, a la largeur max l et la hauteur max h.
function reDim(img,l,h){
// largeur courante
var largeur
largeur = img.width;
// hauteur courante
var hauteur
hauteur = img.height;

if (largeur > l){
	hauteur = Math.ceil(hauteur*(l/largeur));

	largeur=l;
}
if (hauteur > h){
	largeur= Math.ceil(largeur*(h/hauteur));
	hauteur=h;
}
img.width=largeur;
img.height=hauteur;
}

function bigOver(preimg){
	document.getElementById('img_big').width=preimg.width;
	document.getElementById('img_big').height=preimg.height;
	document.getElementById('img_big').src=preimg.src;
}

