//Global vars to hold connection to web pages
var xmlHttp
var xmlHttp2

function showHotels(str, nomHotel, ville, chambre, regime, classement, datepicker1, datepicker2) { 
	//This sub will populate a table with all the states and get the 
	//pagination built
	//Make the AJAX connection for both the navigation and content
	document.getElementById("pgContent").innerHTML="<img src=\"/images/ajax-loader.gif\" border=\"0\"/>";
	
	xmlHttp=GetXmlHttpObject()
	xmlHttp2=GetXmlHttpObject()
	//If we cant do the request error out
	if (xmlHttp==null || xmlHttp2==null ) {
	 	alert ("Browser does not support HTTP Request")
	 	return
	}
	//First build the navigation panel
	var url="getHotels.php"
	url=url+"?p="+str
	url=url+"&nomHotel="+nomHotel
	url=url+"&ville="+ville
	url=url+"&chambre="+chambre
	url=url+"&regime="+regime
	url=url+"&classement="+classement
	url=url+"&datepicker1="+datepicker1
	url=url+"&datepicker2="+datepicker2
	url=url+"&t=nav"
	url=url+"&sid="+Math.random()
	//Once the page finished loading put it into the div
	xmlHttp2.onreadystatechange=navDone 

	//Get the php page
	xmlHttp2.open("GET",url,true)
	xmlHttp2.send(null)
	
	//Build the url to call
	//Pass variables through the url
	var url="getHotels.php"
	url=url+"?p="+str
	url=url+"&nomHotel="+nomHotel
	url=url+"&ville="+ville
	url=url+"&chambre="+chambre
	url=url+"&regime="+regime
	url=url+"&classement="+classement
	url=url+"&datepicker1="+datepicker1
	url=url+"&datepicker2="+datepicker2
	url=url+"&ms=1"
	url=url+"&t=con"
	url=url+"&sid="+Math.random()
	
	//Once the page finished loading put it into the div
	xmlHttp.onreadystatechange=stateChanged 
	
	//Get the php page
	xmlHttp.open("GET",url,true)
	xmlHttp.send(null)
}

function showPartenaires(str) { 
	document.getElementById("pgContent").innerHTML="<img src=\"/images/ajax-loader.gif\" border=\"0\"/>";
	
	//This sub will populate a table with all the states and get the 
	//pagination built
	//Make the AJAX connection for both the navigation and content
	xmlHttp=GetXmlHttpObject()
	xmlHttp2=GetXmlHttpObject()
	//If we cant do the request error out
	if (xmlHttp==null || xmlHttp2==null ) {
	 	alert ("Browser does not support HTTP Request")
	 	return
	}
	var date;
	if(document.getElementById('date').checked){
		date='';
	}else{
		date=document.getElementById('datepicker').value;
	}
	
	//First build the navigation panel
	var url="getpartenaires.php"
	url=url+"?p="+str
	url=url+"&date="+date
	url=url+"&nom="+document.getElementById('nom').value
	url=url+"&t=nav"
	url=url+"&sid="+Math.random()

	//Once the page finished loading put it into the div
	xmlHttp2.onreadystatechange=navDone 

	//Get the php page
	xmlHttp2.open("GET",url,true)
	xmlHttp2.send(null)
	
	//Build the url to call
	//Pass variables through the url
	var url="getpartenaires.php"
	url=url+"?p="+str
	url=url+"&date="+date
	url=url+"&nom="+document.getElementById('nom').value
	url=url+"&t=con"
	url=url+"&sid="+Math.random()
	
	//Once the page finished loading put it into the div
	xmlHttp.onreadystatechange=stateChanged 
	
	//Get the php page
	xmlHttp.open("GET",url,true)
	xmlHttp.send(null)
}

