couleur=2;

function razTarifs(){
    if(document.getElementById('tarif') == null || !document.getElementById('tarif').checked){
        document.getElementById('TarifMin').value = '';
        document.getElementById('TarifMax').value = '';
    }
}

function envoiDonnees(min, max )
{
    document.getElementById('TarifMin').value = min;
    document.getElementById('TarifMax').value = max;
}

function updateFlv()
{
   
    
    var variable = '';
    var variableTmp = '';
    if (listeChamps)
    {
        for (i=0;i<listeChamps.length;i++)
        {
            if (listeChamps[i].indexOf('[]')!= -1) 
                {
                    var tmp = '';
                    if (document.getElementById('formRecherche').elements[listeChamps[i]]){
                    var tab = document.getElementById('formRecherche').elements[listeChamps[i]];
                    for(j=0; j<tab.length; j++)
                    {
                        if (tab[j].checked)
                        {
                            if (tmp != "")
                            {
                                tmp += "|";
                            }
                            tmp += tab[j].value;
                        }
                    }
                    variableTmp += listeChamps[i].split('[')[0]+'='+tmp;
                    }
                }
            else
            {
                if (document.getElementById(listeChamps[i])){
                if (document.getElementById(listeChamps[i]).tagName.toLowerCase() == "input" && document.getElementById(listeChamps[i]).type.toLowerCase() == "checkbox")
                {
                    if (document.getElementById(listeChamps[i]).checked)
                        variableTmp += listeChamps[i]+'='+document.getElementById(listeChamps[i]).value;
                }
                else
                    variableTmp += listeChamps[i]+'='+document.getElementById(listeChamps[i]).value;
                }
            }
            
            if (variableTmp != '')
            {
                variable += '§'+variableTmp;

                variableTmp = '';
            }
        }
    }
    
    if (typeTarif)
    {
        if (variable != '')
        {
            variable += '§';
        }
        variable += typeTarif;
    }
    
    var min = document.getElementById('TarifMin').value;
    var max = document.getElementById('TarifMax').value;

    if (rubrique && lg)
    {
        document.getElementById('divTarif').style.display='';
        if (couleur =='2') 
            document.getElementById('divTarif').innerHTML = insertFlashStr( "/swf/tarif"+couleur+"_"+lg+".swf?lg="+lg+"&mini="+min+"&maxi="+max+"&rub="+rubrique+"&req="+variable, 330, 46, "", "flashSrc");
        else
            document.getElementById('divTarif').innerHTML = insertFlashStr( "/swf/tarif"+couleur+"_"+lg+".swf?lg="+lg+"&mini="+min+"&maxi="+max+"&rub="+rubrique+"&req="+variable, 209, 46, "", "flashSrc");
    }

    if ( document.getElementById('tarif'))
        if (document.getElementById('tarif').checked && document.getElementById('divFlash').style.display == 'none')
        {
            document.getElementById('divFlash').style.display = '';
            setTimeout("envoiDonnees("+min+", "+max+", true)",1000);
        }
}


function insertFlashStr( strSrc, intWidth, intHeight, strAlt, strID )
{
	var strFlash	=  '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0"';
	strFlash		+= 'width="' + intWidth + '" height="' + intHeight + '" title="' + strAlt + '">';
	strFlash		+= '<param name="movie" value="' + strSrc + '" />';
	strFlash		+= '<param name="quality" value="high" />';
	strFlash		+= '<param name="menu" value="false" />';
	strFlash		+= '<param name="wmode" value="transparent" />';
	strFlash		+= '<embed name="'+strID+'" id="'+strID+'" src="' + strSrc + '" width="' + intWidth + '" height="' + intHeight + '" quality="high" wmode="transparent" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" menu="false"></embed>';
	strFlash		+= '</object>';
	return strFlash;
}
