function f_wysiwyg (table, field, type)
{
	iWidth  = 700;
	iHeight = 400;
	iPosX   = (screen.width / 2) - (iWidth / 2);
	iPosY   = (screen.height / 2) - (iHeight / 2);
	szUrl   = "wysiwyg.php?table="+table+"&field="+field+"&type="+type;
	window.open (szUrl , "MiseAjour", " scrollbars=yes , location=no , menubar=no , resizable=no , toolbar=no , width=" + iWidth + ", height=" + iHeight + " , top = " + iPosY + " , left = " + iPosX);
}

function validForm () 
{
	document.getElementById ("formWysiwyg").submit();

}

function changeImageSrc (idImage,idVideo, nameChange, largeur, hauteur)
{
 document.images[idImage].style.display = "inline";
 document.getElementById (idVideo).style.display = "none";
 newImg = new Image();
 newImg.src=nameChange;
 document.images[idImage].src=newImg.src;
 document.images[idImage].width=largeur;
 document.images[idImage].height=hauteur;
}

function showMenu (div)
{
document.getElementById('presentation').style.display="none";
document.getElementById('elevage').style.display="none";
document.getElementById('autres').style.display="none";
document.getElementById(div).style.display="block";
}


function hideMenu ()
{

if (document.getElementById('presentation')!= null) document.getElementById('presentation').style.display="none";
if (document.getElementById('elevage')!= null) document.getElementById('elevage').style.display="none";
if (document.getElementById('autres')!= null) document.getElementById('autres').style.display="none";
}

function chargeVideo (field, idVdo, idImg)
{
        document.getElementById (idVdo).style.display = "block";
        document.getElementById (idImg).style.display = "none";
}

function effaceImage (table, champ)
{

var  httpReq         = false;
var  iTimeoutHttpReq = 250;
try
    {
    httpReq = new ActiveXObject ("Microsoft.XMLHTTP");
    }
catch (e)
    {
    try
        {
        httpReq = new XMLHttpRequest ();
        }
    catch (e)
        {
        return;
        }
    }

try
    {
    var url  = "effaceImage.php?table="+table+"&champ="+champ;

    httpReq.open ("GET", url, false);
    httpReq.send (null);

    if (httpReq.status == 200)
        {
        var  fiche  = httpReq.responseText;
        document.location.reload ();
        }
    }

catch (e)
    {
    }

}
