function fillCategory(){
// this function is used to fill the category list on load
addOption(document.drop_list.category, "Vehicules de tourisme", "Vehicules de tourisme", "");
addOption(document.drop_list.category, "Vehicules utilitaires", "Vehicules utilitaires", "");

}

function SelectSubCat(){
// ON selection of category this function will work

removeAllOptions(document.drop_list.SubCat);
addOption(document.drop_list.SubCat, "", "Selectionnez une voiture", "");

if(document.drop_list.category.value == 'Vehicules de tourisme'){
addOption(document.drop_list.SubCat,"SMART", "SMART");
addOption(document.drop_list.SubCat,"TWINGO", "TWINGO");
addOption(document.drop_list.SubCat,"CITROEN C2", "CITROEN C2");
addOption(document.drop_list.SubCat,"FORD FIESTA", "FORD FIESTA");
addOption(document.drop_list.SubCat,"RENAULT CLIO", "RENAULT CLIO");
addOption(document.drop_list.SubCat,"SEAT IBIZA", "SEAT IBIZA");
addOption(document.drop_list.SubCat,"SUZUKI SWIFT", "SUZUKI SWIFT");
addOption(document.drop_list.SubCat,"FORD FOCUS2", "FORD FOCUS2");
addOption(document.drop_list.SubCat,"GOLF 5", "GOLF 5");
addOption(document.drop_list.SubCat,"RENAULT MEGANE", "RENAULT MEGANE");
addOption(document.drop_list.SubCat,"FORD C MAX", "FORD C MAX");
addOption(document.drop_list.SubCat,"RENAULT SCENIC", "RENAULT SCENIC");
addOption(document.drop_list.SubCat,"MERCEDES VITO", "MERCEDES VITO");
addOption(document.drop_list.SubCat,"MONOSPACE", "MONOSPACE");

}

if(document.drop_list.category.value == 'Vehicules utilitaires'){
addOption(document.drop_list.SubCat,"KANGOO", "KANGOO");
addOption(document.drop_list.SubCat,"BERLINGO", "BERLINGO");
addOption(document.drop_list.SubCat,"FORD CONNECT", "FORD CONNECT");
addOption(document.drop_list.SubCat,"MERCEDES VITO", "MERCEDES VITO");
addOption(document.drop_list.SubCat,"RENAULT TRAFFI", "RENAULT TRAFFIC");

addOption(document.drop_list.SubCat,"MERCEDES 12M", "MERCEDES 12M");
addOption(document.drop_list.SubCat,"IVECO 12M", "IVECO 12M");
addOption(document.drop_list.SubCat,"MERCEDES 23M", "MERCEDES 23M");
addOption(document.drop_list.SubCat,"IVECO 23M", "IVECO 23M");
addOption(document.drop_list.SubCat,"IVECO BENNE", "IVECO BENNE");
addOption(document.drop_list.SubCat,"RENAULT BENNE", "RENAULT BENNE");

}

}


function removeAllOptions(selectbox)
{
var i;
for(i=selectbox.options.length-1;i>=0;i--)
{
//selectbox.options.remove(i);
selectbox.remove(i);
}
}


function addOption(selectbox, value, text )
{
var optn = document.createElement("OPTION");
optn.text = text;
optn.value = value;

selectbox.options.add(optn);
}


function checkifemptyVEHICULE(){
if (document.drop_list.category.value=='')
document.drop_list.SubCat.disabled=true
else
document.drop_list.SubCat.disabled=false
}
if (document.all || document.getElementById)
setInterval("checkifemptyVEHICULE()",100)