function showPrograms(str) { 

	//This sub will populate a table with all the states and get the 
	//pagination built
	//Make the AJAX connection for both the navigation and content
	document.getElementById("pgContent").innerHTML="<img src=\"/images/ajax-loader.gif\" border=\"0\"/>";
	
	xmlHttp=GetXmlHttpObject()
	xmlHttp2=GetXmlHttpObject()
	//If we cant do the request error out
	if (xmlHttp==null || xmlHttp2==null ) {
	 	alert ("Browser does not support HTTP Request")
	 	return
	}
	//ZLM filtre classement : 
	classm = "";
	$j('input[name="categorie"]:checked').each(function(index) {
    		valeur= jQuery(this).val();

    		if(index==0){
    		classm +=valeur;
    		}else{
                classm += ","+valeur;
    		}
    		
  	});
  	categorie=classm ;
  	
  	tarif = "";
	$j('input[name="budget"]:checked').each(function(index) {
    		valeur= jQuery(this).val();

    		if(index==0){
    		tarif +=valeur;
    		}else{
                tarif += ","+valeur;
    		}
    		
  	});
  	budget=tarif ;
  	
	//fin ZLM

	var url="getPrograms.php"
    url=url+"?p="+str
	url=url+"&categorie="+categorie
	url=url+"&budget="+budget
	url=url+"&t=nav"
	url=url+"&sid="+Math.random()

	//Once the page finished loading put it into the div
	xmlHttp2.onreadystatechange=navDone 
	
	//Get the php page
	xmlHttp2.open("GET",url,true)
	xmlHttp2.send(null)
	
	//Build the url to call
	//Pass variables through the url
	var url="getPrograms.php"
	url=url+"?p="+str
	url=url+"&budget="+budget
	url=url+"&categorie="+categorie
	url=url+"&ms=1"
	url=url+"&t=con"
	url=url+"&sid="+Math.random()
	
	//Once the page finished loading put it into the div
	xmlHttp.onreadystatechange=stateChanged 
	
	//Get the php page
	xmlHttp.open("GET",url,true)
	xmlHttp.send(null)
}
function showTransactions(str) { 

	document.getElementById("pgContent").innerHTML="<img src=\"/images/ajax-loader.gif\" style=\"margin-top:10px\" border=\"0\"/>";

	xmlHttp=GetXmlHttpObject()

	xmlHttp2=GetXmlHttpObject()

	//If we cant do the request error out

	if (xmlHttp==null || xmlHttp2==null ) {

	 	alert ("Browser does not support HTTP Request")

	 	return

	}

	var date;

	if(document.getElementById('date').checked){

		date='';

	}else{

		date=document.getElementById('datepicker').value;

	}



	//First build the navigation panel

	var url="getTransactions.php"

	url=url+"?p="+str

	url=url+"&date="+date
	
	url=url+"&ref="+document.getElementById('ref').value

	url=url+"&t=nav"

	url=url+"&sid="+Math.random()



	//Once the page finished loading put it into the div

	xmlHttp2.onreadystatechange=navDone 



	//Get the php page

	xmlHttp2.open("GET",url,true)

	xmlHttp2.send(null)

	

	//Build the url to call

	//Pass variables through the url

	var url="getTransactions.php"

	url=url+"?p="+str

	url=url+"&date="+date
	
	url=url+"&ref="+document.getElementById('ref').value

	url=url+"&t=con"

	url=url+"&sid="+Math.random()

	

	//Once the page finished loading put it into the div

	xmlHttp.onreadystatechange=stateChanged 

	

	//Get the php page

	xmlHttp.open("GET",url,true)

	xmlHttp.send(null)

}


