﻿function OutGif(imgSrc) {
    document.images[imgSrc].src = "images/" + imgSrc + ".gif";
}

function OverGif(imgSrc) {
    document.images[imgSrc].src = "images/" + imgSrc + "_ov.gif";
}

function OutJpg(imgSrc) {
    document.images[imgSrc].src = "images/" + imgSrc + ".jpg";
}

function OverJpg(imgSrc) {
    document.images[imgSrc].src = "images/" + imgSrc + "_ov.jpg";
}

function popup(theURL, winName, features) {
    window.open(theURL, winName, features);
}

function popUpVideo(id, w, h, type, videoPage) {
    var baseURLPsn = videoPage;
    var iMyWidth; var iMyHeight;
    var maxWindowWidth = '800'; var maxWindowHeight = '500';

    // Dimension de la fenêtre
    if (w == "" || w == null || w > maxWindowWidth) { w = maxWindowWidth; }
    if (h == "" || h == null || h > maxWindowHeight) { h = maxWindowHeight; }

    // Déterminer la position de la fenêtre pour la centrer dans l'écran.
    iMyWidth = (window.screen.width - w) / 2;
    iMyHeight = (window.screen.height - h) / 2;

    var startURL = baseURLPsn + "?id=" + id + "&type=" + type;

    //> Génération du popup avec paramètre
    if (startURL != '' || startURL != null) {
        var winVideo = window.open(startURL, "InfoNaturel", "width=" + w + ",height=" + h + ",left=" + iMyWidth + ",top=" + iMyHeight + ",screenX=" + iMyWidth + ",screenY=" + iMyHeight + ",toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no");
	if (winVideo != null)
	        winVideo.focus();
    }
}
