var xmlhttp;
var t;
var d;
// *******************************************************************
// Fenêtre de confirmation pour les delete dans les différentes bases

// *******************************************************************
// Fenêtre de confirmation de suppression pour les documents
function confirm_insc(id) {
	xmlhttp=GetXmlHttpObject();

if (xmlhttp==null)
  {
  alert ("Browser does not support HTTP Request");
  return;
  }

	if(confirm("Vouler vous vraiment supprimer cette inscription ?" )==true)
	{ 
	var url="del_inscr.php";
url=url+"?id_inscr="+id;
url=url+"&sid="+Math.random();
xmlhttp.open("GET",url,false);
xmlhttp.send(null);
		}
	window.location="http://www.fssc.ch/admin/maj_inscr_concours.php";
	window.location.reload();
 }

function confirm_docu(id) {
	xmlhttp=GetXmlHttpObject();

if (xmlhttp==null)
  {
  alert ("Browser does not support HTTP Request");
  return;
  }

	if(confirm("Vouler vous vraiment supprimer ce document ? Il n'apparaitra plus, mais restera present dans le systeme" )==true)
	{ 
	var url="del_docu.php";
url=url+"?id_docu="+id;
url=url+"&sid="+Math.random();
xmlhttp.open("GET",url,false);
xmlhttp.send(null);
		}
	window.location="http://www.fssc.ch/admin/maj_documents.php";
	window.location.reload();
 }

function confirm_galerie(id) {
	xmlhttp=GetXmlHttpObject();

if (xmlhttp==null)
  {
  alert ("Browser does not support HTTP Request");
  return;
  }

	if(confirm("Vouler vous vraiment supprimer cette galerie ?" )==true)
	{ 
	var url="del_galerie.php";
url=url+"?id_galerie="+id;
url=url+"&sid="+Math.random();
xmlhttp.open("GET",url,false);
xmlhttp.send(null);
		}
	window.location="http://www.fssc.ch/admin/maj_galeries.php";
	window.location.reload();
 } 
 
function confirm_joueur(id) {
	xmlhttp=GetXmlHttpObject();

if (xmlhttp==null)
  {
  alert ("Browser does not support HTTP Request");
  return;
  }

	if(confirm("Vouler vous vraiment supprimer ce joueur ?" )==true)
	{ 
	var url="del_joueur.php";
url=url+"?id_joueur="+id;
url=url+"&sid="+Math.random();
xmlhttp.open("GET",url,false);
xmlhttp.send(null);
		}
	window.location="http://www.fssc.ch/admin/maj_joueurs.php";
	window.location.reload();
 }
function confirm_info(id) {
	xmlhttp=GetXmlHttpObject();

if (xmlhttp==null)
  {
  alert ("Browser does not support HTTP Request");
  return;
  }

	if(confirm("Vouler vous vraiment supprimer cette info ?" )==true)
	{ 
	var url="del_info.php";
url=url+"?id_info="+id;
url=url+"&sid="+Math.random();
xmlhttp.open("GET",url,false);
xmlhttp.send(null);
		}
	window.location="http://www.fssc.ch/admin/maj_infos.php";
	window.location.reload();
 }

function confirm_article(id) {
	xmlhttp=GetXmlHttpObject();

if (xmlhttp==null)
  {
  alert ("Browser does not support HTTP Request");
  return;
  }

	if(confirm("Vouler vous vraiment supprimer cet article ?" )==true)
	{ 
	var url="del_article.php";
url=url+"?id_article="+id;
url=url+"&sid="+Math.random();
xmlhttp.open("GET",url,false);
xmlhttp.send(null);
		}
	window.location="http://www.fssc.ch/admin/maj_articles.php";
	window.location.reload();
 }

function confirm_actualite(id) {
	xmlhttp=GetXmlHttpObject();

if (xmlhttp==null)
  {
  alert ("Browser does not support HTTP Request");
  return;
  }

	if(confirm("Vouler vous vraiment supprimer cette actualite ?" )==true)
	{ 
	var url="del_actu.php";
url=url+"?id_actu="+id;
url=url+"&sid="+Math.random();
xmlhttp.open("GET",url,false);
xmlhttp.send(null);
		}
	window.location="http://www.fssc.ch/admin/maj_actualites.php";
	window.location.reload();
 }