function showPackages(str, hotel, ville, datepicker1) { 
	document.getElementById("pgContent").innerHTML="<img src=\"/images/ajax-loader.gif\" border=\"0\"/>";
	
	//This sub will populate a table with all the states and get the 
	//pagination built
	//Make the AJAX connection for both the navigation and content
	xmlHttp=GetXmlHttpObject()
	xmlHttp2=GetXmlHttpObject()
	//If we cant do the request error out
	if (xmlHttp==null || xmlHttp2==null ) {
	 	alert ("Browser does not support HTTP Request")
	 	return
	}
	//First build the navigation panel
	var url="getPackages.php"
	url=url+"?p="+str
	url=url+"&hotel="+hotel
	url=url+"&ville="+ville
	url=url+"&datepicker1="+datepicker1
	url=url+"&t=nav"
	url=url+"&sid="+Math.random()
	//Once the page finished loading put it into the div
	xmlHttp2.onreadystatechange=navDone 

	//Get the php page
	xmlHttp2.open("GET",url,true)
	xmlHttp2.send(null)
	
	//Build the url to call
	//Pass variables through the url
	var url="getPackages.php"
	url=url+"?p="+str
	url=url+"&hotel="+hotel
	url=url+"&ville="+ville
	url=url+"&datepicker1="+datepicker1
	url=url+"&ms=1"
	url=url+"&t=con"
	url=url+"&sid="+Math.random()
	
	//Once the page finished loading put it into the div
	xmlHttp.onreadystatechange=stateChanged 
	
	//Get the php page
	xmlHttp.open("GET",url,true)
	xmlHttp.send(null)
}

function showSpas(str, hotel, ville, type, datepicker1) { 
	document.getElementById("pgContent").innerHTML="<img src=\"/images/ajax-loader.gif\" border=\"0\"/>";
	
	//This sub will populate a table with all the states and get the 
	//pagination built
	//Make the AJAX connection for both the navigation and content
	xmlHttp=GetXmlHttpObject()
	xmlHttp2=GetXmlHttpObject()
	//If we cant do the request error out
	if (xmlHttp==null || xmlHttp2==null ) {
	 	alert ("Browser does not support HTTP Request")
	 	return
	}
	//First build the navigation panel
	var url="getPackages.php"
	url=url+"?p="+str
	url=url+"&hotel="+hotel
	url=url+"&ville="+ville
	url=url+"&type="+type
	url=url+"&datepicker1="+datepicker1
	url=url+"&t=nav"
	url=url+"&sid="+Math.random()
	//Once the page finished loading put it into the div
	xmlHttp2.onreadystatechange=navDone 

	//Get the php page
	xmlHttp2.open("GET",url,true)
	xmlHttp2.send(null)
	
	//Build the url to call
	//Pass variables through the url
	var url="getPackages.php"
	url=url+"?p="+str
	url=url+"&hotel="+hotel
	url=url+"&ville="+ville
	url=url+"&type="+type
	url=url+"&datepicker1="+datepicker1
	url=url+"&ms=1"
	url=url+"&t=con"
	url=url+"&sid="+Math.random()
	
	//Once the page finished loading put it into the div
	xmlHttp.onreadystatechange=stateChanged 
	
	//Get the php page
	xmlHttp.open("GET",url,true)
	xmlHttp.send(null)
}

function showGreens(str, ville) { 
	document.getElementById("pgContent").innerHTML="<img src=\"/images/ajax-loader.gif\" border=\"0\"/>";

	//This sub will populate a table with all the states and get the 
	//pagination built
	//Make the AJAX connection for both the navigation and content
	xmlHttp=GetXmlHttpObject()
	xmlHttp2=GetXmlHttpObject()
	//If we cant do the request error out
	if (xmlHttp==null || xmlHttp2==null ) {
	 	alert ("Browser does not support HTTP Request")
	 	return
	}
	//First build the navigation panel
	var url="getGreens.php"
	url=url+"?p="+str
	url=url+"&ville="+ville
	url=url+"&t=nav"
	url=url+"&sid="+Math.random()

	//Once the page finished loading put it into the div
	xmlHttp2.onreadystatechange=navDone 

	//Get the php page
	xmlHttp2.open("GET",url,true)
	xmlHttp2.send(null)
	
	//Build the url to call
	//Pass variables through the url
	var url="getGreens.php"
	url=url+"?p="+str
	url=url+"&ville="+ville
	url=url+"&ms=1"
	url=url+"&t=con"
	url=url+"&sid="+Math.random()
	
	//Once the page finished loading put it into the div
	xmlHttp.onreadystatechange=stateChanged 
	
	//Get the php page
	xmlHttp.open("GET",url,true)
	xmlHttp.send(null)
}

