function maj_select_arrivages(num_dossier)
{
	if (document.getElementById('check_'+num_dossier).checked)
	{
		document.getElementById('tr_'+num_dossier).style.backgroundColor = '#ffffff';
		document.getElementById('check_'+num_dossier).checked = false;
	}
	else
	{
		document.getElementById('tr_'+num_dossier).style.backgroundColor = '#dEe3e8';
		document.getElementById('check_'+num_dossier).checked = true;
	}
}

function envoi_vehicule()
{
	if (document.form_vehic.marque.value != '' && document.form_vehic.modele.value != '' && document.form_vehic.prenom.value != '' && document.form_vehic.nom.value != '' && document.form_vehic.email.value != '' && document.form_vehic.tel.value != '')
	{
	    document.form_vehic.submit();
	}
	else
	{
	    alert('Les champs marqués d\'une étoile sont obligatoires...');
	}
}

function envoi_contact()
{
	if (document.form_contact.nom.value != '')
	{
		if (document.form_contact.email.value != '' || document.form_contact.tel.value != '')
		{
			document.form_contact.submit();
		}
		else
		{
		    alert("Vous devez saisir un e-mail ou un téléphone...");
		}
	}
	else
	{
	    alert("Vous devez saisir un nom...");
	}
}

function connexion_pro()
{
	if (document.formulaire.login.value != '' && document.formulaire.pwd.value != '')
	{
		document.formulaire.submit();
	}
	else
	{
		alert('Tous les éléments sont obligatoires...');
	}
}

function rech_vo()
{
	location.href='vehicules-occasion-34-'+document.recherchervo.marque.value+'-'+document.recherchervo.modele.value+'-'+document.recherchervo.energie.value+'-'+document.recherchervo.kmmax.value+'-'+document.recherchervo.prixmax.value+'-0';
}

function maj_modeles(marque, modele)
{
	document.getElementById('modele').disabled = true;
	if (marque != '')
	{
		document.getElementById('modele').options[0] = new Option("--- Modèle ---", "0");
	    nbr = 1;
		document.getElementById('modele').options.length = nbr;
		for (i=0; i<liste_modeles.length; i++)
		{
		    m = liste_modeles[i].split('|');
			if (m[0] == marque)
			{
				document.getElementById('modele').options[nbr] = new Option(m[1], m[1]);
				nbr++;
			}
		}
		if (nbr > 1)
		{
			document.getElementById('modele').disabled = false;
		}
	}
    document.getElementById('modele').options.selectedIndex = 0;
	if (modele)
	{
	    document.getElementById('modele').value = modele;
	}
}

function menu_on(menu)
{
	document.getElementById(menu).style.backgroundColor = '#60719a';
}

function menu_off(menu)
{
	document.getElementById(menu).style.backgroundColor = '#20315a';
}

/*function maj_modeles(marque)
{
    document.rech.modele.length = 0;
	var o = new Option("--- Modèle ---", '0');
    document.rech.modele.options[0] = o;
	for (i=0; i<mm.length; i++)
	{
	    val = mm[i].split('|');
	    if (val[0] == marque)
	    {
			o = new Option(val[1], val[1]);
            document.rech.modele.options[document.rech.modele.length] = o;
		}
	}
}*/