function confirm_media(id) {
	xmlhttp=GetXmlHttpObject();

if (xmlhttp==null)
  {
  alert ("Browser does not support HTTP Request");
  return;
  }

	if(confirm("Vouler vous vraiment supprimer cette info media ?" )==true)
	{ 
	var url="del_media.php";
url=url+"?id_media="+id;
url=url+"&sid="+Math.random();
xmlhttp.open("GET",url,false);
xmlhttp.send(null);
		}
	window.location="http://www.fssc.ch/admin/maj_medias.php";
	window.location.reload();
 }



function confirm_arbitrage(ida) {
	xmlhttp=GetXmlHttpObject();

if (xmlhttp==null)
  {
  alert ("Browser does not support HTTP Request");
  return;
  }

	if(confirm("Vouler vous vraiment supprimer cet arbitrage ?" )==true)
	{ 
	var url="del_arbitrage.php";
url=url+"?id_arbitrage="+ida;
url=url+"&sid="+Math.random();
xmlhttp.open("GET",url,false);
xmlhttp.send(null);
		}
	window.location="http://www.fssc.ch/admin/maj_arbitrages.php";
	window.location.reload();
 } 

function confirm_club(id) {
	xmlhttp=GetXmlHttpObject();

if (xmlhttp==null)
  {
  alert ("Browser does not support HTTP Request");
  return;
  }

	if(confirm("Vouler vous vraiment supprimer ce club ?" )==true)
	{ 
	var url="del_club.php";
url=url+"?id_club="+id;
url=url+"&sid="+Math.random();
xmlhttp.open("GET",url,false);
xmlhttp.send(null);
		}
	window.location="maj_clubs.php";
	window.location.reload();
 }

function confirm_tournoi(id) {
	xmlhttp=GetXmlHttpObject();

if (xmlhttp==null)
  {
  alert ("Browser does not support HTTP Request");
  return;
  }

	if(confirm("Vouler vous vraiment supprimer ce tournoi ?" )==true)
	{ 
	var url="del_tournoi.php";
url=url+"?id_tournoi="+id;
url=url+"&sid="+Math.random();
xmlhttp.open("GET",url,false);
xmlhttp.send(null);
		}
	window.location="maj_tournois.php";
	window.location.reload();
 }
 
 function confirm_annonce(id) {
	xmlhttp=GetXmlHttpObject();

if (xmlhttp==null)
  {
  alert ("Browser does not support HTTP Request");
  return;
  }

	if(confirm("Vouler vous vraiment supprimer cette annonce ?" )==true)
	{ 
	var url="del_annonce.php";
url=url+"?id_annonce="+id;
url=url+"&sid="+Math.random();
xmlhttp.open("GET",url,false);
xmlhttp.send(null);
		}
	window.location="gest_annonces.php";
	window.location.reload();
 }

// Fin des fenêtres de confirmation des delete
function showClub(str)
{
xmlhttp=GetXmlHttpObject();

if (xmlhttp==null)
  {
  alert ("Browser does not support HTTP Request");
  return;
  }
  
var url="../procedures/getClub.php";
url=url+"?id_club="+str;
url=url+"&sid="+Math.random();
xmlhttp.open("GET",url,true);
xmlhttp.onreadystatechange=stateChangedClu;
xmlhttp.send(null);

}

function showClubSj(str)
{
xmlhttp=GetXmlHttpObject();

if (xmlhttp==null)
  {
  alert ("Browser does not support HTTP Request");
  return;
  }
var url="../procedures/getClubSj.php";
url=url+"?id_club="+str;
url=url+"&sid="+Math.random();
xmlhttp.open("GET",url,true);
xmlhttp.onreadystatechange=stateChangedCluSj;
xmlhttp.send(null);

}

function showClubScolaire(str)
{
xmlhttp=GetXmlHttpObject();

if (xmlhttp==null)
  {
  alert ("Browser does not support HTTP Request");
  return;
  }
  
var url="../procedures/getClubScolaire.php";
url=url+"?id_club="+str;
url=url+"&sid="+Math.random();
xmlhttp.open("GET",url,true);
xmlhttp.onreadystatechange=stateChangedClu;
xmlhttp.send(null);

}