function showAdminHotels(str, st) { 
	//This sub will populate a table with all the states and get the 
	//pagination built
	//Make the AJAX connection for both the navigation and content
	document.getElementById("pgContent").innerHTML="<img src=\"/images/ajax-loader.gif\" border=\"0\"/>";
	
	xmlHttp=GetXmlHttpObject()
	xmlHttp2=GetXmlHttpObject()
	//If we cant do the request error out
	if (xmlHttp==null || xmlHttp2==null ) {
	 	alert ("Browser does not support HTTP Request")
	 	return
	}
	//First build the navigation panel
	var url="getHotels.php"
	url=url+"?p="+str
	url=url+"&st="+st
	url=url+"&t=nav"
	url=url+"&sid="+Math.random()

	
	//Once the page finished loading put it into the div
	xmlHttp2.onreadystatechange=navDone 

	//Get the php page
	xmlHttp2.open("GET",url,true)
	xmlHttp2.send(null)
	
	//Build the url to call
	//Pass variables through the url
	var url="getHotels.php"
	url=url+"?p="+str
	url=url+"&st="+st
	url=url+"&t=con"
	url=url+"&sid="+Math.random()
	
	//Once the page finished loading put it into the div
	xmlHttp.onreadystatechange=stateChanged 
	
	//Get the php page
	xmlHttp.open("GET",url,true)
	xmlHttp.send(null)
}

function showAdminPackages(str, st) { 
	document.getElementById("pgContent").innerHTML="<img src=\"/images/ajax-loader.gif\" border=\"0\"/>";
	
	//This sub will populate a table with all the states and get the 
	//pagination built
	//Make the AJAX connection for both the navigation and content
	xmlHttp=GetXmlHttpObject()
	xmlHttp2=GetXmlHttpObject()
	//If we cant do the request error out
	if (xmlHttp==null || xmlHttp2==null ) {
	 	alert ("Browser does not support HTTP Request")
	 	return
	}
	//First build the navigation panel
	var url="getPackages.php"
	url=url+"?p="+str
	url=url+"&st="+st
	url=url+"&t=nav"
	url=url+"&sid="+Math.random()

	//Once the page finished loading put it into the div
	xmlHttp2.onreadystatechange=navDone 

	//Get the php page
	xmlHttp2.open("GET",url,true)
	xmlHttp2.send(null)
	
	//Build the url to call
	//Pass variables through the url
	var url="getPackages.php"
	url=url+"?p="+str
	url=url+"&st="+st
	url=url+"&t=con"
	url=url+"&sid="+Math.random()
	
	//Once the page finished loading put it into the div
	xmlHttp.onreadystatechange=stateChanged 
	
	//Get the php page
	xmlHttp.open("GET",url,true)
	xmlHttp.send(null)
}

function showAdminSpas(str, st) { 
	document.getElementById("pgContent").innerHTML="<img src=\"/images/ajax-loader.gif\" border=\"0\"/>";
	
	//This sub will populate a table with all the states and get the 
	//pagination built
	//Make the AJAX connection for both the navigation and content
	xmlHttp=GetXmlHttpObject()
	xmlHttp2=GetXmlHttpObject()
	//If we cant do the request error out
	if (xmlHttp==null || xmlHttp2==null ) {
	 	alert ("Browser does not support HTTP Request")
	 	return
	}
	//First build the navigation panel
	var url="getPackages.php"
	url=url+"?p="+str
	url=url+"&st="+st
	url=url+"&t=nav"
	url=url+"&sid="+Math.random()

	//Once the page finished loading put it into the div
	xmlHttp2.onreadystatechange=navDone 

	//Get the php page
	xmlHttp2.open("GET",url,true)
	xmlHttp2.send(null)
	
	//Build the url to call
	//Pass variables through the url
	var url="getPackages.php"
	url=url+"?p="+str
	url=url+"&st="+st
	url=url+"&t=con"
	url=url+"&sid="+Math.random()
	
	//Once the page finished loading put it into the div
	xmlHttp.onreadystatechange=stateChanged 
	
	//Get the php page
	xmlHttp.open("GET",url,true)
	xmlHttp.send(null)
}

