function DoListInit()
{
MajJour();
//MajHeure();
MajChaine();
//affiche le premier niveau des genres
populate(category,0);
}

function MajHeure()
{
var Mydate;
var heure = 0;
var i = 0;
var Lib ='';
MyDate = new Date();

heure = MyDate.getHours();

for ( i = 0; i < 24 ; i++)
	{
	
	Nboptions = document.Infos.f_heure.length ;
	
	if (((i+heure)%24) < 10)
		Lib = '0';
	Lib = Lib + String(((i+heure)%24))+ ' h 00';
	SQLValue = ((i+heure)%24);
	
	document.Infos.f_heure.options[Nboptions] = new Option( Lib, SQLValue, false, false);
	Lib = '';
	}
}

function MajChaine()
{
var i = 0;
var Nboptions = 0;

	TelecommandeGetInfo() ;
	for ( i = 0; i < ArChaine.length ; i++)
	{
		Nboptions = document.Infos.f_chaine.length ;
		
		document.Infos.f_chaine.options[Nboptions] = new Option( ArChaine[i]['Nom'], ArChaine[i]['Id_Chaine'], false, false);
	}
	
}


/****
fonction pour gestion genre sur deux niveaux dans une combo
********/
function populate(x,idx){
for (m=cacheobj.options.length-1;m>0;m--)
cacheobj.options[m]=null
selectedarray=eval(x)
for (i=0;i<selectedarray.length;i++)
cacheobj.options[i]=new Option(selectedarray[i].text,selectedarray[i].value)
if (idx < 0)
	cacheobj.options[Math.abs(idx)+1].selected=true
else
	cacheobj.options[0].selected=true

}

function displaysub(){
buffer = cacheobj.options[cacheobj.selectedIndex].value ;
if ( buffer != 0 && buffer != '' && buffer != '--' ) 
{
	if (curlevel==1){
	populate(cacheobj.options[cacheobj.selectedIndex].value, 0)
	curlevel=2
	}
	else
	gothere()
}
}


function gothere(){
	tab = cacheobj.options[cacheobj.selectedIndex].value.split(":");
	if (tab[0] < 0)
		populate(tab[1],0)
}