function stateChangedClu()
{
if (xmlhttp.readyState==4)
{
	if ((xmlhttp.status == 200)||(xmlhttp.status == 0)) {
document.getElementById("show_club").innerHTML=xmlhttp.responseText;
}}
}

function stateChangedCluSj()
{

if (xmlhttp.readyState==4)
{
	if ((xmlhttp.status == 200)||(xmlhttp.status == 0)) {
document.getElementById("show_club").innerHTML=xmlhttp.responseText;
}}
}

function resultSearchJoueur(str)
{
xmlhttp=GetXmlHttpObject();

if (xmlhttp==null)
  {
  alert ("Browser does not support HTTP Request");
  return;
  }
  
var url="afficheSearchJoueur.php";
url=url+"?Joueur="+str;
url=url+"&sid="+Math.random();
xmlhttp.open("GET",url,true);
xmlhttp.onreadystatechange=stateChangedSearchJoueur;
xmlhttp.send(null);
}

function stateChangedSearchJoueur()
{
if (xmlhttp.readyState==4)
{
if ((xmlhttp.status == 200)||(xmlhttp.status == 0)) {
var resultats;
	resultats=xmlhttp.responseText;
document.getElementById("main_result").innerHTML=resultats;

// document.getElementById("top_resultats").innerHTML='Rang&points/manche | total des points | Rang tournoi';
}}
}

function searchJoueur(str)
{
xmlhttp=GetXmlHttpObject();

if (xmlhttp==null)
  {
  alert ("Browser does not support HTTP Request");
  return;
  }
  
var url="searchJoueur.php";
url=url+"?ceJoueur="+str;
url=url+"&sid="+Math.random();
xmlhttp.open("GET",url,true);
xmlhttp.onreadystatechange=stateChangedJoueur;
xmlhttp.send(null);

}
function showJoueur(str)
{
xmlhttp=GetXmlHttpObject();

if (xmlhttp==null)
  {
  alert ("Browser does not support HTTP Request");
  return;
  }
  
var url="../procedures/getjoueur.php";
url=url+"?ceJoueur="+str;
url=url+"&sid="+Math.random();
xmlhttp.open("GET",url,true);
xmlhttp.onreadystatechange=stateChangedJoueur;
xmlhttp.send(null);

}

function stateChangedJoueur()
{
if (xmlhttp.readyState==4)
{
	if ((xmlhttp.status == 200)||(xmlhttp.status == 0)) {
document.getElementById("suggestion").innerHTML=xmlhttp.responseText;
}}
}

function showJoueurCla(str)
{
xmlhttp=GetXmlHttpObject();

if (xmlhttp==null)
  {
  alert ("Browser does not support HTTP Request");
  return;
  }
  
var url="../procedures/getjoueurcla.php";
url=url+"?ceJoueur="+str;
url=url+"&sid="+Math.random();
xmlhttp.open("GET",url,true);
xmlhttp.onreadystatechange=stateChangedJoueur;
xmlhttp.send(null);

}

function findJoueurCla(str)
{
xmlhttp=GetXmlHttpObject();

if (xmlhttp==null)
  {
  alert ("Browser does not support HTTP Request");
  return;
  }
  
var url="../procedures/findjoueurcla.php";
url=url+"?ceJoueur="+str;
url=url+"&sid="+Math.random();
xmlhttp.open("GET",url,true);
xmlhttp.onreadystatechange=stateChangedInfoJoueur;
xmlhttp.send(null);

}

function show_actu()
{
xmlhttp=GetXmlHttpObject();

if (xmlhttp==null)
  {
  alert ("Browser does not support HTTP Request");
  return;
  }
  
var url="../procedures/showActu.php";
xmlhttp.open("GET",url,true);
xmlhttp.onreadystatechange=stateChangedActu;
xmlhttp.send(null);

}

function show_infosclubs()
{
xmlhttp=GetXmlHttpObject();

if (xmlhttp==null)
  {
  alert ("Browser does not support HTTP Request");
  return;
  }
  
var url="../procedures/showInfosclubs.php";
xmlhttp.open("GET",url,true);
xmlhttp.onreadystatechange=stateChangedActu;
xmlhttp.send(null);

}