function showAdminGreens(str, st) { 
	document.getElementById("pgContent").innerHTML="<img src=\"/images/ajax-loader.gif\" border=\"0\"/>";
	
	//This sub will populate a table with all the states and get the 
	//pagination built
	//Make the AJAX connection for both the navigation and content
	xmlHttp=GetXmlHttpObject()
	xmlHttp2=GetXmlHttpObject()
	//If we cant do the request error out
	if (xmlHttp==null || xmlHttp2==null ) {
	 	alert ("Browser does not support HTTP Request")
	 	return
	}
	//First build the navigation panel
	var url="getGreens.php"
	url=url+"?p="+str
	url=url+"&st="+st
	url=url+"&t=nav"
	url=url+"&sid="+Math.random()

	//Once the page finished loading put it into the div
	xmlHttp2.onreadystatechange=navDone 

	//Get the php page
	xmlHttp2.open("GET",url,true)
	xmlHttp2.send(null)
	
	//Build the url to call
	//Pass variables through the url
	var url="getGreens.php"
	url=url+"?p="+str
	url=url+"&st="+st
	url=url+"&t=con"
	url=url+"&sid="+Math.random()
	
	//Once the page finished loading put it into the div
	xmlHttp.onreadystatechange=stateChanged 
	
	//Get the php page
	xmlHttp.open("GET",url,true)
	xmlHttp.send(null)
}

function showHotelReservations(str) { 
	document.getElementById("pgContent").innerHTML="<img src=\"/images/ajax-loader.gif\" style=\"margin-top:10px\" border=\"0\"/>";
	xmlHttp=GetXmlHttpObject()
	xmlHttp2=GetXmlHttpObject()
	//If we cant do the request error out
	if (xmlHttp==null || xmlHttp2==null ) {
	 	alert ("Browser does not support HTTP Request")
	 	return
	}
	var date;
	if(document.getElementById('date').checked){
		date='';
	}else{
		date=document.getElementById('datepicker').value;
	}

	//First build the navigation panel
	var url="getReservations.php"
	url=url+"?p="+str
	url=url+"&date="+date
	url=url+"&nom="+document.getElementById('nom').value
	url=url+"&status="+document.getElementById('status').value
	url=url+"&t=nav"
	url=url+"&sid="+Math.random()

	//Once the page finished loading put it into the div
	xmlHttp2.onreadystatechange=navDone 

	//Get the php page
	xmlHttp2.open("GET",url,true)
	xmlHttp2.send(null)
	
	//Build the url to call
	//Pass variables through the url
	var url="getReservations.php"
	url=url+"?p="+str
	url=url+"&date="+date
	url=url+"&nom="+document.getElementById('nom').value
	url=url+"&status="+document.getElementById('status').value
	url=url+"&t=con"
	url=url+"&sid="+Math.random()
	
	//Once the page finished loading put it into the div
	xmlHttp.onreadystatechange=stateChanged 
	
	//Get the php page
	xmlHttp.open("GET",url,true)
	xmlHttp.send(null)
}

function showProgramReservations(str) { 

	document.getElementById("pgContent").innerHTML="<img src=\"/images/ajax-loader.gif\" style=\"margin-top:10px\" border=\"0\"/>";

	xmlHttp=GetXmlHttpObject()

	xmlHttp2=GetXmlHttpObject()

	//If we cant do the request error out

	if (xmlHttp==null || xmlHttp2==null ) {

	 	alert ("Browser does not support HTTP Request")

	 	return

	}



	//First build the navigation panel

	var url="getReservations.php"

	url=url+"?p="+str

	url=url+"&nom="+document.getElementById('nom').value

	url=url+"&status="+document.getElementById('status').value

	url=url+"&t=nav"

	url=url+"&sid="+Math.random()



	//Once the page finished loading put it into the div

	xmlHttp2.onreadystatechange=navDone 



	//Get the php page

	xmlHttp2.open("GET",url,true)

	xmlHttp2.send(null)

	

	//Build the url to call

	//Pass variables through the url

	var url="getReservations.php"

	url=url+"?p="+str


	url=url+"&nom="+document.getElementById('nom').value

	url=url+"&status="+document.getElementById('status').value

	url=url+"&t=con"

	url=url+"&sid="+Math.random()

	

	//Once the page finished loading put it into the div

	xmlHttp.onreadystatechange=stateChanged 

	

	//Get the php page

	xmlHttp.open("GET",url,true)

	xmlHttp.send(null)

}

