function setCategory(chooser) {
var categoryChooser = chooser.form.elements["category"];
var catdb=new Object();catdb['1'] = [{value:'1', text:'FTP'},
{value:'2', text:'Jeux'},
{value:'3', text:'Disques'},
{value:'4', text:'X11 / xorg'},
{value:'5', text:'Firefox'},
{value:'9', text:'Messagerie'},
{value:'11', text:'Video'},
{value:'15', text:'Système'},
{value:'17', text:'Securité'},
{value:'21', text:'Son'},
{value:'31', text:'OLPC'},
{value:'32', text:'Réseaux'},
{value:'33', text:'Développement'},
];
catdb['2'] = [{value:'6', text:'Apache'},
{value:'7', text:'MySQL'},
{value:'8', text:'FTP'},
{value:'20', text:'Mail'},
{value:'25', text:'SQL Server'},
{value:'30', text:'Subversion'},
{value:'34', text:'Oracle'},
];
catdb['3'] = [{value:'10', text:'RAM'},
{value:'14', text:'USB'},
];
catdb['11'] = [{value:'38', text:'Database'},
{value:'37', text:'Threads'},
{value:'36', text:'PyGTK'},
];
catdb['5'] = [{value:'35', text:'jQuery'},
];
catdb['6'] = [{value:'16', text:'Qt'},
];
catdb['7'] = [{value:'18', text:'Cookies'},
{value:'27', text:'Sécurité'},
{value:'39', text:'Symfony'},
];
catdb['8'] = [{value:'19', text:'Gimp'},
];
catdb['9'] = [{value:'22', text:'ASP.NET'},
{value:'23', text:'C#'},
{value:'24', text:'Mono'},
];
// empty previous settings
categoryChooser.options.length = 0;
// get chosen value to act as index to regiondb hash table
var choice = chooser.options[chooser.selectedIndex].value;
var db = catdb[choice];
// insert default first item
categoryChooser.options[0] = new Option("Choose a Category:", "", true, false);
if (choice != "") {
// loop through array of the hash table entry, and populate options
for (var i = 0; i < db.length; i++) {
categoryChooser.options[i + 1] = new Option(db[i].text, db[i].value);
}
}
}
function getHTTPObject()
{
var xmlhttp = false;
/* Compilation conditionnelle dIE */
/*@cc_on
@if (@_jscript_version >= 5)
try
{
xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
}
catch (e)
{
try
{
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
}
catch (E)
{
xmlhttp = false;
}
}
@else
xmlhttp = false;
@end @*/
/* on essaie de créer l'objet si ce n'est pas déjà fait */
if (!xmlhttp && typeof XMLHttpRequest != 'undefined')
{
try
{
xmlhttp = new XMLHttpRequest();
}
catch (e)
{
xmlhttp = false;
}
}
if (xmlhttp)
{
/* on définit ce qui doit se passer quand la page répondra */
xmlhttp.onreadystatechange=function()
{
if (xmlhttp.readyState == 4) /* 4 : état "complete" */
{
if (xmlhttp.status == 200) /* 200 : code HTTP pour OK */
{
/*
Traitement de la réponse.
Ici on affiche la réponse dans une boîte de dialogue.
*/
document.write(xmlhttp.responseText);
}
}
}
}
return xmlhttp;
}
function menuHighlight(action){
menuAction = document.getElementById(action);
menuAction.src = "img/menu/"+action+"-hl.png";
}
function menuNormal(action){
menuAction = document.getElementById(action);
menuAction.src = "img/menu/"+action+".png";
}