function afficheClassCH()
{
xmlhttp=GetXmlHttpObject();

if (xmlhttp==null)
  {
  alert ("Browser does not support HTTP Request");
  return;
  }
  
var url="../procedures/afficheClassCH.php";
xmlhttp.open("GET",url,true);
xmlhttp.onreadystatechange=stateChanged;
xmlhttp.send(null);

}

function afficheClassCHOld()
{
xmlhttp=GetXmlHttpObject();

if (xmlhttp==null)
  {
  alert ("Browser does not support HTTP Request");
  return;
  }
  
var url="../procedures/afficheClassCHold.php";
xmlhttp.open("GET",url,true);
xmlhttp.onreadystatechange=stateChanged;
xmlhttp.send(null);

}

function afficheClassInt()
{
xmlhttp=GetXmlHttpObject();

if (xmlhttp==null)
  {
  alert ("Browser does not support HTTP Request");
  return;
  }
  
var url="../procedures/afficheClassInt.php";
xmlhttp.open("GET",url,true);
xmlhttp.onreadystatechange=stateChanged;
xmlhttp.send(null);

}

function findclassJoueur(str)
{
xmlhttp=GetXmlHttpObject();

if (xmlhttp==null)
  {
  alert ("Browser does not support HTTP Request");
  return;
  }
  
var url="../procedures/afficheClassCHJoueur.php";
url=url+"?licence="+str;
url=url+"&sid="+Math.random();
xmlhttp.open("GET",url,true);
xmlhttp.onreadystatechange=stateChangedClassCHJoueur;
xmlhttp.send(null);

}

function show_scrabblomess()
{
xmlhttp=GetXmlHttpObject();

if (xmlhttp==null)
  {
  alert ("Browser does not support HTTP Request");
  return;
  }
  
var url="../procedures/showScrabblomess.php";
xmlhttp.open("GET",url,true);
xmlhttp.onreadystatechange=stateChangedActu;
xmlhttp.send(null);

}

function infoJoueur(str)
{
xmlhttp=GetXmlHttpObject();

if (xmlhttp==null)
  {
  alert ("Browser does not support HTTP Request");
  return;
  }
  
var url="getinfojoueur.php";
url=url+"?ceJoueur="+str;
url=url+"&sid="+Math.random();
xmlhttp.open("GET",url,true);
xmlhttp.onreadystatechange=stateChangedInfoJoueur;
xmlhttp.send(null);

}

function stateChangedInfoJoueur()
{
if (xmlhttp.readyState==4)
{
	if ((xmlhttp.status == 200)||(xmlhttp.status == 0)) {
document.getElementById("suggestion").innerHTML=xmlhttp.responseText;
}}
}

function stateChangedActu()
{
if (xmlhttp.readyState==4)
{
	if ((xmlhttp.status == 200)||(xmlhttp.status == 0)) {
document.getElementById("main_actu").innerHTML=xmlhttp.responseText;
}}
}


function resultJoueur(str)
{
xmlhttp=GetXmlHttpObject();

if (xmlhttp==null)
  {
  alert ("Browser does not support HTTP Request");
  return;
  }
  
var url="../procedures/afficheResultJoueur.php";
url=url+"?Joueur="+str;
url=url+"&sid="+Math.random();
xmlhttp.open("GET",url,true);
xmlhttp.onreadystatechange=stateChangedResultJoueur;
xmlhttp.send(null);
}

function classJoueur(lic,nom,serie)
{
xmlhttp=GetXmlHttpObject();

if (xmlhttp==null)
  {
  alert ("Browser does not support HTTP Request");
  return;
  }
var url="../procedures/afficheClassJoueur.php";
url=url+"?ref_licence="+lic+"&nom="+nom+"&serie="+serie;
url=url+"&sid="+Math.random();
xmlhttp.open("GET",url,true);
xmlhttp.onreadystatechange=stateChangedResultJoueur;
xmlhttp.send(null);
}