function showPackageReservations(str) { 
	document.getElementById("pgContent").innerHTML="<img src=\"/images/ajax-loader.gif\" border=\"0\"/>";
	
	//This sub will populate a table with all the states and get the 
	//pagination built
	//Make the AJAX connection for both the navigation and content
	xmlHttp=GetXmlHttpObject()
	xmlHttp2=GetXmlHttpObject()
	//If we cant do the request error out
	if (xmlHttp==null || xmlHttp2==null ) {
	 	alert ("Browser does not support HTTP Request")
	 	return
	}
	var date;
	if(document.getElementById('date').checked){
		date='';
	}else{
		date=document.getElementById('datepicker').value;
	}
	
	//First build the navigation panel
	var url="getReservations.php"
	url=url+"?p="+str
	url=url+"&date="+date
	url=url+"&nom="+document.getElementById('nom').value
	url=url+"&status="+document.getElementById('status').value
	url=url+"&status_paym="+document.getElementById('status_paym').value
	url=url+"&t=nav"
	url=url+"&sid="+Math.random()

	//Once the page finished loading put it into the div
	xmlHttp2.onreadystatechange=navDone 

	//Get the php page
	xmlHttp2.open("GET",url,true)
	xmlHttp2.send(null)
	
	//Build the url to call
	//Pass variables through the url
	var url="getReservations.php"
	url=url+"?p="+str
	url=url+"&date="+date
	url=url+"&nom="+document.getElementById('nom').value
	url=url+"&status="+document.getElementById('status').value
	url=url+"&status_paym="+document.getElementById('status_paym').value
	url=url+"&t=con"
	url=url+"&sid="+Math.random()
	
	//Once the page finished loading put it into the div
	xmlHttp.onreadystatechange=stateChanged 
	
	//Get the php page
	xmlHttp.open("GET",url,true)
	xmlHttp.send(null)
}

function showCircuitReservations(str) { 
	document.getElementById("pgContent").innerHTML="<img src=\"/images/ajax-loader.gif\" border=\"0\"/>";
	
	//This sub will populate a table with all the states and get the 
	//pagination built
	//Make the AJAX connection for both the navigation and content
	xmlHttp=GetXmlHttpObject()
	xmlHttp2=GetXmlHttpObject()
	//If we cant do the request error out
	if (xmlHttp==null || xmlHttp2==null ) {
	 	alert ("Browser does not support HTTP Request")
	 	return
	}
	var date;
	if(document.getElementById('date').checked){
		date='';
	}else{
		date=document.getElementById('datepicker').value;
	}
	
	//First build the navigation panel
	var url="getReservations.php"
	url=url+"?p="+str
	url=url+"&date="+date
	url=url+"&nom="+document.getElementById('nom').value
	url=url+"&status="+document.getElementById('status').value
	url=url+"&t=nav"
	url=url+"&sid="+Math.random()

	//Once the page finished loading put it into the div
	xmlHttp2.onreadystatechange=navDone 

	//Get the php page
	xmlHttp2.open("GET",url,true)
	xmlHttp2.send(null)
	
	//Build the url to call
	//Pass variables through the url
	var url="getReservations.php"
	url=url+"?p="+str
	url=url+"&date="+date
	url=url+"&nom="+document.getElementById('nom').value
	url=url+"&status="+document.getElementById('status').value
	url=url+"&t=con"
	url=url+"&sid="+Math.random()
	
	//Once the page finished loading put it into the div
	xmlHttp.onreadystatechange=stateChanged 
	
	//Get the php page
	xmlHttp.open("GET",url,true)
	xmlHttp.send(null)
}

