function MM_findObj (n, d) 
{
    var p,i,x;
    if (!d)
        d = document;
    if((p = n.indexOf ("?")) > 0 && parent.frames.length)
    {
        d = parent.frames[n.substring (p+1)].document;
        n = n.substring (0, p);
    }
    if (!(x=d[n])&&d.all)
        x = d.all[n];
    for (i = 0; !x && i < d.forms.length; i++)
        x = d.forms[i][n];
    for (i = 0; !x && d.layers && i < d.layers.length; i++)
        x = MM_findObj (n, d.layers[i].document);
    if (!x && d.getElementById)
        x = d.getElementById(n);
    return x;
}

function MM_setTextOfLayerSpec (objName, x, newText)
{
    if ((obj=MM_findObj(objName))!=null) with (obj)
        if (document.layers)
        {
            document.write(unescape(newText));
            document.close();
        }
        else
        {
            innerHTML = unescape(newText);
        }
}


function MM_setImageOfLayerDest (objName, x, newImage)
{
    var styleelt = document.getElementById ("div"+objName).style;
    if (newImage == "")
    {
        if (typeof (styleelt.background) == "string")
        {
            styleelt.background = "none";
            styleelt.minHeight = "0px";
        }
        else
        {
            styleelt.setAttribute ("background", "none;");
            styleelt.setAttribute ("min-height", "0px;");
        }
    }
    else
    {
        // a titre indicatif : am.gif / ampref.gif (cf LT_lib/tarifs_voip.csv)
        if (typeof (styleelt.background) == "string")
        {
            styleelt.background = "url(img/"+newImage+") no-repeat right 15px";
            styleelt.minHeight = "44px";
        }
        else
        {
            styleelt.setAttribute ("background", "url(img/"+newImage+") no-repeat right 15px;");
            styleelt.setAttribute ("min-height", "44px;");
        }
    }
}




function MM_setTextOfLayerDest (objName, x, newText)
{
    if ((obj=MM_findObj(objName))!=null) with (obj)
        if (document.layers)
        {
            document.write(unescape(newText));
            document.close();
        }
        else
        {
            innerHTML = unescape(newText);
        }
    var styleelt = document.getElementById ("div"+objName).style;
    if (newText == "")
    {
        if (typeof (styleelt.background) == "string")
        {
            styleelt.background = "none";
            styleelt.display = "none";
        }
        else
        {
            styleelt.setAttribute ("background", "none;");
            styleelt.setAttribute ("display", "none;");
        }
    }
    else
    {
        if (typeof (styleelt.background) == "string")
        {
            styleelt.background = "url(img/puce_rouge.gif) no-repeat -3px 4px";
            styleelt.display = "block";
        }
        else
        {
            styleelt.setAttribute ("background", "url(img/puce_rouge.gif) no-repeat -3px 4px;");
            styleelt.setAttribute ("display", "block;");
        }
    }
}

function affichePrixDest ()
{
    if ( document.getElementById ('formulaireTarifs').choixPays.value != "---" )
    {
        MM_setTextOfLayerSpec ('paysDesc', '', tabTarifsInter[document.getElementById ('formulaireTarifs').choixPays.value]);
    }
    else
    {
        MM_setTextOfLayerSpec ('paysDesc', '', '');
    }
}


function affichePrixDestPro ()
{
    if ( document.getElementById ('formulaireTarifs').choixPays.value != "---" )
    {
        MM_setTextOfLayerDest ('prix', '', tabTarifsInter[document.getElementById ('formulaireTarifs').choixPays.value]);
    }
    else
    {
        MM_setTextOfLayerDest ('prix', '', "S&eacute;lectionnez une destination");
    }
}




function affichePrixSpec ()
{
    if (document.getElementById ('formulaireTarifsSpec').choixSpec.value != "---")
    {
        MM_setTextOfLayerSpec ('prixspec', '', '<div>' + tabTarifsSpec[document.getElementById ('formulaireTarifsSpec').choixSpec.value] + '</div>');
    }
    else
    {
        MM_setTextOfLayerSpec ('prixspec', '', '');
    }
}