function classJoueurOld(lic,nom,serie)
{
xmlhttp=GetXmlHttpObject();

if (xmlhttp==null)
  {
  alert ("Browser does not support HTTP Request");
  return;
  }
var url="../procedures/afficheClassJoueurOld.php";
url=url+"?ref_licence="+lic+"&nom="+nom+"&serie="+serie;
url=url+"&sid="+Math.random();
xmlhttp.open("GET",url,true);
xmlhttp.onreadystatechange=stateChangedResultJoueur;
xmlhttp.send(null);
}

function resultJoueurR(str)
{
xmlhttp=GetXmlHttpObject();

if (xmlhttp==null)
  {
  alert ("Browser does not support HTTP Request");
  return;
  }
  
var url="../procedures/afficheResultJoueurR.php";
url=url+"?Joueur="+str;
url=url+"&sid="+Math.random();
xmlhttp.open("GET",url,true);
xmlhttp.onreadystatechange=stateChangedResultJoueur;
xmlhttp.send(null);
}

function stateChangedResultJoueur()
{
if (xmlhttp.readyState==4)
{
if ((xmlhttp.status == 200)||(xmlhttp.status == 0)) {
var resultats;
	resultats=xmlhttp.responseText;
document.getElementById("resultats").innerHTML=resultats;
document.getElementById('suggestion').innerHTML='';

// document.getElementById("top_resultats").innerHTML='Rang&points/manche | total des points | Rang tournoi';
}}
}

function infosJoueur(str)
{
xmlhttp=GetXmlHttpObject();

if (xmlhttp==null)
  {
  alert ("Browser does not support HTTP Request");
  return;
  }
  
var url="../procedures/afficheInfosJoueur.php";
url=url+"?Joueur="+str;
url=url+"&sid="+Math.random();
xmlhttp.open("GET",url,true);
xmlhttp.onreadystatechange=stateChangedInfosJoueur;
xmlhttp.send(null);
}

function stateChangedClassCHJoueur()
{
if (xmlhttp.readyState==4)
{
if ((xmlhttp.status == 200)||(xmlhttp.status == 0)) {
var resultats;
	resultats=xmlhttp.responseText;
document.getElementById("resultats").innerHTML=resultats;
document.getElementById('suggestion').innerHTML='';
}}
}

function stateChangedInfosJoueur()
{
if (xmlhttp.readyState==4)
{
if ((xmlhttp.status == 200)||(xmlhttp.status == 0)) {
var resultats;
	resultats=xmlhttp.responseText;
document.getElementById("tournoi_result").innerHTML=resultats;
document.getElementById('suggestion').innerHTML='';

// document.getElementById("top_resultats").innerHTML='Rang&points/manche | total des points | Rang tournoi';
}}
}

function selGalerie(galerie)
{
xmlhttp=GetXmlHttpObject();

if (xmlhttp==null)
  {
  alert ("Browser does not support HTTP Request");
  return;
  }
  
var url="../procedures/getResultGalerie.php";
url=url+"?id_galerie="+galerie;
url=url+"&sid="+Math.random();
xmlhttp.open("GET",url,true);
xmlhttp.onreadystatechange=stateChangedGalerie;
xmlhttp.send(null);
}

function selClub(tournoi)
{
xmlhttp=GetXmlHttpObject();

if (xmlhttp==null)
  {
  alert ("Browser does not support HTTP Request");
  return;
  }
  
var url="../procedures/getResultTournoi.php";
url=url+"?selTournoi="+tournoi;
url=url+"&sid="+Math.random();
t = tournoi;
xmlhttp.open("GET",url,true);
xmlhttp.onreadystatechange=stateChangedClub;
xmlhttp.send(null);
}

function extrResultsTournoi(tournoi)
{
xmlhttp=GetXmlHttpObject();

if (xmlhttp==null)
  {
  alert ("Browser does not support HTTP Request");
  return;
  }
  
var url="../procedures/extrResultsTournoi.php";
url=url+"?selTournoi="+tournoi;
url=url+"&sid="+Math.random();
t = tournoi;
xmlhttp.open("GET",url,true);
/*xmlhttp.onreadystatechange=stateChangedClub;
*/xmlhttp.send(null);
}