function showGreenReservations(str) { 
	document.getElementById("pgContent").innerHTML="<img src=\"/images/ajax-loader.gif\" border=\"0\"/>";
	
	//This sub will populate a table with all the states and get the 
	//pagination built
	//Make the AJAX connection for both the navigation and content
	xmlHttp=GetXmlHttpObject()
	xmlHttp2=GetXmlHttpObject()
	//If we cant do the request error out
	if (xmlHttp==null || xmlHttp2==null ) {
	 	alert ("Browser does not support HTTP Request")
	 	return
	}
	var date;
	if(document.getElementById('date').checked){
		date='';
	}else{
		date=document.getElementById('datepicker').value;
	}
	//First build the navigation panel
	var url="getReservations.php"
	url=url+"?p="+str
	url=url+"&date="+date
	url=url+"&nom="+document.getElementById('nom').value
	url=url+"&status="+document.getElementById('status').value
	url=url+"&t=nav"
	url=url+"&sid="+Math.random()

	//Once the page finished loading put it into the div
	xmlHttp2.onreadystatechange=navDone 

	//Get the php page
	xmlHttp2.open("GET",url,true)
	xmlHttp2.send(null)
	
	//Build the url to call
	//Pass variables through the url
	var url="getReservations.php"
	url=url+"?p="+str
	url=url+"&date="+date
	url=url+"&nom="+document.getElementById('nom').value
	url=url+"&status="+document.getElementById('status').value
	url=url+"&t=con"
	url=url+"&sid="+Math.random()
	
	//Once the page finished loading put it into the div
	xmlHttp.onreadystatechange=stateChanged 
	
	//Get the php page
	xmlHttp.open("GET",url,true)
	xmlHttp.send(null)
}
function showClients(str) { 
	document.getElementById("pgContent").innerHTML="<img src=\"/images/ajax-loader.gif\" border=\"0\"/>";

	//This sub will populate a table with all the states and get the 
	//pagination built
	//Make the AJAX connection for both the navigation and content
	xmlHttp=GetXmlHttpObject()
	xmlHttp2=GetXmlHttpObject()
	//If we cant do the request error out
	if (xmlHttp==null || xmlHttp2==null ) {
	 	alert ("Browser does not support HTTP Request")
	 	return
	}
	//First build the navigation panel
	var url="getClients.php"
	url=url+"?p="+str
	url=url+"&nom="+document.getElementById('nom').value
	url=url+"&t=nav"
	url=url+"&sid="+Math.random()

	
	//Once the page finished loading put it into the div
	xmlHttp2.onreadystatechange=navDone 

	//Get the php page
	xmlHttp2.open("GET",url,true)
	xmlHttp2.send(null)
	
	//Build the url to call
	//Pass variables through the url
	var url="getClients.php"
	url=url+"?p="+str
	url=url+"&nom="+document.getElementById('nom').value
	url=url+"&t=con"
	url=url+"&sid="+Math.random()
	
	//Once the page finished loading put it into the div
	xmlHttp.onreadystatechange=stateChanged 
	
	//Get the php page
	xmlHttp.open("GET",url,true)
	xmlHttp.send(null)
}

function showGalerie(str) { 
	document.getElementById("pgContent").innerHTML="<img src=\"/images/ajax-loader.gif\" border=\"0\"/>";
	
	//This sub will populate a table with all the states and get the 
	//pagination built
	//Make the AJAX connection for both the navigation and content
	xmlHttp=GetXmlHttpObject()
	xmlHttp2=GetXmlHttpObject()
	//If we cant do the request error out
	if (xmlHttp==null || xmlHttp2==null ) {
	 	alert ("Browser does not support HTTP Request")
	 	return
	}
	//First build the navigation panel
	var url="getPictures.php"
	url=url+"?p="+str
	url=url+"&t=nav"
	url=url+"&sid="+Math.random()
	//Once the page finished loading put it into the div
	xmlHttp2.onreadystatechange=navDone 

	//Get the php page
	xmlHttp2.open("GET",url,true)
	xmlHttp2.send(null)
	
	//Build the url to call
	//Pass variables through the url
	var url="getPictures.php"
	url=url+"?p="+str
	url=url+"&t=con"
	url=url+"&sid="+Math.random()
	
	//Once the page finished loading put it into the div
	xmlHttp.onreadystatechange=stateChanged 
	
	//Get the php page
	xmlHttp.open("GET",url,true)
	xmlHttp.send(null)
}

