/************************************************************************************************************
(C) www.dhtmlgoodies.com, October 2005

This is a script from www.dhtmlgoodies.com. You will find this and a lot of other scripts at our website.	

Terms of use:
You are free to use this script as long as the copyright message is kept intact. However, you may not
redistribute, sell or repost it without our permission.

Thank you!

www.dhtmlgoodies.com
Alf Magne Kalleland

************************************************************************************************************/	
function GetXmlHttpObject(){
var xmlHttp=null;
try {
  // Firefox, Opera 8.0+, Safari
  xmlHttp=new XMLHttpRequest();
  }
catch (e){
  // Internet Explorer
  try {xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");}
  catch (e){xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");}
  }
return xmlHttp;
}
var ajax = new sack();


function listing(sel){
var cCode = sel.options[sel.selectedIndex].value;
//alert(cCode);
document.getElementById('listing_concours').options.length = 0;	// Vidange de la liste des concours

xmlHttpCat=GetXmlHttpObject();
if (xmlHttpCat==null){
  alert ("Votre navigateur ne supporte pas la technologie AJAX!");
  return;} 
var urlCat="affepreuves.asp";
urlCat=urlCat+"?cCode="+cCode;
urlCat=urlCat+"&sid="+Math.random();
xmlHttpCat.onreadystatechange=stateChangedCat;
xmlHttpCat.open("GET",urlCat,true);
xmlHttpCat.send(null);
}

function stateChangedCat(){ 
	if (xmlHttpCat.readyState==4){
	//alert(xmlHttpCat.responseText);
	var obj = document.getElementById('listing_concours');
	eval(xmlHttpCat.responseText);	// Executing the response from Ajax as Javascript code	
	}
}



/*function listing(sel)
{
	var cCode = sel.options[sel.selectedIndex].value;
	document.getElementById('listing_concours').options.length = 0;	// Vidange de la liste des concours
	if(cCode.length>0){
		ajax.requestFile = 'affepreuves.asp?cCode'+cCode;	// Specifying which file to get
		ajax.onCompletion = creation_concours();	// Specify function that will be executed after file has been found
		ajax.runAJAX();		// Execute AJAX function
	}
}

function creation_concours(){
	alert(ajax.response);
	var obj = document.getElementById('listing_concours');
	eval(ajax.response);	// Executing the response from Ajax as Javascript code	
alert("Terminé");
}
*/
function liste_concours(sel)
{
	var cCode = sel.options[sel.selectedIndex].value;
	document.getElementById('concours_voie').options.length = 0;	// Empty city select box
	if(cCode.length>0){
		ajax.requestFile = 'affConcours.asp?cCode='+cCode;	// Specifying which file to get
		ajax.onCompletion = creation_voies;	// Specify function that will be executed after file has been found
		ajax.runAJAX();		// Execute AJAX function
	}
}

function creation_voies()
{
	var obj = document.getElementById('concours_voie');
	eval(ajax.response);	// Executing the response from Ajax as Javascript code	
}

function liste_concours1(sel)
{
	var cCode = sel.options[sel.selectedIndex].value;
	document.getElementById('concours_voie1').options.length = 0;	// Empty city select box
	if(cCode.length>0){
		ajax.requestFile = 'affConcours.asp?cCode='+cCode;	// Specifying which file to get
		ajax.onCompletion = creation_voies1;	// Specify function that will be executed after file has been found
		ajax.runAJAX();		// Execute AJAX function
	}
}

function creation_voies1()
{
	var obj = document.getElementById('concours_voie1');
	eval(ajax.response);	// Executing the response from Ajax as Javascript code	
}

function liste_concours2(sel)
{
	var cCode = sel.options[sel.selectedIndex].value;
	document.getElementById('concours_voie2').options.length = 0;	// Empty city select box
	if(cCode.length>0){
		ajax.requestFile = 'affConcours.asp?cCode='+cCode;	// Specifying which file to get
		ajax.onCompletion = creation_voies2;	// Specify function that will be executed after file has been found
		ajax.runAJAX();		// Execute AJAX function
	}
}

function creation_voies2()
{
	var obj = document.getElementById('concours_voie2');
	eval(ajax.response);	// Executing the response from Ajax as Javascript code	
}

function liste_concours3(sel)
{
	var cCode = sel.options[sel.selectedIndex].value;
	document.getElementById('concours_voie3').options.length = 0;	// Empty city select box
	if(cCode.length>0){
		ajax.requestFile = 'affConcours.asp?cCode='+cCode;	// Specifying which file to get
		ajax.onCompletion = creation_voies3;	// Specify function that will be executed after file has been found
		ajax.runAJAX();		// Execute AJAX function
	}
}

function creation_voies3()
{
	var obj = document.getElementById('concours_voie3');
	eval(ajax.response);	// Executing the response from Ajax as Javascript code	
}

function liste_concours4(sel)
{
	var cCode = sel.options[sel.selectedIndex].value;
	document.getElementById('concours_voie4').options.length = 0;	// Empty city select box
	if(cCode.length>0){
		ajax.requestFile = 'affConcours.asp?cCode='+cCode;	// Specifying which file to get
		ajax.onCompletion = creation_voies4;	// Specify function that will be executed after file has been found
		ajax.runAJAX();		// Execute AJAX function
	}
}

function creation_voies4()
{
	var obj = document.getElementById('concours_voie4');
	eval(ajax.response);	// Executing the response from Ajax as Javascript code	
}

function liste_concours5(sel)
{
	var cCode = sel.options[sel.selectedIndex].value;
	document.getElementById('concours_voie5').options.length = 0;	// Empty city select box
	if(cCode.length>0){
		ajax.requestFile = 'affConcours.asp?cCode='+cCode;	// Specifying which file to get
		ajax.onCompletion = creation_voies5;	// Specify function that will be executed after file has been found
		ajax.runAJAX();		// Execute AJAX function
	}
}

function creation_voies5()
{
	var obj = document.getElementById('concours_voie5');
	eval(ajax.response);	// Executing the response from Ajax as Javascript code	
}

function liste_concours6(sel)
{
	var cCode = sel.options[sel.selectedIndex].value;
	document.getElementById('concours_voie6').options.length = 0;	// Empty city select box
	if(cCode.length>0){
		ajax.requestFile = 'affConcours.asp?cCode='+cCode;	// Specifying which file to get
		ajax.onCompletion = creation_voies6;	// Specify function that will be executed after file has been found
		ajax.runAJAX();		// Execute AJAX function
	}
}

function creation_voies6()
{
	var obj = document.getElementById('concours_voie6');
	eval(ajax.response);	// Executing the response from Ajax as Javascript code	
}

function maj_auteurs(sel)
{
	var cCode = sel.options[sel.selectedIndex].value;
	document.getElementById('nom_auteur').options.length = 0;	// Empty city select box
	if(cCode.length>0){
		ajax.requestFile = 'affAuteurs.asp';	// Specifying which file to get
		ajax.onCompletion = creation_auteurs;	// Specify function that will be executed after file has been found
		ajax.runAJAX();		// Execute AJAX function
	}
}

function creation_auteurs()
{
	var obj = document.getElementById('nom_auteur');
	eval(ajax.response);	// Executing the response from Ajax as Javascript code	
}