function resultTournoi(tournoi,club)
{
xmlhttp2=GetXmlHttpObject();
if (xmlhttp2==null)
  {
  alert ("Browser does not support HTTP Request");
  return;
  }
  
var url="../procedures/afficheResultTournoi.php";
url=url+"?selTournoi="+tournoi+"&selClub="+club;
url=url+"&sid="+Math.random();
xmlhttp2.open("GET",url,true);
xmlhttp2.onreadystatechange=stateChanged2;
xmlhttp2.send(null);
}

function resultCategorie(tournoi,club,categ)
{
xmlhttp=GetXmlHttpObject();

if (xmlhttp==null)
  {
  alert ("Browser does not support HTTP Request");
  return;
  }
  
var url="../procedures/getResultTournoi.php";
url=url+"?selTournoi="+tournoi+"&selClub="+club+"&selCategorie="+categ;
url=url+"&sid="+Math.random();
xmlhttp.open("GET",url,true);
xmlhttp.onreadystatechange=stateChangedCategorie;
xmlhttp.send(null);
}

function stateChanged()
{
if (xmlhttp.readyState==4)
{
	if ((xmlhttp.status == 200)||(xmlhttp.status == 0)) {
	var resultats;
	resultats=xmlhttp.responseText;
document.getElementById("resultats").innerHTML=resultats;
// document.getElementById("top_resultats").innerHTML='Rang&points/manche | total des points | Rang tournoi';
}}
}

function stateChanged2()
{
if (xmlhttp2.readyState==4)
{
	if ((xmlhttp2.status == 200)||(xmlhttp2.status == 0)) {
	var resultats;
	resultats=xmlhttp2.responseText;
document.getElementById("resultats").innerHTML=resultats;
// document.getElementById("top_resultats").innerHTML='Rang&points/manche | total des points | Rang tournoi';
}}
}

function stateChangedGalerie()
{
if (xmlhttp.readyState==4)
{
	if ((xmlhttp.status == 200)||(xmlhttp.status == 0)) {
	var resultats;
	resultats=xmlhttp.responseText;
document.getElementById("resultats").innerHTML=resultats;
}}
}
function stateChangedRep2()
{
if (xmlhttp.readyState==4)
{
	if ((xmlhttp.status == 200)||(xmlhttp.status == 0)) {
	var resultats;
	resultats=xmlhttp.responseText;
document.getElementById("rep2").innerHTML=resultats;
document.getElementById("rep2").style.display='inline';
document.getElementById("rep2").scrollIntoView();
}}
}
function stateChangedClub()
{
if (xmlhttp.readyState==4)
{
	if ((xmlhttp.status == 200)||(xmlhttp.status == 0)) {
	var clubs;
	clubs=xmlhttp.responseText;
document.getElementById("clubOptions").innerHTML=clubs;
document.getElementById("resultats").innerHTML='<div id="tournoi_title"></div><div id="tournoi_result"><table border="0" cellpadding="0" cellspacing="0"><tr height="425"><td valign="middle"><img src="images/podium_tournoi'+t+'.jpg" hspace="0" vspace="0" border="0"/></td></tr></table></div>';
}}
}

function stateChangedCategorie()
{
if (xmlhttp.readyState==4)
{
	if ((xmlhttp.status == 200)||(xmlhttp.status == 0)) {
	var clubs;
	clubs=xmlhttp.responseText;
document.getElementById("categorieOptions").innerHTML=clubs;
// document.getElementById("top_resultats").innerHTML='Rang&points/manche | total des points | Rang tournoi';
}}
}


function GetXmlHttpObject()
{
if (window.XMLHttpRequest)
  {
  // code for IE7+, Firefox, Chrome, Opera, Safari
  return new XMLHttpRequest();
  XMLHttpRequest.setRequestHeader ("Content-Type", "application/x-www-form-urlencoded; charset=ISO-8859-1","Cache-Control","no-cache");
  }
if (window.ActiveXObject)
  {
  // code for IE6, IE5
  return new ActiveXObject("Microsoft.XMLHTTP");
  ActiveXObject.setRequestHeader ("Content-Type", "application/x-www-form-urlencoded; charset=ISO-8859-1","Cache-Control","no-cache");
  }
return null;
}