function showPages(str) { 
	document.getElementById("pgContent").innerHTML="<img src=\"/images/ajax-loader.gif\" border=\"0\"/>";
	
	//This sub will populate a table with all the states and get the 
	//pagination built
	//Make the AJAX connection for both the navigation and content
	xmlHttp=GetXmlHttpObject()
	xmlHttp2=GetXmlHttpObject()
	//If we cant do the request error out
	if (xmlHttp==null || xmlHttp2==null ) {
	 	alert ("Browser does not support HTTP Request")
	 	return
	}
	//First build the navigation panel
	var url="getPages.php"
	url=url+"?p="+str
	url=url+"&t=nav"
	url=url+"&sid="+Math.random()
	//Once the page finished loading put it into the div
	xmlHttp2.onreadystatechange=navDone 

	//Get the php page
	xmlHttp2.open("GET",url,true)
	xmlHttp2.send(null)
	
	//Build the url to call
	//Pass variables through the url
	var url="getPages.php"
	url=url+"?p="+str
	url=url+"&t=con"
	url=url+"&sid="+Math.random()
	
	//Once the page finished loading put it into the div
	xmlHttp.onreadystatechange=stateChanged 
	
	//Get the php page
	xmlHttp.open("GET",url,true)
	xmlHttp.send(null)
}

function showHistoric(str) { 
	document.getElementById("pgContent").innerHTML="<img src=\"/images/ajax-loader.gif\" style=\"margin-top:10px\" border=\"0\"/>";
	xmlHttp=GetXmlHttpObject()
	xmlHttp2=GetXmlHttpObject()
	//If we cant do the request error out
	if (xmlHttp==null || xmlHttp2==null ) {
	 	alert ("Browser does not support HTTP Request")
	 	return
	}
	var date;
	if(document.getElementById('date').checked){
		date='';
	}else{
		date=document.getElementById('datepicker').value;
	}

	//First build the navigation panel
	var url="getHistoric.php"
	url=url+"?p="+str
	url=url+"&date="+date
	url=url+"&nom="+document.getElementById('nom').value
	url=url+"&t=nav"
	url=url+"&sid="+Math.random()

	//Once the page finished loading put it into the div
	xmlHttp2.onreadystatechange=navDone 

	//Get the php page
	xmlHttp2.open("GET",url,true)
	xmlHttp2.send(null)
	
	//Build the url to call
	//Pass variables through the url
	var url="getHistoric.php"
	url=url+"?p="+str
	url=url+"&date="+date
	url=url+"&nom="+document.getElementById('nom').value
	url=url+"&t=con"
	url=url+"&sid="+Math.random()
	
	//Once the page finished loading put it into the div
	xmlHttp.onreadystatechange=stateChanged 
	
	//Get the php page
	xmlHttp.open("GET",url,true)
	xmlHttp.send(null)
}

function navDone() { 
	//IF this is getting called when the page is done loading then fill the pagination div
	if (xmlHttp2.readyState==4 || xmlHttp2.readyState=="complete") { 
	 	//Update the Div tag with the outputted text
	 	document.getElementById("pgNavigation").innerHTML=xmlHttp2.responseText 
	} 
}

function stateChanged() { 
	//IF this is getting called when the page is done loading the states then output the div
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete") { 
	 	//Update the Div tag with the outputted text
	 	document.getElementById("pgContent").innerHTML=xmlHttp.responseText 
	} 
}

function GetXmlHttpObject() {
	//Determine what browser we are on and make a httprequest connection for ajax
	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;
}
